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.