Skip to content

Commit a7957fe

Browse files
committed
Only override show_helper for Rails 6
1 parent c8e9c79 commit a7957fe

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/generators/rspec/scaffold/scaffold_generator.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,9 @@ def banner
128128
self.class.banner
129129
end
130130

131-
def show_helper(arg = file_name, type: :url)
132-
if Rails::VERSION::STRING.to_f >= 7.0
133-
super
134-
else
135-
"#{singular_route_name}_url(#{arg})"
131+
if Rails::VERSION::STRING.to_f < 7.0
132+
def show_helper(resource_name = file_name)
133+
"#{singular_route_name}_url(#{resource_name})"
136134
end
137135
end
138136
end

0 commit comments

Comments
 (0)