Forum: Ruby on Rails convention for checking rails environment

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
525128e48ca2b4c7fb6176ea166fccfd?d=identicon&s=25 Eric G. (gotskill10)
on 2008-10-12 00:39
Whats the general practice for checking rails environment.

I often find myself having to do: RAILS_ENV=="development".

As of recently, I've been starting to see more of
Rails.env=="production".

Im thinking, we may as well extend "Rails.env" so I could do:

Rails.env.production?
Rails.env.test?
Rails.env.development?

Anybody done this? Or any reasons not to?
A91bd6cef23eb3516245a092e196c4da?d=identicon&s=25 Maurício Linhares (mauricio)
on 2008-10-12 00:43
(Received via mailing list)
If you're running the latest rails, this is already implemented :)

On Sat, Oct 11, 2008 at 7:39 PM, Aryk Grosz
<rails-mailing-list@andreas-s.net> wrote:
> Rails.env.production?
> Rails.env.test?
> Rails.env.development?
>
> Anybody done this? Or any reasons not to?
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>



--
Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/
(en)
João Pessoa, PB, +55 83 8867-7208
This topic is locked and can not be replied to.