mirror of
https://github.com/fspc/BikeShed-1.git
synced 2026-09-16 08:31:36 -04:00
Finish Api/TimeEntries spec, fix bike_id handling
This commit is contained in:
@@ -5,9 +5,10 @@ class Api::V1::TimeEntriesController < Api::V1::BaseController
|
||||
if params[:time_entries] && time_entry = params[:time_entries].first
|
||||
time_entry.merge!({ loggable_id: current_user.id,
|
||||
logger_id: current_user.id })
|
||||
bike_id = time_entry[:bike_id].to_i
|
||||
|
||||
if time_entry[:bike_id] >= 0
|
||||
time_entry.copy_to_bike_history(time_entry[:bike_id])
|
||||
if bike_id > 0
|
||||
time_entry.copy_to_bike_history(bike_id)
|
||||
end
|
||||
|
||||
@time_entry = TimeEntry.new(time_entry.except(:bike_id))
|
||||
|
||||
Reference in New Issue
Block a user