AlexDenisov / iActiveRecord

ActiveRecord for iOS without CoreData, only SQLite
http://alexdenisov.github.com/iActiveRecord/
MIT License
354 stars 50 forks source link

Fix to NSDate+sqlRepresentation.m #18

Closed aspitz closed 11 years ago

aspitz commented 12 years ago

A small fix to NSDate+sqlRepresentation.m. NSTimeInterval is a double and not a float.

AlexDenisov commented 12 years ago

Thanks for contributing. Have you any problems with current NSDate sql representation? I think we need add tests on this case before merge.

pwightman commented 12 years ago

@aspitz The second commit on this looks to be something I fixed previously, you might want to make sure you've merged the latest from the stable branch into your branch. Correct me if I'm wrong. See here: https://github.com/AlexDenisov/iActiveRecord/commit/0857c9b80e60fe01bc2b6a2fd9c41e81f2ead0bd

aspitz commented 12 years ago

@AlexDenisov the NSDate problem makes itself apparent at the seconds level of an NSDate. If you use a float instead of a double you lose some seconds information. I've been away on vacation so I haven't had a chance to pin point the degree of error but going to a double clears the problem. Once I get a moment I'll write the test for this

aspitz commented 12 years ago

@pwightman You're correct, the second fix has already addressed the fix I submitted.

AlexDenisov commented 11 years ago

@aspitz, please, can you provide some code, so I can reproduce NSDate bug and add test case?