Sha256: 999b3c0613617e6aeed3e9abf9a7039319cc17c9995c3434c9c5170078d12321
Contents?: true
Size: 899 Bytes
Versions: 2
Compression:
Stored size: 899 Bytes
Contents
require 'mobility/backend/sequel/hash_valued' module Mobility module Backend =begin Implements the {Mobility::Backend::Hstore} backend for Sequel models. @see Mobility::Backend::Sequel::HashValued =end class Sequel::Hstore < Sequel::HashValued autoload :QueryMethods, 'mobility/backend/sequel/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.to_s] = value && value.to_s end # @!endgroup setup do |attributes, options| extension = Module.new do define_method :i18n do @mobility_scope ||= super().with_extend(QueryMethods.new(attributes, options)) end end extend extension end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
mobility-0.1.5 | lib/mobility/backend/sequel/hstore.rb |
mobility-0.1.4 | lib/mobility/backend/sequel/hstore.rb |