INSERT IGNORE and DataMapper
// February 18th, 2010 // DataMapper, Development, Ruby
So I needed a way to replicate the ‘INSERT IGNORE’ statement in DataMapper and being that the code documentation is sparse, and I didn’t feel like force feeding an SQL statement into DM, I wrote some ruby code to replicate it.
If anyone has a better, or more refined solution, please let me know!
rescue DataObjects::IntegrityError => e
@logger.error e
unless e.code == 1062
throw e
end
end
Leave a Reply
You must be logged in to post a comment.