Fail with private setter by cvb
class TestModel < ActiveRecord::Base
private
def test_attr=(v)
write_attribute(:test_attr, v)
end
end
and when try to build you will get pretty cryptic error
ActiveRecord::UnknownAttributeError: unknown attribute: test_attr
Comments
releu commented about 1 year ago
What do you expect?
makaroni4 commented about 1 year ago
Haha, this is a story about "God damn how could I miss that?"
cvb commented about 1 year ago
I expected more human error, like "Man it's private, wtf?!"