diff --git a/app/models/reshare.rb b/app/models/reshare.rb index 869d73351..7e8fac45b 100644 --- a/app/models/reshare.rb +++ b/app/models/reshare.rb @@ -18,7 +18,7 @@ class Reshare < Post end after_commit :on => :create do - self.root.update_reshares_counter + self.root.update_reshares_counter if self.root.present? end after_destroy do diff --git a/config/application.rb b/config/application.rb index b84576c79..4d579a542 100644 --- a/config/application.rb +++ b/config/application.rb @@ -89,5 +89,8 @@ module Diaspora g.template_engine :haml g.test_framework :rspec end + + # Will be default with Rails 5 + config.active_record.raise_in_transactional_callbacks = true end end