Module: Lockless::Relation
- Defined in:
- lib/lockless/relation.rb
Instance Method Summary collapse
-
#update_all(updates) ⇒ Boolean
Appends update attributes with a random UUID when the model is a lockless model.
Instance Method Details
#update_all(updates) ⇒ Boolean
Appends update attributes with a random UUID when the model is a lockless model
Lockless will only append random UUID updates if the param is a Hash
false is returned if record is outdated or invalid
12 13 14 15 16 17 18 19 20 |
# File 'lib/lockless/relation.rb', line 12 def update_all(updates) if updates.is_a?(Hash) if model.method_defined?(:lockless_column) && updates[model.lockless_column].blank? updates[model.lockless_column] = model.generate_uuid end end super(updates) end |