def encodeWithCoder(coder)
      columns.each do |attr|
        # Serialize attributes except the proxy has_many and belongs_to ones.
        unless [:belongs_to, :has_many, :has_one].include? column(attr).type
          value = self.send(attr)
          unless value.nil?
            coder.encodeObject(value, forKey: attr.to_s)
          end
        end
      end
    end
def encodeWithCoder(coder)
      columns.each do |attr|
        # Serialize attributes except the proxy has_many and belongs_to ones.
        unless [:belongs_to, :has_many, :has_one].include? column(attr).type
          value = self.send(attr)
          unless value.nil?
            coder.encodeObject(value, forKey: attr.to_s)
          end
        end
      end
    end
Follow Apple's recommendation not to encode missing
 values.