e117f4e5af
This aligns better with counter_cache conventions, in case we turn boosts into a model later
16 lines
264 B
Ruby
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
|