Forum: Ruby on Rails ActiveRecord::Base in environment.rb

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.
Sijo k. (Guest)
on 2009-01-15 11:04
 have the following code in environment.rb

class ActiveRecord::Base
  extend Searchable
end

    in the lib folder there is searchable.rb and inside that there is
module Searchable

        My question is why do we define such a class in environment.rb
What is the actual purpose of this

Thanks in advance
Sijo
MaD (Guest)
on 2009-01-15 11:28
(Received via mailing list)
obviously you want to mix in the module Searchable into your
ActiveRecord::Base. by using extend the methods inside the Searchable-
module become class methods (with "include" they would become instance
methods).

> My question is why do we define such a class in environment.rb
> What is the actual purpose of this
since i don't know your code, i can't really tell you, what you are
doing (or trying to do).
besides: shouldn't you know that yourself?
This topic is locked and can not be replied to.