id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
184	[PATCH] updating translated model doesn't work with Rails 2.0	artemv		It brings following error:\r\n{{{\r\nArgumentError: wrong number of arguments (2 for 1)\r\n/mypath/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/locking/optimistic.rb:79:in `attributes_with_quotes'\r\n/mypath/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/locking/optimistic.rb:79:in `update_without_callbacks'\r\n/mypath/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/callbacks.rb:240:in `update_without_timestamps'\r\n/mypath/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/timestamp.rb:38:in `globalize_old_update'\r\nvendor/plugins/globalize-for-1.2/lib/globalize/localization/db_translate.rb:702:in `update'\r\n/mypath/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/base.rb:2165:in `create_or_update_without_callbacks'\r\n/mypath/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/callbacks.rb:213:in `globalize_old_create_or_update'\r\nvendor/plugins/globalize-for-1.2/lib/globalize/localization/db_translate.rb:695:in `create_or_update'\r\n/mypath/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/base.rb:1899:in `save_without_validation'\r\n/mypath/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/validations.rb:901:in `save_without_transactions'\r\n/mypath/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/transactions.rb:108:in `save'\r\n/mypath/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction'\r\n/mypath/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/transactions.rb:80:in `transaction'\r\n/mypath/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/transactions.rb:100:in `transaction'\r\n/mypath/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/transactions.rb:108:in `save'\r\n/mypath/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/transactions.rb:120:in `rollback_active_record_state!'\r\n/mypath/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/transactions.rb:108:in `save'\r\n/mypath/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib/active_record/base.rb:1961:in `update_attributes'\r\napp/controllers/admin/department_controller.rb:53:in `update'\r\n}}}\r\nThis is because method attributes_with_quotes has 2 arguments in Rails 2.0 and it's redefined in Globalize's db_translate.rb. Correct version of method: (also a patch is attached for Edge Globalize, though I still work with globalize-for-1.2 because edge Globalize gives me a handful of test failures)\r\n{{{\r\n        def attributes_with_quotes(include_primary_key = true, include_readonly_attributes = true)          \r\n          if Locale.base?\r\n            quoted = attributes.inject({}) do |quoted, (name, value)|\r\n              if column = column_for_attribute(name)\r\n                quoted[name] = quote_value(value, column) unless !include_primary_key && column.primary\r\n              end\r\n              quoted\r\n            end\r\n          else\r\n            quoted = attributes.inject({}) do |quoted, (name, value)|\r\n              if !self.class.globalize_facets_hash.has_key?(name) &&\r\n                  column = column_for_attribute(name)\r\n                quoted[name] = quote_value(value, column) unless !include_primary_key && column.primary\r\n              end\r\n              quoted\r\n            end\r\n          end\r\n          include_readonly_attributes ? quoted : remove_readonly_attributes(quoted)\r\n        end\r\n}}}	defect	new	major		model				
