Skip to content

Commit

Permalink
remove view helper and singleton
Browse files Browse the repository at this point in the history
  • Loading branch information
madhums committed Mar 12, 2024
1 parent d977e59 commit 892b8b7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
4 changes: 0 additions & 4 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,4 @@ module ApplicationHelper
def time_ago(time)
time_ago_in_words(time, scope: "datetime.distance_in_words.short")
end

def contact_email
Settings.instance.contact_email
end
end
2 changes: 1 addition & 1 deletion app/views/includes/_footer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<%= link_to t('.home'), root_path %>
</li>
<li class="mt-3 mt-sm-2">
<%= link_to t('.contact'), "mailto:#{contact_email}" %>
<%= link_to t('.contact'), "mailto:#{Settings.contact_email}" %>
</li>
<li class="mt-3 mt-sm-2">
<%= link_to t('.stories'), stories_path %>
Expand Down
8 changes: 4 additions & 4 deletions config/initializers/settings.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Settings
include Singleton

def contact_email
ENV["DOMAIN_EMAIL_ADDRESS"]
class << self
def contact_email
ENV["DOMAIN_EMAIL_ADDRESS"]
end
end
end

0 comments on commit 892b8b7

Please sign in to comment.