Sha256: a9b918caa40ccdcdeebd2fda7a41199712426e500b77ce00af8823fcc8377ce4

Contents?: true

Size: 1.1 KB

Versions: 2

Compression:

Stored size: 1.1 KB

Contents

require 'mobility/backends/active_record/pg_hash'

module Mobility
  module Backends
=begin

Implements the {Mobility::Backends::Jsonb} backend for ActiveRecord models.

@see Mobility::Backends::ActiveRecord::HashValued

=end
    class ActiveRecord::Jsonb < ActiveRecord::PgHash
      require 'mobility/backends/active_record/jsonb/query_methods'

      # @!group Backend Accessors
      #
      # @note Translation may be any json type, but querying will only work on
      #   string-typed values.
      # @param [Symbol] locale Locale to read
      # @param [Hash] options
      # @return [String,Integer,Boolean] Value of translation
      # @!method read(locale, **options)

      # @!group Backend Accessors
      # @note Translation may be any json type, but querying will only work on
      #   string-typed values.
      # @param [Symbol] locale Locale to write
      # @param [String,Integer,Boolean] value Value to write
      # @param [Hash] options
      # @return [String,Integer,Boolean] Updated value
      # @!method write(locale, value, **options)

      setup_query_methods(QueryMethods)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mobility-0.5.1 lib/mobility/backends/active_record/jsonb.rb
mobility-0.5.0 lib/mobility/backends/active_record/jsonb.rb