mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-26 04:21:36 +00:00
7 lines
No EOL
245 B
Ruby
7 lines
No EOL
245 B
Ruby
class Reading < ActiveRecord::Base
|
|
belongs_to :user
|
|
belongs_to :readable, :polymorphic => true
|
|
|
|
validates_presence_of :user_id, :readable_id, :readable_type
|
|
validates_uniqueness_of :user_id, :scope => [:readable_id, :readable_type]
|
|
end |