change code style in AdminDashboardData a bit (PR #775)

  • class methods inside class << self
  • check Rails env using StringInquirer’s convenience method
  • prefer && over and and || over or
  • change !x.present? to x.blank?
  • change if !x to unless x


You’ve signed the CLA, goshakkk. Thank you! This pull request is ready for review.

I hate using && and || unless there’s some complex logic happening. I personally prefer “and” and “or”. Otherwise, this pr doesn’t look like refactoring, just style changes. Looks fine, but the && and || will bother me and I’ll probably undo it since I’m the one working in that file. :stuck_out_tongue:

Hi @nlalonde if you prefer and to && you should probably remove that part from the


@wpp Isn’t he part of the official Discourse team?

@snapapps yeah I believe so. I just figure a lot of contributors might get confused if they use the coding style from the contributing guides but then have their changes reverted (because of the style).

ok I removed that guidance. Not really a fan of && and || myself. That one character you save, boy that’s really gonna make a difference in the world.

@coding-horror :+1: much prefer and or to && || ( by the way && looks like two folks in wheelchairs :))

to be clear, I am not saying one is better than the other, just that it doesn’t matter to the point that we need to be advocating one style over the other in this particular case.

Here’s a nice write up on and / or vs && / ||

@bolandrm oh wow thanks for that