Initialize Arguments And Superclass
Join the DZone community and get the full member experience.Join For Free
The rules are
super # passes all arguments super() # passes no arguments super(arg1, arg2) # passes these explicit argumentsSo
class Chunk < ActiveRecord::Base def initialize(*args) @count = 0 super end end cnk = Chunk.create(:letter => ?a)will accept the :letter argument and pass it to ActiveRecord::Base
Opinions expressed by DZone contributors are their own.