Working on something else, I saw the following:
protected
# ...
def self.field_type
to_s.split("::").last.underscore
end
This code can lead to misunderstanding, as the protected
modifier doesn't apply to class methods like self.field_type
.
On this PR, I move two such class methods behind the modifier, near the top of the class, to avoid this confusion.
I also move three other class methods to the top of the class, as I feel class methods should go together in general, in order to clarify interfaces and avoid future instances of this anti-pattern.