Sha256: 93f41544dab0ee22d54239b19fbe003df50e66ca7c8f56cf9bb9f874676b29e8

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

module Mobility
  module Backend
    module ActiveRecord
      autoload :Column,       'mobility/backend/active_record/column'
      autoload :Dirty,        'mobility/backend/active_record/dirty'
      autoload :Hstore,       'mobility/backend/active_record/hstore'
      autoload :Jsonb,        'mobility/backend/active_record/jsonb'
      autoload :KeyValue,     'mobility/backend/active_record/key_value'
      autoload :Serialized,   'mobility/backend/active_record/serialized'
      autoload :QueryMethods, 'mobility/backend/active_record/query_methods'
      autoload :Table,        'mobility/backend/active_record/table'

      def setup_query_methods(query_methods)
        setup do |attributes, options|
          extend(Module.new do
            define_method ::Mobility.query_method do
              super().extending(query_methods.new(attributes, options))
            end
          end)
        end
      end

      def self.included(backend_class)
        backend_class.include(Backend)
        backend_class.extend(self)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mobility-0.1.20 lib/mobility/backend/active_record.rb
mobility-0.1.19 lib/mobility/backend/active_record.rb
mobility-0.1.18 lib/mobility/backend/active_record.rb