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

Better resolution for config/models/roles.yml #688

Open
jagthedrummer opened this issue Nov 21, 2023 · 0 comments · May be fixed by #698
Open

Better resolution for config/models/roles.yml #688

jagthedrummer opened this issue Nov 21, 2023 · 0 comments · May be fixed by #698

Comments

@jagthedrummer
Copy link
Contributor

In the process of trying to get tests running for individual gems I discovered that we try to resolve config/models/roles.yml relative to the current working directory. Which meant that I ended up putting what's essentially a test fixture at bullet_train-incoming_webhooks/config/models/roles.yml just to keep the tests happy.

Ideally we'd resolve that file relative to Rails.root (if we have Rails.root) and the test file could then live in bullet_train-incoming_webhooks/test/dummy/config/models/roles.yml.

Here are at least a couple of spots where that resolution takes place, there may be more:

role_file = "./config/models/roles.yml"
roles_hash = YAML.load_file(role_file)

set_root_path "config/models"
set_filename "roles"

It looks like there are a couple of spots in the roles gem where we tried to get the test suite to look at the right place, but those don't seem to work.

Role.set_root_path("config/models")
Role.set_filename("roles")

Role.class_eval do
set_root_path "test/dummy/config/models"
set_filename "roles"
end

@gazayas gazayas linked a pull request Nov 27, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant