Skip to content

Commit 1fb7f1d

Browse files
committed
Refactor memoization
1 parent 61eccf1 commit 1fb7f1d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

app/controllers/dashboard_controller.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ def index
2121
private
2222

2323
def inventory
24-
return @inventory if defined? @inventory
25-
26-
@inventory = current_organization.nil? ? nil : View::Inventory.new(current_organization.id)
24+
@inventory ||= View::Inventory.new(current_organization.id)
2725
end
2826
end

0 commit comments

Comments
 (0)