Permalink
Browse files

Fix issue where an association cycle is detected incorrectly, bump ve…

…rsion to 1.2.2

This is a one line change that pops the loading stack when the object
already exists in the database, so if later on the object needs to be
loaded again, it won't detect a cycle (since there is no cycle).
  • Loading branch information...
1 parent 5d4464b commit 3566588c5aee5fe075e8d7eb5beecc84fedeff5f @jeremyevans committed May 7, 2009
Showing with 2 additions and 1 deletion.
  1. +1 −1 fixture_dependencies.gemspec
  2. +1 −0 lib/fixture_dependencies.rb
View
2 fixture_dependencies.gemspec
@@ -1,6 +1,6 @@
spec = Gem::Specification.new do |s|
s.name = "fixture_dependencies"
- s.version = "1.2.1"
+ s.version = "1.2.2"
s.author = "Jeremy Evans"
s.email = "code@jeremyevans.net"
s.platform = Gem::Platform::RUBY
View
1 lib/fixture_dependencies.rb
@@ -135,6 +135,7 @@ def use(record, loading = [], procs = {})
# return if object has already been loaded into the database
if existing_obj = model_method(:model_find_by_pk, mtype, model, attributes[model.primary_key.to_sym])
puts "#{spaces}using #{record}: already in database" if verbose > 2
+ loading.pop
return existing_obj
end
obj = model.new

0 comments on commit 3566588

Please sign in to comment.