<% raise Hobo::Error, "The 'collection' attribute must be defined" if collection.blank? belong_class = this.kind_of?(Class) ? this : this.class raise Hobo::Error, "The context is not an ActiveRecord::Base instance or class. (this = #{this.typed_id rescue this.inspect})" unless belong_class < ActiveRecord::Base # prepare symbolized attributes for merging attrs = {} all_attributes.each_pair{|k,v| attrs[k.to_sym] = v} -%> <% if your && belong_class < Hobo::Model::UserBase && this.kind_of?(Hobo::Model::UserBase) && I18n.locale == :en -%> <%= belong_class.human_attribute_name(collection.to_sym, attrs) %> <% else -%> <%= belong_class.human_attribute_name( collection.to_sym, attrs ) %> <% end %>