-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't like abstract classes. #1
Comments
Hi, I believe my thinking behind this was that since abstract classes do not have a table there are no legacy columns to transform. The transformation(s) are done when the class is loaded, so returning when the class is abstract would prevent a subclass' columns from being transformed. In the case that abstract_class? was true, transformation could be placed in the the abstract class' inherited() method, though this is flimsy since it depends the order self.abstract_class and transform_legacy_attribute_methods are called. |
Blows up when it tries to find the columns of an abstract class. Fix is easy by adding line:
def transform_legacy_attribute_methods(*args, &block)
...
Also, for this to work, the abstract class getter must be defined in a model before transform_legacy_attribute_methods. E.g.
class Human < ActiveRecord::Base
def self.abstract_class?
true
end
transform_legacy_attribute_methods
end
The text was updated successfully, but these errors were encountered: