vestal_versions icon indicating copy to clipboard operation
vestal_versions copied to clipboard

Model associated are not reloaded

Open carlesso opened this issue 14 years ago • 0 comments

First of all, thanks a lot for the great gem, very useful an easy to use...

I've a little problem versioning models which have relations. When I'm in a view displaying all the history of an istance I write:

<% @design.versions.each do |v| %> <% @design.revert_to(v.number) %> <%= render :partial => "state", :locals => {:state => v} %> <% end %>

This couse my @design fields to have the correct attribute, but @design belogns to client, so the client_id field is correct, but @design.client is the old one. What I had to do is:

<% @design.versions.each do |v| %> <% @design.revert_to(v.number) %> <% @design.client.reload %> <%= render :partial => "state", :locals => {:state => v} %> <% end %>

Which works well, but I was wondering if it can be done somewhere in the gem itself!

Again. thanks for the great work!

carlesso avatar May 18 '10 12:05 carlesso