Skip to content

Commit 6720020

Browse files
committed
require activerecord.
1 parent 57b92fe commit 6720020

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/annotate/annotate_routes/header_generator.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require 'active_record'
12
require_relative './helpers'
23

34
module AnnotateRoutes
@@ -16,7 +17,7 @@ def generate(options = {})
1617
private
1718

1819
def routes_map(options)
19-
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`
2021
result = command.chomp("\n").split(/\n/, -1)
2122

2223
# In old versions of Rake, the first line of output was the cwd. Not so

0 commit comments

Comments
 (0)