Closed daniel-rikowski closed 10 years ago
I just checked, calling define_attribute_methods
manually solves the problem, but that feels really hacky :)
define_attribute_methods
include DateTimeAttribute
date_time_attribute :created_at
Thanks Daniel! Gimme a sec, I'll fix that
einzige any idea when you'll release this fix?
@robertgauld , @daniel-rikowski sorry guys, forgot about it. I will do today.
Thanks guys, bundled 0.0.6. @daniel-rikowski you were 100% right, I was able to reproduce it the way you described and fix it the way you proposed.
I think I found a new problem in the latest version.
This line fails in Rails (4.0.2)
I think it is because Rails creates the methods the first time
method_missing
is called:Since
date_time_attribute
is called beforemethod_missing
can be called on any instance, the attribute methods don't yet exist.But I'm not 100% sure that this is the root cause
I'm also not sure how this can be solved, but at least it is easy to reproduce, just put this in any Rails model:
You'll get a NameError undefined method `created_at=' as soon as the class is loaded.