Sha256: 90adfa64eef97f014cabc7d6b6bdb6c36e0dc629909f928355f09946b393abab

Contents?: true

Size: 429 Bytes

Versions: 14

Compression:

Stored size: 429 Bytes

Contents

require 'active_support/concern'

module Brightcontent
  module BaseControllerExt
    module Filtering
      extend ActiveSupport::Concern

      included do
        helper_method :ransack_search
      end

      def ransack_search
        @_ransack_search ||= end_of_association_chain.ransack(params[:q])
      end

      def collection
        @_collection ||= ransack_search.result(distinct: true)
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
brightcontent-core-2.3.4 lib/brightcontent/base_controller_ext/filtering.rb
brightcontent-core-2.3.3 lib/brightcontent/base_controller_ext/filtering.rb
brightcontent-core-2.3.2 lib/brightcontent/base_controller_ext/filtering.rb
brightcontent-core-2.3.1 lib/brightcontent/base_controller_ext/filtering.rb
brightcontent-core-2.3.0 lib/brightcontent/base_controller_ext/filtering.rb
brightcontent-core-2.2.2 lib/brightcontent/base_controller_ext/filtering.rb
brightcontent-core-2.2.1 lib/brightcontent/base_controller_ext/filtering.rb
brightcontent-core-2.2.0 lib/brightcontent/base_controller_ext/filtering.rb
brightcontent-core-2.1.5 lib/brightcontent/base_controller_ext/filtering.rb
brightcontent-core-2.1.4 lib/brightcontent/base_controller_ext/filtering.rb
brightcontent-core-2.1.3 lib/brightcontent/base_controller_ext/filtering.rb
brightcontent-core-2.1.2 lib/brightcontent/base_controller_ext/filtering.rb
brightcontent-core-2.1.1 lib/brightcontent/base_controller_ext/filtering.rb
brightcontent-core-2.1.0 lib/brightcontent/base_controller_ext/filtering.rb