Ich arbeite derzeit an Rails-Anwendung. alles ist gut. Ich schrieb SQL-Abfrage und bekam die Image_file_name wie Photo.all.select("photos.id, photos.image_file_name")
, aber ich möchte auch vollständige URL des Bildes analysieren. Gibt es irgendeinen Weg, dies für mich zu tun?Schienen - Get Paperclip URL mit SQL-Abfrage
Ich brauche eine Ausgabe wie
[
#<Photo id: 1, image_file_name: photo1, image_url: '/system/photos/images/000/000/86/thumb/photo1.png?1511864359'>,
#<Photo id: 2, image_file_name: photo2, image_url: '/system/photos/images/000/000/382/thumb/photo2.png?1511864359'>,
#<Photo id: 3, image_file_name: photo3, image_url: '/system/photos/images/000/000/102/thumb/photo3.png?1511864359'>, ...]