1
0
Fork 0
mirror of https://github.com/activerecord-hackery/ransack.git synced 2022-11-09 13:47:45 -05:00

Patch Rails commit c1a118a

Fixes #461.

It would be preferable to find a better way to solve this.
This commit is contained in:
Jon Atack 2014-11-02 01:15:23 +01:00
parent d890de8207
commit c3a93d6b43

View file

@ -1,5 +1,19 @@
require 'action_view'
# This patch is needed since this Rails commit:
# https://github.com/rails/rails/commit/c1a118a
#
# TODO: Find a better a better to solve this.
#
module ActionView::Helpers::Tags
class Base
private
def value(object)
object.send @method_name if object # use send instead of public_send
end
end
end
RANSACK_FORM_BUILDER = 'RANSACK_FORM_BUILDER'.freeze
require 'simple_form' if
@ -126,9 +140,8 @@ module Ransack
end
end
collection = keys.map { |k| [k, Translate.predicate(k)] }
object.predicate ||= Predicate.named(default) if can_use_default?(
default, :predicate, keys
)
object.predicate ||= Predicate.named(default) if
can_use_default?(default, :predicate, keys)
template_collection_select(:p, collection, options, html_options)
end