app/models/concerns/the_comments/comment.rb
# Warn: increment! doesn't call validation =>
# before_validation filters doesn't work   =>
# We have few unuseful requests
# I impressed that I found it and reduce DB requests
# Awesome logic pazzl! I'm really pedant :D

increment. doesn't call validation =>
before_validation filters doesn't work   =>
We have few unuseful requests
I impressed that I found it and reduce DB requests
Awesome logic pazzl. I'm really pedant :D
increment . doesn ' t call validation = > before_validation filters doesn ' t work = > We have few unuseful requests I impressed that I found it and reduce DB requests Awesome logic pazzl . I ' m really pedant : D
def update_cache_counters
      user.try :recalculate_my_comments_counter!
      if holder
        holder.send :try, :define_denormalize_flags
        holder.increment! "#{ state }_comcoms_count"
      end
      if commentable
        commentable.send :define_denormalize_flags
        commentable.increment! "#{ state }_comments_count"
      end
    end
def update_cache_counters user . try :recalculate_my_comments_counter! if holder holder . send :try , :define_denormalize_flags holder . increment! "#{ state }_comcoms_count" end if commentable commentable . send :define_denormalize_flags commentable . increment! "#{ state }_comments_count" end end
Warn: increment!
Warn : increment!
# holder.class.increment_counter("#{ state }_comcoms_count", holder.id)
 # holder.class.increment_counter("#{ state }_comments_count", holder.id)
