Ruby on Rails Monday, August 12, 2013

hi!

i am trying to add database field to a model without model regeneration.
i have added my field to migration scripts

class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :name
t.string :lg, :default => "en"
t.timestamps
end
end
end

field :lg

and now need to add this field as a property of "user" model
how should i do it by hands, just adding a line of code, without model
regenaration

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/31f262b4a14461c3a3cab958a5e50c7e%40ruby-forum.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment