Sha256: 8f3a3be07d1f828593229394de9940951fa2ec695ca0e5d443e215b04499dea0
Contents?: true
Size: 785 Bytes
Versions: 13
Compression:
Stored size: 785 Bytes
Contents
require 'orm_adapter/adapters/active_record' module Cable module Orm # This module contains some helpers and handle schema (migrations): # # create_table :accounts do |t| # t.menuable # t.nameable # t.addressable # t.contactable # t.timestamps # end # # module ActiveRecord module Schema include Cable::Schema # Tell how to apply schema methods. def apply_cable_schema(name, type, options={}) column name, type.to_s.downcase.to_sym, options end end end end end ActiveRecord::ConnectionAdapters::Table.send :include, Cable::Orm::ActiveRecord::Schema ActiveRecord::ConnectionAdapters::TableDefinition.send :include, Cable::Orm::ActiveRecord::Schema
Version data entries
13 entries across 13 versions & 1 rubygems