Thursday, 12 September 2013

Set attribute on model callback with rails 4

Set attribute on model callback with rails 4

sorry for my english...
I am trying set the user id of my model usign the before_create callback,
but I am not getting it.
before_create :set_user_id
def set_user_id
self.user_id = 1
end
user_id is nil, Some help?

No comments:

Post a Comment