{"action":"created","issue":{"url":"https://api.github.com/repos/airblade/paper_trail/issues/415","labels_url":"https://api.github.com/repos/airblade/paper_trail/issues/415/labels{/name}","comments_url":"https://api.github.com/repos/airblade/paper_trail/issues/415/comments","events_url":"https://api.github.com/repos/airblade/paper_trail/issues/415/events","html_url":"https://github.com/airblade/paper_trail/issues/415","id":41638600,"number":415,"title":"Support for partial reify/restore","user":{"login":"fabn","id":324213,"avatar_url":"https://avatars.githubusercontent.com/u/324213?v=3","gravatar_id":"","url":"https://api.github.com/users/fabn","html_url":"https://github.com/fabn","followers_url":"https://api.github.com/users/fabn/followers","following_url":"https://api.github.com/users/fabn/following{/other_user}","gists_url":"https://api.github.com/users/fabn/gists{/gist_id}","starred_url":"https://api.github.com/users/fabn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabn/subscriptions","organizations_url":"https://api.github.com/users/fabn/orgs","repos_url":"https://api.github.com/users/fabn/repos","events_url":"https://api.github.com/users/fabn/events{/privacy}","received_events_url":"https://api.github.com/users/fabn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/airblade/paper_trail/labels/Contributions%20welcome","name":"Contributions welcome","color":"bfd4f2"},{"url":"https://api.github.com/repos/airblade/paper_trail/labels/Not%20a%20bug","name":"Not a bug","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-09-01T13:44:07Z","updated_at":"2015-09-05T09:42:54Z","closed_at":null,"body":"I'm using PT in a model with lot of attributes, and I need to track all of them for changes, but I only want to allow some of them being restorable. For instance take this sample class\r\n\r\n```ruby\r\nclass Project < ActiveRecord::Base\r\n  # has attributes name and description\r\n  has_paper_trail\r\n\r\n  include AASM\r\n  aasm column: :state do\r\n    # Valid states for any project\r\n    state :new, initial: true\r\n    state :started\r\n    state :completed\r\n  end\r\nend\r\n```\r\n\r\nIt's useful to track project state changes for auditing but, because of aasm, state field should not be assigned manually, so if I want to restore name and description I'd like to do something like\r\n\r\n```ruby\r\nversion.reify(only: [:name, :description])\r\n```\r\n\r\nIt should be easy to implement this syntax in [`Version#reify`](https://github.com/airblade/paper_trail/blob/master/lib/paper_trail/version_concern.rb#L114)\r\n\r\nWhat do you think? Is it something you're interested in?"},"comment":{"url":"https://api.github.com/repos/airblade/paper_trail/issues/comments/137937607","html_url":"https://github.com/airblade/paper_trail/issues/415#issuecomment-137937607","issue_url":"https://api.github.com/repos/airblade/paper_trail/issues/415","id":137937607,"user":{"login":"theRealNG","id":5243592,"avatar_url":"https://avatars.githubusercontent.com/u/5243592?v=3","gravatar_id":"","url":"https://api.github.com/users/theRealNG","html_url":"https://github.com/theRealNG","followers_url":"https://api.github.com/users/theRealNG/followers","following_url":"https://api.github.com/users/theRealNG/following{/other_user}","gists_url":"https://api.github.com/users/theRealNG/gists{/gist_id}","starred_url":"https://api.github.com/users/theRealNG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theRealNG/subscriptions","organizations_url":"https://api.github.com/users/theRealNG/orgs","repos_url":"https://api.github.com/users/theRealNG/repos","events_url":"https://api.github.com/users/theRealNG/events{/privacy}","received_events_url":"https://api.github.com/users/theRealNG/received_events","type":"User","site_admin":false},"created_at":"2015-09-05T09:42:54Z","updated_at":"2015-09-05T09:42:54Z","body":"We could do it this way: \r\nhttps://github.com/theRealNG/paper_trail/commit/82a67c7d28fa4075c28a91820e01aa00d14887a6\r\n\r\nBut this will be a problem when even the associated record has an attribute with the same name.\r\n\r\nTrying to figure out how to handle this that case. "}}