granite
granite copied to clipboard
Skip the need to type `select`
When I run Model.where(name: "confact").first.. it complains.
I have to type: Model.where(name: "confact").select.first... do get it to work.
This is a worthy convenience method. It appears that the where just isn't evaluated when the first method is chained. I think it makes sense for this to be a convenience method, but there's also find_by that can take the attribute name and value and just return the single object if found.