module Rails::Initializable

def self.included(base) # :nodoc:

:nodoc:
def self.included(base) # :nodoc:
  base.extend ClassMethods
end

def initializers

def initializers
  @initializers ||= self.class.initializers_for(self)
end

def run_initializers(group = :default, *args)

def run_initializers(group = :default, *args)
  return if instance_variable_defined?(:@ran)
  initializers.tsort_each do |initializer|
    initializer.run(*args) if initializer.belongs_to?(group)
  end
  @ran = true
end