vestal_versions icon indicating copy to clipboard operation
vestal_versions copied to clipboard

Recent issue with Rails3

Open arkan opened this issue 14 years ago • 8 comments

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 :)

arkan avatar May 11 '10 17:05 arkan

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?

lailsonbm avatar Jun 21 '10 00:06 lailsonbm

I can confirm this is still an issue (Rails 3.0.0.rc).

bensie avatar Jul 29 '10 17:07 bensie

i can also confirm this is still an issue (Rails 3.0.0.rc)

tricomsol avatar Aug 18 '10 17:08 tricomsol

Any plans to resolve?

bhellman1 avatar Sep 11 '10 18:09 bhellman1

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 avatar Sep 11 '10 22:09 lailsonbm

@lailsonbm love it, thank you! You just made a newbie's day.

bhellman1 avatar Sep 11 '10 23:09 bhellman1

@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"

bhellman1 avatar Sep 12 '10 17:09 bhellman1

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

bhellman1 avatar Sep 12 '10 17:09 bhellman1