I believe this would be slightly more correct as:

```ruby
if defined?(::Rails)
```

Also we'd prefer the comment above the line instead of inline. Thanks!