{"action":"created","comment":{"url":"https://api.github.com/repos/avantcredit/paranoia/pulls/comments/58096994","id":58096994,"diff_hunk":"@@ -20,6 +20,7 @@ Gem::Specification.new do |s|\n \n   s.add_development_dependency \"bundler\", \">= 1.0.0\"\n   s.add_development_dependency \"rake\"\n+  s.add_dependency \"pry\"","path":"paranoia.gemspec","position":4,"original_position":4,"commit_id":"05c9fff05bafb8414b3ddd82de392a77ca89ab86","original_commit_id":"05c9fff05bafb8414b3ddd82de392a77ca89ab86","user":{"login":"nkeyes","id":1145493,"avatar_url":"https://avatars.githubusercontent.com/u/1145493?v=3","gravatar_id":"","url":"https://api.github.com/users/nkeyes","html_url":"https://github.com/nkeyes","followers_url":"https://api.github.com/users/nkeyes/followers","following_url":"https://api.github.com/users/nkeyes/following{/other_user}","gists_url":"https://api.github.com/users/nkeyes/gists{/gist_id}","starred_url":"https://api.github.com/users/nkeyes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkeyes/subscriptions","organizations_url":"https://api.github.com/users/nkeyes/orgs","repos_url":"https://api.github.com/users/nkeyes/repos","events_url":"https://api.github.com/users/nkeyes/events{/privacy}","received_events_url":"https://api.github.com/users/nkeyes/received_events","type":"User","site_admin":false},"body":"did you mean `add_development_dependency`?","created_at":"2016-03-31T17:48:34Z","updated_at":"2016-03-31T17:48:34Z","html_url":"https://github.com/avantcredit/paranoia/pull/1#discussion_r58096994","pull_request_url":"https://api.github.com/repos/avantcredit/paranoia/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/avantcredit/paranoia/pulls/comments/58096994"},"html":{"href":"https://github.com/avantcredit/paranoia/pull/1#discussion_r58096994"},"pull_request":{"href":"https://api.github.com/repos/avantcredit/paranoia/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/avantcredit/paranoia/pulls/1","id":64690404,"html_url":"https://github.com/avantcredit/paranoia/pull/1","diff_url":"https://github.com/avantcredit/paranoia/pull/1.diff","patch_url":"https://github.com/avantcredit/paranoia/pull/1.patch","issue_url":"https://api.github.com/repos/avantcredit/paranoia/issues/1","number":1,"state":"open","locked":false,"title":"Heavy duty deleted","user":{"login":"bhgames","id":315499,"avatar_url":"https://avatars.githubusercontent.com/u/315499?v=3","gravatar_id":"","url":"https://api.github.com/users/bhgames","html_url":"https://github.com/bhgames","followers_url":"https://api.github.com/users/bhgames/followers","following_url":"https://api.github.com/users/bhgames/following{/other_user}","gists_url":"https://api.github.com/users/bhgames/gists{/gist_id}","starred_url":"https://api.github.com/users/bhgames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhgames/subscriptions","organizations_url":"https://api.github.com/users/bhgames/orgs","repos_url":"https://api.github.com/users/bhgames/repos","events_url":"https://api.github.com/users/bhgames/events{/privacy}","received_events_url":"https://api.github.com/users/bhgames/received_events","type":"User","site_admin":false},"body":"@nkeyes Made this a PR from the original code so you can see my changes, but it's probably better if you just look at my branch as a whole to see what I've done.\r\n\r\nOkay, so the guy was definitely a python coder before a ruby one, because he dumped all the modules and class reopenings in a single file called paranoia.rb, instead of putting each module in a file and requiring them all in a top level module file. For now I have retained that pattern, but I am toying with making this a more Ruby-ish gem, which means likely we will lose any ability to pull in his changes later from upstream.\r\n\r\nI added these abilities:\r\n\r\n1. The gem has PARANOIA_ENABLED env check, to only install the module if the system it runs on has this set to the string \"true\".\r\n\r\n2. The gem has PARANOIA_BLACKLIST, which is a comma separated list of tables that will not have the module included on startup even if they are eligible.\r\n\r\n3. That the gem does not require acts_as_paranoid to be called in ANY model code, it should work for ALL by hooking into the base methods in ActiveRecord::Base(specifically, inherited and connection methods).\r\n\r\n4. That the gem, instead of operating on deleted_at and scoping by it, scopes by the deleted boolean instead(indexed) and only populates deleted_at(unindexed). This is much faster and actually will work in production environments.\r\n\r\n5. The gem ignores tables without the proper columns present(deleted, deleted_at).\r\n\r\n6. I removed a lot of unnecessary functionality, like the ability to specify which columns to use, the ability to have an active column, a default scope that includes deleteds, etc. This is not meant for varied use so I figured the code didn't need to be as \"able.\"\r\n\r\nAnyway, please let me know what you think.\r\n\r\nEDIT: This ENV setup allows us global disablement if something goes wrong on deploy, and we can selectively deploy to certain tables by only adding columns to those tables during a maintenance window. If we add columns to a table and it turns out to not work for some reason, adding it to the BLACKLIST and restarting the webapp will remove it, while maintaining the columnar presence.","created_at":"2016-03-30T20:20:42Z","updated_at":"2016-03-31T17:48:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4cca86cc1899bf8f9a8ddebe23fcf75930ea5205","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/avantcredit/paranoia/pulls/1/commits","review_comments_url":"https://api.github.com/repos/avantcredit/paranoia/pulls/1/comments","review_comment_url":"https://api.github.com/repos/avantcredit/paranoia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/avantcredit/paranoia/issues/1/comments","statuses_url":"https://api.github.com/repos/avantcredit/paranoia/statuses/05c9fff05bafb8414b3ddd82de392a77ca89ab86","head":{"label":"avantcredit:heavy_duty_deleted","ref":"heavy_duty_deleted","sha":"05c9fff05bafb8414b3ddd82de392a77ca89ab86","user":{"login":"avantcredit","id":2895811,"avatar_url":"https://avatars.githubusercontent.com/u/2895811?v=3","gravatar_id":"","url":"https://api.github.com/users/avantcredit","html_url":"https://github.com/avantcredit","followers_url":"https://api.github.com/users/avantcredit/followers","following_url":"https://api.github.com/users/avantcredit/following{/other_user}","gists_url":"https://api.github.com/users/avantcredit/gists{/gist_id}","starred_url":"https://api.github.com/users/avantcredit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avantcredit/subscriptions","organizations_url":"https://api.github.com/users/avantcredit/orgs","repos_url":"https://api.github.com/users/avantcredit/repos","events_url":"https://api.github.com/users/avantcredit/events{/privacy}","received_events_url":"https://api.github.com/users/avantcredit/received_events","type":"Organization","site_admin":false},"repo":{"id":54914897,"name":"paranoia","full_name":"avantcredit/paranoia","owner":{"login":"avantcredit","id":2895811,"avatar_url":"https://avatars.githubusercontent.com/u/2895811?v=3","gravatar_id":"","url":"https://api.github.com/users/avantcredit","html_url":"https://github.com/avantcredit","followers_url":"https://api.github.com/users/avantcredit/followers","following_url":"https://api.github.com/users/avantcredit/following{/other_user}","gists_url":"https://api.github.com/users/avantcredit/gists{/gist_id}","starred_url":"https://api.github.com/users/avantcredit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avantcredit/subscriptions","organizations_url":"https://api.github.com/users/avantcredit/orgs","repos_url":"https://api.github.com/users/avantcredit/repos","events_url":"https://api.github.com/users/avantcredit/events{/privacy}","received_events_url":"https://api.github.com/users/avantcredit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/avantcredit/paranoia","description":"acts_as_paranoid for Rails 3 & 4","fork":true,"url":"https://api.github.com/repos/avantcredit/paranoia","forks_url":"https://api.github.com/repos/avantcredit/paranoia/forks","keys_url":"https://api.github.com/repos/avantcredit/paranoia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/avantcredit/paranoia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/avantcredit/paranoia/teams","hooks_url":"https://api.github.com/repos/avantcredit/paranoia/hooks","issue_events_url":"https://api.github.com/repos/avantcredit/paranoia/issues/events{/number}","events_url":"https://api.github.com/repos/avantcredit/paranoia/events","assignees_url":"https://api.github.com/repos/avantcredit/paranoia/assignees{/user}","branches_url":"https://api.github.com/repos/avantcredit/paranoia/branches{/branch}","tags_url":"https://api.github.com/repos/avantcredit/paranoia/tags","blobs_url":"https://api.github.com/repos/avantcredit/paranoia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/avantcredit/paranoia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/avantcredit/paranoia/git/refs{/sha}","trees_url":"https://api.github.com/repos/avantcredit/paranoia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/avantcredit/paranoia/statuses/{sha}","languages_url":"https://api.github.com/repos/avantcredit/paranoia/languages","stargazers_url":"https://api.github.com/repos/avantcredit/paranoia/stargazers","contributors_url":"https://api.github.com/repos/avantcredit/paranoia/contributors","subscribers_url":"https://api.github.com/repos/avantcredit/paranoia/subscribers","subscription_url":"https://api.github.com/repos/avantcredit/paranoia/subscription","commits_url":"https://api.github.com/repos/avantcredit/paranoia/commits{/sha}","git_commits_url":"https://api.github.com/repos/avantcredit/paranoia/git/commits{/sha}","comments_url":"https://api.github.com/repos/avantcredit/paranoia/comments{/number}","issue_comment_url":"https://api.github.com/repos/avantcredit/paranoia/issues/comments{/number}","contents_url":"https://api.github.com/repos/avantcredit/paranoia/contents/{+path}","compare_url":"https://api.github.com/repos/avantcredit/paranoia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/avantcredit/paranoia/merges","archive_url":"https://api.github.com/repos/avantcredit/paranoia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/avantcredit/paranoia/downloads","issues_url":"https://api.github.com/repos/avantcredit/paranoia/issues{/number}","pulls_url":"https://api.github.com/repos/avantcredit/paranoia/pulls{/number}","milestones_url":"https://api.github.com/repos/avantcredit/paranoia/milestones{/number}","notifications_url":"https://api.github.com/repos/avantcredit/paranoia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/avantcredit/paranoia/labels{/name}","releases_url":"https://api.github.com/repos/avantcredit/paranoia/releases{/id}","deployments_url":"https://api.github.com/repos/avantcredit/paranoia/deployments","created_at":"2016-03-28T18:40:10Z","updated_at":"2016-03-28T18:40:11Z","pushed_at":"2016-03-30T20:20:42Z","git_url":"git://github.com/avantcredit/paranoia.git","ssh_url":"git@github.com:avantcredit/paranoia.git","clone_url":"https://github.com/avantcredit/paranoia.git","svn_url":"https://github.com/avantcredit/paranoia","homepage":"","size":334,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"core"}},"base":{"label":"avantcredit:core","ref":"core","sha":"9e0ec38e5f4d08d25c1bf1b63c1fe78208abe625","user":{"login":"avantcredit","id":2895811,"avatar_url":"https://avatars.githubusercontent.com/u/2895811?v=3","gravatar_id":"","url":"https://api.github.com/users/avantcredit","html_url":"https://github.com/avantcredit","followers_url":"https://api.github.com/users/avantcredit/followers","following_url":"https://api.github.com/users/avantcredit/following{/other_user}","gists_url":"https://api.github.com/users/avantcredit/gists{/gist_id}","starred_url":"https://api.github.com/users/avantcredit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avantcredit/subscriptions","organizations_url":"https://api.github.com/users/avantcredit/orgs","repos_url":"https://api.github.com/users/avantcredit/repos","events_url":"https://api.github.com/users/avantcredit/events{/privacy}","received_events_url":"https://api.github.com/users/avantcredit/received_events","type":"Organization","site_admin":false},"repo":{"id":54914897,"name":"paranoia","full_name":"avantcredit/paranoia","owner":{"login":"avantcredit","id":2895811,"avatar_url":"https://avatars.githubusercontent.com/u/2895811?v=3","gravatar_id":"","url":"https://api.github.com/users/avantcredit","html_url":"https://github.com/avantcredit","followers_url":"https://api.github.com/users/avantcredit/followers","following_url":"https://api.github.com/users/avantcredit/following{/other_user}","gists_url":"https://api.github.com/users/avantcredit/gists{/gist_id}","starred_url":"https://api.github.com/users/avantcredit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avantcredit/subscriptions","organizations_url":"https://api.github.com/users/avantcredit/orgs","repos_url":"https://api.github.com/users/avantcredit/repos","events_url":"https://api.github.com/users/avantcredit/events{/privacy}","received_events_url":"https://api.github.com/users/avantcredit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/avantcredit/paranoia","description":"acts_as_paranoid for Rails 3 & 4","fork":true,"url":"https://api.github.com/repos/avantcredit/paranoia","forks_url":"https://api.github.com/repos/avantcredit/paranoia/forks","keys_url":"https://api.github.com/repos/avantcredit/paranoia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/avantcredit/paranoia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/avantcredit/paranoia/teams","hooks_url":"https://api.github.com/repos/avantcredit/paranoia/hooks","issue_events_url":"https://api.github.com/repos/avantcredit/paranoia/issues/events{/number}","events_url":"https://api.github.com/repos/avantcredit/paranoia/events","assignees_url":"https://api.github.com/repos/avantcredit/paranoia/assignees{/user}","branches_url":"https://api.github.com/repos/avantcredit/paranoia/branches{/branch}","tags_url":"https://api.github.com/repos/avantcredit/paranoia/tags","blobs_url":"https://api.github.com/repos/avantcredit/paranoia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/avantcredit/paranoia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/avantcredit/paranoia/git/refs{/sha}","trees_url":"https://api.github.com/repos/avantcredit/paranoia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/avantcredit/paranoia/statuses/{sha}","languages_url":"https://api.github.com/repos/avantcredit/paranoia/languages","stargazers_url":"https://api.github.com/repos/avantcredit/paranoia/stargazers","contributors_url":"https://api.github.com/repos/avantcredit/paranoia/contributors","subscribers_url":"https://api.github.com/repos/avantcredit/paranoia/subscribers","subscription_url":"https://api.github.com/repos/avantcredit/paranoia/subscription","commits_url":"https://api.github.com/repos/avantcredit/paranoia/commits{/sha}","git_commits_url":"https://api.github.com/repos/avantcredit/paranoia/git/commits{/sha}","comments_url":"https://api.github.com/repos/avantcredit/paranoia/comments{/number}","issue_comment_url":"https://api.github.com/repos/avantcredit/paranoia/issues/comments{/number}","contents_url":"https://api.github.com/repos/avantcredit/paranoia/contents/{+path}","compare_url":"https://api.github.com/repos/avantcredit/paranoia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/avantcredit/paranoia/merges","archive_url":"https://api.github.com/repos/avantcredit/paranoia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/avantcredit/paranoia/downloads","issues_url":"https://api.github.com/repos/avantcredit/paranoia/issues{/number}","pulls_url":"https://api.github.com/repos/avantcredit/paranoia/pulls{/number}","milestones_url":"https://api.github.com/repos/avantcredit/paranoia/milestones{/number}","notifications_url":"https://api.github.com/repos/avantcredit/paranoia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/avantcredit/paranoia/labels{/name}","releases_url":"https://api.github.com/repos/avantcredit/paranoia/releases{/id}","deployments_url":"https://api.github.com/repos/avantcredit/paranoia/deployments","created_at":"2016-03-28T18:40:10Z","updated_at":"2016-03-28T18:40:11Z","pushed_at":"2016-03-30T20:20:42Z","git_url":"git://github.com/avantcredit/paranoia.git","ssh_url":"git@github.com:avantcredit/paranoia.git","clone_url":"https://github.com/avantcredit/paranoia.git","svn_url":"https://github.com/avantcredit/paranoia","homepage":"","size":334,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"core"}},"_links":{"self":{"href":"https://api.github.com/repos/avantcredit/paranoia/pulls/1"},"html":{"href":"https://github.com/avantcredit/paranoia/pull/1"},"issue":{"href":"https://api.github.com/repos/avantcredit/paranoia/issues/1"},"comments":{"href":"https://api.github.com/repos/avantcredit/paranoia/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/avantcredit/paranoia/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/avantcredit/paranoia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/avantcredit/paranoia/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/avantcredit/paranoia/statuses/05c9fff05bafb8414b3ddd82de392a77ca89ab86"}}}}