Files
fizzy/app/models/bubble/boostable.rb
T
2024-11-15 18:17:42 -06:00

16 lines
262 B
Ruby

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