Class: Translates::ColumnBackend

Inherits:
Object
  • Object
show all
Defined in:
lib/translates/column_backend.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model, attribute) ⇒ ColumnBackend

Returns a new instance of ColumnBackend.



3
4
5
# File 'lib/translates/column_backend.rb', line 3

def initialize(model, attribute)
  @model, @attribute = model, attribute
end

Class Method Details

.setup_modelObject



15
16
# File 'lib/translates/column_backend.rb', line 15

def self.setup_model(*)
end

Instance Method Details

#read(locale) ⇒ Object



7
8
9
# File 'lib/translates/column_backend.rb', line 7

def read(locale)
  @model.read_attribute(column(locale))
end

#write(locale, value) ⇒ Object



11
12
13
# File 'lib/translates/column_backend.rb', line 11

def write(locale, value)
  @model.write_attribute(column(locale), value)
end