All of the sudden some columns began to misbehave in cucumber tests, claiming that “Attempt to call private method (NoMethodError)” on normal column attributes!
A simple fix for this, essentially saying that a method is not private when its a column:
#features/support/ar_private_fix.rb required from env.rb
unless ActiveRecord::Base.methods.include?('private_method_defined_with_fix?')
class ActiveRecord::Base
class << self
def private_method_defined_with_fix?(method)
return false if columns_hash.keys.include?(method.to_s)
private_method_defined_without_fix?(method)
end
alias_method_chain :private_method_defined?, :fix
end
end
end