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

Rake tasks define methods on main #70

Closed
fsateler opened this issue Jun 14, 2020 · 0 comments · Fixed by #75
Closed

Rake tasks define methods on main #70

fsateler opened this issue Jun 14, 2020 · 0 comments · Fixed by #75
Labels
enhancement New feature or request

Comments

@fsateler
Copy link
Contributor

Steps to reproduce

Open rails console (with pry):

> Rails.application.load_tasks
> show-source each_tenant

From: /home/felipe/src/satelabs/buk/gems/ruby/2.5.0/bundler/gems/apartment-9665917fde57/lib/tasks/apartment.rake @ line 122:
Owner: Object
Visibility: private
Number of lines: 5

def each_tenant(&block)
  Parallel.each(tenants, in_threads: Apartment.parallel_migration_threads) do |tenant|
    block.call(tenant)
  end
end

Expected behavior

The global main namespace should not be polluted.

Actual behavior

The global main namespace is polluted.

System configuration

  • Apartment version: git

Solution

I think those methods should be extracted to a module, so that they don't pollute the global namespace.

@rpbaltazar rpbaltazar added the enhancement New feature or request label Jun 16, 2020
@rpbaltazar rpbaltazar linked a pull request Jun 24, 2020 that will close this issue
rpbaltazar added a commit that referenced this issue Jun 24, 2020
rpbaltazar added a commit that referenced this issue Jun 25, 2020
rpbaltazar added a commit that referenced this issue Jun 26, 2020
Prepare Release - 2.7.0

# Enhancements

- [Resolves #70] Rake tasks define methods on main - #75
- Add database and schema to active record log. Configurable, defaults to false to keep current behavior - #55

# Bugfixes

- [Fixes #61] Fix database create in mysql - #76

# Chores

- Remove depracated tld_length config option: tld_length was removed in influitive#309, this configuration option doesn't have any effect now. - #72
- Using [diffend.io proxy](https://diffend.io) to safely check required gems
- Added [story branch](https://github.com/story-branch/story_branch) to the configuration
- Using travis-ci to run rubocop as well, replacing github actions: github actions do not work in fork's PRs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants