Class: Mobility::Backends::Sequel::PgHash

Inherits:
Object
  • Object
show all
Includes:
HashValued, Mobility::Backends::Sequel, StringifyLocale
Defined in:
lib/mobility/backends/sequel/pg_hash.rb

Overview

Internal class used by Sequel backends backed by a Postgres data type (hstore, jsonb).

Direct Known Subclasses

Hstore, Jsonb

Instance Method Summary collapse

Methods included from HashValued

#read, #write

Methods included from Mobility::Backends::Sequel

included, #setup_query_methods

Instance Method Details

#each_locale {|Locale| ... } ⇒ Object

Yields locales available for this attribute.

Yield Parameters:

  • Locale (Symbol)


21
22
23
# File 'lib/mobility/backends/sequel/pg_hash.rb', line 21

def each_locale
  super { |l| yield l.to_sym }
end

#translationsObject



25
26
27
# File 'lib/mobility/backends/sequel/pg_hash.rb', line 25

def translations
  model[attribute.to_sym]
end