Find user by photo random guid

diasp:~/diaspora$ RAILS_ENV=production bin/rails c

Loading production environment (Rails 5.1.6)

2.4.4 :001 > Photo.find_by(random_string: ‘369c458d9b5b659a8333’)
=> #<Photo id: 2135366, author_id: 377, public: true, guid: “fba50340b6990136292d047d7b62795e”, pending: false, text: nil, remote_photo_path: “https://diasp.org/uploads/images/”, remote_photo_name: “369c458d9b5b659a8333.jpg”, random_string: “369c458d9b5b659a8333”, processed_image: “369c458d9b5b659a8333.jpg”, created_at: “2018-10-20 13:28:41”, updated_at: “2018-10-20 13:28:52”, unprocessed_image: “369c458d9b5b659a8333.jpg”, status_message_guid: “025389a0b69a01362935047d7b62795e”, comments_count: nil, height: 3264, width: 1836>

2.4.4 :002 > Person.find_by(id: 377)
=> #<Person id: 377, guid: “4d0564183dac139f3d0008e0”, diaspora_handle: “someone123@diasp.org”, serialized_public_key: “—–BEGIN RSA PUBLIC KEY—–\nMIIkfhsdkfjsdhjkje…”, owner_id: 170, created_at: “2010-12-13 00:08:56”, updated_at: “2015-06-18 21:00:47”, closed_account: false, fetch_status: 6, pod_id: nil>

2.4.4 :003 > exit

Leave a Reply

Your email address will not be published. Required fields are marked *