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
on 2009-01-15 10:04
on 2009-01-15 10:28
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?