Files
fizzy/app/models/bubble/boostable.rb
T
Jose Farias e117f4e5af boost_count -> boosts_count
This aligns better with counter_cache conventions, in case we turn boosts into a model later
2024-11-19 14:22:51 -06:00

16 lines
264 B
Ruby

module Bubble::Boostable
extend ActiveSupport::Concern
included do
scope :ordered_by_boosts, -> { order boosts_count: :desc }
end
def boost!
transaction do
track_event :boosted
increment! :boosts_count
rescore
end
end
end