Class | ActiveRecord::Base |
In: |
lib/features/localized_column_human_name.rb
|
Parent: | Object |
columns | -> | columns_without_localization |
Updates the ActiveRecord::Base#columns method (original renamed to columns_without_localization) to set the model_class property on every column belonging to this model class. This is necessary for the overwritten Column#human_name method to work.
# File lib/features/localized_column_human_name.rb, line 59 59: def columns 60: unless @columns 61: columns_without_localization 62: @columns.each do |column| 63: column.model_class = self 64: end 65: else 66: columns_without_localization 67: end 68: end