search for: update_sql

Displaying 5 results from an estimated 5 matches for "update_sql".

Did you mean: update_mysql
2007 Jul 12
0
update_all for an AR instance
...utes (ie, updating only the attributes you designate.) In any case, I extended ActiveRecord::Base to do something like this. Here is my function: def update_attributes_with_sql(attributes) # allows you to update individual columns without saving the whole record (also much faster) update_sql = if attributes.is_a?(Hash) attributes.to_a.collect do |key_value| k, v = key_value v = v.to_s(:db) if v.is_a?(Time) v = "''#{v}''" if v.is_a?(String) %{#{k.to_s}=#{v}} en...
2008 Jan 16
0
[CruiseControl] RubyOnRails build 8649 failed
...dapters/abstract_adapter.rb:156:in `log'' ./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:407:in `execute_without_counting'' ./test/abstract_unit.rb:71:in `execute'' ./test/../lib/active_record/connection_adapters/abstract/database_statements.rb:162:in `update_sql'' ./test/../lib/active_record/connection_adapters/postgresql_adapter.rb:418:in `update_sql'' ./test/../lib/active_record/connection_adapters/abstract/database_statements.rb:49:in `update_without_query_dirty'' ./test/../lib/active_record/connection_adapters/abstract/query_cac...
2009 Mar 03
2
Passing an SQL fragment in AR save
I have a basic model class TestTime with no customization. class TestTime < ActiveRecord::Base end I would like to pass the following SQL fragment as part of an AR save call to TestTime objects. How and where would I do this in the model? "set c_time=current_time" (current_time is an SQL method, not a variable). -- Posted via http://www.ruby-forum.com/.
2011 Jul 25
4
Rails 3 test database issues
I am having a problem using the test database in Rails 3. It apparently has kept track of aspects of the database that I deleted completely from my migrations at some point. I don''t always use the ''down'' part of a migration and sometimes just recreate the whole database. I did rake db:migrate:reset and rake db:test:prepare, but when I run my test it is trying to access
2008 Jan 15
6
SQLite concurrency, SQLite3::BusyException
I am currently experiencing concurrency issues after moving from MySQL to SQLite. My original program worked fined using MySQL but is now returning "SQLite3::BusyException" errors. The same result happens whether or not I enable the allow_concurrency flag. If I do manually acquire a lock on the SQLite DB the problem would disapear, but I thought that rails was supposed to handle this