Forum: Ruby on Rails ' X is not missing constant Y ' , problem after rails update

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
11a08b97f4904999b2398a0c265b38e4?d=identicon&s=25 Frioffol Friofool (friofool)
on 2007-04-18 18:34
Hello,

I'm just updating my rails version to 1.2.3
I get the ' X is not missing constant Y' message for all request in my
existing applications.

Exemple :

app/controller/login/login.rb

use a model in :

app/models/login/connect.rb

This exemple give the error :

" Login is not missing constant Connect! "

What's wrong im my configuration ?
87e41d0d468ad56a3b07d9a6482fd6d5?d=identicon&s=25 Hemant Kumar (gnufied)
on 2007-04-18 18:42
(Received via mailing list)
On 4/18/07, Frioffol Friofool <rails-mailing-list@andreas-s.net> wrote:
>
> use a model in :
>
> app/models/login/connect.rb
>
> This exemple give the error :
>
> " Login is not missing constant Connect! "
>
> What's wrong im my configuration ?
>

 app/models/login/connect.rb

^^^^ whats wrong with your model? why have to stuck them inside login
folder? If you must do something like that, then make sure, you
inherit stuff properly.


I have seen this stuff before, when i i tried to do something like
this, in one of my plugins.

class ActiveRecord::Schema
  # some migration foobar
end


Rewriting above code like this:

module ActiveRecord
  class Schema
    # some migration foobar
  end
end

fixed the error. :)



--
gnufied
11a08b97f4904999b2398a0c265b38e4?d=identicon&s=25 Frioffol Friofool (friofool)
on 2007-04-18 19:06
i put this file in model/login/connect.rb to have a clean structure.

my connect.rb is :

class Login::Connect < ActiveRecord::Base

end

and my login.rb is :

class Login::LoginController < ApplicationController

end

Maybe there is a best method to do that, but before i update my rails
version, the application works fine.

i don't know what to do...
79f9616c279f40ef953f366dcfe38dc8?d=identicon&s=25 Suraj Kurapati (sunaku)
on 2009-06-05 23:28
Hemant Kumar wrote:
> I have seen this stuff before, when i i tried to do something like
> this, in one of my plugins.
>
> class ActiveRecord::Schema
>   # some migration foobar
> end
>
> Rewriting above code like this:
>
> module ActiveRecord
>   class Schema
>     # some migration foobar
>   end
> end
>
> fixed the error. :)

In Rails 2.x, this approach only takes us halfway to the solution.  See
this bug report[1] for the rest of the solution, which involves
monkeypatching the load_missing_constant() method.

[1]
https://rails.lighthouseapp.com/projects/8994-ruby...
This topic is locked and can not be replied to.