Sha256: 5141418913ec4cdecaa0e615b57efe41373406feb2d97b453423ca7ac87ce986

Contents?: true

Size: 513 Bytes

Versions: 9

Compression:

Stored size: 513 Bytes

Contents

# frozen_string_literal: true

module Lite
  module Report
    module Helpers
      module Records

        private

        def class_columns(data)
          return data.klass.column_names if ransack_class?(data)

          data.try(:column_names) || data.class.column_names
        end

        def klass
          @data_options[:klass]
        end

        def ransack_class?(data)
          return false unless defined?(Ransack)

          data.is_a?(Ransack::Search)
        end

      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
lite-report-1.3.2 lib/lite/report/helpers/records.rb
lite-report-1.3.1 lib/lite/report/helpers/records.rb
lite-report-1.3.0 lib/lite/report/helpers/records.rb
lite-report-1.2.0 lib/lite/report/helpers/records.rb
lite-report-1.1.1 lib/lite/report/helpers/records.rb
lite-report-1.1.0 lib/lite/report/helpers/records.rb
lite-report-1.0.6 lib/lite/report/helpers/records.rb
lite-report-1.0.5 lib/lite/report/helpers/records.rb
lite-report-1.0.4 lib/lite/report/helpers/records.rb