This project is archived and is in readonly mode.

#6770 new
andres

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

Reported by andres | May 4th, 2011 @ 09:35 PM

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

No comments found

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>

People watching this ticket

Pages