Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of git@github.com:sam/dm-core

  • Loading branch information...
commit d90102695dcbe409b56289347ce01221f1309234 2 parents 328fc55 + e222cd7
David Leal david authored
8 lib/data_mapper/associations/one_to_many.rb
View
@@ -51,7 +51,13 @@ class Instance
extend Forwardable
def_delegators :children, :[], :size, :length, :first, :last
-
+
+ include Enumerable
+
+ def each
+ children.each { |child| yield(child) }
+ end
+
def children
@children_resources ||= @children_loader.call
end
2  lib/data_mapper/property.rb
View
@@ -261,7 +261,7 @@ def inspect
def initialize(model, name, type, options)
raise ArgumentError, "+model+ is a #{model.class}, but is not a type of Resource" unless Resource === model
raise ArgumentError, "+name+ should be a Symbol, but was #{name.class}" unless Symbol === name
- raise ArgumentError, "+type+ was #{type.class}, which is not a supported type: #{TYPES * ', '}" unless TYPES.include?(type) || (type.respond_to?(:ancestors) && type.ancestors.include?(DataMapper::Type) && TYPES.include?(type.primitive))
+ raise ArgumentError, "+type+ was #{type.inspect}, which is not a supported type: #{TYPES * ', '}" unless TYPES.include?(type) || (type.respond_to?(:ancestors) && type.ancestors.include?(DataMapper::Type) && TYPES.include?(type.primitive))
if (unknown_options = options.keys - PROPERTY_OPTIONS).any?
raise ArgumentError, "options contained unknown keys: #{unknown_options * ', '}"
Please sign in to comment.
Something went wrong with that request. Please try again.