{"action":"created","comment":{"url":"https://api.github.com/repos/Shopify/liquid/pulls/comments/33965643","id":33965643,"diff_hunk":"@@ -47,6 +48,14 @@ def add_filters(filters)\n       @strainer = nil\n     end\n \n+    def add_global_filters(global_filters)","path":"lib/liquid/context.rb","position":12,"original_position":12,"commit_id":"432bc5d4394edf5adf7af29ded01efd649010dfd","original_commit_id":"432bc5d4394edf5adf7af29ded01efd649010dfd","user":{"login":"pushrax","id":984857,"avatar_url":"https://avatars.githubusercontent.com/u/984857?v=3","gravatar_id":"","url":"https://api.github.com/users/pushrax","html_url":"https://github.com/pushrax","followers_url":"https://api.github.com/users/pushrax/followers","following_url":"https://api.github.com/users/pushrax/following{/other_user}","gists_url":"https://api.github.com/users/pushrax/gists{/gist_id}","starred_url":"https://api.github.com/users/pushrax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pushrax/subscriptions","organizations_url":"https://api.github.com/users/pushrax/orgs","repos_url":"https://api.github.com/users/pushrax/repos","events_url":"https://api.github.com/users/pushrax/events{/privacy}","received_events_url":"https://api.github.com/users/pushrax/received_events","type":"User","site_admin":false},"body":"Simply `attr_accessible :global_filter` is probably the way to go here.","created_at":"2015-07-06T18:22:44Z","updated_at":"2015-07-06T18:22:44Z","html_url":"https://github.com/Shopify/liquid/pull/610#discussion_r33965643","pull_request_url":"https://api.github.com/repos/Shopify/liquid/pulls/610","_links":{"self":{"href":"https://api.github.com/repos/Shopify/liquid/pulls/comments/33965643"},"html":{"href":"https://github.com/Shopify/liquid/pull/610#discussion_r33965643"},"pull_request":{"href":"https://api.github.com/repos/Shopify/liquid/pulls/610"}}},"pull_request":{"url":"https://api.github.com/repos/Shopify/liquid/pulls/610","id":39204587,"html_url":"https://github.com/Shopify/liquid/pull/610","diff_url":"https://github.com/Shopify/liquid/pull/610.diff","patch_url":"https://github.com/Shopify/liquid/pull/610.patch","issue_url":"https://api.github.com/repos/Shopify/liquid/issues/610","number":610,"state":"open","locked":false,"title":"add global_filters (v3)","user":{"login":"boobooninja","id":81805,"avatar_url":"https://avatars.githubusercontent.com/u/81805?v=3","gravatar_id":"","url":"https://api.github.com/users/boobooninja","html_url":"https://github.com/boobooninja","followers_url":"https://api.github.com/users/boobooninja/followers","following_url":"https://api.github.com/users/boobooninja/following{/other_user}","gists_url":"https://api.github.com/users/boobooninja/gists{/gist_id}","starred_url":"https://api.github.com/users/boobooninja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boobooninja/subscriptions","organizations_url":"https://api.github.com/users/boobooninja/orgs","repos_url":"https://api.github.com/users/boobooninja/repos","events_url":"https://api.github.com/users/boobooninja/events{/privacy}","received_events_url":"https://api.github.com/users/boobooninja/received_events","type":"User","site_admin":false},"body":"add global filters using a proc\r\nonly add one proc and not an array\r\nadd tests to make sure global_filters are applied after native filters\r\n\r\nWith regard to pull request #588 and #605\r\n\r\nRegarding my comment in #605 pertaining to naming:\r\nI propose we use names like 'native_filters' and 'custom_filters' to represent the current two types of filters. Those that are native to Liquid and those that are custom developed by the user and then registered with Liquid or supplied to render via options.\r\nThis would then allow us to use the 'global_filters' name to accurately represent the filters applied to all variables in the template. I understand we may want to modify this to something like 'appended_global_filters' to reflect the fact they are applied after the explicit filters, or we note this in documentation.\r\n\r\np.s. I apologize for the multiple pull requests. I am trying to learn the best way to amend a commit related to a pull request as well as rebase that work on top of all the changes made to the upstream. Would love any info you can provide for best practices.","created_at":"2015-07-04T08:16:43Z","updated_at":"2015-07-06T18:22:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5e7061cf85c7ddb5dfd83da464548d44df6fe0f6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Shopify/liquid/pulls/610/commits","review_comments_url":"https://api.github.com/repos/Shopify/liquid/pulls/610/comments","review_comment_url":"https://api.github.com/repos/Shopify/liquid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Shopify/liquid/issues/610/comments","statuses_url":"https://api.github.com/repos/Shopify/liquid/statuses/432bc5d4394edf5adf7af29ded01efd649010dfd","head":{"label":"boobooninja:gf3","ref":"gf3","sha":"432bc5d4394edf5adf7af29ded01efd649010dfd","user":{"login":"boobooninja","id":81805,"avatar_url":"https://avatars.githubusercontent.com/u/81805?v=3","gravatar_id":"","url":"https://api.github.com/users/boobooninja","html_url":"https://github.com/boobooninja","followers_url":"https://api.github.com/users/boobooninja/followers","following_url":"https://api.github.com/users/boobooninja/following{/other_user}","gists_url":"https://api.github.com/users/boobooninja/gists{/gist_id}","starred_url":"https://api.github.com/users/boobooninja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boobooninja/subscriptions","organizations_url":"https://api.github.com/users/boobooninja/orgs","repos_url":"https://api.github.com/users/boobooninja/repos","events_url":"https://api.github.com/users/boobooninja/events{/privacy}","received_events_url":"https://api.github.com/users/boobooninja/received_events","type":"User","site_admin":false},"repo":{"id":30233029,"name":"liquid","full_name":"boobooninja/liquid","owner":{"login":"boobooninja","id":81805,"avatar_url":"https://avatars.githubusercontent.com/u/81805?v=3","gravatar_id":"","url":"https://api.github.com/users/boobooninja","html_url":"https://github.com/boobooninja","followers_url":"https://api.github.com/users/boobooninja/followers","following_url":"https://api.github.com/users/boobooninja/following{/other_user}","gists_url":"https://api.github.com/users/boobooninja/gists{/gist_id}","starred_url":"https://api.github.com/users/boobooninja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boobooninja/subscriptions","organizations_url":"https://api.github.com/users/boobooninja/orgs","repos_url":"https://api.github.com/users/boobooninja/repos","events_url":"https://api.github.com/users/boobooninja/events{/privacy}","received_events_url":"https://api.github.com/users/boobooninja/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/boobooninja/liquid","description":"Liquid markup language. Safe, customer facing template language for flexible web apps. ","fork":true,"url":"https://api.github.com/repos/boobooninja/liquid","forks_url":"https://api.github.com/repos/boobooninja/liquid/forks","keys_url":"https://api.github.com/repos/boobooninja/liquid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/boobooninja/liquid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/boobooninja/liquid/teams","hooks_url":"https://api.github.com/repos/boobooninja/liquid/hooks","issue_events_url":"https://api.github.com/repos/boobooninja/liquid/issues/events{/number}","events_url":"https://api.github.com/repos/boobooninja/liquid/events","assignees_url":"https://api.github.com/repos/boobooninja/liquid/assignees{/user}","branches_url":"https://api.github.com/repos/boobooninja/liquid/branches{/branch}","tags_url":"https://api.github.com/repos/boobooninja/liquid/tags","blobs_url":"https://api.github.com/repos/boobooninja/liquid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/boobooninja/liquid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/boobooninja/liquid/git/refs{/sha}","trees_url":"https://api.github.com/repos/boobooninja/liquid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/boobooninja/liquid/statuses/{sha}","languages_url":"https://api.github.com/repos/boobooninja/liquid/languages","stargazers_url":"https://api.github.com/repos/boobooninja/liquid/stargazers","contributors_url":"https://api.github.com/repos/boobooninja/liquid/contributors","subscribers_url":"https://api.github.com/repos/boobooninja/liquid/subscribers","subscription_url":"https://api.github.com/repos/boobooninja/liquid/subscription","commits_url":"https://api.github.com/repos/boobooninja/liquid/commits{/sha}","git_commits_url":"https://api.github.com/repos/boobooninja/liquid/git/commits{/sha}","comments_url":"https://api.github.com/repos/boobooninja/liquid/comments{/number}","issue_comment_url":"https://api.github.com/repos/boobooninja/liquid/issues/comments{/number}","contents_url":"https://api.github.com/repos/boobooninja/liquid/contents/{+path}","compare_url":"https://api.github.com/repos/boobooninja/liquid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/boobooninja/liquid/merges","archive_url":"https://api.github.com/repos/boobooninja/liquid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/boobooninja/liquid/downloads","issues_url":"https://api.github.com/repos/boobooninja/liquid/issues{/number}","pulls_url":"https://api.github.com/repos/boobooninja/liquid/pulls{/number}","milestones_url":"https://api.github.com/repos/boobooninja/liquid/milestones{/number}","notifications_url":"https://api.github.com/repos/boobooninja/liquid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/boobooninja/liquid/labels{/name}","releases_url":"https://api.github.com/repos/boobooninja/liquid/releases{/id}","created_at":"2015-02-03T08:37:21Z","updated_at":"2015-05-07T08:41:14Z","pushed_at":"2015-07-04T08:04:38Z","git_url":"git://github.com/boobooninja/liquid.git","ssh_url":"git@github.com:boobooninja/liquid.git","clone_url":"https://github.com/boobooninja/liquid.git","svn_url":"https://github.com/boobooninja/liquid","homepage":"http://liquidmarkup.org/","size":1808,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Shopify:master","ref":"master","sha":"8cb23641797dbbd7c95cce7a41d7341bbda5b1fc","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":15435,"name":"liquid","full_name":"Shopify/liquid","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/liquid","description":"Liquid markup language. Safe, customer facing template language for flexible web apps. ","fork":false,"url":"https://api.github.com/repos/Shopify/liquid","forks_url":"https://api.github.com/repos/Shopify/liquid/forks","keys_url":"https://api.github.com/repos/Shopify/liquid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/liquid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/liquid/teams","hooks_url":"https://api.github.com/repos/Shopify/liquid/hooks","issue_events_url":"https://api.github.com/repos/Shopify/liquid/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/liquid/events","assignees_url":"https://api.github.com/repos/Shopify/liquid/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/liquid/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/liquid/tags","blobs_url":"https://api.github.com/repos/Shopify/liquid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/liquid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/liquid/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/liquid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/liquid/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/liquid/languages","stargazers_url":"https://api.github.com/repos/Shopify/liquid/stargazers","contributors_url":"https://api.github.com/repos/Shopify/liquid/contributors","subscribers_url":"https://api.github.com/repos/Shopify/liquid/subscribers","subscription_url":"https://api.github.com/repos/Shopify/liquid/subscription","commits_url":"https://api.github.com/repos/Shopify/liquid/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/liquid/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/liquid/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/liquid/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/liquid/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/liquid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/liquid/merges","archive_url":"https://api.github.com/repos/Shopify/liquid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/liquid/downloads","issues_url":"https://api.github.com/repos/Shopify/liquid/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/liquid/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/liquid/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/liquid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/liquid/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/liquid/releases{/id}","created_at":"2008-05-08T15:27:26Z","updated_at":"2015-07-06T12:17:33Z","pushed_at":"2015-07-05T20:23:41Z","git_url":"git://github.com/Shopify/liquid.git","ssh_url":"git@github.com:Shopify/liquid.git","clone_url":"https://github.com/Shopify/liquid.git","svn_url":"https://github.com/Shopify/liquid","homepage":"http://liquidmarkup.org/","size":7919,"stargazers_count":3443,"watchers_count":3443,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":461,"mirror_url":null,"open_issues_count":33,"forks":461,"open_issues":33,"watchers":3443,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Shopify/liquid/pulls/610"},"html":{"href":"https://github.com/Shopify/liquid/pull/610"},"issue":{"href":"https://api.github.com/repos/Shopify/liquid/issues/610"},"comments":{"href":"https://api.github.com/repos/Shopify/liquid/issues/610/comments"},"review_comments":{"href":"https://api.github.com/repos/Shopify/liquid/pulls/610/comments"},"review_comment":{"href":"https://api.github.com/repos/Shopify/liquid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Shopify/liquid/pulls/610/commits"},"statuses":{"href":"https://api.github.com/repos/Shopify/liquid/statuses/432bc5d4394edf5adf7af29ded01efd649010dfd"}}}}