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
请先登录再写评论。
It is rails magic which cannot be statically analyzed. I've filed an issue - http://youtrack.jetbrains.net/issue/RUBY-5849. Thanks!