Skip to content

Instantly share code, notes, and snippets.

@h0lyalg0rithm
Last active August 29, 2015 14:27
Show Gist options
  • Save h0lyalg0rithm/50391187f509cc6ecb71 to your computer and use it in GitHub Desktop.
Save h0lyalg0rithm/50391187f509cc6ecb71 to your computer and use it in GitHub Desktop.
Table inheritance
class Item < ItemTemplate
self.primary_key = "id"
end
class ItemTemplate < ActiveRecord::Base
end
execute <<-SQL
CREATE TABLE items (
) INHERITS (item_templates);
SQL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment