In this line:
visits.map(&:visit_status_id).max == VisitState.get(state).id
I’m just curious what that ampersand is doing there and its relevance to
being passed into map with the symbol.
Also, when you specify a has_many :visits, for example, will that create
a local variable in the model called visits, which contains the
collection of records from the visits table?
Thanks for response
- A has_many declaration will create methods for you (not a local
thanks for response
But if visits is a method, how can you call map on it? Map can only be
called on enumerables like array, string, and hash, right? Or does the
visits method return an array of visit records and if the returned value
is an array, then map is called on that array