Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Conditionally add the #adjust method to the DO adapter is it's being …

…used
  • Loading branch information...
commit aa8fe5cb290647cb52b7255a2a61e8b5a0cc3e11 1 parent 7812873
@dkubb dkubb authored
Showing with 14 additions and 2 deletions.
  1. +14 −2 lib/dm-adjust/adapters/data_objects_adapter.rb
View
16 lib/dm-adjust/adapters/data_objects_adapter.rb
@@ -1,6 +1,6 @@
module DataMapper
module Adapters
- class DataObjectsAdapter < AbstractAdapter
+ module DataObjectsAdapterAdjust
def adjust(attributes, collection)
query = collection.query
@@ -44,6 +44,18 @@ def set_adjustment_statement(properties)
end # module SQL
include SQL
- end # class DataObjectsAdapter
+ end # module DataObjectsAdapterAdjust
+
+ extendable do
+ # @api private
+ def const_added(const_name)
+ if const_name == :DataObjectsAdapter
+ DataObjectsAdapter.send(:include, DataObjectsAdapterAdjust)
+ end
+
+ super
+ end
+ end
+
end # module Adapters
end # module DataMapper

0 comments on commit aa8fe5c

Please sign in to comment.
Something went wrong with that request. Please try again.