Skip to content

Commit

Permalink
Fixes #36849 - Run GHA on Ruby 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ofedoren authored and evgeni committed Jan 3, 2024
1 parent 75017ef commit b23f8a4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/matrix.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"postgresql": ["12"],
"ruby": ["2.7"],
"ruby": ["2.7", "3.0"],
"node": ["14"]
}
6 changes: 5 additions & 1 deletion app/models/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ def self.method_missing(method, *args, &block)
end
end
if type.constantize.respond_to?(method, true)
type.constantize.send(method, *args, &block)
if method.to_s =~ /\Afind_in_(.*)\Z/ && args.size == 1 && args[0].is_a?(Hash)
type.constantize.send(method, **args[0], &block)
else
type.constantize.send(method, *args, &block)
end
else
super
end
Expand Down
4 changes: 2 additions & 2 deletions test/helpers/application_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ def test_generate_link_for
end

test '#documentation_url and new docs page' do
url = documentation_url('TestSection', { type: 'plugin_manual', name: 'foreman_my_plugin', version: '1.2' })
url = documentation_url('TestSection', type: 'plugin_manual', name: 'foreman_my_plugin', version: '1.2')

assert_match %r{links/plugin_manual/TestSection\?name=foreman_my_plugin&version=1\.2}, url
end

test '#documentation_url and new docs page' do
url = documentation_url('TestSection', { type: 'docs', chapter: 'test_chapter' })
url = documentation_url('TestSection', type: 'docs', chapter: 'test_chapter')

assert_match %r{links/docs/TestSection\?chapter=test_chapter}, url
end
Expand Down

0 comments on commit b23f8a4

Please sign in to comment.