{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/18659","labels_url":"https://api.github.com/repos/rails/rails/issues/18659/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/18659/comments","events_url":"https://api.github.com/repos/rails/rails/issues/18659/events","html_url":"https://github.com/rails/rails/issues/18659","id":55298236,"number":18659,"title":"AR: define_attribute_methods is not fired when record is loaded from marshal","user":{"login":"printercu","id":1144890,"avatar_url":"https://avatars.githubusercontent.com/u/1144890?v=3","gravatar_id":"","url":"https://api.github.com/users/printercu","html_url":"https://github.com/printercu","followers_url":"https://api.github.com/users/printercu/followers","following_url":"https://api.github.com/users/printercu/following{/other_user}","gists_url":"https://api.github.com/users/printercu/gists{/gist_id}","starred_url":"https://api.github.com/users/printercu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/printercu/subscriptions","organizations_url":"https://api.github.com/users/printercu/orgs","repos_url":"https://api.github.com/users/printercu/repos","events_url":"https://api.github.com/users/printercu/events{/privacy}","received_events_url":"https://api.github.com/users/printercu/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-23T16:01:16Z","updated_at":"2015-01-23T21:57:09Z","closed_at":"2015-01-23T21:57:09Z","body":"When loading marshaled record `define_attribute_methods` is not fired. So if there was no calls to `.new` before, the record wont have attribute methods. I don't even know if this can be fixed in rails, or this is ruby's issue (cause there is no callbacks after load in marshal).\r\n\r\nThere is `marshal_load` method, which can be defined in model, but the problem that there is no superclass method for it.\r\n\r\nFor now I've workaround: firing `define_attribute_methods` manually right before `Marshal.load`.\r\n\r\nAny ideas? Thanks in advance!\r\n\r\ncc @tenderlove "},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/71273418","html_url":"https://github.com/rails/rails/issues/18659#issuecomment-71273418","issue_url":"https://api.github.com/repos/rails/rails/issues/18659","id":71273418,"user":{"login":"sgrif","id":1529387,"avatar_url":"https://avatars.githubusercontent.com/u/1529387?v=3","gravatar_id":"","url":"https://api.github.com/users/sgrif","html_url":"https://github.com/sgrif","followers_url":"https://api.github.com/users/sgrif/followers","following_url":"https://api.github.com/users/sgrif/following{/other_user}","gists_url":"https://api.github.com/users/sgrif/gists{/gist_id}","starred_url":"https://api.github.com/users/sgrif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgrif/subscriptions","organizations_url":"https://api.github.com/users/sgrif/orgs","repos_url":"https://api.github.com/users/sgrif/repos","events_url":"https://api.github.com/users/sgrif/events{/privacy}","received_events_url":"https://api.github.com/users/sgrif/received_events","type":"User","site_admin":false},"created_at":"2015-01-23T21:57:09Z","updated_at":"2015-01-23T21:57:09Z","body":"Duplicate of https://github.com/rails/rails/issues/18339"}}