chandrashekar
chandrashekar

Reputation: 619

how to list of all models and include one common module

I'm working on a Rails 3 app. I wrote one module and want it accessible to all my models without using include in each one. Please help me do this.

Upvotes: 1

Views: 251

Answers (1)

BroiSatse
BroiSatse

Reputation: 44715

Create a file config/initializers/your_module_name.rb:

class ActiveRecord::Base
  include YourModule
end

Upvotes: 3

Related Questions