Re: [Rails] Unable to Seed Data for Authlogic

On 2 April 2011 20:10, Dan King <lists@ruby-forum.com> wrote:
> When I run rake db:seed in my Rails 3 application I get the following
> error; anyone know how to resolve it?
>
> rake aborted!
> undefined method
> 'find_or_create_by_first_name_and_last_name_and_role_and_email_and_password_and_password_confirmation'
>
> Below are my create_users.rb,user.rb, and seeds.rb files respectively.
>
> create_users.rb:
>
> def self.up
>    create_table :users do |t|
>      t.string :first_name, :null => false
>      t.string :last_name, :null => false
>      t.string :role, :null => false
>      t.string :email, :null => false
>      t.string :crypted_password, :null => false
>      t.string :password_salt, :null => false
>      t.string :persistence_token, :null => false
>      t.string :current_login_ip
>      t.string :last_login_ip
>      t.datetime :current_login_at
>      t.datetime :last_login_at
>
>      t.timestamps
>    end
>  end
>
> user.rb:
>
> class User < ActiveRecord::Base
>  acts_as_authentic
> end
>
> seeds.rb:
>
> User.find_or_create_by_first_name_and_last_name_and_role_and_email_and_password_and_password_confirmation(...)

password and password_confirmation do not exist in the table.

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.