Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thbar/data-patcher
Little gem to produce database patchs
https://github.com/thbar/data-patcher
Last synced: about 1 month ago
JSON representation
Little gem to produce database patchs
- Host: GitHub
- URL: https://github.com/thbar/data-patcher
- Owner: thbar
- License: mit
- Created: 2009-03-10T09:23:53.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2009-07-15T21:00:47.000Z (over 15 years ago)
- Last Synced: 2024-10-14T02:50:22.527Z (2 months ago)
- Language: Ruby
- Size: 85.9 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.textile
- License: LICENSE
Awesome Lists containing this project
README
h2. WHAT
Given a bunch of ruby Hash, an ActiveRecord model class and a unique key, DataPatcher creates a Hash of the differences between the bunch of Hash and the table.
Have a look at the (very simple) spec/data_patcher.rb to get a better understanding of what's possible.
h2. REAL-LIFE USE
This is useful if you are aggregating various data sources and what to have a good level of control on what is added or modified. I do that on "Learnivore.com":http://www.learnivore.com and for some of my clients data processing.
When doing this, I tend to parse all the sources again, compare the result to already registered data, and see what are the differences and if they should be applied.
h2. TEST
Edit spec/database.yml and run rake spec.
Test data is recreated automatically when running rake spec.
h2. IDEAS
* find another name - I don't like DataPatcher
* find a better Hash patch format
** move the key outside the diff Hash ?
* support removed records ? (I don't need that for the moment)
* add some way to apply the patch directly inside DataPatcher ?h2. COPYRIGHT
Copyright (c) 2008 Thibaut Barrère. See LICENSE for details.