-
-
Save brunomichetti/ecb78d63898df01b0738e67d84a0a542 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FanInfluencer < ActiveRecord::Base | |
include Counter::Cache | |
belongs_to :fan | |
belongs_to :influencer | |
counter_cache_on column: :fans_count, | |
relation: :influencer, | |
relation_class_name: 'Influencer', | |
wait: (ENV['CC_DEFERRED_DELAY_SECONDS'] || '20').to_i.seconds, | |
recalculation: true, | |
method: :update_fans_count | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment