jeudi 1 octobre 2015

Rails : Unique address from array of active record addresses

How to retrieve unique addresses which has got same latitude and longitude

> addresses
=> [#<Address id: 10, country: "IN", state: "KA", latitude: "12.971513803339702", longitude: "77.59443104418949", user_id: 11>, #<Address id: 9, country: "IN", state: "KA", latitude: "12.971513803339702", longitude: "77.59443104418949", user_id: 10>]

In this case I need any one of the ActiveRecord, as latitude and longitude are having similar values.

Aucun commentaire:

Enregistrer un commentaire