Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # == Schema Information
- #
- # Table name: followings
- #
- # id :integer not null, primary key
- # user_id :integer
- # followable_id :integer
- # followable_type :string(255)
- # created_at :datetime not null
- # updated_at :datetime not null
- #
- class Following < ActiveRecord::Base
- belongs_to :followable, polymorphic: true
- belongs_to :user
- validates :followable, :user, presence: true
- validates :user_id, uniqueness: { scope: [:followable_id, :followable_type] }
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement