Making it so created & modified dates for integers is automatically set & filtered through the asData function, if the model contains 'created' or 'modified' columns

This commit is contained in:
Ryan Coyne 2017-11-26 17:47:36 -05:00
parent fa8eda53e9
commit ed3f71b843
1 changed files with 4 additions and 1 deletions

View File

@ -90,8 +90,11 @@ extension Array where Iterator.Element == Mirror {
if !includingNilValues { if !includingNilValues {
if child.label.isNotNil, String(describing: child.value) != "nil" { if child.label.isNotNil, String(describing: child.value) != "nil" {
allChild.append(child) allChild.append(child)
// Automatic created & modified fields:
} else if child.label.isNotNil, child.label == "created" || child.label == "modified" { } else if child.label.isNotNil, child.label == "created" || child.label == "modified" {
allChild.append(child) var mutableChild = child
mutableChild.value = Int(Date().timeIntervalSince1970)
allChild.append(mutableChild)
} }
} else { } else {
if child.label.isNotNil { if child.label.isNotNil {