Skip to content

Instantly share code, notes, and snippets.

@meltzerj
Created May 7, 2011 16:30
Show Gist options
  • Select an option

  • Save meltzerj/960625 to your computer and use it in GitHub Desktop.

Select an option

Save meltzerj/960625 to your computer and use it in GitHub Desktop.
NOTIFICATIONS_CONDITION = 'some SQL'
has_many :user_notifications
has_many :notifications, :through => :user_notifications,
:conditions => NOTIFICATIONS_CONDITION,
:order => "timeline_events.created_at DESC"
belongs_to :user
belongs_to :notification, :class_name => 'TimelineEvent'
#an example of how a timeline_event is created (relies on timeline_fu plugin)
fires :video_added, :on => :create,
:actor => :user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment