module Ransack::Translate
def attribute_name(context, name, include_associations = nil)
def attribute_name(context, name, include_associations = nil) @context, @name = context, name @assoc_path = context.association_path(name) @attr_name = @name.sub(/^#{@assoc_path}_/, ''.freeze) associated_class = @context.traverse(@assoc_path) if @assoc_path.present? @include_associated = include_associations && associated_class defaults = default_attribute_name << fallback_args options = { count: 1, default: defaults } interpolations = build_interpolations(associated_class) I18n.translate(defaults.shift, **options.merge(interpolations)) end