Open translunar opened 13 years ago
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.
Hi John,
Thank you for the very helpful information! I should have had more consideration for overwriting Array#clear method. xx-P
This is a patch. Try it out.
class Array alias :_clear :clear def clear self.each{|e| e.clear if e.class.method_defined? :clear} _clear end end
And... you have taught me another bug involved. Look at this commit: https://github.com/ashbb/green_shoes/commit/2e50b7ce3da408bb5f2951cd5d851a1f758ad091
ashbb
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.