Module: Likeable

Extended by:
ActiveSupport::Concern
Included in:
Argument
Defined in:
app/models/concerns/likeable.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#update_likes_counterObject



28
29
30
# File 'app/models/concerns/likeable.rb', line 28

def update_likes_counter
  self.class.where(id: self.id).update_all likes_count: self.likes.count, dislikes_count: self.dislikes.count
end