Fixing missing table_exists? #22

Merged
merged 1 commit into from Dec 17, 2012

Projects

None yet

2 participants

@gducharme

In some contexts (for example when using RubyCas, which dynamically defines an ActiveRecord model upon self.included?) a call to subclass.respond_to?(:table_exists?) will fail as the still initializing subclass will not have a name to resolve to, which leads to a SQL call like

SELECT '' FROM ''.

Checking the presence of the name will prevent this type of error, by skipping the attribute normalizer entirely.

@mdeering mdeering merged commit 4bd9fd7 into mdeering:master Dec 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment