From 2aae157c67267da861fc62cf0043287146f34681 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Wed, 26 Feb 2014 11:32:23 -0300 Subject: [PATCH] rails3: fix active record for plugins --- lib/noosfero/plugin/active_record.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/noosfero/plugin/active_record.rb b/lib/noosfero/plugin/active_record.rb index f7769ed..563371b 100644 --- a/lib/noosfero/plugin/active_record.rb +++ b/lib/noosfero/plugin/active_record.rb @@ -1,5 +1,7 @@ class Noosfero::Plugin::ActiveRecord < ActiveRecord::Base - def self.table_name - self.name.gsub('::','_').underscore.pluralize + + def self.inherited(child) + self.table_name = child.name.gsub('::','_').underscore.pluralize end + end -- libgit2 0.21.2