Title / Description
Code require 'sqlite3' require 'active_record' class Alcoholic < ActiveRecord::Base self.abstract_class = true establish_connection adapter: "sqlite3", database: "../../db/brewing.sqlite" def self.create_the_tables self.descendants.each do |a| a.connection.create_table(a.to_s.downcase.pluralize) end end end class Beer < Alcoholic end class Cider < Alcoholic end
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code