{"action":"created","issue":{"url":"https://api.github.com/repos/benedikt/mongoid-tree/issues/36","repository_url":"https://api.github.com/repos/benedikt/mongoid-tree","labels_url":"https://api.github.com/repos/benedikt/mongoid-tree/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/benedikt/mongoid-tree/issues/36/comments","events_url":"https://api.github.com/repos/benedikt/mongoid-tree/issues/36/events","html_url":"https://github.com/benedikt/mongoid-tree/issues/36","id":8120010,"number":36,"title":"undefined method `parent_ids' for nil:NilClass","user":{"login":"adpande","id":128881,"avatar_url":"https://avatars0.githubusercontent.com/u/128881?v=4","gravatar_id":"","url":"https://api.github.com/users/adpande","html_url":"https://github.com/adpande","followers_url":"https://api.github.com/users/adpande/followers","following_url":"https://api.github.com/users/adpande/following{/other_user}","gists_url":"https://api.github.com/users/adpande/gists{/gist_id}","starred_url":"https://api.github.com/users/adpande/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adpande/subscriptions","organizations_url":"https://api.github.com/users/adpande/orgs","repos_url":"https://api.github.com/users/adpande/repos","events_url":"https://api.github.com/users/adpande/events{/privacy}","received_events_url":"https://api.github.com/users/adpande/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2012-11-05T21:35:26Z","updated_at":"2017-11-15T08:57:59Z","closed_at":"2013-05-08T10:52:58Z","author_association":"NONE","body":"Using mongoid (3.0.9) \n# Using mongoid-tree (1.0.1) \n\nRails Method is throwing  \n\n def rebuild_path\n\n```\nMassTopic.all.each do |topic|\n  puts \"Buliding Path: \" + topic.name\n  topic.path = topic.ancestors_and_self.collect{ |item| \"#{item.name}||#{item.id}\"}.join(\"$$\")\n\n  topic.save\n\nend\nrespond_to do |format|\n  format.html { render :text => \"Done\"}\nend\n```\n\n  end\n# \n\n[2012-11-05 21:28:24] ERROR NoMethodError: undefined method `parent_ids' for nil:NilClass\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/mongoid-tree-1.0.1/lib/mongoid/tree.rb:420:in`rearrange'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/mongoid-tree-1.0.1/lib/mongoid/tree.rb:95:in `block (3 levels) in <module:Tree>'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:403:in`_run__2708834019810802991__rearrange__21207758887223718__callbacks'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in`_run_rearrange_callbacks'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/mongoid-3.0.9/lib/mongoid/callbacks.rb:114:in`run_callbacks'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/mongoid-tree-1.0.1/lib/mongoid/tree.rb:95:in `block (2 levels) in <module:Tree>'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:407:in`_run__2708834019810802991__validation__21207758887223718__callbacks'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in`_run_validation_callbacks'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/mongoid-3.0.9/lib/mongoid/callbacks.rb:114:in`run_callbacks'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activemodel-3.2.8/lib/active_model/validations/callbacks.rb:53:in `run_validations!'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activemodel-3.2.8/lib/active_model/validations.rb:194:in`valid?'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/mongoid-3.0.9/lib/mongoid/validations.rb:78:in `valid?'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activemodel-3.2.8/lib/active_model/validations.rb:202:in`invalid?'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/mongoid-3.0.9/lib/mongoid/persistence/modification.rb:22:in `prepare'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/mongoid-3.0.9/lib/mongoid/persistence/operations/update.rb:43:in`persist'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/mongoid-3.0.9/lib/mongoid/persistence.rb:139:in `update'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/mongoid-3.0.9/lib/mongoid/persistence.rb:81:in`save'\n    /home/ec2-user/apps/testtree/app/controllers/homes_controller.rb:48:in `block in rebuild_path'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/mongoid-3.0.9/lib/mongoid/contextual/mongo.rb:644:in`yield_document'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/mongoid-3.0.9/lib/mongoid/contextual/mongo.rb:134:in `block (2 levels) in each'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/moped-1.2.7/lib/moped/query.rb:78:in`block in each'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/moped-1.2.7/lib/moped/cursor.rb:26:in `block in each'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/moped-1.2.7/lib/moped/cursor.rb:26:in`each'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/moped-1.2.7/lib/moped/cursor.rb:26:in `each'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/moped-1.2.7/lib/moped/query.rb:77:in`each'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/moped-1.2.7/lib/moped/query.rb:77:in `each'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/mongoid-3.0.9/lib/mongoid/contextual/mongo.rb:133:in`block in each'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/mongoid-3.0.9/lib/mongoid/contextual/mongo.rb:603:in `selecting'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/mongoid-3.0.9/lib/mongoid/contextual/mongo.rb:132:in`each'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/mongoid-3.0.9/lib/mongoid/contextual.rb:18:in `each'\n    /home/ec2-user/apps/testtree/app/controllers/homes_controller.rb:37:in`rebuild_path'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:4:in `send_action'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in`process_action'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:10:in `process_action'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:18:in`block in process_action'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:414:in `_run__1342489903615171212__process_action__184040716227805675__callbacks'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in`__run_callback'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in`run_callbacks'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:17:in `process_action'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_controller/metal/rescue.rb:29:in`process_action'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in`block in instrument'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in`instrument'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:29:in `process_action'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_controller/metal/params_wrapper.rb:207:in`process_action'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:121:in `process'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:45:in`process'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_controller/metal.rb:203:in `dispatch'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_controller/metal/rack_delegation.rb:14:in`dispatch'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_controller/metal.rb:246:in `block in action'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:in`call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:36:in`call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/journey-1.0.4/lib/journey/router.rb:56:in`each'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:600:in`call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/mongoid-3.0.9/lib/rack/mongoid/middleware/identity_map.rb:33:in `block in call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/mongoid-3.0.9/lib/mongoid/unit_of_work.rb:39:in`unit_of_work'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/mongoid-3.0.9/lib/rack/mongoid/middleware/identity_map.rb:33:in `call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/sass-3.2.1/lib/sass/plugin/rack.rb:54:in`call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/rack-1.4.1/lib/rack/etag.rb:23:in`call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/rack-1.4.1/lib/rack/conditionalget.rb:25:in `call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_dispatch/middleware/head.rb:14:in`call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_dispatch/middleware/params_parser.rb:21:in `call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_dispatch/middleware/flash.rb:242:in`call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in`call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_dispatch/middleware/cookies.rb:339:in `call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:28:in`block in call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `_run__1883085759501563229__call__21207758887223718__callbacks'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in`__run_callback'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in`run_callbacks'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:27:in `call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_dispatch/middleware/remote_ip.rb:31:in`call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_dispatch/middleware/show_exceptions.rb:56:in`call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/rack/logger.rb:26:in `call_app'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/rack/logger.rb:16:in`call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_dispatch/middleware/request_id.rb:22:in `call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in`call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/cache/strategy/local_cache.rb:72:in`call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in`call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/engine.rb:479:in `call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/application.rb:223:in`call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/rack-1.4.1/lib/rack/content_length.rb:14:in `call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/rack/log_tailer.rb:17:in`call'\n    /home/ec2-user/.rvm/gems/ruby-1.9.3-p286/gems/rack-1.4.1/lib/rack/handler/webrick.rb:59:in `service'\n    /home/ec2-user/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/webrick/httpserver.rb:138:in`service'\n    /home/ec2-user/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'\n    /home/ec2-user/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/webrick/server.rb:191:in`block in start_thread'\n"},"comment":{"url":"https://api.github.com/repos/benedikt/mongoid-tree/issues/comments/344527391","html_url":"https://github.com/benedikt/mongoid-tree/issues/36#issuecomment-344527391","issue_url":"https://api.github.com/repos/benedikt/mongoid-tree/issues/36","id":344527391,"user":{"login":"benedikt","id":9696,"avatar_url":"https://avatars0.githubusercontent.com/u/9696?v=4","gravatar_id":"","url":"https://api.github.com/users/benedikt","html_url":"https://github.com/benedikt","followers_url":"https://api.github.com/users/benedikt/followers","following_url":"https://api.github.com/users/benedikt/following{/other_user}","gists_url":"https://api.github.com/users/benedikt/gists{/gist_id}","starred_url":"https://api.github.com/users/benedikt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benedikt/subscriptions","organizations_url":"https://api.github.com/users/benedikt/orgs","repos_url":"https://api.github.com/users/benedikt/repos","events_url":"https://api.github.com/users/benedikt/events{/privacy}","received_events_url":"https://api.github.com/users/benedikt/received_events","type":"User","site_admin":false},"created_at":"2017-11-15T08:57:59Z","updated_at":"2017-11-15T08:57:59Z","author_association":"OWNER","body":"@prcongithub This is most likely a problem with the data and not a problem with the code. Can you share more details of your particular case?"}}
{"actor":{"display_login":"benedikt"}}