# File lib/dm-core/adapters/data_objects_adapter.rb, line 114 def update(attributes, collection) query = collection.query # TODO: if the query contains any links, a limit or an offset # use a subselect to get the rows to be updated properties = [] bind_values = [] # make the order of the properties consistent query.model.properties(name).each do |property| next unless attributes.key?(property) properties << property bind_values << attributes[property] end statement, conditions_bind_values = update_statement(properties, query) bind_values.concat(conditions_bind_values) execute(statement, *bind_values).to_i end