Skip to content

Commit

Permalink
Add accessor method for nested_entries (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
pulkitkkr authored Jul 26, 2022
1 parent 3a5018e commit 8a25ef3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ _Please add entries here for your pull requests that are not yet released._
- `append_javascript_pack_tag` and `append_stylesheet_pack_tag` helpers return `nil` to prevent rendering the queue into view when using `<%= … %>` ERB syntax. [PR 167](https://github.com/shakacode/shakapacker/pull/167) by [ur5us](https://github.com/ur5us)
- fix non-runnable test due to wrong code nesting [PR 173](https://github.com/shakacode/shakapacker/pull/173) by [ur5us](https://github.com/ur5us)
- fix default configurations not working for custom Rails environments [PR 168](https://github.com/shakacode/shakapacker/pull/168) by [ur5us](https://github.com/ur5us)
- Add accessor method for `nested_entries` configuration. [PR 176](https://github.com/shakacode/shakapacker/pull/176) by [pulkitkkr](https://github.com/pulkitkkr)

## [v6.5.0] - July 4, 2022
### Added
Expand Down
4 changes: 4 additions & 0 deletions lib/webpacker/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ def compile?
fetch(:compile)
end

def nested_entries?
fetch(:nested_entries)
end

def ensure_consistent_versioning?
fetch(:ensure_consistent_versioning)
end
Expand Down
12 changes: 12 additions & 0 deletions test/configuration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@ def test_compile?
end
end

def test_nested_entries?
refute @config.nested_entries?

with_rails_env("development") do
refute Webpacker.config.nested_entries?
end

with_rails_env("test") do
refute Webpacker.config.nested_entries?
end
end

def test_ensure_consistent_versioning?
refute @config.ensure_consistent_versioning?

Expand Down

0 comments on commit 8a25ef3

Please sign in to comment.