Class: Mobility::Backends::ActiveRecord::PgHash

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

Overview

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

Direct Known Subclasses

Hstore, Jsonb

Defined Under Namespace

Classes: Coder

Instance Method Summary collapse

Methods included from HashValued

#read, #write

Methods included from Mobility::Backends::ActiveRecord

included, #setup_query_methods

Instance Method Details

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

Yields locales available for this attribute.

Yield Parameters:

  • Locale (Symbol)


17
18
19
# File 'lib/mobility/backends/active_record/pg_hash.rb', line 17

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

#translationsObject



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

def translations
  model.read_attribute(attribute)
end