Class: Mobility::Backend::ActiveRecord::Hstore

Inherits:
HashValued show all
Defined in:
lib/mobility/backend/active_record/hstore.rb

Overview

Implements the Hstore backend for ActiveRecord models.

See Also:

Defined Under Namespace

Classes: QueryMethods

Instance Attribute Summary

Attributes included from Mobility::Backend

#attribute, #model, #options

Backend Accessors collapse

Methods inherited from HashValued

#translations, #write_to_cache?

Methods included from Mobility::Backend

included, #initialize, method_name

Instance Method Details

#read(locale, **options) ⇒ Object

Returns Value of translation.

Parameters:

  • locale (Symbol)

    Locale to read

  • options (Hash)

Returns:

  • (Object)

    Value of translation



# File 'lib/mobility/backend/active_record/hstore.rb', line 15

#write(locale, value, **options) ⇒ Object

Returns Updated value.

Parameters:

  • locale (Symbol)

    Locale to write

  • value (Object)

    Value to write

  • options (Hash)

Returns:



21
22
23
# File 'lib/mobility/backend/active_record/hstore.rb', line 21

def write(locale, value, **options)
  translations[locale] = value && value.to_s
end