diff --git a/app/controllers/mezuro_ranges_controller.rb b/app/controllers/mezuro_ranges_controller.rb index 15ad8b2..f70910e 100644 --- a/app/controllers/mezuro_ranges_controller.rb +++ b/app/controllers/mezuro_ranges_controller.rb @@ -49,6 +49,7 @@ class MezuroRangesController < ApplicationController private def mezuro_range_params + params[:mezuro_range][:beginning] = params[:mezuro_range][:beginning].to_f.to_s if numeric?(params[:mezuro_range][:beginning]) # this is necessary for the beginning validator params[:mezuro_range] end @@ -78,6 +79,10 @@ class MezuroRangesController < ApplicationController @metric_configuration_id = params[:metric_configuration_id].to_i end + # used on mezuro_range_params + def numeric?(text) + Float(text) != nil rescue false + end def set_mezuro_range @mezuro_range = MezuroRange.find(params[:id].to_i) diff --git a/features/mezuro_range/deletion.feature b/features/mezuro_range/deletion.feature index 86a3da0..f28d4f0 100644 --- a/features/mezuro_range/deletion.feature +++ b/features/mezuro_range/deletion.feature @@ -13,7 +13,7 @@ Feature: Range Deletion And I have a sample reading within the sample reading group labeled "My Reading" And I have a sample range within the sample metric configuration And I am at the sample metric configuration page - When I click the Destroy Range link + When I click the Destroy link Then I should be at metric configuration sample page And I should see "There are no ranges yet!" @@ -27,4 +27,4 @@ Feature: Range Deletion And I have a sample reading within the sample reading group labeled "My Reading" And I have a sample range within the sample metric configuration When I am at the sample metric configuration page - Then I should not see "Destroy Range" + Then I should not see "Destroy" -- libgit2 0.21.2