Skip to content

Instantly share code, notes, and snippets.

@mishrarohit
Created October 19, 2013 10:32
Show Gist options
  • Save mishrarohit/7054266 to your computer and use it in GitHub Desktop.
Save mishrarohit/7054266 to your computer and use it in GitHub Desktop.
The new notification model for Allotrop
# == Schema Information
#
# Table name: notifications
#
# id :integer not null, primary key
# user_id :integer
# category :string(255)
# post_id :integer
# data :hstore
# created_at :datetime
# updated_at :datetime
#
class Notification < ActiveRecord::Base
belongs_to :user
belongs_to :post
attr_accessible :category, :minimum_threshold, :maximum_threshold, :post_id, :network, :friend_id, :classifier
# minimum_threshold is the inclusive smallest value -- for example, for follow, this contains
# the minimum_relationship_id and same for maximum_threshold
store_accessor :data, :minimum_threshold, :maximum_threshold, :network, :friend_id, :classifier
default_scope { order('updated_at DESC') }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment