method
read_time_parameter_value
rails latest stable - Class:
ActiveRecord::Base
read_time_parameter_value(name, values_hash_from_param)private
No documentation available.
# File activerecord/lib/active_record/base.rb, line 2042
def read_time_parameter_value(name, values_hash_from_param)
# If Date bits were not provided, error
raise "Missing Parameter" if [1,2,3].any?{|position| !values_hash_from_param.has_key?(position)}
max_position = extract_max_param_for_multiparameter_attributes(values_hash_from_param, 6)
set_values = (1..max_position).collect{|position| values_hash_from_param[position] }
# If Date bits were provided but blank, then default to 1
# If Time bits are not there, then default to 0
[1,1,1,0,0,0].each_with_index{|v,i| set_values[i] = set_values[i].blank? ? v : set_values[i]}
instantiate_time_object(name, set_values)
end