This project is archived and is in readonly mode.

#6770 new

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


class Facility < ActiveRecord::Base


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=""></a>

People watching this ticket