Sha256: 65d6ba759f00007424d0cf8b34b120c1c1ba56d1a4c60adf020353eac27b459c
Contents?: true
Size: 552 Bytes
Versions: 5
Compression:
Stored size: 552 Bytes
Contents
# frozen_string_literal: true module Might # class RansackableFilter # @param app [#call] def initialize(app) @app = app end # @param env [<ActiveRecord::Relation, Hash] # * first element is a scope to be filtered # * second is a hash with user provided filters # @return [<ActiveRecord::Relation, Hash] # def call(env) scope, params = env filtered_scope = scope.ransack(params[:filter]).result app.call([filtered_scope, params]) end private attr_reader :app end end
Version data entries
5 entries across 5 versions & 1 rubygems