{"action":"created","comment":{"url":"https://api.github.com/repos/teachbase/amorail/pulls/comments/28696687","id":28696687,"diff_hunk":"@@ -1,48 +1,41 @@\n module Amorail\n   class AmoCompany < Amorail::AmoEntity\n-    set_amo_name \"company\"\n-    set_amo_response_name \"contacts\"\n-    \n+    set_amo_name 'company'\n+    set_amo_response_name 'contacts'\n+\n     attr_accessor :name, :linked_leads_id,\n                   :email, :phone, :address, :website\n \n     validates :name, presence: true\n \n-    def create_params\n+    def params\n       {\n-        request: {\n-          contacts: {\n-            add: [\n-              {\n-                name: name,\n-                type: \"contact\",\n-                date_create: to_timestamp(date_create),\n-                last_modified: to_timestamp(last_modified),\n-                request_id: request_id,\n-                responsible_user_id: responsible_user_id,\n-                linked_leads_id: [linked_leads_id],\n-                custom_fields: [\n-                  {\n-                    id: properties.company.address.id,\n-                    values: [{value: address}]\n-                  },\n-                  {\n-                    id: properties.company.phone.id,\n-                    values: [{value: phone, enum: \"WORK\"}]\n-                  },\n-                  {\n-                    id: properties.company.email.id,\n-                    values: [{value: email, enum: \"WORK\"}]\n-                  },\n-                  {\n-                    id: properties.company.web.id,\n-                    values: [{value: website}]\n-                  }\n-                ]\n-              }\n-            ]\n+        id: id,\n+        name: name,\n+        type: 'contact',\n+        date_create: to_timestamp(date_create),\n+        last_modified: to_timestamp(last_modified) || Time.now.to_i,\n+        request_id: request_id,\n+        responsible_user_id: responsible_user_id,\n+        linked_leads_id: [linked_leads_id],\n+        custom_fields: [\n+          {\n+            id: properties.company.address.id,\n+            values: [{ value: address }]\n+          },\n+          {\n+            id: properties.company.phone.id,\n+            values: [{ value: phone, enum: 'WORK' }]","path":"lib/amorail/entities/company.rb","position":63,"original_position":63,"commit_id":"72af1e04e173fe08cd3c4750b2b5647aac9f7e30","original_commit_id":"72af1e04e173fe08cd3c4750b2b5647aac9f7e30","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","created_at":"2015-04-20T15:08:01Z","updated_at":"2015-04-20T15:08:01Z","html_url":"https://github.com/teachbase/amorail/pull/3#discussion_r28696687","pull_request_url":"https://api.github.com/repos/teachbase/amorail/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/teachbase/amorail/pulls/comments/28696687"},"html":{"href":"https://github.com/teachbase/amorail/pull/3#discussion_r28696687"},"pull_request":{"href":"https://api.github.com/repos/teachbase/amorail/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/teachbase/amorail/pulls/3","id":33644626,"html_url":"https://github.com/teachbase/amorail/pull/3","diff_url":"https://github.com/teachbase/amorail/pull/3.diff","patch_url":"https://github.com/teachbase/amorail/pull/3.patch","issue_url":"https://api.github.com/repos/teachbase/amorail/issues/3","number":3,"state":"open","locked":false,"title":"add update_attributes method; add specs; [fix] updated params for contac...","user":{"login":"alekseenkoss77","id":2551688,"avatar_url":"https://avatars.githubusercontent.com/u/2551688?v=3","gravatar_id":"","url":"https://api.github.com/users/alekseenkoss77","html_url":"https://github.com/alekseenkoss77","followers_url":"https://api.github.com/users/alekseenkoss77/followers","following_url":"https://api.github.com/users/alekseenkoss77/following{/other_user}","gists_url":"https://api.github.com/users/alekseenkoss77/gists{/gist_id}","starred_url":"https://api.github.com/users/alekseenkoss77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alekseenkoss77/subscriptions","organizations_url":"https://api.github.com/users/alekseenkoss77/orgs","repos_url":"https://api.github.com/users/alekseenkoss77/repos","events_url":"https://api.github.com/users/alekseenkoss77/events{/privacy}","received_events_url":"https://api.github.com/users/alekseenkoss77/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-20T08:33:50Z","updated_at":"2015-04-20T15:08:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"694a87a923d68a3275c02c21d5a875267994f05f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/teachbase/amorail/pulls/3/commits","review_comments_url":"https://api.github.com/repos/teachbase/amorail/pulls/3/comments","review_comment_url":"https://api.github.com/repos/teachbase/amorail/pulls/comments{/number}","comments_url":"https://api.github.com/repos/teachbase/amorail/issues/3/comments","statuses_url":"https://api.github.com/repos/teachbase/amorail/statuses/72af1e04e173fe08cd3c4750b2b5647aac9f7e30","head":{"label":"teachbase:update-user-info","ref":"update-user-info","sha":"72af1e04e173fe08cd3c4750b2b5647aac9f7e30","user":{"login":"teachbase","id":10232914,"avatar_url":"https://avatars.githubusercontent.com/u/10232914?v=3","gravatar_id":"","url":"https://api.github.com/users/teachbase","html_url":"https://github.com/teachbase","followers_url":"https://api.github.com/users/teachbase/followers","following_url":"https://api.github.com/users/teachbase/following{/other_user}","gists_url":"https://api.github.com/users/teachbase/gists{/gist_id}","starred_url":"https://api.github.com/users/teachbase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teachbase/subscriptions","organizations_url":"https://api.github.com/users/teachbase/orgs","repos_url":"https://api.github.com/users/teachbase/repos","events_url":"https://api.github.com/users/teachbase/events{/privacy}","received_events_url":"https://api.github.com/users/teachbase/received_events","type":"Organization","site_admin":false},"repo":{"id":29674544,"name":"amorail","full_name":"teachbase/amorail","owner":{"login":"teachbase","id":10232914,"avatar_url":"https://avatars.githubusercontent.com/u/10232914?v=3","gravatar_id":"","url":"https://api.github.com/users/teachbase","html_url":"https://github.com/teachbase","followers_url":"https://api.github.com/users/teachbase/followers","following_url":"https://api.github.com/users/teachbase/following{/other_user}","gists_url":"https://api.github.com/users/teachbase/gists{/gist_id}","starred_url":"https://api.github.com/users/teachbase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teachbase/subscriptions","organizations_url":"https://api.github.com/users/teachbase/orgs","repos_url":"https://api.github.com/users/teachbase/repos","events_url":"https://api.github.com/users/teachbase/events{/privacy}","received_events_url":"https://api.github.com/users/teachbase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/teachbase/amorail","description":"AmoCRM Rails plugin","fork":false,"url":"https://api.github.com/repos/teachbase/amorail","forks_url":"https://api.github.com/repos/teachbase/amorail/forks","keys_url":"https://api.github.com/repos/teachbase/amorail/keys{/key_id}","collaborators_url":"https://api.github.com/repos/teachbase/amorail/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/teachbase/amorail/teams","hooks_url":"https://api.github.com/repos/teachbase/amorail/hooks","issue_events_url":"https://api.github.com/repos/teachbase/amorail/issues/events{/number}","events_url":"https://api.github.com/repos/teachbase/amorail/events","assignees_url":"https://api.github.com/repos/teachbase/amorail/assignees{/user}","branches_url":"https://api.github.com/repos/teachbase/amorail/branches{/branch}","tags_url":"https://api.github.com/repos/teachbase/amorail/tags","blobs_url":"https://api.github.com/repos/teachbase/amorail/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/teachbase/amorail/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/teachbase/amorail/git/refs{/sha}","trees_url":"https://api.github.com/repos/teachbase/amorail/git/trees{/sha}","statuses_url":"https://api.github.com/repos/teachbase/amorail/statuses/{sha}","languages_url":"https://api.github.com/repos/teachbase/amorail/languages","stargazers_url":"https://api.github.com/repos/teachbase/amorail/stargazers","contributors_url":"https://api.github.com/repos/teachbase/amorail/contributors","subscribers_url":"https://api.github.com/repos/teachbase/amorail/subscribers","subscription_url":"https://api.github.com/repos/teachbase/amorail/subscription","commits_url":"https://api.github.com/repos/teachbase/amorail/commits{/sha}","git_commits_url":"https://api.github.com/repos/teachbase/amorail/git/commits{/sha}","comments_url":"https://api.github.com/repos/teachbase/amorail/comments{/number}","issue_comment_url":"https://api.github.com/repos/teachbase/amorail/issues/comments{/number}","contents_url":"https://api.github.com/repos/teachbase/amorail/contents/{+path}","compare_url":"https://api.github.com/repos/teachbase/amorail/compare/{base}...{head}","merges_url":"https://api.github.com/repos/teachbase/amorail/merges","archive_url":"https://api.github.com/repos/teachbase/amorail/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/teachbase/amorail/downloads","issues_url":"https://api.github.com/repos/teachbase/amorail/issues{/number}","pulls_url":"https://api.github.com/repos/teachbase/amorail/pulls{/number}","milestones_url":"https://api.github.com/repos/teachbase/amorail/milestones{/number}","notifications_url":"https://api.github.com/repos/teachbase/amorail/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/teachbase/amorail/labels{/name}","releases_url":"https://api.github.com/repos/teachbase/amorail/releases{/id}","created_at":"2015-01-22T11:01:40Z","updated_at":"2015-02-12T12:50:29Z","pushed_at":"2015-04-20T15:07:54Z","git_url":"git://github.com/teachbase/amorail.git","ssh_url":"git@github.com:teachbase/amorail.git","clone_url":"https://github.com/teachbase/amorail.git","svn_url":"https://github.com/teachbase/amorail","homepage":null,"size":448,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"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":"master"}},"base":{"label":"teachbase:master","ref":"master","sha":"f6ab7f0d17ba99c7c486ea3882ad3c500f44c389","user":{"login":"teachbase","id":10232914,"avatar_url":"https://avatars.githubusercontent.com/u/10232914?v=3","gravatar_id":"","url":"https://api.github.com/users/teachbase","html_url":"https://github.com/teachbase","followers_url":"https://api.github.com/users/teachbase/followers","following_url":"https://api.github.com/users/teachbase/following{/other_user}","gists_url":"https://api.github.com/users/teachbase/gists{/gist_id}","starred_url":"https://api.github.com/users/teachbase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teachbase/subscriptions","organizations_url":"https://api.github.com/users/teachbase/orgs","repos_url":"https://api.github.com/users/teachbase/repos","events_url":"https://api.github.com/users/teachbase/events{/privacy}","received_events_url":"https://api.github.com/users/teachbase/received_events","type":"Organization","site_admin":false},"repo":{"id":29674544,"name":"amorail","full_name":"teachbase/amorail","owner":{"login":"teachbase","id":10232914,"avatar_url":"https://avatars.githubusercontent.com/u/10232914?v=3","gravatar_id":"","url":"https://api.github.com/users/teachbase","html_url":"https://github.com/teachbase","followers_url":"https://api.github.com/users/teachbase/followers","following_url":"https://api.github.com/users/teachbase/following{/other_user}","gists_url":"https://api.github.com/users/teachbase/gists{/gist_id}","starred_url":"https://api.github.com/users/teachbase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teachbase/subscriptions","organizations_url":"https://api.github.com/users/teachbase/orgs","repos_url":"https://api.github.com/users/teachbase/repos","events_url":"https://api.github.com/users/teachbase/events{/privacy}","received_events_url":"https://api.github.com/users/teachbase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/teachbase/amorail","description":"AmoCRM Rails plugin","fork":false,"url":"https://api.github.com/repos/teachbase/amorail","forks_url":"https://api.github.com/repos/teachbase/amorail/forks","keys_url":"https://api.github.com/repos/teachbase/amorail/keys{/key_id}","collaborators_url":"https://api.github.com/repos/teachbase/amorail/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/teachbase/amorail/teams","hooks_url":"https://api.github.com/repos/teachbase/amorail/hooks","issue_events_url":"https://api.github.com/repos/teachbase/amorail/issues/events{/number}","events_url":"https://api.github.com/repos/teachbase/amorail/events","assignees_url":"https://api.github.com/repos/teachbase/amorail/assignees{/user}","branches_url":"https://api.github.com/repos/teachbase/amorail/branches{/branch}","tags_url":"https://api.github.com/repos/teachbase/amorail/tags","blobs_url":"https://api.github.com/repos/teachbase/amorail/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/teachbase/amorail/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/teachbase/amorail/git/refs{/sha}","trees_url":"https://api.github.com/repos/teachbase/amorail/git/trees{/sha}","statuses_url":"https://api.github.com/repos/teachbase/amorail/statuses/{sha}","languages_url":"https://api.github.com/repos/teachbase/amorail/languages","stargazers_url":"https://api.github.com/repos/teachbase/amorail/stargazers","contributors_url":"https://api.github.com/repos/teachbase/amorail/contributors","subscribers_url":"https://api.github.com/repos/teachbase/amorail/subscribers","subscription_url":"https://api.github.com/repos/teachbase/amorail/subscription","commits_url":"https://api.github.com/repos/teachbase/amorail/commits{/sha}","git_commits_url":"https://api.github.com/repos/teachbase/amorail/git/commits{/sha}","comments_url":"https://api.github.com/repos/teachbase/amorail/comments{/number}","issue_comment_url":"https://api.github.com/repos/teachbase/amorail/issues/comments{/number}","contents_url":"https://api.github.com/repos/teachbase/amorail/contents/{+path}","compare_url":"https://api.github.com/repos/teachbase/amorail/compare/{base}...{head}","merges_url":"https://api.github.com/repos/teachbase/amorail/merges","archive_url":"https://api.github.com/repos/teachbase/amorail/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/teachbase/amorail/downloads","issues_url":"https://api.github.com/repos/teachbase/amorail/issues{/number}","pulls_url":"https://api.github.com/repos/teachbase/amorail/pulls{/number}","milestones_url":"https://api.github.com/repos/teachbase/amorail/milestones{/number}","notifications_url":"https://api.github.com/repos/teachbase/amorail/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/teachbase/amorail/labels{/name}","releases_url":"https://api.github.com/repos/teachbase/amorail/releases{/id}","created_at":"2015-01-22T11:01:40Z","updated_at":"2015-02-12T12:50:29Z","pushed_at":"2015-04-20T15:07:54Z","git_url":"git://github.com/teachbase/amorail.git","ssh_url":"git@github.com:teachbase/amorail.git","clone_url":"https://github.com/teachbase/amorail.git","svn_url":"https://github.com/teachbase/amorail","homepage":null,"size":448,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"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":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/teachbase/amorail/pulls/3"},"html":{"href":"https://github.com/teachbase/amorail/pull/3"},"issue":{"href":"https://api.github.com/repos/teachbase/amorail/issues/3"},"comments":{"href":"https://api.github.com/repos/teachbase/amorail/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/teachbase/amorail/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/teachbase/amorail/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/teachbase/amorail/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/teachbase/amorail/statuses/72af1e04e173fe08cd3c4750b2b5647aac9f7e30"}}}}