Sha256: a5cf3db3d2352dc8e597a93e37b789419066f47af452937adece9da7cf1e073a

Contents?: true

Size: 552 Bytes

Versions: 13

Compression:

Stored size: 552 Bytes

Contents

module Mobility
  module Backend
    module Sequel
=begin

Defines query method overrides to handle translated attributes for Sequel
models. For details see backend-specific subclasses.

=end
      class QueryMethods < Module
        # @param [Array<String>] attributes Translated attributes
        def initialize(attributes, **_)
          @attributes = attributes.map! &:to_sym
          @attributes_extractor = lambda do |cond|
            cond.is_a?(Hash) && (cond.keys & attributes).presence
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
mobility-0.1.20 lib/mobility/backend/sequel/query_methods.rb
mobility-0.1.19 lib/mobility/backend/sequel/query_methods.rb
mobility-0.1.18 lib/mobility/backend/sequel/query_methods.rb
mobility-0.1.17 lib/mobility/backend/sequel/query_methods.rb
mobility-0.1.16 lib/mobility/backend/sequel/query_methods.rb
mobility-0.1.15 lib/mobility/backend/sequel/query_methods.rb
mobility-0.1.14 lib/mobility/backend/sequel/query_methods.rb
mobility-0.1.13 lib/mobility/backend/sequel/query_methods.rb
mobility-0.1.12 lib/mobility/backend/sequel/query_methods.rb
mobility-0.1.11 lib/mobility/backend/sequel/query_methods.rb
mobility-0.1.10 lib/mobility/backend/sequel/query_methods.rb
mobility-0.1.7 lib/mobility/backend/sequel/query_methods.rb
mobility-0.1.6 lib/mobility/backend/sequel/query_methods.rb