Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ActionView::Helpers::Tags::Base#value Monkey Patch #1485

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions lib/ransack/helpers/form_builder.rb
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
require 'action_view'

module ActionView::Helpers::Tags
# TODO: Find a better way to solve this issue!
# This patch is needed since this Rails commit:
# https://github.com/rails/rails/commit/c1a118a
class Base
private
if defined? ::ActiveRecord
def value
if @allow_method_names_outside_object
object.send @method_name if object && object.respond_to?(@method_name, true)
else
object.send @method_name if object
end
end
end
end
end

RANSACK_FORM_BUILDER = 'RANSACK_FORM_BUILDER'.freeze

require 'simple_form' if
Expand Down Expand Up @@ -130,6 +112,7 @@ def search_fields(name, args, block)

def predicate_select(options = {}, html_options = {})
options[:compounds] = true if options[:compounds].nil?
options[:selected] ||= nil
default = options.delete(:default) || Constants::CONT

keys =
Expand Down
Loading