# File lib/dm-do-adapter/adapter.rb, line 176 def update(attributes, collection) query = collection.query 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) with_connection do |connection| connection.create_command(statement).execute_non_query(*bind_values) end.affected_rows end