Module: Believer::Updating
- Included in:
- Query
- Defined in:
- lib/believer/updating.rb
Instance Method Summary collapse
-
#update_all(values) ⇒ Object
Updates all objects returned by the query with the given values.
Instance Method Details
#update_all(values) ⇒ Object
Updates all objects returned by the query with the given values
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/believer/updating.rb', line 6 def update_all(values) q = clone q.selects = primary_key_columns batch = Batch.new(:record_class => record_class) q.each do |obj| update = Update.create(obj) update.values = values batch << update end batch.execute end |