You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 30, 2018. It is now read-only.
…ce as lambdas
Now, it's possible to do:
class MyModel
include Tire::Model::Persistence
property :created_at, :default => lambda { Time.now }
end
Note though, that the lambda is evaluated when you create the object, not when you access the property.
Closeskarmi#459
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have been reading the code for how a property default value is defined. It seems like something like:
property :published_on, type: 'date', default: Date.new
Would not work because it would cache the default value to now at that time. Is this the correct assumption?
The text was updated successfully, but these errors were encountered: