i am new to ROR, just setup the enviroment
ruby 1.9.2 with rails 3.0.6
just notice one thing.
after create model.. propeties has been add into database but couldn`t see from the class..
and it just work for me.
looks like rails will scan my database schema before launching the application..
but i have a question for it:
if i frequently add or remove columns…
how do i know what properties do i have if i do not define in the class?
can i manually add properties into ActiceRecord class(es) ??
class User < ActiveRecord::Base
has_one :contact
validates_confirmation_of :password
end
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.string :username
t.string :password
t.timestamps
end
end
def self.down
drop_table :users
end
end
i;m not sure i understand the question, but you can just view the schema.rb
any migration that you make will update the schema