Sha256: 35515322694e94612cce5cf3f5c1dfabde07e54bc175f65305b0b004627744b6

Contents?: true

Size: 645 Bytes

Versions: 1

Compression:

Stored size: 645 Bytes

Contents

require 'mobility/backends/active_record/pg_query_methods'
require 'mobility/backends/active_record/query_methods'

module Mobility
  module Backends
    module ActiveRecord
      class Hstore::QueryMethods < QueryMethods
        include PgQueryMethods

        def matches(key, locale)
          build_infix(:'->', arel_table[column_name(key)], build_quoted(locale))
        end

        def exists(key, locale)
          build_infix(:'?', arel_table[column_name(key)], build_quoted(locale))
        end

        def quote(value)
          build_quoted(value)
        end
      end
      Hstore.private_constant :QueryMethods
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mobility-0.6.0 lib/mobility/backends/active_record/hstore/query_methods.rb