Commit 2aae157c67267da861fc62cf0043287146f34681
1 parent
46a6f863
Exists in
master
and in
29 other branches
rails3: fix active record for plugins
Showing
1 changed file
with
4 additions
and
2 deletions
Show diff stats
lib/noosfero/plugin/active_record.rb
1 | class Noosfero::Plugin::ActiveRecord < ActiveRecord::Base | 1 | class Noosfero::Plugin::ActiveRecord < ActiveRecord::Base |
2 | - def self.table_name | ||
3 | - self.name.gsub('::','_').underscore.pluralize | 2 | + |
3 | + def self.inherited(child) | ||
4 | + self.table_name = child.name.gsub('::','_').underscore.pluralize | ||
4 | end | 5 | end |
6 | + | ||
5 | end | 7 | end |