Last active
August 29, 2015 14:08
-
-
Save kvzb/8946a8ddccd04706dd83 to your computer and use it in GitHub Desktop.
A way to eliminate rails env lookup duplication.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Rails | |
STABLE_ENVIRONMENTS = %w(staging production) | |
def stable_env? | |
STABLE_ENVIRONMENTS.include? Rails.env | |
end | |
module_function :stable_env? | |
def unstable_env? | |
!stable_env? | |
end | |
module_function :unstable_env? | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment