Re: Setting a boolean to false in a before_create callback

Robert Walker
Wed, 13 May 2009 18:16:27 -0000

Gabriel Saravia wrote:
> Also, is it just me because I''m too new, or is the
> "before_validation_on_create" callback not talked about enough?

As me for me, I set my defaults in the migration (and hence the
database) rather than initializing attributes with callbacks. I don''t
know if that''s exactly the right way to do it, but it seems to work
well
as far as I can tell.

...
...
  t.boolean :bool_value, :default => false
...
...