Re: Suggestion: default values for models

Alexander Kurakin
Wed, 17 Oct 2012 19:52:08 -0000

You can read here:
https://github.com/FooBarWidget/default_value_for#when-not-to-use-default_value_for

среда, 17 октября 2012 г., 23:41:55 UTC+4 пользователь Zamith
написал:
>
> Isn''t this just the same as having a before_save callback where
you define
> these default values?
>
> Also, what do you mean with "We can use db''s default values
but they are
> evaluated during migrations"?
> On Oct 17, 2012, at 8:28 PM, Alexander Kurakin wrote:
>
> ROR doesn''t realize functionality of setting default values for
models. We
> can use db''s default values but they are evaluated during
migrations. We
> can''t set default value i.e. Time.now. But there are completed
gems that
> realize this. I.e. default_value_for (
> https://github.com/FooBarWidget/default_value_for). Why not to merge it
> in rails? Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rubyonrails-core/-/u1PNgYmkABUJ.
> To post to this group, send email to
rubyonra...@googlegroups.com<javascript:>
> .
> To unsubscribe from this group, send email to
> rubyonrails-co...@googlegroups.com <javascript:>.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-core?hl=en.
>
>
> Cumprimentos,
> Luís Ferreira
>
>
>
>

--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To view this discussion on the web visit