Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/railties 7 #1

Closed
wants to merge 11 commits into from
Closed

Feature/railties 7 #1

wants to merge 11 commits into from

Conversation

tagliala
Copy link
Owner

@tagliala tagliala commented Dec 14, 2021

⚠️ DO NOT RELY ON THIS BRANCH FOR DEPLOYMENT ⚠️

@tagliala tagliala force-pushed the feature/railties-7 branch 2 times, most recently from 64604ad to a771967 Compare December 17, 2021 08:42
@tagliala tagliala force-pushed the feature/railties-7 branch 8 times, most recently from 9a9b17f to bc1e8e4 Compare December 21, 2021 14:29
@tagliala tagliala force-pushed the feature/railties-7 branch 16 times, most recently from 48fc4ee to 12ef798 Compare December 27, 2021 13:02
@tagliala tagliala force-pushed the feature/railties-7 branch 2 times, most recently from 93b4a3e to 8ccc35b Compare January 19, 2022 20:54
@tagliala tagliala force-pushed the feature/railties-7 branch 3 times, most recently from 920f143 to 5d6dfbe Compare February 5, 2022 11:47
@tagliala tagliala force-pushed the feature/railties-7 branch 3 times, most recently from 3927b00 to a8ce826 Compare February 14, 2022 22:50
@sachin-amzur
Copy link

sachin-amzur commented Feb 20, 2022

@tagliala I am getting this issue with feature/railties-7 branch, how to fix it?

Screenshot from 2022-02-20 10-48-35

@tagliala
Copy link
Owner Author

just run bundle update activeadmin again. I'm force-pushing to this branch, so the old reference is not available anymore

Please also do not rely on this branch for deployments

@sachin-amzur
Copy link

just run bundle update activeadmin again. I'm force-pushing to this branch, so the old reference is not available anymore

Please also do not rely on this branch for deployments

@tagliala then what is the solution to use activeadmin with rails 7? Please suggest.

@tagliala
Copy link
Owner Author

tagliala commented Feb 21, 2022

@sachin-amzur you can fork this repo and point your gemfile to a branch you have control on

@tagliala tagliala force-pushed the feature/railties-7 branch 2 times, most recently from 2443ab3 to 871c6af Compare February 25, 2022 23:02
`cucumber-rails` 2.5 with Rails 7 support has not been released yet
at the time of this commit

This change will allow activeadmin#7235 to be merged
@tagliala tagliala force-pushed the feature/railties-7 branch 3 times, most recently from 68da7a1 to 3299528 Compare March 5, 2022 13:58
dependabot bot and others added 10 commits March 7, 2022 01:17
Bumps [rollup](https://github.com/rollup/rollup) from 2.69.0 to 2.69.2.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](rollup/rollup@v2.69.0...v2.69.2)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [github-pages](https://github.com/github/pages-gem) from 224 to 225.
- [Release notes](https://github.com/github/pages-gem/releases)
- [Commits](github/pages-gem@v224...v225)

---
updated-dependencies:
- dependency-name: github-pages
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
…nd_yarn/rollup-2.69.2

Bump rollup from 2.69.0 to 2.69.2
…er/docs/github-pages-225

Bump github-pages from 224 to 225 in /docs
- Relax railties dependency to allow 7.0
- Move Rails 6.1 Gemfile to gemfiles directory
- Set main test application to Rails 7.0
This method has been removed in Rails 7 and replaced with `constantize`
`ActiveAdmin::Aplication.remove_active_admin_load_paths_from_rails_autoload_and_eager_load`
is not working on feature tests.

Starting from Rails 7.0, running tests with eager_load enabled produces the following error:

```
Failure/Error: require
"#{ActiveAdmin::TestApplication.new.full_app_dir}/config/environment.rb"

FrozenError:
  can't modify frozen Array: ["<root>/tmp/test_apps/rails_70/app/admin",
"<root>/tmp/test_apps/rails_70/app/channels",
"<root>/tmp/test_apps/rails_70/app/controllers",
"<root>/tmp/test_apps/rails_70/app/controllers/concerns",
"<root>/tmp/test_apps/rails_70/app/helpers",
"<root>/tmp/test_apps/rails_70/app/jobs",
"<root>/tmp/test_apps/rails_70/app/mailers",
"<root>/tmp/test_apps/rails_70/app/models",
"<root>/tmp/test_apps/rails_70/app/models/concerns",
"<root>/tmp/test_apps/rails_70/app/policies"
```

`ActiveAdmin::Aplication.remove_active_admin_load_paths_from_rails_autoload_and_eager_load`
fails because `ActiveAdmin.application.load_paths` value is
`<root>/app/admin` when it should be `<root>/tmp/test_apps/rails_70/app/admin`.

`ActiveAdmin::ApplicationSettings` initialize `load_path` with
`[File.expand_path("app/admin", Rails.root)]`.

On testing app bootstrap ([this line](https://github.com/activeadmin/activeadmin/blob/master/features/support/env.rb#L12))
`Rails.root` is nil and `File.expand_path` is expanding to the folder where
`rake test` runs (`<root>`).

`ActiveAdmin::Engine` has an initializer to define default value for
`load_paths`. The problem is that the block runs after initializers in
`config/initializers` folder, including `ActiveAdmin.setup` where
`ActiveAdmin::Aplication.remove_active_admin_load_paths_from_rails_autoload_and_eager_load`
is called from.

This commit makes sure the block runs before `config/initializers`.

That way the block sets a proper default.
At the moment of this commit, JRuby does not support Ruby 2.7, the
minimum version required to run Rails 7.0, and gems did not install
with jruby-head

This platform can be added back when JRuby will release a version
compatible with 2.7 MRI
@tagliala tagliala closed this Mar 7, 2022
@tagliala tagliala deleted the feature/railties-7 branch March 7, 2022 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants