{"action":"created","comment":{"url":"https://api.github.com/repos/artsy/eigen/pulls/comments/26713155","id":26713155,"diff_hunk":"@@ -3,28 +3,72 @@\n #import \"ORStackView+ArtsyViews.h\"\n #import \"ARArtworkSetViewController.h\"\n \n+\n @interface ARArtworkRelatedArtworksView() <AREmbeddedModelsDelegate>\n @property (nonatomic, assign) BOOL hasRequested;\n-@property (nonatomic, strong) AFJSONRequestOperation *relatedArtworksRequest;\n+@property (nonatomic, assign) BOOL hasArtworks;\n @property (nonatomic, strong) Artwork *artwork;\n-@property (nonatomic) SaleArtwork *saleArtwork;\n-@property (nonatomic) BOOL hasArtworks;\n+@property (nonatomic, strong) SaleArtwork *saleArtwork;\n+@property (nonatomic, strong) NSArray *relatedArtworkRequests;\n+@end\n+\n+\n+@interface ARArtworkRelatedArtworksContentView : ORStackView\n @property (nonatomic, strong) AREmbeddedModelsViewController *artworksVC;\n+@property (nonatomic, strong) UIView *separator;\n+@end\n+\n+@implementation ARArtworkRelatedArtworksContentView\n+\n+- (instancetype)initWithTag:(ARRelatedArtworksSubviewOrder)tag\n+                     module:(ARArtworkMasonryModule *)module\n+                   artworks:(NSArray *)artworks\n+                    heading:(NSString *)heading;\n+{\n+    if ((self = [super init])) {\n+        self.tag = (NSInteger)tag;\n+        [self addPageSubtitleWithString:heading.uppercaseString withTopMargin:@\"22\" tag:0];\n+        _artworksVC = [[AREmbeddedModelsViewController alloc] init];\n+        _artworksVC.constrainHeightAutomatically = YES;\n+        _artworksVC.activeModule = module;\n+        [_artworksVC appendItems:artworks];\n+        [self addSubview:_artworksVC.view withTopMargin:@\"0\" sideMargin:@\"0\"];\n+        _separator = [self addGenericSeparatorWithSideMargin:@\"40\"];\n+        _separator.hidden = YES;\n+    }\n+    return self;\n+}\n+\n @end\n \n+\n @implementation ARArtworkRelatedArtworksView\n \n-- (instancetype)init\n+- (instancetype)init;","path":"Artsy/Classes/Views/ARArtworkRelatedArtworksView.m","position":49,"original_position":49,"commit_id":"26e6b0afabf95dcf9c1df0becd96e65d442a32b3","original_commit_id":"26e6b0afabf95dcf9c1df0becd96e65d442a32b3","user":{"login":"alloy","id":2320,"avatar_url":"https://avatars.githubusercontent.com/u/2320?v=3","gravatar_id":"","url":"https://api.github.com/users/alloy","html_url":"https://github.com/alloy","followers_url":"https://api.github.com/users/alloy/followers","following_url":"https://api.github.com/users/alloy/following{/other_user}","gists_url":"https://api.github.com/users/alloy/gists{/gist_id}","starred_url":"https://api.github.com/users/alloy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alloy/subscriptions","organizations_url":"https://api.github.com/users/alloy/orgs","repos_url":"https://api.github.com/users/alloy/repos","events_url":"https://api.github.com/users/alloy/events{/privacy}","received_events_url":"https://api.github.com/users/alloy/received_events","type":"User","site_admin":false},"body":"Oops :sake:\r\n\r\nThis happened because I removed the original `init` and then much later wrote a new one. I always add semi-colons in implementation file because then they can be easily copied to the interface… Objections?","created_at":"2015-03-18T22:12:24Z","updated_at":"2015-03-18T22:12:24Z","html_url":"https://github.com/artsy/eigen/pull/277#discussion_r26713155","pull_request_url":"https://api.github.com/repos/artsy/eigen/pulls/277","_links":{"self":{"href":"https://api.github.com/repos/artsy/eigen/pulls/comments/26713155"},"html":{"href":"https://github.com/artsy/eigen/pull/277#discussion_r26713155"},"pull_request":{"href":"https://api.github.com/repos/artsy/eigen/pulls/277"}}},"pull_request":{"url":"https://api.github.com/repos/artsy/eigen/pulls/277","id":31084422,"html_url":"https://github.com/artsy/eigen/pull/277","diff_url":"https://github.com/artsy/eigen/pull/277.diff","patch_url":"https://github.com/artsy/eigen/pull/277.patch","issue_url":"https://api.github.com/repos/artsy/eigen/issues/277","number":277,"state":"open","locked":false,"title":"@ashfurrow => Related artworks.","user":{"login":"alloy","id":2320,"avatar_url":"https://avatars.githubusercontent.com/u/2320?v=3","gravatar_id":"","url":"https://api.github.com/users/alloy","html_url":"https://github.com/alloy","followers_url":"https://api.github.com/users/alloy/followers","following_url":"https://api.github.com/users/alloy/following{/other_user}","gists_url":"https://api.github.com/users/alloy/gists{/gist_id}","starred_url":"https://api.github.com/users/alloy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alloy/subscriptions","organizations_url":"https://api.github.com/users/alloy/orgs","repos_url":"https://api.github.com/users/alloy/repos","events_url":"https://api.github.com/users/alloy/events{/privacy}","received_events_url":"https://api.github.com/users/alloy/received_events","type":"User","site_admin":false},"body":"This fixes #113.\r\n\r\nSo I decided to take the [if-else block](https://github.com/artsy/eigen/blob/2e814fc6216f88c61a2373a2e35db369695e6dba/Artsy/Classes/Views/ARArtworkRelatedArtworksView.m#L51-L69) out of `ARArtworkRelatedArtworksView` and make that a controller concern (still to do). The controller then simply adds the sections for the right context and the view doesn’t need to know about it.\r\n\r\nRight now my biggest question is about [the sale update](https://github.com/artsy/eigen/blob/2e814fc6216f88c61a2373a2e35db369695e6dba/Artsy/Classes/Views/ARArtworkRelatedArtworksView.m#L39-L41), it’s not really clear to me how this is working. I assumed it was so that when you’re looking at an auction lot, it keeps the bids up-to-date? But besides it setting a property (`saleArtwork`) I don’t see how it would do that. Any hints?","created_at":"2015-03-12T22:30:43Z","updated_at":"2015-03-18T22:12:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"49b7f57d9d1d7d397fd485cdfec055d85f2ebd31","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/artsy/eigen/pulls/277/commits","review_comments_url":"https://api.github.com/repos/artsy/eigen/pulls/277/comments","review_comment_url":"https://api.github.com/repos/artsy/eigen/pulls/comments{/number}","comments_url":"https://api.github.com/repos/artsy/eigen/issues/277/comments","statuses_url":"https://api.github.com/repos/artsy/eigen/statuses/26e6b0afabf95dcf9c1df0becd96e65d442a32b3","head":{"label":"artsy:alloy-artwork-related-outside-genes","ref":"alloy-artwork-related-outside-genes","sha":"26e6b0afabf95dcf9c1df0becd96e65d442a32b3","user":{"login":"artsy","id":546231,"avatar_url":"https://avatars.githubusercontent.com/u/546231?v=3","gravatar_id":"","url":"https://api.github.com/users/artsy","html_url":"https://github.com/artsy","followers_url":"https://api.github.com/users/artsy/followers","following_url":"https://api.github.com/users/artsy/following{/other_user}","gists_url":"https://api.github.com/users/artsy/gists{/gist_id}","starred_url":"https://api.github.com/users/artsy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artsy/subscriptions","organizations_url":"https://api.github.com/users/artsy/orgs","repos_url":"https://api.github.com/users/artsy/repos","events_url":"https://api.github.com/users/artsy/events{/privacy}","received_events_url":"https://api.github.com/users/artsy/received_events","type":"Organization","site_admin":false},"repo":{"id":29702213,"name":"eigen","full_name":"artsy/eigen","owner":{"login":"artsy","id":546231,"avatar_url":"https://avatars.githubusercontent.com/u/546231?v=3","gravatar_id":"","url":"https://api.github.com/users/artsy","html_url":"https://github.com/artsy","followers_url":"https://api.github.com/users/artsy/followers","following_url":"https://api.github.com/users/artsy/following{/other_user}","gists_url":"https://api.github.com/users/artsy/gists{/gist_id}","starred_url":"https://api.github.com/users/artsy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artsy/subscriptions","organizations_url":"https://api.github.com/users/artsy/orgs","repos_url":"https://api.github.com/users/artsy/repos","events_url":"https://api.github.com/users/artsy/events{/privacy}","received_events_url":"https://api.github.com/users/artsy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/artsy/eigen","description":"The Art World in Your Pocket, Artsy's iOS app.","fork":false,"url":"https://api.github.com/repos/artsy/eigen","forks_url":"https://api.github.com/repos/artsy/eigen/forks","keys_url":"https://api.github.com/repos/artsy/eigen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/artsy/eigen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/artsy/eigen/teams","hooks_url":"https://api.github.com/repos/artsy/eigen/hooks","issue_events_url":"https://api.github.com/repos/artsy/eigen/issues/events{/number}","events_url":"https://api.github.com/repos/artsy/eigen/events","assignees_url":"https://api.github.com/repos/artsy/eigen/assignees{/user}","branches_url":"https://api.github.com/repos/artsy/eigen/branches{/branch}","tags_url":"https://api.github.com/repos/artsy/eigen/tags","blobs_url":"https://api.github.com/repos/artsy/eigen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/artsy/eigen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/artsy/eigen/git/refs{/sha}","trees_url":"https://api.github.com/repos/artsy/eigen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/artsy/eigen/statuses/{sha}","languages_url":"https://api.github.com/repos/artsy/eigen/languages","stargazers_url":"https://api.github.com/repos/artsy/eigen/stargazers","contributors_url":"https://api.github.com/repos/artsy/eigen/contributors","subscribers_url":"https://api.github.com/repos/artsy/eigen/subscribers","subscription_url":"https://api.github.com/repos/artsy/eigen/subscription","commits_url":"https://api.github.com/repos/artsy/eigen/commits{/sha}","git_commits_url":"https://api.github.com/repos/artsy/eigen/git/commits{/sha}","comments_url":"https://api.github.com/repos/artsy/eigen/comments{/number}","issue_comment_url":"https://api.github.com/repos/artsy/eigen/issues/comments{/number}","contents_url":"https://api.github.com/repos/artsy/eigen/contents/{+path}","compare_url":"https://api.github.com/repos/artsy/eigen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/artsy/eigen/merges","archive_url":"https://api.github.com/repos/artsy/eigen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/artsy/eigen/downloads","issues_url":"https://api.github.com/repos/artsy/eigen/issues{/number}","pulls_url":"https://api.github.com/repos/artsy/eigen/pulls{/number}","milestones_url":"https://api.github.com/repos/artsy/eigen/milestones{/number}","notifications_url":"https://api.github.com/repos/artsy/eigen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/artsy/eigen/labels{/name}","releases_url":"https://api.github.com/repos/artsy/eigen/releases{/id}","created_at":"2015-01-22T21:52:39Z","updated_at":"2015-03-18T18:17:40Z","pushed_at":"2015-03-17T23:33:44Z","git_url":"git://github.com/artsy/eigen.git","ssh_url":"git@github.com:artsy/eigen.git","clone_url":"https://github.com/artsy/eigen.git","svn_url":"https://github.com/artsy/eigen","homepage":"http://iphone.artsy.net","size":29538,"stargazers_count":513,"watchers_count":513,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":61,"mirror_url":null,"open_issues_count":101,"forks":61,"open_issues":101,"watchers":513,"default_branch":"master"}},"base":{"label":"artsy:master","ref":"master","sha":"57641664f89e8085e6092b367d45280aee63e31b","user":{"login":"artsy","id":546231,"avatar_url":"https://avatars.githubusercontent.com/u/546231?v=3","gravatar_id":"","url":"https://api.github.com/users/artsy","html_url":"https://github.com/artsy","followers_url":"https://api.github.com/users/artsy/followers","following_url":"https://api.github.com/users/artsy/following{/other_user}","gists_url":"https://api.github.com/users/artsy/gists{/gist_id}","starred_url":"https://api.github.com/users/artsy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artsy/subscriptions","organizations_url":"https://api.github.com/users/artsy/orgs","repos_url":"https://api.github.com/users/artsy/repos","events_url":"https://api.github.com/users/artsy/events{/privacy}","received_events_url":"https://api.github.com/users/artsy/received_events","type":"Organization","site_admin":false},"repo":{"id":29702213,"name":"eigen","full_name":"artsy/eigen","owner":{"login":"artsy","id":546231,"avatar_url":"https://avatars.githubusercontent.com/u/546231?v=3","gravatar_id":"","url":"https://api.github.com/users/artsy","html_url":"https://github.com/artsy","followers_url":"https://api.github.com/users/artsy/followers","following_url":"https://api.github.com/users/artsy/following{/other_user}","gists_url":"https://api.github.com/users/artsy/gists{/gist_id}","starred_url":"https://api.github.com/users/artsy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artsy/subscriptions","organizations_url":"https://api.github.com/users/artsy/orgs","repos_url":"https://api.github.com/users/artsy/repos","events_url":"https://api.github.com/users/artsy/events{/privacy}","received_events_url":"https://api.github.com/users/artsy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/artsy/eigen","description":"The Art World in Your Pocket, Artsy's iOS app.","fork":false,"url":"https://api.github.com/repos/artsy/eigen","forks_url":"https://api.github.com/repos/artsy/eigen/forks","keys_url":"https://api.github.com/repos/artsy/eigen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/artsy/eigen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/artsy/eigen/teams","hooks_url":"https://api.github.com/repos/artsy/eigen/hooks","issue_events_url":"https://api.github.com/repos/artsy/eigen/issues/events{/number}","events_url":"https://api.github.com/repos/artsy/eigen/events","assignees_url":"https://api.github.com/repos/artsy/eigen/assignees{/user}","branches_url":"https://api.github.com/repos/artsy/eigen/branches{/branch}","tags_url":"https://api.github.com/repos/artsy/eigen/tags","blobs_url":"https://api.github.com/repos/artsy/eigen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/artsy/eigen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/artsy/eigen/git/refs{/sha}","trees_url":"https://api.github.com/repos/artsy/eigen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/artsy/eigen/statuses/{sha}","languages_url":"https://api.github.com/repos/artsy/eigen/languages","stargazers_url":"https://api.github.com/repos/artsy/eigen/stargazers","contributors_url":"https://api.github.com/repos/artsy/eigen/contributors","subscribers_url":"https://api.github.com/repos/artsy/eigen/subscribers","subscription_url":"https://api.github.com/repos/artsy/eigen/subscription","commits_url":"https://api.github.com/repos/artsy/eigen/commits{/sha}","git_commits_url":"https://api.github.com/repos/artsy/eigen/git/commits{/sha}","comments_url":"https://api.github.com/repos/artsy/eigen/comments{/number}","issue_comment_url":"https://api.github.com/repos/artsy/eigen/issues/comments{/number}","contents_url":"https://api.github.com/repos/artsy/eigen/contents/{+path}","compare_url":"https://api.github.com/repos/artsy/eigen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/artsy/eigen/merges","archive_url":"https://api.github.com/repos/artsy/eigen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/artsy/eigen/downloads","issues_url":"https://api.github.com/repos/artsy/eigen/issues{/number}","pulls_url":"https://api.github.com/repos/artsy/eigen/pulls{/number}","milestones_url":"https://api.github.com/repos/artsy/eigen/milestones{/number}","notifications_url":"https://api.github.com/repos/artsy/eigen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/artsy/eigen/labels{/name}","releases_url":"https://api.github.com/repos/artsy/eigen/releases{/id}","created_at":"2015-01-22T21:52:39Z","updated_at":"2015-03-18T18:17:40Z","pushed_at":"2015-03-17T23:33:44Z","git_url":"git://github.com/artsy/eigen.git","ssh_url":"git@github.com:artsy/eigen.git","clone_url":"https://github.com/artsy/eigen.git","svn_url":"https://github.com/artsy/eigen","homepage":"http://iphone.artsy.net","size":29538,"stargazers_count":513,"watchers_count":513,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":61,"mirror_url":null,"open_issues_count":101,"forks":61,"open_issues":101,"watchers":513,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/artsy/eigen/pulls/277"},"html":{"href":"https://github.com/artsy/eigen/pull/277"},"issue":{"href":"https://api.github.com/repos/artsy/eigen/issues/277"},"comments":{"href":"https://api.github.com/repos/artsy/eigen/issues/277/comments"},"review_comments":{"href":"https://api.github.com/repos/artsy/eigen/pulls/277/comments"},"review_comment":{"href":"https://api.github.com/repos/artsy/eigen/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/artsy/eigen/pulls/277/commits"},"statuses":{"href":"https://api.github.com/repos/artsy/eigen/statuses/26e6b0afabf95dcf9c1df0becd96e65d442a32b3"}}}}