activerecord - Pass custom argument to rails event model callbacks? -


very simple question unable figure out. possible like:

  after_create    :log_activity(my_var) 

so write 1 method handles actions ( destroy,save,update)?

no, not possible pass variables callback method. reason simple callback methods called rails stack , when call callback method, did't know pass in callback method.


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -