'eq' not found

13 views
Skip to first unread message

FuzzLightyear

unread,
Jan 25, 2011, 4:10:17 AM1/25/11
to machini...@googlegroups.com
I have the blueprints defined, but get the following error on trying to repeatedly calling Services.make! ie 50.times { Services.make! }



The blueprint:
# machinist blueprint definition for the object
  Services.blueprint do
    portID              { randomize_foreign_key("ports") }       # Link to portID foreign_key
    protocol            { get_protocol() }                     # Random service name - need better seeds
    product             { (["MS Active Directory","Kerberos","MySQL"].shuffle)[1] }                # unsure about this
    version             { rand(9).to_s + "." + rand(9).to_s }                  # random version number definition
    extraInfo           { Faker::Lorem.sentence(rand(15)) }      # randomized text Lorem
    timestamp           { Time.now() }                           # Current timestamp inserted
  end

The error

undefined method `eq' for nil:NilClass
/home//.rvm/gems/ree-1.8.7-2010.02@/gems/activerecord-3.0.1/lib/active_record/relation/finder_methods.rb:291:in `find_one'
/home//.rvm/gems/ree-1.8.7-2010.02@/bundler/gems/machinist-5534f442f9d7/lib/machinist/active_record/blueprint.rb:33:in `value'
/home//.rvm/gems/ree-1.8.7-2010.02@/bundler/gems/machinist-5534f442f9d7/lib/machinist/active_record/blueprint.rb:33:in `outside_transaction'
/home//.rvm/gems/ree-1.8.7-2010.02@/bundler/gems/machinist-5534f442f9d7/lib/machinist/shop.rb:43:in `buy'
/home//.rvm/gems/ree-1.8.7-2010.02@/bundler/gems/machinist-5534f442f9d7/lib/machinist/machinable.rb:55:in `make!'
/home//.rvm/gems/ree-1.8.7-2010.02@/bundler/gems/machinist-5534f442f9d7/lib/machinist/machinable.rb:94:in `decode_args_to_make'
/home//.rvm/gems/ree-1.8.7-2010.02@/bundler/gems/machinist-5534f442f9d7/lib/machinist/machinable.rb:53:in `make!'

Would appreciate any help on this.

The first make! call seems to execute and populate my database but on consecutive calls in the loop it falls with the above error. 
 

FuzzLightyear

unread,
Jan 25, 2011, 5:45:30 AM1/25/11
to machini...@googlegroups.com
I seem to be getting this on all blueprints.

 
NoMethodError: undefined method `eq' for nil:NilClass
        from /home//.rvm/gems/ree-1.8.7-2010.02@/gems/activerecord-3.0.1/lib/active_record/relation/finder_methods.rb:291:in `find_one'
        from /home//.rvm/gems/ree-1.8.7-2010.02@/bundler/gems/machinist-5534f442f9d7/lib/machinist/active_record/blueprint.rb:33:in `value'
        from /home//.rvm/gems/ree-1.8.7-2010.02@/bundler/gems/machinist-5534f442f9d7/lib/machinist/active_record/blueprint.rb:33:in `outside_transaction'
        from /home//.rvm/gems/ree-1.8.7-2010.02@/bundler/gems/machinist-5534f442f9d7/lib/machinist/shop.rb:43:in `buy'
        from /home//.rvm/gems/ree-1.8.7-2010.02@/bundler/gems/machinist-5534f442f9d7/lib/machinist/machinable.rb:55:in `make!'
        from /home//.rvm/gems/ree-1.8.7-2010.02@/bundler/gems/machinist-5534f442f9d7/lib/machinist/machinable.rb:94:in `decode_args_to_make'
        from /home//.rvm/gems/ree-1.8.7-2010.02@/bundler/gems/machinist-5534f442f9d7/lib/machinist/machinable.rb:53:in `make!'
        from (irb):153
Currently I'm suppressing the 'no method' errors just to have it execute without breaking my loops, but would be nice to understand and be able to fix this.
Reply all
Reply to author
Forward
0 new messages