I have an model called 'Notation' with the attributes 'name' and 'tag' In its controller there is an action that will return an json with the array with all 'tag' value (the 'tag' value from all model's records).
I have implemented this:
@tags = Notation.all.map{ |notation| notation.tag }
render json: @tags
this works, but I checked in the console and saw the SQL that has been queried:
SELECT "notations".* FROM "notations"
I was wondering if there is another way using ActiveRecord to query only the 'tag' attribute (mostly because of performances issues), or if this is something I do not have to worry about