Active Record Finders
These are some Active Record Finder methods which I find helpful.
Assign attributes
cat = Cat.new(name: "Simba")
cat.assign_attributes(name: "Nala")
Select attributes as a list.
Cat.pluck(:name)
Cat.all.map { |x| x.name }
Get column names
Cat.column_names
Join with another table
Cat.joins(:owners)
Select ambiguous column from joined table
Cat.joins(:owners)
.select("owners.id")
.map { |x| x.id }