views:

65

answers:

1

I'm using vestal_versions 1.0.2 and rails 2.3.8

I'm trying to associate a user with changes made to models as shown in the the documentation:

@user.update_attributes(:last_name => "Jobs", :updated_by => "Tyler")
@user.versions.last.user # => "Tyler"

Documentation: http://github.com/laserlemon/vestal_versions

After calling @user.save the user "Tyler" is NOT saved in versions table used by vestal_versions.

Has anybody seen this? Is this a bug?

A: 

There seems to be a bug with mass assignment and the updated_by parameter.

My workaround looks like this:

@my_model.updated_by = current_user
@my_model.save

I added the assignment before every save or update_attributes call in the controllers.

Justin Tanner