开发者

Vestal Versions -

I'm using the Vestal Version Fork here for Rails 3 support: http://github.com/adamcooper/vestal_versions/

The issue I'm having is that the updated_by => current_user is not storing in the versions table on update.

def update 
        @book = Book.find(params[:id]) 
  respond_to do |format| 
    if @book.update_attributes(params[:book].merge(:updated_by => current_user)) 
      format.html { redirect_to(@book, :notice => 'Book was 
successfully updated.') } 
      format.xml  { head :ok } 
    else 
      format.html { render :action => "edit" } 
      format.xml  { render :xml => @book.errors, :sta开发者_StackOverflow社区tus => :unprocessable_entity } 
    end 
  end 
end 

I checked the logs, there is no error, Rails is INSERTING NULLs in the DB for the user fields, the one I need to populate is user_id

Ideas?

Thanks


Add the following to your model class should make it work

attr_accessible  :updated_by
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜