GitHub PullRequestReviewCommentEvent at 2014-12-19 18:11:30
Repository: catarse
Actor: cerberusci
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/volmer/catarse/pulls/comments/22119053","id":22119053,"diff_hunk":"@@ -2,319 +2,319 @@\n # coding: utf-8\n class Project < ActiveRecord::Base\n \n-  include ActionView::Helpers::NumberHelper\n-  include ActionView::Helpers::TextHelper\n-  include ActionView::Helpers::UrlHelper\n-  include ERB::Util\n-  include Rails.application.routes.url_helpers\n-  include PgSearch\n-  extend CatarseAutoHtml\n-\n-  before_save do\n-    if online_days_changed? || !self.expires_at.present?\n-      self.expires_at = DateTime.now+(online_days rescue 0).days\n-    end\n-  end\n-\n-  mount_uploader :uploaded_image, LogoUploader\n-\n-  delegate :display_status, :display_progress, :display_image, :display_expires_at,\n-    :display_pledged, :display_goal, :remaining_days, :video_embed_url,\n-    :to => :decorator\n-\n-  schema_associations\n-  belongs_to :user\n-  has_many :backers, :dependent => :destroy\n-  has_many :rewards, :dependent => :destroy\n-  has_many :updates, :dependent => :destroy\n-  has_many :notifications, :dependent => :destroy\n-  has_one :project_total\n-  accepts_nested_attributes_for :rewards\n-\n-  catarse_auto_html_for field: :about, video_width: 600, video_height: 403\n-\n-  pg_search_scope :pg_search, against: [\n-      [:name, 'A'],\n-      [:headline, 'B'],\n-      [:about, 'C']\n-    ],\n-    associated_against:  {user: [:name, :address_city ]},\n-    :using => {tsearch: {:dictionary => \"portuguese\"}},\n-    ignoring: :accents\n-\n-  scope :by_progress, ->(progress) { joins(:project_total).where(\"project_totals.pledged >= projects.goal*?\", progress.to_i/100.to_f) }\n-  scope :by_state, ->(state) { where(state: state) }\n-  scope :by_id, ->(id) { where(id: id) }\n-  scope :by_permalink, ->(p) { where(permalink: p) }\n-  scope :by_category_id, ->(id) { where(category_id: id) }\n-  scope :name_contains, ->(term) { where(\"unaccent(upper(name)) LIKE ('%'||unaccent(upper(?))||'%')\", term) }\n-  scope :user_name_contains, ->(term) { joins(:user).where(\"unaccent(upper(users.name)) LIKE ('%'||unaccent(upper(?))||'%')\", term) }\n-  scope :order_table, ->(sort) {\n-    if sort == 'desc'\n-      order('goal desc')\n-    else\n-      order('goal asc')\n-    end\n-  }\n-\n-  scope :visible, where(\"state NOT IN ('draft', 'rejected')\")\n-  scope :financial, where(\"(expires_at > current_timestamp - '15 days'::interval) AND (state in ('online', 'successful', 'waiting_funds'))\")\n-  scope :recommended, where(recommended: true)\n-  scope :expired, where(\"expires_at < current_timestamp\")\n-  scope :not_expired, where(\"expires_at >= current_timestamp\")\n-  scope :expiring, not_expired.where(\"expires_at < (current_timestamp + interval '2 weeks')\")\n-  scope :not_expiring, not_expired.where(\"NOT (expires_at < (current_timestamp + interval '2 weeks'))\")\n-  scope :recent, where(\"current_timestamp - projects.created_at <= '15 days'::interval\")\n-  scope :successful, where(state: 'successful')\n-  scope :online, where(state: 'online')\n-  scope :recommended_for_home, ->{\n-    includes(:user, :category, :project_total).\n-    recommended.\n-    visible.\n-    not_expired.\n-    order('random()').\n-    limit(4)\n-  }\n-  scope :order_for_search, ->{ reorder(\"\n-                                     CASE state\n-                                     WHEN 'online' THEN 1\n-                                     WHEN 'waiting_funds' THEN 2\n-                                     WHEN 'successful' THEN 3\n-                                     WHEN 'failed' THEN 4\n-                                     END ASC, created_at DESC, id DESC\") }\n-  scope :expiring_for_home, ->(exclude_ids){\n-    includes(:user, :category, :project_total).where(\"coalesce(id NOT IN (?), true)\", exclude_ids).visible.expiring.order('date(expires_at), random()').limit(3)\n-  }\n-  scope :recent_for_home, ->(exclude_ids){\n-    includes(:user, :category, :project_total).where(\"coalesce(id NOT IN (?), true)\", exclude_ids).visible.recent.not_expiring.order('date(created_at) DESC, random()').limit(3)\n-  }\n-  scope :backed_by, ->(user_id){\n-    where(\"id IN (SELECT project_id FROM backers b WHERE b.confirmed AND b.user_id = ?)\", user_id)\n-  }\n-\n-  validates :video_url, presence: true, if: ->(p) { p.state_name == 'online' }\n-  validates_presence_of :name, :user, :category, :about, :headline, :goal, :permalink\n-  validates_length_of :headline, :maximum => 140\n-  validates_numericality_of :online_days, :less_than_or_equal_to => 60\n-  validates_uniqueness_of :permalink, :allow_blank => true, :allow_nil => true, :case_sensitive => false\n-  validates_format_of :permalink, with: /^(\\w|-)*$/, :allow_blank => true, :allow_nil => true\n-  validates_format_of :video_url, with: Regexp.union(/https?:\\/\\/(www\\.)?vimeo.com\\/(\\d+)/, VideoInfo::Youtube.new('').regex), message: I18n.t('project.video_regex_validation'), allow_blank: true\n-  mount_uploader :video_thumbnail, LogoUploader\n-\n-  def self.between_created_at(start_at, ends_at)\n-    return scoped unless start_at.present? && ends_at.present?\n-    where(\"created_at between to_date(?, 'dd/mm/yyyy') and to_date(?, 'dd/mm/yyyy')\", start_at, ends_at)\n-  end\n-\n-  def self.between_expires_at(start_at, ends_at)\n-    return scoped unless start_at.present? && ends_at.present?\n-    where(\"expires_at between to_date(?, 'dd/mm/yyyy') and to_date(?, 'dd/mm/yyyy')\", start_at, ends_at)\n-  end\n-\n-  def self.finish_projects!\n-    expired.each do |resource|\n-      Rails.logger.info \"[FINISHING PROJECT #{resource.id}] #{resource.name}\"\n-      resource.finish\n-    end\n-  end\n-\n-  def self.state_names\n-    self.state_machine.states.map &:name\n-  end\n-\n-  def subscribed_users\n-    User.subscribed_to_updates.subscribed_to_project(self.id)\n-  end\n-\n-  def decorator\n-    @decorator ||= ProjectDecorator.new(self)\n-  end\n-\n-  def video\n-    if self.video_url.present?\n-      if @video.blank? || (@video.url != self.video_url)\n-        @video = VideoInfo.get(self.video_url)\n+    include ActionView::Helpers::NumberHelper\n+    include ActionView::Helpers::TextHelper\n+    include ActionView::Helpers::UrlHelper\n+    include ERB::Util\n+    include Rails.application.routes.url_helpers\n+    include PgSearch\n+    extend CatarseAutoHtml\n+\n+    before_save do\n+      if online_days_changed? || !self.expires_at.present?\n+        self.expires_at = DateTime.now+(online_days rescue 0).days\n+      end\n+    end\n+\n+    mount_uploader :uploaded_image, LogoUploader\n+\n+    delegate :display_status, :display_progress, :display_image, :display_expires_at,","path":"app/models/project.rb","position":152,"original_position":152,"commit_id":"1376ff3763b054bacfdab6f709306af412abea8d","original_commit_id":"1376ff3763b054bacfdab6f709306af412abea8d","user":{"login":"cerberusci","id":8737644,"avatar_url":"https://avatars.githubusercontent.com/u/8737644?v=3","gravatar_id":"","url":"https://api.github.com/users/cerberusci","html_url":"https://github.com/cerberusci","followers_url":"https://api.github.com/users/cerberusci/followers","following_url":"https://api.github.com/users/cerberusci/following{/other_user}","gists_url":"https://api.github.com/users/cerberusci/gists{/gist_id}","starred_url":"https://api.github.com/users/cerberusci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cerberusci/subscriptions","organizations_url":"https://api.github.com/users/cerberusci/orgs","repos_url":"https://api.github.com/users/cerberusci/repos","events_url":"https://api.github.com/users/cerberusci/events{/privacy}","received_events_url":"https://api.github.com/users/cerberusci/received_events","type":"User","site_admin":false},"body":"Line is too long. [85/80]","created_at":"2014-12-19T18:11:30Z","updated_at":"2014-12-19T18:11:30Z","html_url":"https://github.com/volmer/catarse/pull/9#discussion_r22119053","pull_request_url":"https://api.github.com/repos/volmer/catarse/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/volmer/catarse/pulls/comments/22119053"},"html":{"href":"https://github.com/volmer/catarse/pull/9#discussion_r22119053"},"pull_request":{"href":"https://api.github.com/repos/volmer/catarse/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/volmer/catarse/pulls/9","id":21175957,"html_url":"https://github.com/volmer/catarse/pull/9","diff_url":"https://github.com/volmer/catarse/pull/9.diff","patch_url":"https://github.com/volmer/catarse/pull/9.patch","issue_url":"https://api.github.com/repos/volmer/catarse/issues/9","number":9,"state":"open","locked":false,"title":"Nasty pr","user":{"login":"volmer","id":301187,"avatar_url":"https://avatars.githubusercontent.com/u/301187?v=3","gravatar_id":"","url":"https://api.github.com/users/volmer","html_url":"https://github.com/volmer","followers_url":"https://api.github.com/users/volmer/followers","following_url":"https://api.github.com/users/volmer/following{/other_user}","gists_url":"https://api.github.com/users/volmer/gists{/gist_id}","starred_url":"https://api.github.com/users/volmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volmer/subscriptions","organizations_url":"https://api.github.com/users/volmer/orgs","repos_url":"https://api.github.com/users/volmer/repos","events_url":"https://api.github.com/users/volmer/events{/privacy}","received_events_url":"https://api.github.com/users/volmer/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-09-12T20:08:37Z","updated_at":"2014-12-19T18:11:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"25b087e0f66d8e9a8b237604a418de4d7f026d63","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/volmer/catarse/pulls/9/commits","review_comments_url":"https://api.github.com/repos/volmer/catarse/pulls/9/comments","review_comment_url":"https://api.github.com/repos/volmer/catarse/pulls/comments/{number}","comments_url":"https://api.github.com/repos/volmer/catarse/issues/9/comments","statuses_url":"https://api.github.com/repos/volmer/catarse/statuses/1376ff3763b054bacfdab6f709306af412abea8d","head":{"label":"volmer:bad_pr_2","ref":"bad_pr_2","sha":"1376ff3763b054bacfdab6f709306af412abea8d","user":{"login":"volmer","id":301187,"avatar_url":"https://avatars.githubusercontent.com/u/301187?v=3","gravatar_id":"","url":"https://api.github.com/users/volmer","html_url":"https://github.com/volmer","followers_url":"https://api.github.com/users/volmer/followers","following_url":"https://api.github.com/users/volmer/following{/other_user}","gists_url":"https://api.github.com/users/volmer/gists{/gist_id}","starred_url":"https://api.github.com/users/volmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volmer/subscriptions","organizations_url":"https://api.github.com/users/volmer/orgs","repos_url":"https://api.github.com/users/volmer/repos","events_url":"https://api.github.com/users/volmer/events{/privacy}","received_events_url":"https://api.github.com/users/volmer/received_events","type":"User","site_admin":false},"repo":{"id":8314225,"name":"catarse","full_name":"volmer/catarse","owner":{"login":"volmer","id":301187,"avatar_url":"https://avatars.githubusercontent.com/u/301187?v=3","gravatar_id":"","url":"https://api.github.com/users/volmer","html_url":"https://github.com/volmer","followers_url":"https://api.github.com/users/volmer/followers","following_url":"https://api.github.com/users/volmer/following{/other_user}","gists_url":"https://api.github.com/users/volmer/gists{/gist_id}","starred_url":"https://api.github.com/users/volmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volmer/subscriptions","organizations_url":"https://api.github.com/users/volmer/orgs","repos_url":"https://api.github.com/users/volmer/repos","events_url":"https://api.github.com/users/volmer/events{/privacy}","received_events_url":"https://api.github.com/users/volmer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/volmer/catarse","description":"The first open source crowdfunding platform for creative projects in the world","fork":true,"url":"https://api.github.com/repos/volmer/catarse","forks_url":"https://api.github.com/repos/volmer/catarse/forks","keys_url":"https://api.github.com/repos/volmer/catarse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/volmer/catarse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/volmer/catarse/teams","hooks_url":"https://api.github.com/repos/volmer/catarse/hooks","issue_events_url":"https://api.github.com/repos/volmer/catarse/issues/events{/number}","events_url":"https://api.github.com/repos/volmer/catarse/events","assignees_url":"https://api.github.com/repos/volmer/catarse/assignees{/user}","branches_url":"https://api.github.com/repos/volmer/catarse/branches{/branch}","tags_url":"https://api.github.com/repos/volmer/catarse/tags","blobs_url":"https://api.github.com/repos/volmer/catarse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/volmer/catarse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/volmer/catarse/git/refs{/sha}","trees_url":"https://api.github.com/repos/volmer/catarse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/volmer/catarse/statuses/{sha}","languages_url":"https://api.github.com/repos/volmer/catarse/languages","stargazers_url":"https://api.github.com/repos/volmer/catarse/stargazers","contributors_url":"https://api.github.com/repos/volmer/catarse/contributors","subscribers_url":"https://api.github.com/repos/volmer/catarse/subscribers","subscription_url":"https://api.github.com/repos/volmer/catarse/subscription","commits_url":"https://api.github.com/repos/volmer/catarse/commits{/sha}","git_commits_url":"https://api.github.com/repos/volmer/catarse/git/commits{/sha}","comments_url":"https://api.github.com/repos/volmer/catarse/comments{/number}","issue_comment_url":"https://api.github.com/repos/volmer/catarse/issues/comments/{number}","contents_url":"https://api.github.com/repos/volmer/catarse/contents/{+path}","compare_url":"https://api.github.com/repos/volmer/catarse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/volmer/catarse/merges","archive_url":"https://api.github.com/repos/volmer/catarse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/volmer/catarse/downloads","issues_url":"https://api.github.com/repos/volmer/catarse/issues{/number}","pulls_url":"https://api.github.com/repos/volmer/catarse/pulls{/number}","milestones_url":"https://api.github.com/repos/volmer/catarse/milestones{/number}","notifications_url":"https://api.github.com/repos/volmer/catarse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/volmer/catarse/labels{/name}","releases_url":"https://api.github.com/repos/volmer/catarse/releases{/id}","created_at":"2013-02-20T14:05:47Z","updated_at":"2013-05-01T20:52:34Z","pushed_at":"2014-09-12T20:08:07Z","git_url":"git://github.com/volmer/catarse.git","ssh_url":"git@github.com:volmer/catarse.git","clone_url":"https://github.com/volmer/catarse.git","svn_url":"https://github.com/volmer/catarse","homepage":"http://catarse.me","size":30773,"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":"master"}},"base":{"label":"volmer:master","ref":"master","sha":"b514ca84b4d63770fe3858f2430938a43202d7a9","user":{"login":"volmer","id":301187,"avatar_url":"https://avatars.githubusercontent.com/u/301187?v=3","gravatar_id":"","url":"https://api.github.com/users/volmer","html_url":"https://github.com/volmer","followers_url":"https://api.github.com/users/volmer/followers","following_url":"https://api.github.com/users/volmer/following{/other_user}","gists_url":"https://api.github.com/users/volmer/gists{/gist_id}","starred_url":"https://api.github.com/users/volmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volmer/subscriptions","organizations_url":"https://api.github.com/users/volmer/orgs","repos_url":"https://api.github.com/users/volmer/repos","events_url":"https://api.github.com/users/volmer/events{/privacy}","received_events_url":"https://api.github.com/users/volmer/received_events","type":"User","site_admin":false},"repo":{"id":8314225,"name":"catarse","full_name":"volmer/catarse","owner":{"login":"volmer","id":301187,"avatar_url":"https://avatars.githubusercontent.com/u/301187?v=3","gravatar_id":"","url":"https://api.github.com/users/volmer","html_url":"https://github.com/volmer","followers_url":"https://api.github.com/users/volmer/followers","following_url":"https://api.github.com/users/volmer/following{/other_user}","gists_url":"https://api.github.com/users/volmer/gists{/gist_id}","starred_url":"https://api.github.com/users/volmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volmer/subscriptions","organizations_url":"https://api.github.com/users/volmer/orgs","repos_url":"https://api.github.com/users/volmer/repos","events_url":"https://api.github.com/users/volmer/events{/privacy}","received_events_url":"https://api.github.com/users/volmer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/volmer/catarse","description":"The first open source crowdfunding platform for creative projects in the world","fork":true,"url":"https://api.github.com/repos/volmer/catarse","forks_url":"https://api.github.com/repos/volmer/catarse/forks","keys_url":"https://api.github.com/repos/volmer/catarse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/volmer/catarse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/volmer/catarse/teams","hooks_url":"https://api.github.com/repos/volmer/catarse/hooks","issue_events_url":"https://api.github.com/repos/volmer/catarse/issues/events{/number}","events_url":"https://api.github.com/repos/volmer/catarse/events","assignees_url":"https://api.github.com/repos/volmer/catarse/assignees{/user}","branches_url":"https://api.github.com/repos/volmer/catarse/branches{/branch}","tags_url":"https://api.github.com/repos/volmer/catarse/tags","blobs_url":"https://api.github.com/repos/volmer/catarse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/volmer/catarse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/volmer/catarse/git/refs{/sha}","trees_url":"https://api.github.com/repos/volmer/catarse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/volmer/catarse/statuses/{sha}","languages_url":"https://api.github.com/repos/volmer/catarse/languages","stargazers_url":"https://api.github.com/repos/volmer/catarse/stargazers","contributors_url":"https://api.github.com/repos/volmer/catarse/contributors","subscribers_url":"https://api.github.com/repos/volmer/catarse/subscribers","subscription_url":"https://api.github.com/repos/volmer/catarse/subscription","commits_url":"https://api.github.com/repos/volmer/catarse/commits{/sha}","git_commits_url":"https://api.github.com/repos/volmer/catarse/git/commits{/sha}","comments_url":"https://api.github.com/repos/volmer/catarse/comments{/number}","issue_comment_url":"https://api.github.com/repos/volmer/catarse/issues/comments/{number}","contents_url":"https://api.github.com/repos/volmer/catarse/contents/{+path}","compare_url":"https://api.github.com/repos/volmer/catarse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/volmer/catarse/merges","archive_url":"https://api.github.com/repos/volmer/catarse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/volmer/catarse/downloads","issues_url":"https://api.github.com/repos/volmer/catarse/issues{/number}","pulls_url":"https://api.github.com/repos/volmer/catarse/pulls{/number}","milestones_url":"https://api.github.com/repos/volmer/catarse/milestones{/number}","notifications_url":"https://api.github.com/repos/volmer/catarse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/volmer/catarse/labels{/name}","releases_url":"https://api.github.com/repos/volmer/catarse/releases{/id}","created_at":"2013-02-20T14:05:47Z","updated_at":"2013-05-01T20:52:34Z","pushed_at":"2014-09-12T20:08:07Z","git_url":"git://github.com/volmer/catarse.git","ssh_url":"git@github.com:volmer/catarse.git","clone_url":"https://github.com/volmer/catarse.git","svn_url":"https://github.com/volmer/catarse","homepage":"http://catarse.me","size":30773,"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":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/volmer/catarse/pulls/9"},"html":{"href":"https://github.com/volmer/catarse/pull/9"},"issue":{"href":"https://api.github.com/repos/volmer/catarse/issues/9"},"comments":{"href":"https://api.github.com/repos/volmer/catarse/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/volmer/catarse/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/volmer/catarse/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/volmer/catarse/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/volmer/catarse/statuses/1376ff3763b054bacfdab6f709306af412abea8d"}}}}