Fixed #11: validation of heat map ranges

This commit is contained in:
Yury V Bukhman
2015-07-03 17:52:28 -05:00
parent 1263d43ce3
commit 892e301c71
7 changed files with 32 additions and 9 deletions
+13 -2
View File
@@ -97,10 +97,21 @@ class Assay
#validates :plate_dimensions_column, :numericality => { :only_integer => true, :greater_than => 0}
#validates :plate_dimensions_row, :numericality => { :only_integer => true, :greater_than => 0 }
#validate inoculation timepoint
# (7) validate inoculation timepoint
validates :start_index, :numericality => { :only_integer => true, :greater_than => 0}
# (8) validate heatmap ranges
#validates_numericality_of :blank_value_input,:if => :user_input?, :message => '- Invalid OD blank value. Please Enter A Real Number.'
validates_numericality_of :totg_min, :if => :user_input?, :allow_blank => true, :greater_than_or_equal_to => 0, :message => '- Please Enter a positive real number.'
validates_numericality_of :totg_max, :if => :user_input?, :allow_blank => true, :greater_than_or_equal_to => 0, :message => '- Please Enter a positive real number.'
validates_numericality_of :totg_OD_min, :if => :user_input?, :allow_blank => true, :greater_than_or_equal_to => 0, :message => '- Please Enter a positive real number.'
validates_numericality_of :totg_OD_max, :if => :user_input?, :allow_blank => true, :greater_than_or_equal_to => 0, :message => '- Please Enter a positive real number.'
validates_numericality_of :specg_min, :if => :user_input?, :allow_blank => true, :greater_than_or_equal_to => 0, :message => '- Please Enter a positive real number.'
validates_numericality_of :specg_max, :if => :user_input?, :allow_blank => true, :greater_than_or_equal_to => 0, :message => '- Please Enter a positive real number.'
validates_numericality_of :lagT_min, :if => :user_input?, :allow_blank => true, :greater_than_or_equal_to => 0, :message => '- Please Enter a positive real number.'
validates_numericality_of :lagT_max, :if => :user_input?, :allow_blank => true, :greater_than_or_equal_to => 0, :message => '- Please Enter a positive real number.'
def initialize(attributes = {})
attributes.each do |name, value|
send("#{name}=", value)
Binary file not shown.
Binary file not shown.