We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 57b92fe commit 6720020Copy full SHA for 6720020
lib/annotate/annotate_routes/header_generator.rb
@@ -1,3 +1,4 @@
1
+require 'active_record'
2
require_relative './helpers'
3
4
module AnnotateRoutes
@@ -16,7 +17,7 @@ def generate(options = {})
16
17
private
18
19
def routes_map(options)
- command = Rails.version.first.to_i > 5 ? `rails routes` : `rake routes`
20
+ command = ActiveRecord.version.to_s.first.to_i > 5 ? `rails routes` : `rake routes`
21
result = command.chomp("\n").split(/\n/, -1)
22
23
# In old versions of Rake, the first line of output was the cwd. Not so
0 commit comments