1 class Subscription < ActiveRecord::Base
2 belongs_to :subscribeable, :polymorphic => true
5 # Helper class method to lookup all subscriptions assigned
6 # to all subscribeable types for a given user.
7 def self.find_subscriptions_by_user(user)
10 :conditions => ["user_id = ?", user],
11 :order => "created_at DESC"