Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

lib nested modules name space clash with models on console (bug or feature?) #1083

Closed
lighthouse-import opened this Issue · 0 comments

1 participant

@lighthouse-import

Imported from Lighthouse. Original ticket at: http://rails.lighthouseapp.com/projects/8994/tickets/6770
Created by andres - 2011-05-04 20:35:33 UTC

given an AR class like Facility on ./app/models/facility.rb

and a namespaced module in a library with the same name ./lib/extensions/facility.rb
when invoking the Facility constant class name from console

AS loads first the file under the lib, not the model definition class

app/models/facility.rb

class Facility < ActiveRecord::Base
end

lib/extensions/facility.rb

module Extensions
module Facility
end
end

rails console
Loading development environment (Rails 3.0.6)
ruby-1.9.2-p136 :001 > Facility
LoadError: Expected /home/andres/Documents/code/sage/lib/extensions/facility.rb to define Facility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.