Skip to content

Commit

Permalink
Rename not_null_latlng to with_latlng for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
jensb committed Nov 6, 2015
1 parent a9dcacc commit 9f89a14
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/geokit-rails/acts_as_mappable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def adapter
def within(distance, options = {})
options[:within] = distance
#geo_scope(options)
not_null_latlng.where(distance_conditions(options))
with_latlng.where(distance_conditions(options))
end
alias inside within

Expand Down Expand Up @@ -140,10 +140,10 @@ def by_distance(options = {})
bounds = extract_bounds_from_options(options)
distance_column_name = distance_sql(origin, units, formula)
#geo_scope(options).order("#{distance_column_name} asc")
not_null_latlng.order("#{distance_column_name} #{options[:reverse] ? 'DESC' : 'ASC'}")
with_latlng.order("#{distance_column_name} #{options[:reverse] ? 'DESC' : 'ASC'}")
end

def not_null_latlng
def with_latlng
where("#{qualified_lat_column_name} IS NOT NULL AND #{qualified_lng_column_name} IS NOT NULL")
end

Expand Down

0 comments on commit 9f89a14

Please sign in to comment.