Episode #177: Model Versioning
1. Torsten Aug 31, 2009 at 00:23this is much nicer than acts_as_versioned! Thanks for pointing this out.
Episode #177: Model Versioning
2. Aditya Sanghi Aug 31, 2009 at 01:25Hi Ryan,
Minor typo in your blog post, it's vestal_versions i believe, not vistal_versions.
Cheers,
Aditya
Episode #177: Model Versioning
3. August Lilleaas Aug 31, 2009 at 03:42Out of curiosity, where's the wiki_link helper in your show.html.erb form?
Episode #177: Model Versioning
4. Tobias Aug 31, 2009 at 06:21Thanks a lot thats just what I was locking for for our next sprint next week :-).
Episode #177: Model Versioning
5. Shane Aug 31, 2009 at 06:55Might I also suggest taking a look at has_versioning:
http://github.com/kkurach/has_versioning/tree/master
It doesn't only version models, it will also version associations (though not yet via has_many through) and allows for rollback.
You can even lump a whole bunch of changes into a single changelist so that you can later undo them all at once later if need be...
Episode #177: Model Versioning
6. Ryan Bates Aug 31, 2009 at 07:25@Aditya, fixed, thanks!
@August, the wiki_link helper method is inside the application_helper.rb file. Check out the full source code link in the show notes.
@Shane, thanks for pointing this out! I hadn't heard of has_versioning.
Episode #177: Model Versioning
7. Jon Aug 31, 2009 at 07:43I'm wondering how to get this to work with associated models, so if the associations change this is reflected in the versioned model.
I could implement a simple after_update method that touches the parent (i.e. versioned) model when the associated model is updated but I'm wondering will the parent model recognise the changes. Particularly as the main aspect that will change on the associated model is the attached file via paperclip!
Episode #177: Model Versioning
8. Brian Armstrong Aug 31, 2009 at 07:47If anyone wants to do a "diff" output with this to compare versions, check out HTMLDIff
http://github.com/myobie/htmldiff/tree/master
It will put new stuff in green, old in red with strikethrough, etc.
I setup something like this with the acts_as_audited plugin a while back which is also good, looks very similar.
Episode #177: Model Versioning
9. Andy Stewart Aug 31, 2009 at 09:15This looks good.
You may also like my PaperTrail gem, which doesn't require you to touch existing records to store their starting state. It also lets you recover destroyed records, and copes with intermediate schema changes. It also records who was responsible.
Episode #177: Model Versioning
10. Andy Stewart Aug 31, 2009 at 09:15Forgot the link:
http://github.com/airblade/paper_trail/tree/master
Episode #177: Model Versioning
11. Karol Aug 31, 2009 at 09:56@Shane
has_versioning plugin ( http://github.com/kkurach/has_versioning/tree/master ) doesn't support rollbacks yet. everything else you wrote is correct :)
it supports tracking objects AND associations, and also packing many changes into one changelist
Episode #177: Model Versioning
12. Michael Schuerig Aug 31, 2009 at 13:34Anyone wondering about the name of the vestal_versions plugin probably needs to listen to A Whiter Shade of Pale
http://www.youtube.com/watch?v=PbWULu5_nXI
Episode #177: Model Versioning
13. Chris Gunther Aug 31, 2009 at 19:42Great screencast on a useful gem. Now I have to find a project to use it in.
Episode #177: Model Versioning
14. sthapit Sep 01, 2009 at 04:49works great but one problem - my model has a "state" column that gets changed from "pending" to "active". this would allow users to revert an active post to pending - is there a way to prevent Vestal Versions from not tracking a specific column (in this case the "state" column)? thanks!
Episode #177: Model Versioning
15. sam Sep 01, 2009 at 07:17Hi, very nice screencast
can someone explain me what the & in
Page.find_each(&:touche)
does?
thx
Episode #177: Model Versioning
16. hartwig Sep 01, 2009 at 16:06@sam
Event shorter: Ryan made an episode about that: http://railscasts.com/episodes/6-shortcut-blocks-with-symbol-to-proc
In short: its just a shortcut for
Page.find_each{|item| item.touche}
The & converts the symbol to a proc object ( to be more specific the & calls the to_proc method on the symbol or on any other object), which gets then called for each object which find_each returns.
Thats feature is in ruby 1.9 per default, or you can define it like rails did.
Look at http://blog.hasmanythrough.com/2006/3/7/symbol-to-proc-shorthand and search for to_proc
Episode #177: Model Versioning
17. Aaron Sep 01, 2009 at 19:54I've been using acts_as_revisable on my project, which has worked out extremely well, it seems to be a bit more developed, and works very will in conjunction with AASM. acts_as_revisable also supports association versioning as detailed in the without_scope blog: http://withoutscope.com/2009/5/12/simple-association-versioning-with-acts_as_revisable
http://github.com/rich/acts_as_revisable/tree/master
Episode #177: Model Versioning
18. Robert Sep 01, 2009 at 23:50What version of Rails does vestal_versions require, will it work on 2.1?
Episode #177: Model Versioning
19. vidar Sep 02, 2009 at 03:36For getting the log and the hirb working, install the hirb gem and put
if ENV['RAILS_ENV']
require 'rubygems'
require 'hirb'
require 'activerecord'
Hirb.enable
ActiveRecord::Base.logger = Logger.new(STDOUT)
end
into .irbrc and then fire up script/console
Episode #177: Model Versioning
20. Vishnu Shashank Sep 03, 2009 at 04:27I was using acts_as_versioned. Thanks Ryan. This one is good.
@Bryan, Thanks. I got the HTMLDiff working as well. Its fantastic.
Episode #177: Model Versioning
21. Matias Korhonen Sep 05, 2009 at 05:37Maybe it's about time for a Railscast on anti-spam measures?
Episode #177: Model Versioning
22. Dji Sep 07, 2009 at 18:04It might be time for a Railscast on implementing Captcha and eliminating spam.
Episode #177: Model Versioning
23. mikhailov Sep 10, 2009 at 07:33It's pretty cool!
By the way, isn't hard implementation
Episode #177: Model Versioning
24. Everlast Sep 12, 2009 at 03:12Hi,
I've been using acts_as_versioned with acts_as_paranoid, which need(ed) a custom patch to work proprely together in a project (the patch ensured that deleting a record not only sets the deleted_at column to the current date-time, but also moves it to the *_versions table and was provided on the versioned act track or somewhere like that; btw the patch on the site didn't work but I mailed the author and he gave me the correct one - obviuosly he didn't upload the patch right but was very helpful).
Since Rails 2.1.x came out with the enhanced change-tracking functionalities and acts_as_versioned stopped working, I'm stuck using Rails 2.0.2 for that project.
So, my question is: Is there a way/act/plugin to achieve what I now have with newer Rails versions?
The idea is that I need to keep track of both changes and deletions
Episode #177: Model Versioning
25. sthapit Sep 24, 2009 at 02:11I ended up creating a simple fork of vestal_versions so that I could specify which columns to include or exclude. Details are at http://github.com/sthapit/vestal_versions
Episode #177: Model Versioning
26. kb Oct 08, 2009 at 06:00In Rails 2.3.4 it says: undefined method `password_confirmation' for #<User:0x7f4ffda0a7e0>
I added an
attr_accessor :password_confirmation
to the User-Model
But still got the Error:
Password confirmation is too short (minimum is 4 characters)
Episode #177: Model Versioning
28. mbt shuguli gtx Mar 28, 2010 at 20:22Very interesting!Thank you for your sharing!
Episode #177: Model Versioning
29. daisy Apr 21, 2010 at 00:17Life is just a series of trying to make up your mind.
Episode #177: Model Versioning
30. cly Apr 21, 2010 at 00:18It is not enough to be industrious, so are the ants. What are you industrious for?
Episode #177: Model Versioning
31. lily Apr 21, 2010 at 02:14contented mind is the greatest blessing a man can enjoy in this world.
Episode #177: Model Versioning
32. lily Apr 21, 2010 at 02:15A lifetime of happiness!No man alive could bear it; it would be hell on erath.
Episode #177: Model Versioning
33. birdprotectblog Apr 29, 2010 at 20:01Life can be good,
Life can be bad,
Life is mostly cheerful,
But sometimes sad.
Life can be dreams,
Life can be great thoughts;
Life can mean a person,
Sitting in court.
Episode #177: Model Versioning
34. fbafblog Apr 29, 2010 at 20:01Life can be dirty,
Life can even be painful;
But life is what you make it,
So try to make it beautiful.
Episode #177: Model Versioning
35. bkod Apr 29, 2010 at 20:02Hold fast to dreams,
For if dreams die
life is a broken-winged bird
That cannot fly.
Episode #177: Model Versioning
36. 49p.org Apr 29, 2010 at 20:03
If your life feels like it is lacking the power that you want and the motivation that you need, sometimes all you have to do is shift your point of view
Episode #177: Model Versioning
37. bnco Apr 29, 2010 at 20:03Hold fast to dreams,
For when dreams go
life is a barren field
Forzen with snow.
Episode #177: Model Versioning
38. bvvv Apr 29, 2010 at 20:04
If your life feels like it is lacking the power that you want and the motivation that you need, sometimes all you have to do is shift your point of view.
Episode #177: Model Versioning
39. artslifeblog Apr 29, 2010 at 20:05By training your thoughts to concentrate on the bright side of things, you are more likely to have the incentive to follow through on your goals.
Episode #177: Model Versioning
40. brandlifeblog Apr 29, 2010 at 20:06You are less likely to be held back by negative ideas that might limit your performance.
Episode #177: Model Versioning
41. anffans Apr 29, 2010 at 20:07Your life can be enhanced, and your happiness enriched, when you choose to change your perspective. Don't leave your future to chance
Episode #177: Model Versioning
42. brandshoeblog Apr 29, 2010 at 20:07wait for things to get better mysteriously on their own. You must go in the direction of your hopes and aspirations. Begin to build your confidence, and work through problems rather than avoid them.
Episode #177: Model Versioning
43. mBddblog Apr 29, 2010 at 20:25It is true that the focus from the beginning has been on pragmatism, not necessarily understanding of the mechanisms of the actions - and that this has hindered its modern acceptance in the West.
Episode #177: Model Versioning
44. mbtsale Apr 29, 2010 at 20:54all shall be well, jack shall have gill
Episode #177: Model Versioning
45. mbtshoes-shops Apr 29, 2010 at 20:56So,don‘t envy other people because happiness is always nearly!
Episode #177: Model Versioning
46. abercrombie-1892 Apr 29, 2010 at 20:57Instead,life is like a revolving door.when it closes,it also opens!
Episode #177: Model Versioning
47. abercrombie4u Apr 29, 2010 at 20:58Pressure and challenges are all an opportunity for me to rise!
Episode #177: Model Versioning
48. jasmine Apr 29, 2010 at 22:13One is always on a strange road, watching strange scenery and listening to strange music. Then one day, you will find that the things you try hard to forget are already gone.
[url=http://www.abercrombieandfitchs.com/]Abercrombie and Fitch[/url]
Episode #177: Model Versioning
49. jasmine Apr 29, 2010 at 22:15<a href=" http://www.abercrombieandfitchs.com/" title="Abercrombie and Fitch">Abercrombie and Fitch</a>Happiness is not about being immortal nor having food or rights in one's hand. It’s about having each tiny wish come true, or having something to eat when you are hungry or having someone's love when you need love.
Episode #177: Model Versioning
50. jasmine Apr 30, 2010 at 01:45One may fall in love with many people during the lifetime. When you finally get your own happiness, you will understand the previous sadness is kind of treasure, which makes you better to hold and cherishthe people you love.<a href="http://www.nikejordanpremium.com/">Air Jordan</a>
Episode #177: Model Versioning
51. jasmine Apr 30, 2010 at 01:47One may fall in love with many people during the lifetime. When you finally get your own happiness, you will understand the previous sadness is kind of treasure, which makes you better to hold and cherishthe people you love.<a href="http://www.nikejordanpremium.com/">Air Jodan</a>
Episode #177: Model Versioning
52. blue May 21, 2010 at 18:30<a href="http://www.timberlandonlineshop.com/">Timberland Boot</a> Pain past is pleasure.
Episode #177: Model Versioning
53. Timberland Boot Jun 19, 2010 at 18:16Pain past is pleasure.<a href="http://www.timberlandonlineshop.com/">Timberland Boot</a>
Episode #177: Model Versioning
55. ersey Jun 21, 2010 at 00:20[url=http://www.nflonlinestore.net]NFL[/url]
Episode #177: Model Versioning
56. NFL Jersey Jun 21, 2010 at 00:20Thanks for sharing the nice post with me, an girl who firmly follows the fashion trend, It really brings me some fresh feelings with addtional insights into today's world.
Episode #177: Model Versioning
57. io Jun 23, 2010 at 12:08There is newer version of vestal_versioned.
Some changes:
To install it add:
config.gem 'vestal_versions'
And there is no need for adding migration to get version 1 for existing records.
Episode #177: Model Versioning
58. webtasarim Jul 15, 2010 at 09:04web tasarımı, kurumsal site tasarımı, profesyonel web sitesi tasarımı, profesyonel web tasarımı
<a href="http://www.webtasarimturk.net" title="web tasarımı">web tasarımı</a>
Episode #177: Model Versioning
59. http://www.pandora-jewelry-club.com/<strong>buy Pandora</strong></a> see after today's announcement, the band will still not a bargain. <a href=http://www.pandora-jewelry-club.com/pandora-bangles-sale><strong>Beads Bangles</strong></a> Now the band says t Jul 20, 2010 at 00:57hjdhfj mfhjsdhjf fdfsdfs
Episode #177: Model Versioning
60. bathroom vanity Jul 27, 2010 at 22:27Good article, Each and every point is good enough.Thanks for sharing with us your wisdom.
Episode #177: Model Versioning
61. power strip Jul 27, 2010 at 22:29I am totally agree with your oppinion.this blog post is very encouraging to people who want to know these topics.
Episode #177: Model Versioning
63. abercrombie london Aug 04, 2010 at 00:15Wish there’s a way out for all of us, is there? I hope so.
Episode #177: Model Versioning
64. wholesale new era hats Aug 20, 2010 at 20:25I really liked your article and I shared with my friends in my facebook account ..
I gave my site a few examples below. If you appreciate my comments in you enter.
Episode #177: Model Versioning
65. Nike Sb Dunks Aug 20, 2010 at 22:53Thanks for the code. Good article, Each and every point is good enough. I really enjoy watching the RailsCasts. I think type of site that is useful in sharing information and it is important to share.
Episode #177: Model Versioning
66. PDF to Images Converter Aug 24, 2010 at 23:13Some times, to a certain need, we have to convert PDF to image for enjoyment.
Episode #177: Model Versioning
67. christian louboutin simple pump Aug 25, 2010 at 00:36That is a idea, I am agree with the opinions of this articles about
Episode #177: Model Versioning
68. Wholesale Electronics Aug 25, 2010 at 01:40Discount Wholesale Electronics, Wholesale Cell Phones, Electronic Gadgets and More from the Best Dropship Wholesaler
Episode #177: Model Versioning
69. louis vuitton shoes Aug 26, 2010 at 21:14Thanks for sharing your article. I really enjoyed it. I put a link to my site to here so other people can read it. My readers have about the same interets
Episode #177: Model Versioning
70. louis vuitton shoes Aug 26, 2010 at 23:22Thanks for sharing your article. I really enjoyed it. I put a link to my site to here so other people can read it. My readers have about the same interets
Episode #177: Model Versioning
71. wholesale Keyboard Aug 30, 2010 at 20:30thanks for your sharing, it is so nice and i like it very much.
Episode #177: Model Versioning
72. snow boots Aug 30, 2010 at 20:49You can even lump a whole bunch of changes into a single changelist so that you can later undo them all at once later if need be...






