What's the proper way to override Rails ActiveRecord creation/deletion events in a subclass, such as

Posted by Paul Gibler on Stack Overflow See other posts from Stack Overflow or by Paul Gibler
Published on 2010-05-26T19:26:46Z Indexed on 2010/05/27 2:51 UTC
Read the original article Hit count: 320

Hi, I have a class heirarchy as follows:

class A < ActiveRecord::Base
  after_create { |i|
    #do something
  }
end

class B < A
  after_create { |i|
    #do something else after what A did
  }
end

I want to have A's behavior performed in B when after_create is invoked, but I am not sure of the proper way to write the after_create method in B.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby