With most references to JAVA transfers on the Internet, it is mentioned everywhere that transfers must be all in upper case (for example:) ACTIVE.
Like here: Coding Conventions - Name Enumerations
But when it comes to Rails, in all examples and documents they use the lowercase value enum (ex: 'active'), as here: http://edgeapi.rubyonrails.org/classes/ActiveRecord/Enum.html
which makes sense since rails also provides instance methods by the name of these enums (for example: obj.active?). Is this the only reason why Rails's enumerations are used as lowercase letters, or is there even more? Also, we differ from the agreement when we use enumerations as lowercase, if so? or will we also use capital letters in Rails?
So, for example, in my model there is a variable statusthat can be active, draft or inactive in accordance with the agreement, if it:
enum status: {active: 1, draft: 2, inactive: 3}
or
enum status: {active: 1, draft: 2, inactive: 3}
Which and why?
source
share