Method: DataMapper::Model.append_inclusions

Defined in:
lib/dm-core/model.rb

.append_inclusions(*inclusions) ⇒ Boolean

Appends a module for inclusion into the model class after Resource.

This is a useful way to extend Resource while still retaining a self.included method.

Parameters:

  • inclusions (Module)

    the module that is to be appended to the module after Resource

Returns:

  • (Boolean)

    true if the inclusions have been successfully appended to the list



147
148
149
150
151
152
153
154
155
156
# File 'lib/dm-core/model.rb', line 147

def self.append_inclusions(*inclusions)
  extra_inclusions.concat inclusions

  # Add the inclusion to existing descendants
  descendants.each do |model|
    inclusions.each { |inclusion| model.send :include, inclusion }
  end

  true
end