I want to convert the following into Rails Ruby code:
SELECT * FROM ALBUMS
WHERE TITLE='Greatest Hits'
AND ARTIST='The Beatles';
SELECT COUNT(ID) FROM ALBUMS
WHERE TITLE='Greatest Hits'
AND ARTIST='The Beatles';
For the first, I've read about the pluck method in Ruby, but I don't know how to pluck given multiple limitations, in this case, not just title, but also artist.
For the second, I want to just count how many occurrences of title and artist being the same.
Please help? My best source: http://apidock.com/rails/ActiveRecord/Calculations/pluck