Skip to content

Commit d4ac0fe

Browse files
committed
Remove unnecessary ivars
There's no need for these to be ivars because they are not accessed anywhere else and also they aren't memoized. This commits switches them to be local vars.
1 parent 7ff54f5 commit d4ac0fe

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

app/helpers/ops_helper.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ def row_data(label, value)
2222
end
2323

2424
def database_details
25-
@database_details = ActiveRecord::Base.configurations.configs_for(:env_name => Rails.env).first.configuration_hash
26-
@database_display_name =
27-
if @database_details[:host].in?([nil, "", "localhost", "127.0.0.1"])
25+
details = ActiveRecord::Base.configurations.configs_for(:env_name => Rails.env).first.configuration_hash
26+
display_name =
27+
if details[:host].in?([nil, "", "localhost", "127.0.0.1"])
2828
_("Internal Database")
2929
else
3030
_("External Database")
3131
end
3232
@data = {:title => _('Basic Information')}
3333
@data[:rows] = [
34-
row_data(_('Name'), @database_display_name),
35-
row_data(_('Hostname'), @database_details[:host]),
36-
row_data(_('Database name'), @database_details[:database]),
37-
row_data(_('Username'), @database_details[:username])
34+
row_data(_('Name'), display_name),
35+
row_data(_('Hostname'), details[:host]),
36+
row_data(_('Database name'), details[:database]),
37+
row_data(_('Username'), details[:username])
3838
]
3939
end
4040

0 commit comments

Comments
 (0)