I canβt access my model attributes in the after_create callback ... it looks like I should have the right?
controller:
@dog = Dog.new(:color => 'brown', :gender => 'male') @dog.user_id = current_user.id @dog.save
Model:
class Dog < ActiveRecord::Base def after_create logger.debug "[DOG CREATED] color:
console: (all is well)
>>Dog.last =>#<Dog id: 1, color: "brown", gender: "male", user_id: 1>
log: (wtf !?)
... [DOG CREATED] color: gender:male user ...
Some of my attributes appear, while others do not! Oh no! Does anyone know what I'm doing wrong? In the past, I have always been able to user after_create this way.
Note. The actual variable names and values ββI used were different, but the methods and code are the same.
source share