Sha256: 02872b9a4f63fd3293e6aa4a784993d02b037b1f3f2b64cf04618ad70d5a2c75

Contents?: true

Size: 769 Bytes

Versions: 13

Compression:

Stored size: 769 Bytes

Contents

# frozen_string_literal: true
module Mobility
  module Plugins
=begin

@see {Mobility::Plugins::ActiveRecord::Query}

=end
    module Query
      class << self
        def apply(attributes, option)
          if option
            include_query_module(attributes)
          end
        end

        private

        def include_query_module(attributes)
          if Loaded::ActiveRecord && attributes.model_class < ::ActiveRecord::Base
            require "mobility/plugins/active_record/query"
            ActiveRecord::Query.apply(attributes)
          elsif Loaded::Sequel && attributes.model_class < ::Sequel::Model
            require "mobility/plugins/sequel/query"
            Sequel::Query.apply(attributes)
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
mobility-0.8.13 lib/mobility/plugins/query.rb
mobility-0.8.11 lib/mobility/plugins/query.rb
mobility-0.8.10 lib/mobility/plugins/query.rb
mobility-0.8.9 lib/mobility/plugins/query.rb
mobility-0.8.8 lib/mobility/plugins/query.rb
mobility-0.8.7 lib/mobility/plugins/query.rb
mobility-0.8.6 lib/mobility/plugins/query.rb
mobility-0.8.5 lib/mobility/plugins/query.rb
mobility-0.8.4 lib/mobility/plugins/query.rb
mobility-0.8.3 lib/mobility/plugins/query.rb
mobility-0.8.2 lib/mobility/plugins/query.rb
mobility-0.8.1 lib/mobility/plugins/query.rb
mobility-0.8.0 lib/mobility/plugins/query.rb