Migrations bug with Rails 1.0, PostgreSQL 8.1?

Filed a ticket for bogus Ruby produced via:

rake db_schema_dump

http://dev.rubyonrails.org/ticket/3232

I’d appreciate it if someone could verify against
PostgreSQL 8.0.x


– Tom M.

What does this have to do with:

rake db_schema_dump

producing non-functional Ruby code that breaks tests
and doesn’t correctly instantiate the database?

I find it rather hard to believe that broken code
generation is expected behavior, or that the basis
for the new DB migrations functionality is supposed
to misassign default column value settings?


– Tom M.

On 14-dec-2005, at 22:06, Tom M. wrote:

Filed a ticket for bogus Ruby produced via:

rake db_schema_dump

http://dev.rubyonrails.org/ticket/3232

This is expected behavior.

If you want to set default values, the Rails way is to use a filter:

class Model < ActiveRecord::Base

protected
before_create :set_default_values

def.set_default_value
self.updated_at = Time.now
end
end

However, in the case of updated_at/on created_at/on, Rails will
automagically populate those if present.


Regards, Charles.

On 15-dec-2005, at 10:35, Tom M. wrote:

What does this have to do with:

rake db_schema_dump

Right. I missed that.


Regards, Charles.