Skip to content

Files

Latest commit

 

History

History
24 lines (15 loc) · 482 Bytes

Rails-EnvironmentComparison.md

File metadata and controls

24 lines (15 loc) · 482 Bytes

Pattern: Missing use of Rails.env.%<env>s?

Issue: -

Description

This rule checks that Rails.env is compared using .production?-like methods instead of equality against a string or symbol.

Examples

# bad
Rails.env == 'production'

# bad, always returns false
Rails.env == :test

# good
Rails.env.production?

Further Reading