Hi All, 

I'm looking for the best way to add some lightweight versioning to my 
ActiveRecord model. 

Long story short, I work on an image hosting site, where each ActiveRecord 
of a resource contains some description fields and links to attachments. 
Users submit resources, and they are reviewed by admin before made 
available to the public. Once an image is made public, the original author 
can make changes to the resource, but that change needs to be reviewed 
before it can be made public again. 

The problem is, we don't want to take down a resource once it goes live 
just because the author decides to submit some edits. Instead, we want the 
ability to continue showing old version of the resource on the live site, 
during this edit/review stage. So, the edits need to be saved somewhere 
else. 

I looked into using versioning plugin like PaperTrail, but it seems too 
heavy handed. An alternative approach is to duplicate all fields in the 
resource, so the edits are stored in the duplicate fields; but this doesn't 
seem like an elegant solution. A third possibility is to create a temporary 
resource (perhaps even of a different type) just to hold the values being 
edited, and copy those values back to the main resource once edits are 
approved. This still has some complexity, but I'm leaning toward the third 
approach. 

Any ideas for better way of handling this problem? 

Thanks,
Yi

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/9ff0a104-ceb1-4b81-8c26-dd7c5040b0ff%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to