Module: Trendable::Concern
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/concerns/trendable.rb
Instance Method Summary collapse
- #boost_trending_power!(add_value = 1000, dont_touch: false) ⇒ Object
- #fade_out_trending_power!(multiplier = 0.9, dont_touch: false) ⇒ Object
Instance Method Details
#boost_trending_power!(add_value = 1000, dont_touch: false) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/concerns/trendable.rb', line 15 def boost_trending_power!( add_value = 1000, dont_touch: false ) if dont_touch self.update_columns( trending_power: trending_power + add_value ) else self.update( trending_power: trending_power + add_value ) end end |
#fade_out_trending_power!(multiplier = 0.9, dont_touch: false) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/concerns/trendable.rb', line 23 def fade_out_trending_power!( multiplier = 0.9, dont_touch: false ) if dont_touch self.update_columns( trending_power: trending_power * multiplier ) else self.update( trending_power: trending_power * multiplier ) end end |