Last active
December 15, 2015 02:59
-
-
Save vladimir-e/5190710 to your computer and use it in GitHub Desktop.
Disable ActiveRecord "type" column subclassing (http://www.ruby-forum.com/topic/102961) #rails #ar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rails 4 | |
class ExampleModel < ActiveRecord::Base | |
self.inheritance_column = '_type_disable' | |
end | |
# Rails 3 | |
class ExampleModel < ActiveRecord::Base | |
set_inheritance_column do | |
'disabled' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment