Skip to content

Instantly share code, notes, and snippets.

@vladimir-e
Last active December 15, 2015 02:59
Show Gist options
  • Save vladimir-e/5190710 to your computer and use it in GitHub Desktop.
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
# 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