{"action":"opened","issue":{"url":"https://api.github.com/repos/rubysherpas/paranoia/issues/326","repository_url":"https://api.github.com/repos/rubysherpas/paranoia","labels_url":"https://api.github.com/repos/rubysherpas/paranoia/issues/326/labels{/name}","comments_url":"https://api.github.com/repos/rubysherpas/paranoia/issues/326/comments","events_url":"https://api.github.com/repos/rubysherpas/paranoia/issues/326/events","html_url":"https://github.com/rubysherpas/paranoia/issues/326","id":155163558,"number":326,"title":"really_destroy! updates column with datetime even when using sentinel_value","user":{"login":"mhaylock","id":673828,"avatar_url":"https://avatars.githubusercontent.com/u/673828?v=3","gravatar_id":"","url":"https://api.github.com/users/mhaylock","html_url":"https://github.com/mhaylock","followers_url":"https://api.github.com/users/mhaylock/followers","following_url":"https://api.github.com/users/mhaylock/following{/other_user}","gists_url":"https://api.github.com/users/mhaylock/gists{/gist_id}","starred_url":"https://api.github.com/users/mhaylock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhaylock/subscriptions","organizations_url":"https://api.github.com/users/mhaylock/orgs","repos_url":"https://api.github.com/users/mhaylock/repos","events_url":"https://api.github.com/users/mhaylock/events{/privacy}","received_events_url":"https://api.github.com/users/mhaylock/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-17T02:26:11Z","updated_at":"2016-05-17T02:26:11Z","closed_at":null,"body":"Using paranoia 2.1.5, I have a model setup using the `sentinel_value` option, as [documented in the README under \"Indexes\"](https://github.com/rubysherpas/paranoia#about-indexes), e.g:\r\n```ruby\r\nadd_column :clients, :active, :boolean\r\nadd_index :clients, [:group_id, :active], unique: true\r\n\r\nclass Client < ActiveRecord::Base\r\n  # optionally have paranoia make use of your unique column, so that\r\n  # your lookups will benefit from the unique index\r\n  acts_as_paranoid column: :active, sentinel_value: true\r\n\r\n  def paranoia_restore_attributes\r\n    {\r\n      deleted_at: nil,\r\n      active: true\r\n    }\r\n  end\r\n\r\n  def paranoia_destroy_attributes\r\n    {\r\n      deleted_at: current_time_from_proper_timezone,\r\n      active: nil\r\n    }\r\n  end\r\nend\r\n```\r\n\r\nWhen calling `really_destroy!` on this model the following warning is generated by Rails (4.2.6):\r\n```\r\nDEPRECATION WARNING: You attempted to assign a value which is not explicitly `true` or `false` (2016-05-17 02:02:23 UTC) to a boolean column. Currently this value casts to `false`. This will change to match Ruby's semantics, and will cast to `true` in Rails 5. If you would like to maintain the current behavior, you should explicitly handle the values you would like cast to `false`.\r\n```\r\n\r\nThis is because paranoia is writing the current datetime into the paranoia column (`active` in this example), at this line: https://github.com/rubysherpas/paranoia/blob/core/lib/paranoia.rb#L146. I think this should probably use `paranoia_destroy_attributes` instead?\r\n\r\nHowever it's not clear to me why it is even updating the column if it then goes and deletes the row from the database? Why update the column at all?"}}