views:

33

answers:

1

SHould it be 'username' or 'user_name' when creating a property for a model?

'userstatus or 'user_status'

Are all datetimes ending with '_at' ?

what other ones are there?

+4  A: 

variable naming in Ruby tends to follow the convention of all lowercase with underscores separating words (so user_name in your example). There is no special convention for datetimes, Rails just happens to put a couple of attributes on models by default which end with "_at". Other general conventions:

  • method names follow the same convention as variables.
  • constants are generally all upper-case with underscores between words (i.e. MAX_LENGTH).
  • class/module names are generally camel-cased (i.e. HourlyEmployee).
Pete