Class: Mobility::Backends::Sequel::Hstore

Inherits:
PgHash
  • Object
show all
Defined in:
lib/mobility/backends/sequel/hstore.rb

Overview

Implements the Hstore backend for Sequel models.

See Also:

  • HashValued

Defined Under Namespace

Classes: QueryMethods

Backend Accessors collapse

Methods inherited from PgHash

#each_locale, #translations

Methods included from HashValued

#each_locale

Methods included from Mobility::Backends::Sequel

included, #setup_query_methods

Instance Method Details

#read(locale, **options) ⇒ Object

Gets the translated value for provided locale from configured backend.

Parameters:

  • locale (Symbol)

    Locale to read

Returns:

  • (Object)

    Value of translation



# File 'lib/mobility/backends/sequel/hstore.rb', line 15


#write(locale, value, options = {}) ⇒ Object

Updates translation for provided locale without calling backend's methods to persist the changes.

Parameters:

  • locale (Symbol)

    Locale to write

  • value (Object)

    Value to write

Returns:

  • (Object)

    Updated value



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

def write(locale, value, options = {})
  super(locale, value && value.to_s, options)
end