Skip to content

Instantly share code, notes, and snippets.

@abhishek0
Created August 9, 2013 10:51
Show Gist options
  • Save abhishek0/6192762 to your computer and use it in GitHub Desktop.
Save abhishek0/6192762 to your computer and use it in GitHub Desktop.
Default users
rake aborted!
undefined method `<<' for nil:NilClass
/home/abhishek/mine/code/infocus/backend-ror/db/seeds.rb:10:in `(root)'
org/jruby/RubyKernel.java:1073:in `load'
/home/abhishek/.rvm/gems/jruby-1.7.4/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:1:in `(root)'
/home/abhishek/.rvm/gems/jruby-1.7.4/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
/home/abhishek/.rvm/gems/jruby-1.7.4/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
/home/abhishek/.rvm/gems/jruby-1.7.4/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
org/jruby/RubyProc.java:255:in `call'
/home/abhishek/.rvm/gems/jruby-1.7.4/bundler/gems/mongoid-85e146637503/lib/mongoid/railties/database.rake:18:in `(root)'
org/jruby/RubyArray.java:1617:in `each'
org/jruby/RubyArray.java:1617:in `each'
org/jruby/RubyKernel.java:1073:in `load'
Tasks: TOP => db:seed
(See full trace by running task with --trace)
puts 'Default users'
admin = User.create! :first_name => 'admin', :last_name => 'admin', :email => 'admin@example.com', :mobile => '9999911111', :locality => 'Goregaon', :city => 'Mumbai', :user_type => 'admin', :username => 'admin@example.com', :password => 'admin'
franchisee = User.create! :first_name => 'franchisee', :last_name => 'franchisee', :email => 'franchisee@example.com', :mobile => '9999911111', :locality => 'Goregaon', :city => 'Mumbai', :user_type => 'franchisee', :username => 'franchisee@example.com', :password => 'franchisee'
#puts(admin.methods.grep(/child/))
admin.children<< franchisee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment