Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/helpers/rails_admin/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def navigation(parent_groups, nodes, level = 0)
nav_icon = node.navigation_icon ? %(<i class="#{node.navigation_icon}"></i>).html_safe : ''
css_classes = ['nav-link']
css_classes.push("nav-level-#{level}") if level > 0
css_classes.push('active') if defined?(@action) && current_action?(@action, model_param)
css_classes.push('active') if @action && current_action?(@action, model_param)
li = content_tag :li, data: {model: model_param} do
link_to nav_icon + " " + node.label_plural, url, class: css_classes.join(' ')
end
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/rails_admin/templates/rails_admin.scss.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<%= instance_variable_defined?(:@fa_font_path) ? %{$fa-font-path: "#{@fa_font_path}";\n} : '' %>@import "rails_admin/src/rails_admin/styles/base";
<%= @fa_font_path ? %{$fa-font-path: "#{@fa_font_path}";\n} : '' %>@import "rails_admin/src/rails_admin/styles/base";
4 changes: 1 addition & 3 deletions lib/rails_admin/config/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ def initialize(entity)
end

def excluded?
return @excluded if defined?(@excluded)

@excluded = !RailsAdmin::AbstractModel.all.collect(&:model_name).include?(abstract_model.try(:model_name))
@excluded ||= !RailsAdmin::AbstractModel.all.collect(&:model_name).include?(abstract_model.try(:model_name))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the behaviour change here intended? This change removes the benefit of memoisation when the result is falsely.

Ref: http://gavinmiller.io/2013/advanced-memoization-in-ruby/

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. No that is not intended. If you put up a PR I'll approve, otherwise I'll try to get to it later today.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored in #3587. Thanks for reporting.

end

def object_label
Expand Down