Brian Buckley wrote:
>Hello all,
>
>When using ActiveRecord can one define default values for attributes?
>I''d like these defaults to be used if and only if the client does
not
>provide a value for the attribute in the initialization hash (such
>defaults will ease the work the client must do to initialize an
>object).
>
>I''d like to use ruby to define my defaults instead of setting them
in
>the database DDL.
>
>
>
Not exactly what you''re looking for, but look at before_save(). You
could apply your defaults here.