{"action":"created","issue":{"url":"https://api.github.com/repos/dblock/grape-with-roar/issues/5","labels_url":"https://api.github.com/repos/dblock/grape-with-roar/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/dblock/grape-with-roar/issues/5/comments","events_url":"https://api.github.com/repos/dblock/grape-with-roar/issues/5/events","html_url":"https://github.com/dblock/grape-with-roar/issues/5","id":54100259,"number":5,"title":"I can't upgrade to grape 0.10","user":{"login":"eguneys","id":3844764,"avatar_url":"https://avatars.githubusercontent.com/u/3844764?v=3","gravatar_id":"","url":"https://api.github.com/users/eguneys","html_url":"https://github.com/eguneys","followers_url":"https://api.github.com/users/eguneys/followers","following_url":"https://api.github.com/users/eguneys/following{/other_user}","gists_url":"https://api.github.com/users/eguneys/gists{/gist_id}","starred_url":"https://api.github.com/users/eguneys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eguneys/subscriptions","organizations_url":"https://api.github.com/users/eguneys/orgs","repos_url":"https://api.github.com/users/eguneys/repos","events_url":"https://api.github.com/users/eguneys/events{/privacy}","received_events_url":"https://api.github.com/users/eguneys/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-12T20:08:22Z","updated_at":"2015-01-12T21:57:56Z","closed_at":null,"body":"I use this project as a template, except I use `activerecord`:\r\n\r\n    get 'articles' do\r\n      # ActiveRecord::Relation\r\n      articles = Articles.all\r\n      # articles.respond_to?('merge') == true\r\n      present articles, with: ArticlesPresenter\r\n    end\r\n\r\nThis crashes because of this [change](https://github.com/intridea/grape/pull/784/files).\r\n\r\nBecause the `opts` parameter is empty:\r\n\r\n    link :self do |opts|\r\n      \"#{base_url(opts)}/api\"\r\n    end\r\n\r\nThough it's not a problem for this project because `splines` is an array and it doesn't `respond_to?('merge')`.\r\n\r\n    get do\r\n      splines = Acme::Models::Spline.all\r\n      present Kaminari.paginate_array(splines).page(params[:page]).per(params[:size]), with: Acme::Api::Presenters::SplinesPresenter\r\n    end\r\n\r\nI can't understand further, please fix this, here's a full stack trace:\r\n\r\n```bash\r\nNoMethodError:\r\nundefined method `[]' for nil:NilClass\r\nShared Example Group: \"paginated resource\" called from ./spec/app/api/article_spec.rb:4\r\n# ./app/presenters/paginated_presenter.rb:33:in `request_url'\r\n# ./app/presenters/paginated_presenter.rb:16:in `block in <module:PaginatedPresenter>'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/roar-1.0.0/lib/roar/hypermedia.rb:80:in `instance_exec'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/roar-1.0.0/lib/roar/hypermedia.rb:80:in `run_link_block'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/roar-1.0.0/lib/roar/hypermedia.rb:68:in `block in compile_links_for'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/roar-1.0.0/lib/roar/hypermedia.rb:66:in `collect'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/roar-1.0.0/lib/roar/hypermedia.rb:66:in `compile_links_for'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/roar-1.0.0/lib/roar/hypermedia.rb:62:in `prepare_links!'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/roar-1.0.0/lib/roar/hypermedia.rb:139:in `block in create_links_definition!'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/uber-0.0.12/lib/uber/options.rb:80:in `instance_exec'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/uber-0.0.12/lib/uber/options.rb:80:in `proc!'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/uber-0.0.12/lib/uber/options.rb:69:in `evaluate_for'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/uber-0.0.12/lib/uber/options.rb:60:in `evaluate'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/representable-2.1.3/lib/representable/binding.rb:107:in `evaluate_option'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/representable-2.1.3/lib/representable/binding.rb:80:in `get'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/representable-2.1.3/lib/representable/binding.rb:37:in `block in compile_fragment'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/representable-2.1.3/lib/representable/binding.rb:100:in `evaluate_option'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/representable-2.1.3/lib/representable/binding.rb:36:in `compile_fragment'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/representable-2.1.3/lib/representable/mapper.rb:64:in `compile_fragment'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/roar-1.0.0/lib/roar/json/hal.rb:64:in `compile_fragment'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/representable-2.1.3/lib/representable/mapper.rb:30:in `serialize_property'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/representable-2.1.3/lib/representable/mapper.rb:22:in `block in serialize'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/representable-2.1.3/lib/representable/mapper.rb:21:in `each'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/representable-2.1.3/lib/representable/mapper.rb:21:in `serialize'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/representable-2.1.3/lib/representable.rb:41:in `create_representation_with'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/representable-2.1.3/lib/representable/hash.rb:35:in `to_hash'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/grape-0.10.1/lib/grape/dsl/inside_route.rb:200:in `merge'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/grape-0.10.1/lib/grape/dsl/inside_route.rb:200:in `present'\r\n# ./app/api/articles.rb:20:in `block in <class:Articles>'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/grape-0.10.1/lib/grape/endpoint.rb:47:in `call'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/grape-0.10.1/lib/grape/endpoint.rb:47:in `block in generate_api_method'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/grape-0.10.1/lib/grape/endpoint.rb:247:in `call'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/grape-0.10.1/lib/grape/endpoint.rb:247:in `run'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/grape-0.10.1/lib/grape/endpoint.rb:195:in `block in call!'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/grape-0.10.1/lib/grape/middleware/base.rb:24:in `call'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/grape-0.10.1/lib/grape/middleware/base.rb:24:in `call!'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/grape-0.10.1/lib/grape/middleware/base.rb:18:in `call'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/grape-0.10.1/lib/grape/middleware/base.rb:24:in `call!'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/grape-0.10.1/lib/grape/middleware/base.rb:18:in `call'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/grape-0.10.1/lib/grape/middleware/error.rb:27:in `block in call!'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/grape-0.10.1/lib/grape/middleware/error.rb:26:in `catch'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/grape-0.10.1/lib/grape/middleware/error.rb:26:in `call!'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/grape-0.10.1/lib/grape/middleware/base.rb:18:in `call'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/rack-1.6.0/lib/rack/head.rb:13:in `call'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/rack-1.6.0/lib/rack/builder.rb:153:in `call'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/grape-0.10.1/lib/grape/endpoint.rb:196:in `call!'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/grape-0.10.1/lib/grape/endpoint.rb:184:in `call'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:152:in `block in call'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:96:in `block in recognize'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:75:in `optimized_each'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:95:in `recognize'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:141:in `call'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:96:in `block in recognize'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:75:in `optimized_each'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:95:in `recognize'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:141:in `call'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/grape-0.10.1/lib/grape/api.rb:102:in `call'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/rack-test-0.6.3/lib/rack/mock_session.rb:30:in `request'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/rack-test-0.6.3/lib/rack/test.rb:244:in `process_request'\r\n# /home/ubuntu/.rvm/gems/ruby-2.1.3/gems/rack-test-0.6.3/lib/rack/test.rb:58:in `get'\r\n# ./spec/app/api/shared_examples/resource.rb:34:in `block (3 levels) in <top (required)>'\r\n```\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dblock/grape-with-roar/issues/comments/69654343","html_url":"https://github.com/dblock/grape-with-roar/issues/5#issuecomment-69654343","issue_url":"https://api.github.com/repos/dblock/grape-with-roar/issues/5","id":69654343,"user":{"login":"dblock","id":542335,"avatar_url":"https://avatars.githubusercontent.com/u/542335?v=3","gravatar_id":"","url":"https://api.github.com/users/dblock","html_url":"https://github.com/dblock","followers_url":"https://api.github.com/users/dblock/followers","following_url":"https://api.github.com/users/dblock/following{/other_user}","gists_url":"https://api.github.com/users/dblock/gists{/gist_id}","starred_url":"https://api.github.com/users/dblock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dblock/subscriptions","organizations_url":"https://api.github.com/users/dblock/orgs","repos_url":"https://api.github.com/users/dblock/repos","events_url":"https://api.github.com/users/dblock/events{/privacy}","received_events_url":"https://api.github.com/users/dblock/received_events","type":"User","site_admin":false},"created_at":"2015-01-12T21:57:56Z","updated_at":"2015-01-12T21:57:56Z","body":"Do you have a branch with all your code changes? Happy to help."}}