search for: fix_table_nam

Displaying 1 result from an estimated 1 matches for "fix_table_nam".

Did you mean: fix_table_name
2006 Jul 26
4
Execute code when an inheritance happens, or disabling STI
I am trying to inherit from a ActiveRecord class defined in a plugin. The problem is that ActiveRecord thinks I am doing an STI and is looking up a table that doesn''t exist. Currently, I have a method in the parent class that looks like this: def self.fix_table_name class_eval do set_table_name(Inflector.tableize(self.to_s)) end end The problem is that this method has to be manually called from each inheriting class. There must be a better way to execute this code. Any ideas? -- Posted via http://www.ruby-forum.com/.