Skip to content

Commit

Permalink
Remove use of search_path_to_camelized_param
Browse files Browse the repository at this point in the history
Since we're no longer auto camelizing, we do not need to use this method
in generated layouts.
  • Loading branch information
jho406 committed Dec 17, 2023
1 parent a77bfdd commit 7c4af4a
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ end

if path
json.action 'graft'
json.path search_path_to_camelized_param(path)
json.path params[:props_at]
end

json.restoreStrategy 'fromCacheAndRevisitInBackground'
Expand Down
1 change: 0 additions & 1 deletion superglue_rails/lib/superglue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module Controller
def self.included(base)
if base.respond_to?(:helper_method)
base.helper_method :param_to_search_path
base.helper_method :search_path_to_camelized_param
end
end
end
Expand Down
11 changes: 0 additions & 11 deletions superglue_rails/lib/superglue/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,5 @@ def param_to_search_path(param)
end
end
end

def search_path_to_camelized_param(path)
path.map do |part|
if part.include? "="
key, rest = part.split("=")
[key.camelize(:lower), rest].join("=")
else
part.camelize(:lower)
end
end.join(".")
end
end
end
6 changes: 0 additions & 6 deletions superglue_rails/test/helpers_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,4 @@ class HelpersTest < ActiveSupport::TestCase

assert_equal param_to_search_path(qry), ["foo", "bar"]
end

test "camelize_path" do
path = ["foo_bar", "foo_bar=1", "foo_baz_roo"]

assert_equal search_path_to_camelized_param(path), "fooBar.fooBar=1.fooBazRoo"
end
end

0 comments on commit 7c4af4a

Please sign in to comment.