I get this error whenever I use update_attributes. I am using rails
v.8008. I’ve uninstalled the rails gem, so I am definitely using the
rails in vendor/rails (v. 8008).
There was a change made to attributes_with_quotes to add a second
argument:
Returns copy of the attributes hash where all the values have been
safely quoted for use in an SQL statement.
def attributes_with_quotes(
include_primary_key = true, include_readonly_attributes = true )
quoted = attributes.inject({}) do |quoted, (name, value)|
if column = column_for_attribute(name)
quoted[name] = quote_value(value, column) unless
!include_primary_key &&
column.primary
end
quoted
end
include_readonly_attributes ? quoted :
remove_readonly_attributes(quoted)
end
The call in base.rb:1998 looks like this:
Updates the associated record with values matching those
of the instance attributes. Returns the number of affected rows.
def update
quoted_attributes = attributes_with_quotes(false, false)
Here is the stack trace:
vendor/rails/activerecord/lib/active_record/base.rb:1998:in
attributes_with_quotes' vendor/rails/activerecord/lib/active_record/base.rb:1998:inupdate_without_lock’
vendor/rails/activerecord/lib/active_record/locking/optimistic.rb:70:in
update_without_callbacks' vendor/rails/activerecord/lib/active_record/callbacks.rb:240:inupdate_without_timestamps’
vendor/rails/activerecord/lib/active_record/timestamp.rb:38:in update' vendor/rails/activerecord/lib/active_record/base.rb:1991:increate_or_update_without_callbacks’
vendor/rails/activerecord/lib/active_record/callbacks.rb:213:in
create_or_update' vendor/rails/activerecord/lib/active_record/base.rb:1743:insave_without_validation’
vendor/rails/activerecord/lib/active_record/validations.rb:891:in
save_without_transactions' vendor/rails/activerecord/lib/active_record/transactions.rb:105:insave’
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in
transaction' vendor/rails/activerecord/lib/active_record/transactions.rb:77:intransaction’
vendor/rails/activerecord/lib/active_record/transactions.rb:97:in
transaction' vendor/rails/activerecord/lib/active_record/transactions.rb:105:insave’
vendor/rails/activerecord/lib/active_record/transactions.rb:117:in
rollback_active_record_state!' vendor/rails/activerecord/lib/active_record/transactions.rb:105:insave’
vendor/rails/activerecord/lib/active_record/base.rb:1790:in
update_attributes' app/controllers/users_controller.rb:57:inupdate_password’
app/controllers/users_controller.rb:56:in update_password' /usr/local/bin/mongrel_rails:18:inload’
/usr/local/bin/mongrel_rails:18
It looks to me like attributes_with_quotes takes two arguments, so I do
not understand “(2 for 1).”
This was working fine before upgrading to the latest Edge Rails.
Any ideas as to what the problem might be?
Thanks,
Chas.