This project is archived and is in readonly mode.
arel_table.as("xxx") throws nil
Reported by Jason May | August 30th, 2010 @ 08:01 PM
Rails 3.0.0 general release.
Given an ActiveRecord class Foo:
Foo.arel_table.as("bar")
throws
NoMethodError: undefined method merge' for
nil:NilClass
from /Users/jmay/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.0/lib/active_support/whiny_nil.rb:48:in `method_missing'
from /Users/jmay/.rvm/gems/ruby-1.9.2-p0/gems/arel-1.0.1/lib/arel/engines/sql/relations/table.rb:54:in `as'
It appears that options is not being defaulted to {} in table.rb.
Comments and changes to this ticket
-
Jason May August 30th, 2010 @ 08:06 PM
Quick fix: adding the line:
@options = {}
at line 35 in table.rb.
-
Emilio Tagua August 31st, 2010 @ 02:23 PM
- State changed from new to resolved
- Importance changed from to Low
Hey Jason,
This is fixed in this commit: http://github.com/rails/arel/commit/026594c93e8497bb4657f94ea99ebbf...
I'm marking the ticket as resolved if you still find any problem feel free to reopen it.
Thanks.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>