Skip to content

Commit

Permalink
Merge pull request maxdemarzi#101 from vsamaco/dev
Browse files Browse the repository at this point in the history
Fixes validations for relationships with empty attributes
  • Loading branch information
vsamaco committed Jan 24, 2014
2 parents d335cf4 + 5399749 commit 5dfbbc9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/deja/schema_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,15 @@ def inspect_attributes

def inspect_validations
validators.inject({}) do |memo, validator|
validator.attributes.each do |attr|
memo[attr] ||= {}
memo[attr][validator.kind] = validator.options
if validator.respond_to? :attributes
validator.attributes.each do |attr|
memo[attr] ||= {}
memo[attr][validator.kind] = validator.options
end
memo
else
memo
end
memo
end
end
end
Expand Down

0 comments on commit 5dfbbc9

Please sign in to comment.