Skip to content

Commit f34754e

Browse files
authored
Merge pull request #2798 from rspec/fix-rails-main-for-solid-cache
Fix rails main for solid cache
2 parents 40069a2 + c1ccbeb commit f34754e

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

Rakefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ namespace :smoke do
105105
in_example_app args.cmd.to_s
106106
end
107107

108+
desc "run rake routes in example app"
109+
task :routes do
110+
in_example_app "bin/rails routes"
111+
end
112+
108113
desc "run RSPEC_OPTS environment variable in the example app for local dev"
109114
task :rspec do
110115
in_example_app "LOCATION='../../example_app_generator/run_specs.rb' bin/rspec #{ENV.fetch("RSPEC_OPTS")}"
@@ -144,6 +149,11 @@ namespace :no_active_record do
144149
"no_active_record:smoke",
145150
]
146151

152+
desc "run rake routes in example app"
153+
task :routes do
154+
in_example_app "bin/rails routes", app_dir: example_app_dir
155+
end
156+
147157
desc "run RSPEC_OPTS environment variable in the example app for local dev"
148158
task :rspec do
149159
in_example_app "LOCATION='../../example_app_generator/run_specs.rb' bin/rspec #{ENV.fetch("RSPEC_OPTS")}", app_dir: example_app_dir
@@ -165,7 +175,7 @@ namespace :no_active_record do
165175
sh "rm -f #{bindir}/rails"
166176
sh "bundle exec rails new #{example_app_dir} --no-rc --skip-active-record --skip-javascript --skip-bootsnap " \
167177
"--skip-sprockets --skip-git --skip-test-unit --skip-listen --skip-bundle --skip-spring " \
168-
"--skip-action-text --template=example_app_generator/generate_app.rb"
178+
"--skip-action-text --skip-solid --template=example_app_generator/generate_app.rb"
169179

170180
in_example_app(app_dir: example_app_dir) do
171181
sh "./ci_retry_bundle_install.sh 2>&1"
@@ -188,7 +198,7 @@ namespace :no_active_record do
188198

189199
desc "generate a bunch of stuff with generators"
190200
task :stuff do
191-
in_example_app "bin/rake #{rails_template_command} LOCATION='../../example_app_generator/generate_stuff.rb'", app_dir: example_app_dir
201+
in_example_app "bin/rake #{rails_template_command} LOCATION='../../example_app_generator/generate_stuff.rb' __RSPEC_NO_AR=true", app_dir: example_app_dir
192202
end
193203
end
194204
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)