Rails.env.development?

Greetings...

I've been using the following in my code:

     RAILS_ENV == "development"

But now the younger rails people want me to use:

     Rails.env.development?

Because it's "nicer" they say.

RubyMine raises a warning stating it Cannot find 'development?' for type 'ActiveSupport::StringInquirer'.

But it seems to work, so is the warning incorrect?

Thanks,
Mark

1 comment

RubyMine raises a warning stating it Cannot find 'development?' for type 'ActiveSupport::StringInquirer'.

But it seems to work, so is the warning incorrect?

It is rails magic which cannot be statically analyzed. I've filed an issue - http://youtrack.jetbrains.net/issue/RUBY-5849. Thanks!

0

Please sign in to leave a comment.