diff --git a/app/controllers/entries_controller.rb b/app/controllers/entries_controller.rb index 56b928e..38043a6 100644 --- a/app/controllers/entries_controller.rb +++ b/app/controllers/entries_controller.rb @@ -74,7 +74,9 @@ class EntriesController < ApplicationController #@entry = current_user.entries.where(end_time: nil).order(start_time: :desc).first if @entry @entry.end_time = Time.current - @entry.lunch_break_minutes = params[:lunch_break_minutes].to_i + @entry.lunch_break_minutes = 30 if ActiveModel::Type::Boolean.new.cast(params[:lunch_break]) + + total_minutes = @entry.total_minutes_including_break @entry.hours = total_minutes / 60 diff --git a/app/views/entries/index.html.erb b/app/views/entries/index.html.erb index 0d841d7..a62238f 100644 --- a/app/views/entries/index.html.erb +++ b/app/views/entries/index.html.erb @@ -111,7 +111,13 @@ Dauer: Berechne …