I have this line of code in a User model:
attr_accessor :birthdate
In the same model, I have a method that tries to set that birthdate by doing this:
self.birthdate = mydate
Where mydate is a Date object.
I get this error: undefined method birthdate='
Why is this happening? Isn’t attr_accessor creates a setter and a getter?
Let me guess, you’re calling that setter from a class method, right?