Switching my Rails 3.2.12 project to Ruby 2.0.0 fails a test:
NoMethodError:
private method `initialize_dup' called for #<Receipt:0x007fe06c809428>
Looks like initialize_dup
is now a private method.
What can I do to get my tests to pass when using Rails 3.2.12 and Ruby 2.0.0?
For those who are worried about upgrading to 3.2.13 because of some issues it could bring, I added this in an initializer file:
# Because of the Ruby 2.0 privatizes the method and Rails 3.2.12's use of it
# , and because Rails 3.2.13 (which has a fix) also could potentially
# introduce other bugs, we're adding this patch to fix the issue.
#
# Remove this if the project contains Rails >= 3.2.13
module ActiveModel
class Errors
public :initialize_dup
end
module Validations
public :initialize_dup
end
end
class ActiveRecord::Base
public :initialize_dup
end
It been released please use Ruby 2.0.0 with Rails 3.2.13.rc2 and also fixed the above issue initialize_dup in this released and few more fixes.
http://weblog.rubyonrails.org/2013/3/7/Rails-3-2-13-rc2-has-been-released/
It works for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With