ruby on rails - Rails3 ActiveRecord Transactions after_commit on multiple actions -


according the documentation can define same method executed after commit of type create or update:

after_commit :do_foo_bar, :on [:create, :update] 

well, code results in parsing error me:

can't convert symbol integer

i change this:

after_commit :do_foo_bar, :on => [:create, :update] 

i no errors, nothing happens! further investigation @ logs show me silent , strange error:

/home/nuno/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:404: syntax error, unexpected '[', expecting tstring_content or tstring_dbeg or tstring_dvar or tstring_end ...(transaction_include_action?(:[:create, :update])) ...                               ^ /home/nuno/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:412: syntax error, unexpected keyword_end, expecting ')' /home/nuno/.rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:413: syntax error, unexpected $end, expecting ')' redirected http://localhost:3000/people/1 completed 302 found in 7491ms (activerecord: 410.6ms) 

how can this?

i think version of rails using not supporting feature on callbacks. check feature request below

https://github.com/rails/rails/pull/9356


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -