Skip to content

Commit

Permalink
require activerecord.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanfox1985 committed May 12, 2023
1 parent 57b92fe commit 6720020
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/annotate/annotate_routes/header_generator.rb
@@ -1,3 +1,4 @@
require 'active_record'
require_relative './helpers'

module AnnotateRoutes
Expand All @@ -16,7 +17,7 @@ def generate(options = {})
private

def routes_map(options)
command = Rails.version.first.to_i > 5 ? `rails routes` : `rake routes`
command = ActiveRecord.version.to_s.first.to_i > 5 ? `rails routes` : `rake routes`
result = command.chomp("\n").split(/\n/, -1)

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

0 comments on commit 6720020

Please sign in to comment.