find_all_by issues
I have rails application, which deals with some google map related stuff.the problem is , i have a table which contains latitude & longitude columns. the column types are "float". for some occasions i need to generate the query by the following:
clients.find_all_by_lat_and_lng(latvalue,lngvalue).
I gave the correct & existing lat & lng values to fetch the database value. but i can get only Empty.
I tried with difference dynamic finder开发者_开发问答s like find_by_lat,find_by_lng i get only empty values from the query ...but data are exits in the table.
I guess the Float column type is the culprit here, i don't how to overcome this and get the values. Can one suggest me on this.
NOTE : if i work with same query in windows i get the values. my box is ubuntu here i can't get the values
clients.find(:all, :conditions => ["lat = ? and lng = ?",latvalue, lngvalue])
try this your model name is "clients" ??? or Client
精彩评论