Changes for multiple i18n_variable in bulletin

This commit is contained in:
Christophe Vilayphiou committed 2012-02-15 00:34:22 +08:00
1 parent 1f7dae9bee
commit f57e9f19f7
3 files changed
+73 -37

No files matched your search

+6 -2
View File
@@ -9,8 +9,12 @@ class I18nVariable
belongs_to :language_value, polymorphic: true
def method_missing(field)
self[field]
def method_missing(*field)
if field.size > 1
self.write_attribute(field[0].to_s.delete('=').to_sym, field[1])
else
self[field[0]]
end
end
end