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

Only define Punditize if Pundit has been loaded. #1068

Merged
merged 1 commit into from
Jan 16, 2018

Conversation

nickcharlton
Copy link
Member

When the RAILS_ENV is set to production, the concern will be eagerly
loaded. As we include Pundit here, this means that it'll fail if
pundit isn't included in the bundle.

Fixes #1048.

When the `RAILS_ENV` is set to `production`, the concern will be eagerly
loaded. As we `include Pundit` here, this means that it'll fail if
`pundit` isn't included in the bundle.

Fixes #1048.
@pedantic-git
Copy link
Contributor

Oops! Good spot! The fix looks good to me!

@nickcharlton nickcharlton merged commit 7c0dbdc into master Jan 16, 2018
@nickcharlton nickcharlton deleted the nc-check-if-pundit-exists branch January 16, 2018 09:48
fbuys added a commit to fbuys/administrate that referenced this pull request May 23, 2023
This commit fixes: thoughtbot#2378
By adding a conditional that includes Pundit::Authorization when it is
defined else it includes Pundit.

This change ensures that we remain compatible with Pundit < 2.2.0

See: thoughtbot#2141
See: thoughtbot#1068
fbuys added a commit to fbuys/administrate that referenced this pull request May 23, 2023
This commit fixes: thoughtbot#2378
By adding a conditional that includes Pundit::Authorization when it is
defined else it includes Pundit.

This change ensures that we remain compatible with Pundit < 2.2.0

To test with Pundit "~> 2.1.0", we run:
```
bundle exec appraisal pundit21 rspec spec/controllers/concerns/administrate/punditize_spec.rb
```

See: thoughtbot#2141
See: thoughtbot#1068
fbuys added a commit to fbuys/administrate that referenced this pull request May 23, 2023
This commit fixes: thoughtbot#2378
By adding a conditional that includes Pundit::Authorization when it is
defined else it includes Pundit.

This change ensures that we remain compatible with Pundit < 2.2.0

To test with Pundit "~> 2.1.0", we run:
```
bundle exec appraisal pundit21 rspec spec/controllers/concerns/administrate/punditize_spec.rb
```

See: thoughtbot#2141
See: thoughtbot#1068
fbuys added a commit to fbuys/administrate that referenced this pull request May 24, 2023
This commit fixes: thoughtbot#2378
By adding a conditional that includes Pundit::Authorization when it is
defined else it includes Pundit.

This change ensures that we remain compatible with Pundit < 2.2.0

To test with Pundit "~> 2.1.0", we run:
```
bundle exec appraisal pundit21 rspec spec/controllers/concerns/administrate/punditize_spec.rb
```

See: thoughtbot#2141
See: thoughtbot#1068
fbuys added a commit to fbuys/administrate that referenced this pull request May 26, 2023
This commit fixes: thoughtbot#2378
By adding a conditional that includes Pundit::Authorization when it is
defined else it includes Pundit.

This change ensures that we remain compatible with Pundit < 2.2.0

To test with Pundit "~> 2.1.0", we run:
```
bundle exec appraisal pundit21 rspec spec/controllers/concerns/administrate/punditize_spec.rb
```

See: thoughtbot#2141
See: thoughtbot#1068
pablobm pushed a commit that referenced this pull request May 27, 2023
This commit fixes #2378
by adding a conditional that includes Pundit::Authorization when it is
defined else it includes Pundit.

This change ensures that we remain compatible with Pundit < 2.2.0

To test with Pundit "~> 2.1.0", we run:

```
bundle exec appraisal pundit21 rspec spec/controllers/concerns/administrate/punditize_spec.rb
```

See: #2141
See: #1068
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