We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here is my code: http://pastie.org/456077 The first time i run it, it goes ok. The second time it blows up when i add the event to the list.
It seems the second time it passes the "if record['polymorphic_parent_class']" in base.rb. The first time it doesnt enter the if.
can't dup NilClass /Users/magmarules/Sites/Probono/vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs/base.rb:14:in dup' /Users/magmarules/Sites/Probono/vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs/base.rb:14:ininstantiate' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:635:in find_by_sql' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:635:incollect!' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:635:in find_by_sql' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:1490:infind_every' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:589:in find' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/associations/has_many_through_association.rb:73:infind_target' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_collection.rb:344:in load_target' /Users/magmarules/Sites/Probono/vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs/association.rb:19:in<<' /Users/magmarules/Sites/Probono/lib/tasks/import.rake:222 /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in call' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:inexecute' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in each' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:inexecute' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in invoke_with_call_chain' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:insynchronize' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in invoke_with_call_chain' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:ininvoke' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2027:in invoke_task' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:intop_level' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in each' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:intop_level' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in standard_exception_handling' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:1999:intop_level' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:1977:in run' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:instandard_exception_handling' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in run' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/bin/rake:31 /usr/bin/rake:19:inload' /usr/bin/rake:19
dup' /Users/magmarules/Sites/Probono/vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs/base.rb:14:in
find_by_sql' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:635:in
find_by_sql' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:1490:in
find' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/associations/has_many_through_association.rb:73:in
load_target' /Users/magmarules/Sites/Probono/vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs/association.rb:19:in
call' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in
each' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in
invoke_with_call_chain' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in
invoke_with_call_chain' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:in
invoke_task' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in
each' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in
standard_exception_handling' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:1999:in
run' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in
run' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/bin/rake:31 /usr/bin/rake:19:in
The text was updated successfully, but these errors were encountered:
Sorry my bad, i have the object named event and the relation named events and that was the problem.
Sorry, something went wrong.
No branches or pull requests
Here is my code: http://pastie.org/456077
The first time i run it, it goes ok. The second time it blows up when i add the event to the list.
It seems the second time it passes the "if record['polymorphic_parent_class']" in base.rb. The first time it doesnt enter the if.
can't dup NilClass
/Users/magmarules/Sites/Probono/vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs/base.rb:14:in
dup' /Users/magmarules/Sites/Probono/vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs/base.rb:14:in
instantiate'/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:635:in
find_by_sql' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:635:in
collect!'/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:635:in
find_by_sql' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:1490:in
find_every'/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:589:in
find' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/associations/has_many_through_association.rb:73:in
find_target'/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_collection.rb:344:in
load_target' /Users/magmarules/Sites/Probono/vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs/association.rb:19:in
<<'/Users/magmarules/Sites/Probono/lib/tasks/import.rake:222
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in
call' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in
execute'/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in
each' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in
execute'/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in
invoke_with_call_chain' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in
synchronize'/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in
invoke_with_call_chain' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:in
invoke'/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2027:in
invoke_task' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in
top_level'/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in
each' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in
top_level'/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in
standard_exception_handling' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:1999:in
top_level'/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:1977:in
run' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in
standard_exception_handling'/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in
run' /Library/Ruby/Gems/1.8/gems/rake-0.8.4/bin/rake:31 /usr/bin/rake:19:in
load'/usr/bin/rake:19
The text was updated successfully, but these errors were encountered: