Skip to content

Commit 8584199

Browse files
committed
Set no active record for generator via flag
1 parent 40069a2 commit 8584199

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ namespace :no_active_record do
188188

189189
desc "generate a bunch of stuff with generators"
190190
task :stuff do
191-
in_example_app "bin/rake #{rails_template_command} LOCATION='../../example_app_generator/generate_stuff.rb'", app_dir: example_app_dir
191+
in_example_app "bin/rake #{rails_template_command} LOCATION='../../example_app_generator/generate_stuff.rb' __RSPEC_NO_AR=true", app_dir: example_app_dir
192192
end
193193
end
194194
end

example_app_generator/generate_stuff.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ def skip_active_record?
5757
end
5858

5959
def self.environment_hooks
60-
if defined?(ActiveRecord)
61-
AR
62-
else
60+
if ENV['__RSPEC_NO_AR']
6361
NoAR
62+
else
63+
AR
6464
end
6565
end
6666
end

0 commit comments

Comments
 (0)