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

Rename render_page in apipie.rake to render_apipie_page #943

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

nathanpalmer
Copy link
Contributor

We tried to integrate this project this week but ran into a very specific issue. We have a field called render_page on one of our models. And we're using factory_bot to build factories for our tests. Inside our factory we're calling a render_page function to set up the data for the initial value. (i.e.)

FactoryBot.define do
  factory :my_model do
    render_page { "the_page" }
  end
end

As soon as we add apipie-rails to the Gemfile like this it starts failing.

gem "apipie-rails"

Example output

NoMethodError: undefined method `namespace' for module Apipie (NoMethodError)
/Users/person/Source/project/packs/docs/config/initializers/apipie.rb:35:in `<module:Apipie>'
/Users/person/Source/project/packs/docs/config/initializers/apipie.rb:34:in `<main>'
/Users/person/Source/project/config/environment.rb:5:in `<main>'
Tasks: TOP => tailwindcss:build => environment

I tracked it down to the fact that there is a function in apipie.rake that is aparantly existing in the global namespace and it's trying to call this function instead. I just renamed it to be very specific to apipie and I no longer have this issue.

@mathieujobin mathieujobin merged commit eeef4de into Apipie:master Sep 30, 2024
25 checks passed
@nathanpalmer
Copy link
Contributor Author

Thank you!

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 this pull request may close these issues.

2 participants