Skip to content

Instantly share code, notes, and snippets.

@kvzb
Last active August 29, 2015 14:08
Show Gist options
  • Save kvzb/8946a8ddccd04706dd83 to your computer and use it in GitHub Desktop.
Save kvzb/8946a8ddccd04706dd83 to your computer and use it in GitHub Desktop.
A way to eliminate rails env lookup duplication.
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