Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

arel_table.as("xxx") throws nil

#5500

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.

Reported by Jason May · August 30th, 2010 @ 08:01 PM

State: resolved
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Jason May
    Jason May

    Quick fix: adding the line:

    @options = {}

    at line 35 in table.rb.

    August 30th, 2010 @ 08:06 PM

  2. Emilio Tagua
    Emilio Tagua
    • 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.

    August 31st, 2010 @ 02:23 PM