Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Work with Sequel 3.10.0+ one_to_one associations, bump version to 1.2.5

  • Loading branch information...
commit 3ca5decbe2ae4fb7d8538e586c504dbefb44fe28 1 parent 9c0fae9
@jeremyevans authored
View
2  fixture_dependencies.gemspec
@@ -1,6 +1,6 @@
spec = Gem::Specification.new do |s|
s.name = "fixture_dependencies"
- s.version = "1.2.4"
+ s.version = "1.2.5"
s.author = "Jeremy Evans"
s.email = "code@jeremyevans.net"
s.platform = Gem::Platform::RUBY
View
6 lib/fixture_dependencies/sequel.rb
@@ -2,7 +2,11 @@ class << FixtureDependencies
private
def add_associated_object_S(reflection, attr, object, assoc)
- object.send("add_#{attr.to_s.singularize}", assoc) unless object.send(attr).include?(assoc)
+ if reflection[:type] == :one_to_one
+ object.send("#{reflection[:name]}=", assoc)
+ else
+ object.send("add_#{attr.to_s.singularize}", assoc) unless object.send(attr).include?(assoc)
+ end
end
def model_find_S(model, pk)
Please sign in to comment.
Something went wrong with that request. Please try again.