ActiveRecord offers attribute helper methods such as _?
and the "dirty" methods (_changed?
etc.)
Is there a Rails way to define these same methods on non-persisted or "virtual" attributes?
I'm hoping for something like:
class MyClass < ActiveRecord::Base
some_macro :my_attribute
end
$ @my_class = MyClass.new
$ @my_class.my_attribute? # => false
$ @my_class.my_attribute_changed? # => false