File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ def scope_url
153153 # We need to add the rootpath to `script_name` manually for applications that use a Rails
154154 # version lower than 5.1. Otherwise, it is going to generate a wrong path for Engines
155155 # that use Devise. Remove it when the support of Rails 5.0 is droped.
156- elsif root_path_defined? ( context ) && rails_5_and_down ?
156+ elsif root_path_defined? ( context ) && ! rails_51_and_up ?
157157 rootpath = context . routes . url_helpers . root_path
158158 opts [ :script_name ] = rootpath . chomp ( '/' ) if rootpath . length > 1
159159 end
@@ -278,14 +278,8 @@ def root_path_defined?(context)
278278 defined? ( context . routes ) && context . routes . url_helpers . respond_to? ( :root_path )
279279 end
280280
281- def rails_5_and_down?
282- return false if rails_5_up?
283-
284- Rails ::VERSION ::MAJOR >= 4
285- end
286-
287- def rails_5_up?
288- Rails ::VERSION ::MAJOR >= 5 && Rails ::VERSION ::MINOR > 0
281+ def rails_51_and_up?
282+ Rails ::VERSION ::MAJOR >= 5 && Rails ::VERSION ::MINOR >= 1
289283 end
290284 end
291285end
You can’t perform that action at this time.
0 commit comments