Skip to content

Commit

Permalink
Use Hash#fetch instead of #delete to not change menu options
Browse files Browse the repository at this point in the history
  • Loading branch information
n-rodriguez committed Oct 31, 2018
1 parent 395edef commit 2ec54d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/simple_navigation_bootstrap/bootstrap_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def render_item(*args)


def container_class(level)
remove_navigation_class = options.delete(:remove_navigation_class) { false }
remove_navigation_class = options.fetch(:remove_navigation_class) { false }
if level == 1
remove_navigation_class ? '' : ['nav', navigation_class].compact
else
Expand Down
10 changes: 5 additions & 5 deletions lib/simple_navigation_bootstrap/rendered_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ def initialize(renderer, item, level, bootstrap_version)
@bootstrap_version = bootstrap_version

@options = item.html_options
@navbar_text = options.delete(:navbar_text)
@divider = options.delete(:divider) { false }
@header = options.delete(:header) { false }
@split = options.delete(:split) { false }
@skip_caret = options.delete(:skip_caret) { false }
@navbar_text = options.fetch(:navbar_text) { nil }
@divider = options.fetch(:divider) { false }
@header = options.fetch(:header) { false }
@split = options.fetch(:split) { false }
@skip_caret = options.fetch(:skip_caret) { false }
@link_options = @item.link_html_options || {}
end

Expand Down

0 comments on commit 2ec54d5

Please sign in to comment.