We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7a13da4 commit e78d4c2Copy full SHA for e78d4c2
1 file changed
helpers.rb
@@ -2,6 +2,15 @@
2
#to make our work with sinatra easier
3
4
helpers do
5
+
6
+ #this defines three helpers, that all test our environment:
7
+ #they're called 'development?', 'test?', and 'production?'
8
+ [:development, :production, :test].each do |environment|
9
+ define_method "#{environment.to_s}?" do
10
+ return settings.environment == environment.to_sym
11
+ end
12
13
14
#this method returns the logged_in hacker
15
def current_user
16
#let's look up the Hacker by the id in the session
0 commit comments