Module: Ratable::Models::Ratee::ActiveRecordExtension
- Defined in:
- lib/ratable/models/ratee.rb
Instance Method Summary collapse
Instance Method Details
#acts_as_ratee(options = {has_one: false}) ⇒ Object
9 10 11 12 13 |
# File 'lib/ratable/models/ratee.rb', line 9 def acts_as_ratee(={has_one: false}) raise "To make a model the rater and the ratee use `acts_as_ratee_and_rater`" if acts_like_rater? @has_one = [:has_one] include Ratee end |
#acts_like_ratee? ⇒ Boolean
15 16 17 |
# File 'lib/ratable/models/ratee.rb', line 15 def acts_like_ratee? ancestors.include?(Ratee) end |