Hi Carlos,
thanks for your help. I now extended the migration file generated by
devise and the column has been added to db. I had to delete the table
in db first before running rake db:migrate again.
Now I added the additional property to the view which I extracted with
devise beforehand. If I register the new property is not recognized as
the db value is null. Do I need to amend the controller from devise to
store also the new property beside devise standard properties?
Cheers,
Mark
On 18 Jan., 00:56, Carlos Moutinho <
carlosmouti...@gmail.com> wrote:
> Hi Mark,
>
> I'm fairly new to devise but I think I can help.
>
> I'd say it's ok to add attributes to your user model.
> I would only use another model and relationship if the attributes were used
> elsewhere or related to another model.
>
> About your attempt. Are you adding the new attribute to the migration
> generated by devise? Have you run rake db:migrate?
> If you have then you should add a new migration to change the users table.
> Something like this:
>
> class AddFieldsToUsers < ActiveRecord::Migration
> def self.up
> add_column :users, :name, :string
> end
>
> def self.down
> remove_column :users, :name
> end
> end
>
> Hope this helps.
> Cheers,
> Carlos Moutinho
>