.included(model) ⇒ Object

This method is part of a private API.
You should avoid using this method if possible, as it may be removed or be changed in the future.

Makes sure a class gets all the methods when it includes Resource

Note that including this module into an anonymous class will leave the
model descendant tracking mechanism with no possibility to reliably track
the anonymous model across code reloads. This means that
DescendantSet will currently leak memory in scenarios where
anonymous models are reloaded multiple times (as is the case in dm-rails
development mode for example).

#attribute_set(name, value) ⇒ undefinedAlso known as:
[]=

Sets the value of the attribute and marks the attribute as dirty if it has
been changed so that it may be saved. Do not set from instance variables
directly, but use this method. This method handles the lazy loading the
property and returning of defaults if nessesary.

# File 'lib/dm-core/resource.rb', line 328defattributes=(attributes)model=self.modelattributes.eachdo|name,value|casenamewhenString,Symbolifmodel.public_method_defined?(setter="#{name}=")__send__(setter,value)elseraiseArgumentError,"The attribute '#{name}' is not accessible in #{model}"endwhenAssociations::Relationship,Propertyself.persisted_state=persisted_state.set(name,value)endendend

#before_create_hook ⇒ undefined(protected)

This method is part of a private API.
You should avoid using this method if possible, as it may be removed or be changed in the future.

This is accomplished by resetting the Resource key to it's original
value, and then removing all the ivars for properties and relationships.
On the next access of those ivars, the resource will eager load what it
needs. While this is more of a lazy reload, it should result in more
consistent behavior since no cached results will remain from the initial
load.