Skip to content

Instantly share code, notes, and snippets.

@DylanFM
Created September 14, 2009 05:44
Show Gist options
  • Save DylanFM/186528 to your computer and use it in GitHub Desktop.
Save DylanFM/186528 to your computer and use it in GitHub Desktop.
ruby-1.8.6-p383 > postcode = Postcode.find_by_postcode(2251)
=> #<Postcode id: 1026, postcode: 2251, suburb: "AVOCA BEACH", state: "NSW", dc: "TERRIGAL DC", type_str: "Delivery Area", lat: #<BigDecimal:10451f1a8,'-0.33464937E2',18(27)>, lng: #<BigDecimal:10451f108,'0.151432387E3',18(27)>, created_at: nil, updated_at: nil>
ruby-1.8.6-p383 > Course.find(:all, :origin => [postcode.lat, postcode.lng], :within => 20)
=> [#<Course id: 25996, type: "Course", title: "", raw_body: nil, html_body: "", start_time: nil, end_time: nil, v4_id: 2284, created_at: "2009-01-07 23:06:26", updated_at: "2009-01-08 02:30:48", start_date: nil, end_date: nil, slug: "25996-palm-beach-golf-club", v4_slug: "2284-palm-beach-golf-club", lat: #<BigDecimal:1044faf38,'-0.33590081E2',18(27)>, lng: #<BigDecimal:1044fadf8,'0.151323109E3',18(27)>, reviews_count: 6, average_review: #<BigDecimal:1044faba0,'0.1667E1',18(18)>, featured: "", forum_id: nil, topic_id: nil, cached_tag_list: "", delta: false, workflow_state: "new">, #<Course id: 25521, type: "Course", title: "", raw_body: nil, html_body: "", start_time: nil, end_time: nil, v4_id: 1782, created_at: "2009-01-07 23:04:34", updated_at: "2009-03-17 21:14:19", start_date: nil, end_date: nil, slug: "25521-gosford-golf-club", v4_slug: "1782-gosford-golf-club", lat: #<BigDecimal:1044f85d0,'-0.33417078E2',18(27)>, lng: #<BigDecimal:1044f8170,'0.151335726E3',18(27)>, reviews_count: 8, average_review: #<BigDecimal:1044f7dd8,'0.425E1',18(18)>, featured: "", forum_id: nil, topic_id: nil, cached_tag_list: "", delta: false, workflow_state: "new">, #<Course id: 26351, type: "Course", title: "", raw_body: "Tuggerah Lakes Golf Club is located on the New Sout...", html_body: "", start_time: nil, end_time: nil, v4_id: 2649, created_at: "2009-01-07 23:07:43", updated_at: "2009-05-20 05:58:34", start_date: nil, end_date: nil, slug: "26351-tuggerah-lakes-golf-club", v4_slug: "2649-tuggerah-lakes-golf-club", lat: #<BigDecimal:1044f51a0,'-0.3337032E2',18(27)>, lng: #<BigDecimal:1044f5100,'0.151487346E3',18(27)>, reviews_count: 2, average_review: #<BigDecimal:1044f4930,'0.35E1',18(18)>, featured: "", forum_id: nil, topic_id: nil, cached_tag_list: "", delta: false, workflow_state: "new">, #<Course id: 26527, type: "Course", title: "", raw_body: nil, html_body: "Magenta Shores is the only private golf course loca...", start_time: nil, end_time: nil, v4_id: 2834, created_at: "2009-01-07 23:08:20", updated_at: "2009-07-13 09:55:18", start_date: nil, end_date: nil, slug: "26527-magenta-shores", v4_slug: "2834-magenta-shores", lat: #<BigDecimal:1044f0448,'-0.3331076913 19E2',27(27)>, lng: #<BigDecimal:1044f0218,'0.1515227937 698E3',27(27)>, reviews_count: 4, average_review: #<BigDecimal:1044efcf0,'0.425E1',18(18)>, featured: "", forum_id: nil, topic_id: nil, cached_tag_list: "", delta: false, workflow_state: "new">]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment