Created
April 29, 2011 19:06
-
-
Save jmoody/948820 to your computer and use it in GitHub Desktop.
This file contains 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 create | |
params.each do |key,value| | |
logger.warn "Param #{key}: #{value}" | |
end | |
url_args = { :latitude => params["longitude"], :longitude => params["longitude"] } | |
logger.debug "url_args = #{url_args}" | |
@count_threshold = CountThreshold.new(url_args) | |
@count_threshold.save | |
#ActiveRecord::Base.include_root_in_json = false | |
respond_with(@count_threshold) do |format| | |
format.html { render :json => @count_threshold } | |
format.json { render :json => @count_threshold } | |
end | |
end |
def fill_in_thresholds
target_accuracy_percent = 34
min_bikes_to_count = 21
min_survey_time_seconds = 780
end
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
class CountThreshold < ActiveRecord::Base
attr_accessor :target_accuracy_percent, :min_bikes_to_count, :min_survey_time_seconds
attr_accessor :latitude, :longitude
before_save :fill_in_thresholds
def fill_in_thresholds
@target_accuracy_percent = 34
@min_bikes_to_count = 21
@min_survey_time_seconds = 780
end