lib/basketball/drafting/engine_serializer.rb in basketball-0.0.5 vs lib/basketball/drafting/engine_serializer.rb in basketball-0.0.6
- old
+ new
@@ -113,11 +113,10 @@
def serialize_events(events)
events.map do |event|
{
type: event.class.name.split('::').last,
- id: event.id,
front_office: event.front_office.id,
pick: event.pick,
round: event.round,
round_pick: event.round_pick
}.tap do |hash|
@@ -155,10 +154,10 @@
end
end
def deserialize_events(json, players, front_offices)
(json.dig(:engine, :events) || []).map do |event_hash|
- event_opts = event_hash.slice(:id, :pick, :round, :round_pick).merge(
+ event_opts = event_hash.slice(:pick, :round, :round_pick).merge(
front_office: front_offices.find { |t| t.id == event_hash[:front_office] }
)
class_constant = EVENT_CLASSES.fetch(event_hash[:type])