[Locomotive-users] Problem with :belongs_to relation
Samuel Linde
samuel.linde at gmail.com
Mon Feb 26 19:24:39 GMT 2007
Hi again, Stephen,
Again, thanks for taking your time helping me through this.
Booking.find(:first) returns the first object, as suspected.
> b.customer?
This method returns the following:
ArgumentError: wrong number of arguments (0 for 1)
from /Applications/Locomotive2/Bundles/
rmagickRailsJan2007_x86.locobundle/framework/lib/ruby/gems/1.8/gems/
activesupport-1.4.0/lib/active_support/deprecation.rb:93:in
`customer_without_deprecation?'
from /Applications/Locomotive2/Bundles/
rmagickRailsJan2007_x86.locobundle/framework/lib/ruby/gems/1.8/gems/
activesupport-1.4.0/lib/active_support/deprecation.rb:93:in `customer?'
from (irb):2
> b.customer.nil?
Returns false.
> b.customer
Returns the customer object.
> Booking.find(:all).each { |b| puts b.customer.name if b.customer? }
Also returns ArgumentError:
ArgumentError: wrong number of arguments (0 for 1)
from /Applications/Locomotive2/Bundles/
rmagickRailsJan2007_x86.locobundle/framework/lib/ruby/gems/1.8/gems/
activesupport-1.4.0/lib/active_support/deprecation.rb:93:in
`customer_without_deprecation?'
from /Applications/Locomotive2/Bundles/
rmagickRailsJan2007_x86.locobundle/framework/lib/ruby/gems/1.8/gems/
activesupport-1.4.0/lib/active_support/deprecation.rb:93:in `customer?'
from (irb):5
from (irb):5:in `each'
from (irb):5
/Samuel
More information about the Locomotive-users
mailing list