{"comment":{"created_at":"2011-10-20T01:36:13Z","body":"Pull request merged, thanks for working on this!","updated_at":"2011-10-20T01:36:13Z","url":"https://api.github.com/repos/jcasimir/draper/issues/comments/2463587","id":2463587,"user":{"avatar_url":"https://secure.gravatar.com/avatar/039547def8be2e50f7dc4a1beb9fecaa?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"039547def8be2e50f7dc4a1beb9fecaa","url":"https://api.github.com/users/jcasimir","id":43102,"login":"jcasimir"}},"action":"created","issue":{"number":46,"created_at":"2011-10-13T10:24:22Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"I've run into some problems when accessing `session` in a decorator method:\r\n\r\nA basic test controller:\r\n\r\n```\r\nclass TestController < ...\r\n   def test_page\r\n      session[:test] ||= 0\r\n      session[:test] += 1\r\n      .. \r\n   end\r\nend\r\n```\r\n\r\nWith a decorator:\r\n\r\n```\r\nclass TestDecorator < ...\r\n  def test\r\n     h.session[:test]\r\n  end\r\nend\r\n```\r\n\r\nIn a view:\r\n\r\n```\r\nActual session value: <%= session[:test] %>\r\nDecorator value: <%= @decorator.test %>\r\n```\r\n\r\nThe first page load displays the same value, but afterwards the value returned by the decorator isn't updated as the session value changes.","comments":4,"title":"Accessing session from Decorator","updated_at":"2011-10-20T01:36:13Z","url":"https://api.github.com/repos/jcasimir/draper/issues/46","id":1898918,"assignee":null,"milestone":null,"closed_at":"2011-10-20T01:36:13Z","user":{"avatar_url":"https://secure.gravatar.com/avatar/aa52c36976ef60f237e4aa5e386e36f8?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"aa52c36976ef60f237e4aa5e386e36f8","url":"https://api.github.com/users/pfeiffer","id":195925,"login":"pfeiffer"},"html_url":"https://github.com/jcasimir/draper/issues/46","labels":[],"state":"closed"},"legacy":{"issue_id":1898918,"comment_id":2463587}}