Is it possible to set up something you could call a "fake property" in a DataMapper model? What I mean is, a property that isn't persisted, but that is still modifiable using create() or update(). Instead of persisting the data in the data store, a function would be called instead with the value.
Asked
Active
Viewed 99 times
2 Answers
0
Turns out that create() and update() do nothing more than self.property = value
.

user1499207
- 305
- 1
- 4
- 7
0
Use attr_accessor
in your model like this:
class Account
include DataMapper::Resource
attr_accessor :password
end
The method is explained here what is attr_accessor in datamapper - ruby