Skip to content

Instantly share code, notes, and snippets.

@royw
Created December 21, 2008 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save royw/38729 to your computer and use it in GitHub Desktop.
Save royw/38729 to your computer and use it in GitHub Desktop.
irb(main):003:0> a = Account.first
~ SELECT `id`, `register_number`, `created_at`, `updated_at` FROM `accounts` ORDER BY `id` LIMIT 1
=> #<Account id=1 register_number=nil created_at=nil updated_at=nil>
irb(main):004:0> c = Contact.first
~ SELECT `id`, `title`, `first_name`, `middle_name`, `last_name`, `suffix`, `company_name`, `created_at`, `updated_at`, `account_id`, `veterinarian_id`, `groomer_id`, `clinic_id` FROM `contacts` ORDER BY `id` LIMIT 1
=> #<Contact id=1 title=nil first_name=nil middle_name=nil last_name=nil suffix=nil company_name=nil created_at=nil updated_at=#<DateTime: 212096641211/86400,-1/4,2299161> account_id=1 veterinarian_id=nil groomer_id=nil clinic_id=nil>
irb(main):005:0> c.account = a
=> #<Account id=1 register_number=nil created_at=nil updated_at=nil>
irb(main):006:0> c.save
=> true
irb(main):007:0> a.contacts
~ SELECT `id`, `title`, `first_name`, `middle_name`, `last_name`, `suffix`, `company_name`, `created_at`, `updated_at`, `account_id`, `veterinarian_id`, `groomer_id`, `clinic_id` FROM `contacts` WHERE (`account_id` IN (1)) ORDER BY `id`
NameError: uninitialized constant LazyArray::RETURN_SELF
from /Users/royw/views/petstation/trunk/gems/gems/dm-core-0.9.7/lib/dm-core/associations/one_to_many.rb:311:in `method_missing'
from /opt/local/lib/ruby/1.8/irb.rb:302:in `output_value'
from /opt/local/lib/ruby/1.8/irb.rb:151:in `eval_input'
from /opt/local/lib/ruby/1.8/irb.rb:263:in `signal_status'
from /opt/local/lib/ruby/1.8/irb.rb:147:in `eval_input'
from /opt/local/lib/ruby/1.8/irb.rb:146:in `eval_input'
from /opt/local/lib/ruby/1.8/irb.rb:70:in `start'
from /opt/local/lib/ruby/1.8/irb.rb:69:in `catch'
from /opt/local/lib/ruby/1.8/irb.rb:69:in `start'
from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0.4/lib/merb-core/rack/adapter/irb.rb:161:in `start'
from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0.4/lib/merb-core/server.rb:174:in `bootup'
from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0.4/lib/merb-core/server.rb:42:in `start'
from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0.4/lib/merb-core.rb:170:in `start'
from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0.4/bin/merb:11
from /opt/local/bin/merb:19:in `load'
from /opt/local/bin/merb:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment