app/models/user.rb
# Method to dynamically add items to an array with protection for StaleObjects
# So even if multiple processes are calling this, it will go alright
Method to dynamically add items to an array with protection for StaleObjects
So even if multiple processes are calling this, it will go alright
Method to dynamically add items to an array with protection for StaleObjects So even if multiple processes are calling this it will go alright
def add_to_array attribute, value
    update! attribute => self[attribute].push(value.to_s).uniq
  rescue ActiveRecord::StaleObjectError
    reload
    retry
  end
def add_to_array attribute , value update! attribute => self [ attribute ] . push ( value . to_s ) . uniq rescue ActiveRecord :: StaleObjectError reload retry end
Method to dynamically add items to an array with protection for StaleObjects
So even if multiple processes are calling this, it will go alright
Method to dynamically add items to an array with protection for StaleObjects So even if multiple processes are calling this it will go alright
attribute
<not_specific>
value
<not_specific>