Sha256: 6d59dfe85a75252e6d02b07d64c4f7c5bdccb94ea962fd42e36bb6a16506bf07
Contents?: true
Size: 1.01 KB
Versions: 6
Compression:
Stored size: 1.01 KB
Contents
module Mobility module Backend =begin Implements the {Mobility::Backend::Column} backend for Sequel models. @note This backend disables the +accessor_locales+ option, which would otherwise interfere with column methods. =end class Sequel::Column include Backend include Mobility::Backend::Column autoload :QueryMethods, 'mobility/backend/sequel/column/query_methods' # @!group Backend Accessors # @!macro backend_reader # @!method read(locale, **options) # @!group Backend Accessors # @!macro backend_writer # @!method write(locale, value, **options) # @!group Backend Configuration def self.configure!(options) options[:locale_accessors] = false 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
6 entries across 6 versions & 1 rubygems