You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use SciRuby::Plotter (a Green Shoes GUI) with Rails 3.1.1. I have a method on one of my models called update!, which sends an HTTP request to get some meta info, and then applies that meta info to the object (and saves). This happens within a transaction.
(1.0ms) BEGIN
(1.3ms) SELECT 1 FROM "genes" WHERE ("genes"."entrez_id" = 54101 AND "genes"."id" != 177592) LIMIT 1
(24.8ms) UPDATE "genes" SET "symbol" = 'RIPK4', "name" = 'receptor-interacting serine-threonine kinase 4', "desc" = 'The protein encoded by this gene is a serine/threonine protein kinase that interacts with protein kinase C-delta. The encoded protein can also activate NFkappaB and is required for keratinocyte differentiation. This kinase undergoes autophosphorylation. [provided by RefSeq, Jul 2008]', "updated_at" = '2011-11-16 23:20:46.130810' WHERE "genes"."id" = 177592
(1.2ms) COMMIT
NOTICE: there is no transaction in progress
(1.1ms) ROLLBACK
NoMethodError: undefined method `clear' for #<Gene:0xf954c28>
from /usr/local/lib/ruby/gems/1.9.1/gems/activemodel-3.1.1/lib/active_model/attribute_methods.rb:385:in `method_missing'
from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.1.1/lib/active_record/attribute_methods.rb:60:in `method_missing'
from /usr/local/lib/ruby/gems/1.9.1/gems/green_shoes-1.0.309/lib/shoes/ruby.rb:155:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/green_shoes-1.0.309/lib/shoes/ruby.rb:155:in `clear'
from /usr/local/lib/ruby/gems/1.9.1/gems/green_shoes-1.0.309/lib/shoes/ruby.rb:155:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/green_shoes-1.0.309/lib/shoes/ruby.rb:155:in `clear'
from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:374:in `rollback_transaction_records'
from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:230:in `rescue in transaction'
I think there must be a conflict between lib/shoes/ruby.rb's Array modification and ActiveRecord.
I will try to gather some more data.
The text was updated successfully, but these errors were encountered:
So it looks like ActiveRecord expects clear on Array to work differently. I was able to get rid of the aforementioned problem simply by renaming, in lib/shoes/ruby.rb, def clear to def green_shoes_clear, and def clear_all to def green_shoes_clear_all.
Of course, the problem with that solution is that now no Shoes app shows up at all. Not ideal.
I'm trying to use SciRuby::Plotter (a Green Shoes GUI) with Rails 3.1.1. I have a method on one of my models called
update!
, which sends an HTTP request to get some meta info, and then applies that meta info to the object (and saves). This happens within a transaction.I think there must be a conflict between
lib/shoes/ruby.rb
'sArray
modification and ActiveRecord.I will try to gather some more data.
The text was updated successfully, but these errors were encountered: