vestal_versions
vestal_versions copied to clipboard
Recent issue with Rails3
Hi,
I'm using rails3 and vestal_versions for 3 months. Everything was fine until today. After a "bundle install" and an update of ActiveRecord, vestal_version crashs.
With rails i got this message : ActiveRecord::DangerousAttributeError: changes is defined by ActiveRecord
With the console, the message is the next : ActiveRecord::DangerousAttributeError: changes is defined by ActiveRecord
The probleme is the presence of the changes column into the vestal_versions model. It could be wisely to rename the column to don't interfer with the behavior of rails3 and ActiveReccord .
Thanks for fixing the issue :)
Yes, that's the problem: the versions table has a column name called changes and Rails does not allow an attribute with such name. Would it be possible to rename it to, say, modifications?
I can confirm this is still an issue (Rails 3.0.0.rc).
i can also confirm this is still an issue (Rails 3.0.0.rc)
Any plans to resolve?
Actually, this problem is already solved on many forks (including one I did). I suggest you to use the Adam Cooper's fork: http://github.com/adamcooper/vestal_versions/ I really don't know what happened to the maintainer of this project, Steve Richert, but it seems to be discontinued now. =/
@lailsonbm love it, thank you! You just made a newbie's day.
@lailsonbm Do you know if this forked version supports the updated_by?
In my: def update @book = Book.find(params[:id], :updated_by => current_user) end
I'm getting the following error: "Unknown key(s): updated_by"
Scratch that, I'm using:
def update @book = Book.find(params[:id]) if @book.update_attributes(params[:book].merge(:updated_by => current_user)) . . . end
The book is updating and a version is being saved but not with any updated_by details, the one I need is user_id