Sha256: a33faf2315f9685ee7fd44e7978b38fcbc412c2148f95cc341d644947a8471f2

Contents?: true

Size: 910 Bytes

Versions: 2

Compression:

Stored size: 910 Bytes

Contents

require 'active_record'

module Khronos
  class Storage
    module Adapter

      module ActiveRecord
        autoload :Schedule,     'khronos/storage/adapter/activerecord/schedule'
        autoload :ScheduleLog,  'khronos/storage/adapter/activerecord/schedule_log'

        def self.connect!(url)
          puts "Connect! => #{url.inspect}"
          if File.exists?("config/database.yml")
            ::ActiveRecord::Base.establish_connection(YAML.load_file("config/database.yml")[ENV['RACK_ENV']])
          else
            ::ActiveRecord::Base.establish_connection(url)
          end

          #
          # ::ActiveRecord::Base.logger = ::Logger.new(STDOUT)
          #
          self
        end

        def self.included(base)
          #puts "included in #{base}"
        end

        def self.extended(base)
          #puts "extended in #{base.inspect}"
        end

      end

    end
  end
end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
khronos-0.0.1.pre1 lib/khronos/storage/adapter/activerecord.rb
khronos-0.0.1 lib/khronos/storage/adapter/activerecord.rb