Sha256: 6bf45ab46e931bd9e38501679fec284efddd1bd4c746ef71bad57af93bec233c

Contents?: true

Size: 432 Bytes

Versions: 46

Compression:

Stored size: 432 Bytes

Contents

require 'active_support/concern'

module HeadRow
  module AssociationExtensions
    extend ActiveSupport::Concern

    def association(association_name, options = {})
      options.reverse_merge!(label_method: :name)
      label_method = options.delete(:label_method)

      column(association_name, sortable_options: ["#{association_name}_#{label_method}", resource_klass.human_attribute_name(association_name)])
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
itsf_backend-5.0.0.pre app/extensions/concerns/head_row/association_extensions.rb
itsf_backend-4.2.3 app/extensions/concerns/head_row/association_extensions.rb
itsf_backend-4.2.2 app/extensions/concerns/head_row/association_extensions.rb
itsf_backend-4.2.1 app/extensions/concerns/head_row/association_extensions.rb
itsf_backend-4.2.0 app/extensions/concerns/head_row/association_extensions.rb
itsf_backend-4.0.1 app/extensions/concerns/head_row/association_extensions.rb
itsf_backend-4.0.0 app/extensions/concerns/head_row/association_extensions.rb
itsf_backend-3.1.1 app/extensions/concerns/head_row/association_extensions.rb
itsf_backend-3.1.0 app/extensions/concerns/head_row/association_extensions.rb
itsf_backend-3.0.7 app/extensions/concerns/head_row/association_extensions.rb
itsf_backend-3.0.6 app/extensions/concerns/head_row/association_extensions.rb
itsf_backend-3.0.5 app/extensions/concerns/head_row/association_extensions.rb
itsf_backend-3.0.4 app/extensions/concerns/head_row/association_extensions.rb
itsf_backend-3.0.3 app/extensions/concerns/head_row/association_extensions.rb
itsf_backend-3.0.2 app/extensions/concerns/head_row/association_extensions.rb
itsf_backend-3.0.1 app/extensions/concerns/head_row/association_extensions.rb
itsf_backend-3.0.0 app/extensions/concerns/head_row/association_extensions.rb
itsf_backend-2.2.1 app/extensions/concerns/head_row/association_extensions.rb
itsf_backend-2.2.0 app/extensions/concerns/head_row/association_extensions.rb
itsf_backend-2.1.0 app/extensions/concerns/head_row/association_extensions.rb