{"action":"created","comment":{"url":"https://api.github.com/repos/PopulateTools/gobierto/pulls/comments/226020618","pull_request_review_id":165743748,"id":226020618,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNjAyMDYxOA==","diff_hunk":"@@ -0,0 +1,98 @@\n+# frozen_string_literal: true\n+\n+module GobiertoAdmin\n+  module GobiertoCommon\n+    class CustomFieldRecordsForm < BaseForm\n+\n+      attr_accessor(\n+        :site_id,\n+        :item\n+      )\n+\n+      delegate :persisted?, to: :item\n+\n+      validates :site, presence: true\n+\n+      def available_custom_fields\n+        site.custom_fields.where(class_name: item.class.name)\n+      end\n+\n+      def custom_field_records\n+        @custom_field_records ||= available_custom_fields.map do |custom_field|\n+          ::GobiertoCommon::CustomFieldRecordDecorator.new(site.custom_field_records.find_or_initialize_by(item: item, custom_field: custom_field))\n+        end\n+      end\n+\n+      def has_localized_records?\n+        custom_field_records.any?(&:has_localized_value?)\n+      end\n+\n+      def localized_custom_field_records\n+        custom_field_records.select(&:has_localized_value?)\n+      end\n+\n+      def not_localized_custom_field_records\n+        custom_field_records.reject(&:has_localized_value?)\n+      end\n+\n+      def image_fields_options\n+        site.custom_fields.pluck(:uid, :options).map do |uid, options|\n+          { uid: uid,\n+            max_width: 500,\n+            max_height: 500 }\n+        end\n+      end\n+\n+      def custom_field_records=(values)\n+        @custom_field_records ||= begin","path":"app/forms/gobierto_admin/gobierto_common/custom_field_records_form.rb","position":47,"original_position":47,"commit_id":"627a00eecd0ae64726119207d037f49ac6fa3c8b","original_commit_id":"627a00eecd0ae64726119207d037f49ac6fa3c8b","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Memoized variable @custom_field_records does not match method name custom_field_records=. Use @custom_field_records= instead.","created_at":"2018-10-17T17:15:46Z","updated_at":"2018-10-17T17:15:46Z","html_url":"https://github.com/PopulateTools/gobierto/pull/1957#discussion_r226020618","pull_request_url":"https://api.github.com/repos/PopulateTools/gobierto/pulls/1957","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/PopulateTools/gobierto/pulls/comments/226020618"},"html":{"href":"https://github.com/PopulateTools/gobierto/pull/1957#discussion_r226020618"},"pull_request":{"href":"https://api.github.com/repos/PopulateTools/gobierto/pulls/1957"}}},"pull_request":{"url":"https://api.github.com/repos/PopulateTools/gobierto/pulls/1957","id":223686214,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIzNjg2MjE0","html_url":"https://github.com/PopulateTools/gobierto/pull/1957","diff_url":"https://github.com/PopulateTools/gobierto/pull/1957.diff","patch_url":"https://github.com/PopulateTools/gobierto/pull/1957.patch","issue_url":"https://api.github.com/repos/PopulateTools/gobierto/issues/1957","number":1957,"state":"open","locked":false,"title":"Charters views integration [WIP]","user":{"login":"entantoencuanto","id":446459,"node_id":"MDQ6VXNlcjQ0NjQ1OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/446459?v=4","gravatar_id":"","url":"https://api.github.com/users/entantoencuanto","html_url":"https://github.com/entantoencuanto","followers_url":"https://api.github.com/users/entantoencuanto/followers","following_url":"https://api.github.com/users/entantoencuanto/following{/other_user}","gists_url":"https://api.github.com/users/entantoencuanto/gists{/gist_id}","starred_url":"https://api.github.com/users/entantoencuanto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/entantoencuanto/subscriptions","organizations_url":"https://api.github.com/users/entantoencuanto/orgs","repos_url":"https://api.github.com/users/entantoencuanto/repos","events_url":"https://api.github.com/users/entantoencuanto/events{/privacy}","received_events_url":"https://api.github.com/users/entantoencuanto/received_events","type":"User","site_admin":false},"body":"related with #1929 \r\n\r\n\r\n## :v: What does this PR do?\r\nThis PR is on top of https://github.com/PopulateTools/gobierto/pull/1929. Do not merge before merging the other one.\r\n\r\nThis PR integrates the views defined in the sandbox\r\n\r\n## :mag: How should this be manually tested?\r\n\r\n\r\n## :eyes: Screenshots\r\n\r\n### Before this PR\r\n<img width=\"1238\" alt=\"screen shot 2018-10-17 at 19 13 02\" src=\"https://user-images.githubusercontent.com/446459/47104054-db131180-d240-11e8-9428-fa05a2bcba38.png\">\r\n\r\n### After this PR\r\n<img width=\"1221\" alt=\"screen shot 2018-10-17 at 19 12 01\" src=\"https://user-images.githubusercontent.com/446459/47104066-e23a1f80-d240-11e8-82ce-6879bc70b3da.png\">\r\n\r\n## :shipit: Does this PR changes any configuration file?\r\nNo","created_at":"2018-10-17T17:15:21Z","updated_at":"2018-10-17T17:15:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a871231adadf4b41608887b85a97352ee203b112","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":490972266,"node_id":"MDU6TGFiZWw0OTA5NzIyNjY=","url":"https://api.github.com/repos/PopulateTools/gobierto/labels/wip","name":"wip","color":"000000","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/PopulateTools/gobierto/pulls/1957/commits","review_comments_url":"https://api.github.com/repos/PopulateTools/gobierto/pulls/1957/comments","review_comment_url":"https://api.github.com/repos/PopulateTools/gobierto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PopulateTools/gobierto/issues/1957/comments","statuses_url":"https://api.github.com/repos/PopulateTools/gobierto/statuses/627a00eecd0ae64726119207d037f49ac6fa3c8b","head":{"label":"PopulateTools:charters_views_integration","ref":"charters_views_integration","sha":"627a00eecd0ae64726119207d037f49ac6fa3c8b","user":{"login":"PopulateTools","id":12809868,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyODA5ODY4","avatar_url":"https://avatars2.githubusercontent.com/u/12809868?v=4","gravatar_id":"","url":"https://api.github.com/users/PopulateTools","html_url":"https://github.com/PopulateTools","followers_url":"https://api.github.com/users/PopulateTools/followers","following_url":"https://api.github.com/users/PopulateTools/following{/other_user}","gists_url":"https://api.github.com/users/PopulateTools/gists{/gist_id}","starred_url":"https://api.github.com/users/PopulateTools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PopulateTools/subscriptions","organizations_url":"https://api.github.com/users/PopulateTools/orgs","repos_url":"https://api.github.com/users/PopulateTools/repos","events_url":"https://api.github.com/users/PopulateTools/events{/privacy}","received_events_url":"https://api.github.com/users/PopulateTools/received_events","type":"Organization","site_admin":false},"repo":{"id":71801692,"node_id":"MDEwOlJlcG9zaXRvcnk3MTgwMTY5Mg==","name":"gobierto","full_name":"PopulateTools/gobierto","private":false,"owner":{"login":"PopulateTools","id":12809868,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyODA5ODY4","avatar_url":"https://avatars2.githubusercontent.com/u/12809868?v=4","gravatar_id":"","url":"https://api.github.com/users/PopulateTools","html_url":"https://github.com/PopulateTools","followers_url":"https://api.github.com/users/PopulateTools/followers","following_url":"https://api.github.com/users/PopulateTools/following{/other_user}","gists_url":"https://api.github.com/users/PopulateTools/gists{/gist_id}","starred_url":"https://api.github.com/users/PopulateTools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PopulateTools/subscriptions","organizations_url":"https://api.github.com/users/PopulateTools/orgs","repos_url":"https://api.github.com/users/PopulateTools/repos","events_url":"https://api.github.com/users/PopulateTools/events{/privacy}","received_events_url":"https://api.github.com/users/PopulateTools/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/PopulateTools/gobierto","description":"Plataforma de gobierno abierto open source","fork":false,"url":"https://api.github.com/repos/PopulateTools/gobierto","forks_url":"https://api.github.com/repos/PopulateTools/gobierto/forks","keys_url":"https://api.github.com/repos/PopulateTools/gobierto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PopulateTools/gobierto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PopulateTools/gobierto/teams","hooks_url":"https://api.github.com/repos/PopulateTools/gobierto/hooks","issue_events_url":"https://api.github.com/repos/PopulateTools/gobierto/issues/events{/number}","events_url":"https://api.github.com/repos/PopulateTools/gobierto/events","assignees_url":"https://api.github.com/repos/PopulateTools/gobierto/assignees{/user}","branches_url":"https://api.github.com/repos/PopulateTools/gobierto/branches{/branch}","tags_url":"https://api.github.com/repos/PopulateTools/gobierto/tags","blobs_url":"https://api.github.com/repos/PopulateTools/gobierto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PopulateTools/gobierto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PopulateTools/gobierto/git/refs{/sha}","trees_url":"https://api.github.com/repos/PopulateTools/gobierto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PopulateTools/gobierto/statuses/{sha}","languages_url":"https://api.github.com/repos/PopulateTools/gobierto/languages","stargazers_url":"https://api.github.com/repos/PopulateTools/gobierto/stargazers","contributors_url":"https://api.github.com/repos/PopulateTools/gobierto/contributors","subscribers_url":"https://api.github.com/repos/PopulateTools/gobierto/subscribers","subscription_url":"https://api.github.com/repos/PopulateTools/gobierto/subscription","commits_url":"https://api.github.com/repos/PopulateTools/gobierto/commits{/sha}","git_commits_url":"https://api.github.com/repos/PopulateTools/gobierto/git/commits{/sha}","comments_url":"https://api.github.com/repos/PopulateTools/gobierto/comments{/number}","issue_comment_url":"https://api.github.com/repos/PopulateTools/gobierto/issues/comments{/number}","contents_url":"https://api.github.com/repos/PopulateTools/gobierto/contents/{+path}","compare_url":"https://api.github.com/repos/PopulateTools/gobierto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PopulateTools/gobierto/merges","archive_url":"https://api.github.com/repos/PopulateTools/gobierto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PopulateTools/gobierto/downloads","issues_url":"https://api.github.com/repos/PopulateTools/gobierto/issues{/number}","pulls_url":"https://api.github.com/repos/PopulateTools/gobierto/pulls{/number}","milestones_url":"https://api.github.com/repos/PopulateTools/gobierto/milestones{/number}","notifications_url":"https://api.github.com/repos/PopulateTools/gobierto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PopulateTools/gobierto/labels{/name}","releases_url":"https://api.github.com/repos/PopulateTools/gobierto/releases{/id}","deployments_url":"https://api.github.com/repos/PopulateTools/gobierto/deployments","created_at":"2016-10-24T15:13:26Z","updated_at":"2018-10-17T09:31:57Z","pushed_at":"2018-10-17T17:15:22Z","git_url":"git://github.com/PopulateTools/gobierto.git","ssh_url":"git@github.com:PopulateTools/gobierto.git","clone_url":"https://github.com/PopulateTools/gobierto.git","svn_url":"https://github.com/PopulateTools/gobierto","homepage":"https://gobierto.es","size":25887,"stargazers_count":38,"watchers_count":38,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":87,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":9,"open_issues":87,"watchers":38,"default_branch":"master"}},"base":{"label":"PopulateTools:master","ref":"master","sha":"7160c316da2d9f77b767394ca1212d1f7dac891b","user":{"login":"PopulateTools","id":12809868,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyODA5ODY4","avatar_url":"https://avatars2.githubusercontent.com/u/12809868?v=4","gravatar_id":"","url":"https://api.github.com/users/PopulateTools","html_url":"https://github.com/PopulateTools","followers_url":"https://api.github.com/users/PopulateTools/followers","following_url":"https://api.github.com/users/PopulateTools/following{/other_user}","gists_url":"https://api.github.com/users/PopulateTools/gists{/gist_id}","starred_url":"https://api.github.com/users/PopulateTools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PopulateTools/subscriptions","organizations_url":"https://api.github.com/users/PopulateTools/orgs","repos_url":"https://api.github.com/users/PopulateTools/repos","events_url":"https://api.github.com/users/PopulateTools/events{/privacy}","received_events_url":"https://api.github.com/users/PopulateTools/received_events","type":"Organization","site_admin":false},"repo":{"id":71801692,"node_id":"MDEwOlJlcG9zaXRvcnk3MTgwMTY5Mg==","name":"gobierto","full_name":"PopulateTools/gobierto","private":false,"owner":{"login":"PopulateTools","id":12809868,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyODA5ODY4","avatar_url":"https://avatars2.githubusercontent.com/u/12809868?v=4","gravatar_id":"","url":"https://api.github.com/users/PopulateTools","html_url":"https://github.com/PopulateTools","followers_url":"https://api.github.com/users/PopulateTools/followers","following_url":"https://api.github.com/users/PopulateTools/following{/other_user}","gists_url":"https://api.github.com/users/PopulateTools/gists{/gist_id}","starred_url":"https://api.github.com/users/PopulateTools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PopulateTools/subscriptions","organizations_url":"https://api.github.com/users/PopulateTools/orgs","repos_url":"https://api.github.com/users/PopulateTools/repos","events_url":"https://api.github.com/users/PopulateTools/events{/privacy}","received_events_url":"https://api.github.com/users/PopulateTools/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/PopulateTools/gobierto","description":"Plataforma de gobierno abierto open source","fork":false,"url":"https://api.github.com/repos/PopulateTools/gobierto","forks_url":"https://api.github.com/repos/PopulateTools/gobierto/forks","keys_url":"https://api.github.com/repos/PopulateTools/gobierto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PopulateTools/gobierto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PopulateTools/gobierto/teams","hooks_url":"https://api.github.com/repos/PopulateTools/gobierto/hooks","issue_events_url":"https://api.github.com/repos/PopulateTools/gobierto/issues/events{/number}","events_url":"https://api.github.com/repos/PopulateTools/gobierto/events","assignees_url":"https://api.github.com/repos/PopulateTools/gobierto/assignees{/user}","branches_url":"https://api.github.com/repos/PopulateTools/gobierto/branches{/branch}","tags_url":"https://api.github.com/repos/PopulateTools/gobierto/tags","blobs_url":"https://api.github.com/repos/PopulateTools/gobierto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PopulateTools/gobierto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PopulateTools/gobierto/git/refs{/sha}","trees_url":"https://api.github.com/repos/PopulateTools/gobierto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PopulateTools/gobierto/statuses/{sha}","languages_url":"https://api.github.com/repos/PopulateTools/gobierto/languages","stargazers_url":"https://api.github.com/repos/PopulateTools/gobierto/stargazers","contributors_url":"https://api.github.com/repos/PopulateTools/gobierto/contributors","subscribers_url":"https://api.github.com/repos/PopulateTools/gobierto/subscribers","subscription_url":"https://api.github.com/repos/PopulateTools/gobierto/subscription","commits_url":"https://api.github.com/repos/PopulateTools/gobierto/commits{/sha}","git_commits_url":"https://api.github.com/repos/PopulateTools/gobierto/git/commits{/sha}","comments_url":"https://api.github.com/repos/PopulateTools/gobierto/comments{/number}","issue_comment_url":"https://api.github.com/repos/PopulateTools/gobierto/issues/comments{/number}","contents_url":"https://api.github.com/repos/PopulateTools/gobierto/contents/{+path}","compare_url":"https://api.github.com/repos/PopulateTools/gobierto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PopulateTools/gobierto/merges","archive_url":"https://api.github.com/repos/PopulateTools/gobierto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PopulateTools/gobierto/downloads","issues_url":"https://api.github.com/repos/PopulateTools/gobierto/issues{/number}","pulls_url":"https://api.github.com/repos/PopulateTools/gobierto/pulls{/number}","milestones_url":"https://api.github.com/repos/PopulateTools/gobierto/milestones{/number}","notifications_url":"https://api.github.com/repos/PopulateTools/gobierto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PopulateTools/gobierto/labels{/name}","releases_url":"https://api.github.com/repos/PopulateTools/gobierto/releases{/id}","deployments_url":"https://api.github.com/repos/PopulateTools/gobierto/deployments","created_at":"2016-10-24T15:13:26Z","updated_at":"2018-10-17T09:31:57Z","pushed_at":"2018-10-17T17:15:22Z","git_url":"git://github.com/PopulateTools/gobierto.git","ssh_url":"git@github.com:PopulateTools/gobierto.git","clone_url":"https://github.com/PopulateTools/gobierto.git","svn_url":"https://github.com/PopulateTools/gobierto","homepage":"https://gobierto.es","size":25887,"stargazers_count":38,"watchers_count":38,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":87,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":9,"open_issues":87,"watchers":38,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PopulateTools/gobierto/pulls/1957"},"html":{"href":"https://github.com/PopulateTools/gobierto/pull/1957"},"issue":{"href":"https://api.github.com/repos/PopulateTools/gobierto/issues/1957"},"comments":{"href":"https://api.github.com/repos/PopulateTools/gobierto/issues/1957/comments"},"review_comments":{"href":"https://api.github.com/repos/PopulateTools/gobierto/pulls/1957/comments"},"review_comment":{"href":"https://api.github.com/repos/PopulateTools/gobierto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PopulateTools/gobierto/pulls/1957/commits"},"statuses":{"href":"https://api.github.com/repos/PopulateTools/gobierto/statuses/627a00eecd0ae64726119207d037f49ac6fa3c8b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"houndci-bot"}}