initial commit

This commit is contained in:
2018-01-20 13:02:44 -03:00
commit 203138a969
650 changed files with 19523 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
# This module creates a formalized way to facilitate collection lookups.
# The default convention is that every workflow model has an associated
# collection with it:
# WorkflowInstance::Scenario1::Collection
# WorkflowInstance::Scenario2::Collection
# OwnerInitialization::Scenario1::Collection
# etc...
# But since we should be ready for unforseen circumstances a lookup method
# should be used in stead of a hard namespace lookup.
module Dunlop::CollectionLookup
extend ActiveSupport::Concern
# conveniance and proper code smell implementation to avoid self.class
# calls in places where it does not belong
def collection_class
self.class.collection
end
module ClassMethods
# conveniance and proper code smell implementation to avoid self::Collection
# calls in places where it does not belong
def collection
self::Collection
end
end
end