Sha256: 79f11d3de549802e14a19746bbf7c317a4d41ab83a2fe7c812a5614ae55c67aa

Contents?: true

Size: 701 Bytes

Versions: 8

Compression:

Stored size: 701 Bytes

Contents

require 'mobility/backend/active_record/hash_valued'

module Mobility
  module Backend
=begin

Implements the {Mobility::Backend::Hstore} backend for ActiveRecord models.

@see Mobility::Backend::ActiveRecord::HashValued

=end
    class ActiveRecord::Hstore < ActiveRecord::HashValued
      require 'mobility/backend/active_record/hstore/query_methods'

      # @!group Backend Accessors
      # @!macro backend_reader
      # @!method read(locale, **options)

      # @!group Backend Accessors
      # @!macro backend_writer
      def write(locale, value, **_)
        translations[locale] = value && value.to_s
      end
      # @!endgroup

      setup_query_methods(QueryMethods)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mobility-0.1.20 lib/mobility/backend/active_record/hstore.rb
mobility-0.1.19 lib/mobility/backend/active_record/hstore.rb
mobility-0.1.18 lib/mobility/backend/active_record/hstore.rb
mobility-0.1.17 lib/mobility/backend/active_record/hstore.rb
mobility-0.1.16 lib/mobility/backend/active_record/hstore.rb
mobility-0.1.15 lib/mobility/backend/active_record/hstore.rb
mobility-0.1.14 lib/mobility/backend/active_record/hstore.rb
mobility-0.1.13 lib/mobility/backend/active_record/hstore.rb