Module: Trendable::Concern

Extended by:
ActiveSupport::Concern
Defined in:
lib/concerns/trendable.rb

Instance Method Summary collapse

Instance Method Details



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


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