Sha256: cefe9ca94e1253e9440e72311ed8b06471530bfa5b75c9e36a4adcfd8edc83ad

Contents?: true

Size: 708 Bytes

Versions: 17

Compression:

Stored size: 708 Bytes

Contents

require 'mobility/backends/active_record/pg_hash'

module Mobility
  module Backends
=begin

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

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

=end
    class ActiveRecord::Hstore < ActiveRecord::PgHash
      require 'mobility/backends/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, options = {})
        super(locale, value && value.to_s, options)
      end
      # @!endgroup

      setup_query_methods(QueryMethods)
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
mobility-0.5.1 lib/mobility/backends/active_record/hstore.rb
mobility-0.5.0 lib/mobility/backends/active_record/hstore.rb
mobility-0.4.3 lib/mobility/backends/active_record/hstore.rb
mobility-0.4.2 lib/mobility/backends/active_record/hstore.rb
mobility-0.4.1 lib/mobility/backends/active_record/hstore.rb
mobility-0.4.0 lib/mobility/backends/active_record/hstore.rb
mobility-0.3.6 lib/mobility/backends/active_record/hstore.rb
mobility-0.3.5 lib/mobility/backends/active_record/hstore.rb
mobility-0.3.4 lib/mobility/backends/active_record/hstore.rb
mobility-0.3.3 lib/mobility/backends/active_record/hstore.rb
mobility-0.3.2 lib/mobility/backends/active_record/hstore.rb
mobility-0.3.1 lib/mobility/backends/active_record/hstore.rb
mobility-0.3.0 lib/mobility/backends/active_record/hstore.rb
mobility-0.2.3 lib/mobility/backends/active_record/hstore.rb
mobility-0.2.2 lib/mobility/backends/active_record/hstore.rb
mobility-0.2.1 lib/mobility/backends/active_record/hstore.rb
mobility-0.2.0 lib/mobility/backends/active_record/hstore.rb