Reputation: 4336
I have a base model MyAppRecordBase
which inherits from ActiveRecord::Base
and which all other models inherit from. How do I set a default parent model for rails generate model XYZ
?
Upvotes: 0
Views: 829
Reputation: 4336
Set the following in environments/development.rb
config.generators.active_record[:parent] = 'MyAppRecordBase'
Alternatively you can set it on the command line with
rails generate model Dog --parent MyAppRecordBase
Upvotes: 2