Closed divyabaid16 closed 5 years ago
Hi @divyabaid16 are you looking to plan this one out a bit? One thing you could do is look at another system in Rails that has versioning. For example our node
model in plots2
has "revisions" which are stored in a second table: https://github.com/publiclab/plots2/blob/master/app/models/node.rb
https://github.com/publiclab/plots2/blob/master/app/models/revision.rb
Potentially a second table could be used to store timestamped corner location data for each image?
Let's map out how it's done currently -- aha, actually we use the Node table:
Perhaps we need to add a "version" column to that table, and then we can fetch the associated nodes using that, instead of using a concatenated list like 1,2,3,4
the way we do here:
Here's where we currently fetch the nodes for an image (called a Warpable): https://github.com/publiclab/mapknitter/blob/3588ccd8b2510472d6aa73328fbf37f865f3f596/app/models/warpable.rb#L127-L129
Hi @divyabaid16, looking ahead to this - I think it'll make some really interesting things possible, like opening an image in image-sequencer and saving the output as a new version! That'll let people fix lens distortion (the fisheye effect) or do brightness or contrast fixes on their images. What do you think of this idea?
Like the ndvi button right now doesn't save at all. It just replaces images temporarily. But a versioning system could actually save the output but allow reverting it too!
I was looking into this and found that we can also use the "paper_trail" gem to track versions of records. https://github.com/paper-trail-gem/paper_trail This is different from that used in plots2. What are your views in this? @jywarren @gauravano
hm, cool! Great find! Do you think it's pretty simple to use and integrate? If so, i think that could work!
On Mon, Jul 15, 2019 at 2:14 AM Divya Baid notifications@github.com wrote:
I was looking into this and found that we can also use the "paper_trail" gem to track versions of records. https://github.com/paper-trail-gem/paper_trail This is different from that used in plots2. What are your views in this? @jywarren https://github.com/jywarren @gauravano https://github.com/gauravano
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/mapknitter/issues/682?email_source=notifications&email_token=AAAF6J63RGMRNLBX3CWKYR3P7QIRBA5CNFSM4HXBANTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ4ZKDI#issuecomment-511284493, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAF6J34GL5E3WSTRVCQLL3P7QIRBANCNFSM4HXBANTA .
Paper_trail is good but let's consider all the cases we need to handle. If paper_trail can do it, let's use it. Otherwise, we can just do it on our own.
If we want to implement this https://github.com/publiclab/mapknitter/issues/682#issuecomment-511258238, then we need to maintain version of warpable not nodes as hinted here.
Also, as warpable has all the essential attributes:
We can have versioning of that. So, basic cases/implementation would be:
Description Images can be updated by the users and the history of all the images must be stored. The latest version of the image must be shown up.
Something similar to the GitHub comments:
Image versioning, locking, and reverting must be possible.
Thanks!