Class ActiveRecord::Base
In: lib/gettext/active_record.rb
Parent: Object

Methods

Included Modules

GetText Validations

Public Class methods

[Source]

     # File lib/gettext/active_record.rb, line 184
184:       def columns_with_gettext
185:         unless defined? @columns
186:           @columns = nil 
187:         end
188:         unless @columns
189:           @columns = columns_without_gettext
190:           @columns.each {|column| 
191:             column.table_class = self
192:           }
193:         end
194:         @columns
195:       end

((Deprecated)) Use ActionView::Helpers::ActiveRecordHelper::L10n.set_error_message_explanation instead.

Sets a your own explanation of the error message dialog.

  • msg: [single_msg, plural_msg]. Usually you need to call this with Nn_().
  • Returns: [single_msg, plural_msg]

[Source]

     # File lib/gettext/active_record.rb, line 222
222:       def set_error_message_explanation(msg, plural_msg = nil)
223:         ActionView::Helpers::ActiveRecordHelper::L10n.set_error_message_explanation(msg, plural_msg)
224:       end

((Deprecated)) Use ActionView::Helpers::ActiveRecordHelper::L10n.set_error_message_title instead.

Sets a your own title of error message dialog.

  • msg: [single_msg, plural_msg]. Usually you need to call this with Nn_().
  • Returns: [single_msg, plural_msg]

[Source]

     # File lib/gettext/active_record.rb, line 208
208:       def set_error_message_title(msg, plural_msg = nil)
209:         ActionView::Helpers::ActiveRecordHelper::L10n.set_error_message_title(msg, plural_msg)
210:       end

Sets the untranslate columns. (e.g.) untranslate :foo, :bar, :baz

[Source]

     # File lib/gettext/active_record.rb, line 167
167:       def untranslate(*w)
168:         ary = @@gettext_untranslate_columns[self] || []
169:         ary += w.collect{|v| v.to_s}
170:         @@gettext_untranslate_columns[self] = ary
171:       end

Returns true if the column is set "untranslate". (e.g.) untranslate? :foo

[Source]

     # File lib/gettext/active_record.rb, line 175
175:       def untranslate?(columnname)
176:         ary = @@gettext_untranslate_columns[self] || []
177:         ary.include?(columnname)
178:       end

Untranslate all of the tablename/fieldnames in this model class.

[Source]

     # File lib/gettext/active_record.rb, line 156
156:       def untranslate_all
157:         @@gettext_untranslate[self] = true
158:       end

Returns true if "untranslate_all" is called. Otherwise false.

[Source]

     # File lib/gettext/active_record.rb, line 161
161:       def untranslate_all?
162:         @@gettext_untranslate[self]
163:       end

[Validate]