Created
August 20, 2013 17:35
-
-
Save janjiss/6284626 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_coordinates | |
| if @branch.present? | |
| @show_cities = Purchase.where(:branch = @branch) | |
| @show_sale_points = Purchase.find(:all, :select => "DISTINCT sale_point") | |
| @show_all_blanches = Purchase.find(:all, :select => "DISTINCT branch") | |
| @show_sale_points = Purchase.where(:city => @city, :branch => @branch) if @city.present? | |
| if @city.present? && @sales_point.present? | |
| coordinates = Purchase.where(:city => @city, :branch => @branch, :sale_point => @sale_point) | |
| @latitude = coordinates.first.latitude | |
| @longitude = coordinates.first.longitude | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment