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

Version Path
cable-0.9.11 lib/cable/orm/active_record.rb
cable-0.9.10 lib/cable/orm/active_record.rb
cable-0.9.9 lib/cable/orm/active_record.rb
cable-0.9.8 lib/cable/orm/active_record.rb
cable-0.9.6 lib/cable/orm/active_record.rb
cable-0.9.5 lib/cable/orm/active_record.rb
cable-0.9.4 lib/cable/orm/active_record.rb
cable-0.9.3 lib/cable/orm/active_record.rb
cable-0.9.1 lib/cable/orm/active_record.rb
cable-0.9.0 lib/cable/orm/active_record.rb
cable-0.8.6 lib/cable/orm/active_record.rb
cable-0.8.5 lib/cable/orm/active_record.rb
cable-0.8.4 lib/cable/orm/active_record.rb