{"action":"closed","issue":{"url":"https://api.github.com/repos/apotonick/representable/issues/171","labels_url":"https://api.github.com/repos/apotonick/representable/issues/171/labels{/name}","comments_url":"https://api.github.com/repos/apotonick/representable/issues/171/comments","events_url":"https://api.github.com/repos/apotonick/representable/issues/171/events","html_url":"https://github.com/apotonick/representable/issues/171","id":119841359,"number":171,"title":"Deprecation warnings under 'standard' rails usage","user":{"login":"skippy","id":3746,"avatar_url":"https://avatars.githubusercontent.com/u/3746?v=3","gravatar_id":"","url":"https://api.github.com/users/skippy","html_url":"https://github.com/skippy","followers_url":"https://api.github.com/users/skippy/followers","following_url":"https://api.github.com/users/skippy/following{/other_user}","gists_url":"https://api.github.com/users/skippy/gists{/gist_id}","starred_url":"https://api.github.com/users/skippy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skippy/subscriptions","organizations_url":"https://api.github.com/users/skippy/orgs","repos_url":"https://api.github.com/users/skippy/repos","events_url":"https://api.github.com/users/skippy/events{/privacy}","received_events_url":"https://api.github.com/users/skippy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-02T00:39:08Z","updated_at":"2015-12-02T00:47:13Z","closed_at":"2015-12-02T00:47:13Z","body":"if a rails controller has an equivalent line to this:\r\n\r\n```ruby\r\n  render json: ModelDecorator.new(model)\r\n```\r\n\r\nas of 2.4 this throws the deprecation warning: `[Representable] Mixing user and representable options is deprecated. Please provide your options via :user_options.`  I had no ideal how or where this was coming from as there is only one instance of `:user_options` on the readme.  (though putting a breakpoint in a debug session quickly solved that problem).\r\n\r\nIf you are curious, rails controller adds this by default `#to_json(:prefixes=>[\"[controller_path]\", \"application\"], :template=>\"[object_name]\")` and possibly other things\r\n\r\n\r\nI put 'standard' in quotes as there are many ways to do this in rails, but passing an object that responds to `#to_json` is a common rails pattern.  In this case, it is easy to fix by doing the following:\r\n\r\n```ruby\r\n  render json: ModelDecorator.new(model).to_json\r\n```\r\n\r\nbut if you use Rails ActiveController helpers `respond_to` and `respond_with` you can't do that.  \r\n\r\nI understand the core issue here, where you want to split out control flags used by Representable from user-supplied data.  But I am curious, is it common to pass in representable parameters into a `#to_json` call rather than define it at the property level?\r\n\r\nanyway, I am logging this just in case it is a pain point for others.\r\n"}}