Skip to content

Scope 'near' does not work with pluck() #166

Open
@santuxus

Description

@santuxus

Hello!

I needed to get array of only one column values from my locations table and it seems that pluck() always returns location.id, not depending what attribute is passed to the function.

Location.near('Lille')
=>
Location id: 4, area: "Lille", lat: 50.6292, lon: 3.05726, created_at: "2012-01-25 18:13:09",
Location id: 6, area: "Villeneuve-d'Ascq", lat: 50.6233, lon: 3.145, created_at: "2012-01-25 19:05:44"

Location.near('Lille').pluck(:id)
=> [4, 6]

Location.near('Lille').pluck(:created_at)
=> [4, 6]

Regards,
Santuxus

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions