palkan/store_attribute

No dirty tracking methods when using only `store_attribute`

Closed this issue · 2 comments

If I use

store_accessor :settings, some_time: :datetime

there is saved_change_to_some_time? (and other dirty tracking methods), but if

store_attribute :settings, :some_time, :datetime

there is no.

Good catch. Thanks!
Will fix soon

For now you can try the following hack:

# this would add dirty methods
store_accessor :settings, :some_time
# this would add type casting
store_attribute :settings, :some_time, :datetime

(No 100% sure though)

Released in 0.8.1