Skip to content

Commit

Permalink
Rename too_short to insufficient_recording_time (#163)
Browse files Browse the repository at this point in the history
* Rename too_short to insufficient_recording_time

* Fix linter

* Update ruby version
  • Loading branch information
CuddlyBunion341 authored Feb 11, 2025
1 parent b5c4bf5 commit c18976f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.2
3.2
3 changes: 1 addition & 2 deletions app/models/finished_timer_session_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ def validate_issues_selected
def validate_minimal_duration
return unless (@record.splittable_hours / @record.issues.count) < SettingsManager.min_hours_to_record.to_f

@record.errors.add(:timer_start,
:too_short)
@record.errors.add(:timer_start, :insufficient_recording_time)
end

def validate_day_limit
Expand Down
4 changes: 3 additions & 1 deletion app/services/time_rebalancer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ def handle_issues_not_changed

def update_times
new_time = @timer_session.splittable_hours / @issues.count
@timer_session.errors.add(:timer_start, :too_short) if new_time < SettingsManager.min_hours_to_record
if new_time < SettingsManager.min_hours_to_record
@timer_session.errors.add(:timer_start, :insufficient_recording_time)
end
return unless @timer_session.valid?

@timer_session.time_entries.each do |time_entry|
Expand Down
2 changes: 1 addition & 1 deletion config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ de:
after_end: muss vor dem Ende der Arbeitszeit sein
limit_reached_day: Du versuchst zu viel Zeit am Starttag zu buchen
limit_reached_session: Du versuchst zu viel Zeit in dieser Session zu buchen
too_short: Bitte buche mindestens 0.01 Stunden für jedes Issue
insufficient_recording_time: Bitte buche mindestens 0.01 Stunden für jedes Issue
timer_end:
before_start: muss nach dem Start der Arbeitszeit sein
issue_id:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ en:
after_end: must be before the end of the timer
limit_reached_day: You are trying to record too much time for one day
limit_reached_session: You are trying to record too much time for one session
too_short: Please log at least 0.01 hours
insufficient_recording_time: Please log at least 0.01 hours
timer_end:
before_start: must be after the start of the timer
issue_id:
Expand Down

0 comments on commit c18976f

Please # to comment.