]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blobdiff - src/TSN/XML/AutoRacingResults.hs
Add a TODO comment to TSN.XML.AutoRacingResults.
[dead/htsn-import.git] / src / TSN / XML / AutoRacingResults.hs
index 96433ee0e7638efd31c257e61e812b12776c4970..179b8ab43cdaf4be124f70f268cad85a954cb5b7 100644 (file)
@@ -267,7 +267,7 @@ data MostLapsLeading =
 data AutoRacingResultsRaceInformation =
   AutoRacingResultsRaceInformation {
     -- Note the apostrophe to disambiguate it from the
-    -- AutoRacingResultsListing filed.
+    -- AutoRacingResultsListing field.
     db_auto_racing_results_id' :: DefaultKey AutoRacingResults,
     db_track_length :: Double,
     db_track_length_kph :: Double,
@@ -391,13 +391,16 @@ mkPersist tsn_codegen_config [groundhog|
           reference:
             onDelete: cascade
 
-
+# Note the apostrophe in the foreign key. This is to disambiguate
+# it from the AutoRacingResultsListing foreign key of the same name.
+# We strip it out of the dbName.
 - entity: AutoRacingResultsRaceInformation
   dbName: auto_racing_results_race_information
   constructors:
     - name: AutoRacingResultsRaceInformation
       fields:
         - name: db_auto_racing_results_id'
+          dbName: auto_racing_results_id
           reference:
             onDelete: cascade
         - name: db_most_laps_leading
@@ -519,7 +522,7 @@ pickle_race_information =
     xpWrap (from_tuple, to_tuple) $
     xp11Tuple (-- I can't think of another way to get both the
                -- TrackLength and its KPH attribute. So we shove them
-               -- both in a 2-tuple.
+               -- both in a 2-tuple. This should probably be an embedded type!
                  xpElem "TrackLength" $ xpPair xpPrim (xpAttr "KPH" xpPrim) )
               (xpElem "Laps" xpInt)
               (xpOption $ xpElem "AverageSpeedMPH" xpPrim)