Help: delegated association 'App' returning ActionDispatch::Integration::Session instead

class Foo < ActiveRecord::Base
  has_one :bar
  delegate :app, :to => :bar

class Bar < ActiveRecord::Base
  belongs_to :app

  def self.attribute_column_names
    return @@attr_columns if defined?(@@attr_columns)
    readers = { |n| } -
    @@attr_columns ||= { |k| [k, "#{k}=".to_sym] }.flatten

This all worked fine until in the console in my staging and production
environments, I assigned to an undefined variable:

Bar.all.each do |p|
  p.update_attribute("app_id", my_undefined_variable)

After doing this, I get:
  NameError: undefined local variable or method
`my_undefined_variable' for main:Object

for whatever reason is now returning an
ActionDispatch::Integration::Session object -- not only in the
console, but through the web, as well.

How can I correct this?

Update- I think the ActionDispatch::Integration::Session is only
returned in console.

Seems that console believes I'm calling it's own 'app' method even
though I've delegated it to an association.

Is this something worth filing a bug report on? Should I just rename
App to something else, however unnatural it may be?