mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 11:41:45 +08:00
Drop Rails3 support
This commit is contained in:
@ -33,24 +33,13 @@ else
|
||||
# Outside of test mode, use after_commit
|
||||
class DiscourseObserver < ActiveRecord::Observer
|
||||
def after_commit(model)
|
||||
if rails4?
|
||||
if model.send(:transaction_include_any_action?, [:create])
|
||||
after_create_delegator(model)
|
||||
end
|
||||
|
||||
if model.send(:transaction_include_any_action?, [:destroy])
|
||||
after_destroy_delegator(model)
|
||||
end
|
||||
else
|
||||
if model.send(:transaction_include_action?, :create)
|
||||
after_create_delegator(model)
|
||||
end
|
||||
|
||||
if model.send(:transaction_include_action?, :destroy)
|
||||
after_destroy_delegator(model)
|
||||
end
|
||||
if model.send(:transaction_include_any_action?, [:create])
|
||||
after_create_delegator(model)
|
||||
end
|
||||
|
||||
if model.send(:transaction_include_any_action?, [:destroy])
|
||||
after_destroy_delegator(model)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user