{"action":"created","comment":{"url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/pulls/comments/30968359","id":30968359,"diff_hunk":"@@ -1,8 +1,30 @@\n class Invoice < ActiveRecord::Base\n   has_many :line_items\n   belongs_to :client\n+  has_one :address, as: :addressdetail, dependent: :destroy\n+  accepts_nested_attributes_for :line_items, allow_destroy: true\n+  acts_as_sequenced column: :invoice_number, start_at: 1000\n \n-  accepts_nested_attributes_for :line_items, :allow_destroy => true\n+  def self.find_next_available_number_for(default=1000)\n+    (self.maximum(:invoice_number) || default).succ\n+  end\n \n-  validates :item_id, presence: true\n+  def date_of_issue=(val)\n+    write_attribute(:date_of_issue, parse_date(val)) if val.present?\n+  end\n+\n+  def paid_to_date=(val)","path":"app/models/invoice.rb","position":18,"original_position":18,"commit_id":"9cc9a6ad0715a834291c627ba79ad6644f454bf8","original_commit_id":"9cc9a6ad0715a834291c627ba79ad6644f454bf8","user":{"login":"AmitPatel-BoTreeConsulting","id":1289894,"avatar_url":"https://avatars.githubusercontent.com/u/1289894?v=3","gravatar_id":"","url":"https://api.github.com/users/AmitPatel-BoTreeConsulting","html_url":"https://github.com/AmitPatel-BoTreeConsulting","followers_url":"https://api.github.com/users/AmitPatel-BoTreeConsulting/followers","following_url":"https://api.github.com/users/AmitPatel-BoTreeConsulting/following{/other_user}","gists_url":"https://api.github.com/users/AmitPatel-BoTreeConsulting/gists{/gist_id}","starred_url":"https://api.github.com/users/AmitPatel-BoTreeConsulting/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmitPatel-BoTreeConsulting/subscriptions","organizations_url":"https://api.github.com/users/AmitPatel-BoTreeConsulting/orgs","repos_url":"https://api.github.com/users/AmitPatel-BoTreeConsulting/repos","events_url":"https://api.github.com/users/AmitPatel-BoTreeConsulting/events{/privacy}","received_events_url":"https://api.github.com/users/AmitPatel-BoTreeConsulting/received_events","type":"User","site_admin":false},"body":"use meaningful name for `val`. eg. `pay_by_date`","created_at":"2015-05-25T08:23:18Z","updated_at":"2015-05-25T08:23:18Z","html_url":"https://github.com/BoTreeConsultingTeam/invoiceme/pull/40#discussion_r30968359","pull_request_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/pulls/40","_links":{"self":{"href":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/pulls/comments/30968359"},"html":{"href":"https://github.com/BoTreeConsultingTeam/invoiceme/pull/40#discussion_r30968359"},"pull_request":{"href":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/pulls/40","id":35629475,"html_url":"https://github.com/BoTreeConsultingTeam/invoiceme/pull/40","diff_url":"https://github.com/BoTreeConsultingTeam/invoiceme/pull/40.diff","patch_url":"https://github.com/BoTreeConsultingTeam/invoiceme/pull/40.patch","issue_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/issues/40","number":40,"state":"open","locked":false,"title":"Development invoice management 39","user":{"login":"PragatiDoshi-BTC","id":10512791,"avatar_url":"https://avatars.githubusercontent.com/u/10512791?v=3","gravatar_id":"","url":"https://api.github.com/users/PragatiDoshi-BTC","html_url":"https://github.com/PragatiDoshi-BTC","followers_url":"https://api.github.com/users/PragatiDoshi-BTC/followers","following_url":"https://api.github.com/users/PragatiDoshi-BTC/following{/other_user}","gists_url":"https://api.github.com/users/PragatiDoshi-BTC/gists{/gist_id}","starred_url":"https://api.github.com/users/PragatiDoshi-BTC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PragatiDoshi-BTC/subscriptions","organizations_url":"https://api.github.com/users/PragatiDoshi-BTC/orgs","repos_url":"https://api.github.com/users/PragatiDoshi-BTC/repos","events_url":"https://api.github.com/users/PragatiDoshi-BTC/events{/privacy}","received_events_url":"https://api.github.com/users/PragatiDoshi-BTC/received_events","type":"User","site_admin":false},"body":"invoice management price calculation in add & edit invoice","created_at":"2015-05-18T12:43:45Z","updated_at":"2015-05-25T08:23:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"02847f3bc05614c1ff61aae6e67a86e09f341fa0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/pulls/40/commits","review_comments_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/pulls/40/comments","review_comment_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/issues/40/comments","statuses_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/statuses/9cc9a6ad0715a834291c627ba79ad6644f454bf8","head":{"label":"BoTreeConsultingTeam:development-invoice-management-39","ref":"development-invoice-management-39","sha":"9cc9a6ad0715a834291c627ba79ad6644f454bf8","user":{"login":"BoTreeConsultingTeam","id":3539381,"avatar_url":"https://avatars.githubusercontent.com/u/3539381?v=3","gravatar_id":"","url":"https://api.github.com/users/BoTreeConsultingTeam","html_url":"https://github.com/BoTreeConsultingTeam","followers_url":"https://api.github.com/users/BoTreeConsultingTeam/followers","following_url":"https://api.github.com/users/BoTreeConsultingTeam/following{/other_user}","gists_url":"https://api.github.com/users/BoTreeConsultingTeam/gists{/gist_id}","starred_url":"https://api.github.com/users/BoTreeConsultingTeam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BoTreeConsultingTeam/subscriptions","organizations_url":"https://api.github.com/users/BoTreeConsultingTeam/orgs","repos_url":"https://api.github.com/users/BoTreeConsultingTeam/repos","events_url":"https://api.github.com/users/BoTreeConsultingTeam/events{/privacy}","received_events_url":"https://api.github.com/users/BoTreeConsultingTeam/received_events","type":"Organization","site_admin":false},"repo":{"id":30966477,"name":"invoiceme","full_name":"BoTreeConsultingTeam/invoiceme","owner":{"login":"BoTreeConsultingTeam","id":3539381,"avatar_url":"https://avatars.githubusercontent.com/u/3539381?v=3","gravatar_id":"","url":"https://api.github.com/users/BoTreeConsultingTeam","html_url":"https://github.com/BoTreeConsultingTeam","followers_url":"https://api.github.com/users/BoTreeConsultingTeam/followers","following_url":"https://api.github.com/users/BoTreeConsultingTeam/following{/other_user}","gists_url":"https://api.github.com/users/BoTreeConsultingTeam/gists{/gist_id}","starred_url":"https://api.github.com/users/BoTreeConsultingTeam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BoTreeConsultingTeam/subscriptions","organizations_url":"https://api.github.com/users/BoTreeConsultingTeam/orgs","repos_url":"https://api.github.com/users/BoTreeConsultingTeam/repos","events_url":"https://api.github.com/users/BoTreeConsultingTeam/events{/privacy}","received_events_url":"https://api.github.com/users/BoTreeConsultingTeam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BoTreeConsultingTeam/invoiceme","description":"Invoice management","fork":false,"url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme","forks_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/forks","keys_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/teams","hooks_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/hooks","issue_events_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/issues/events{/number}","events_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/events","assignees_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/assignees{/user}","branches_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/branches{/branch}","tags_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/tags","blobs_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/git/refs{/sha}","trees_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/statuses/{sha}","languages_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/languages","stargazers_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/stargazers","contributors_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/contributors","subscribers_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/subscribers","subscription_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/subscription","commits_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/commits{/sha}","git_commits_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/git/commits{/sha}","comments_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/comments{/number}","issue_comment_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/issues/comments{/number}","contents_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/contents/{+path}","compare_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/merges","archive_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/downloads","issues_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/issues{/number}","pulls_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/pulls{/number}","milestones_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/milestones{/number}","notifications_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/labels{/name}","releases_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/releases{/id}","created_at":"2015-02-18T13:25:29Z","updated_at":"2015-05-05T13:51:14Z","pushed_at":"2015-05-25T07:41:55Z","git_url":"git://github.com/BoTreeConsultingTeam/invoiceme.git","ssh_url":"git@github.com:BoTreeConsultingTeam/invoiceme.git","clone_url":"https://github.com/BoTreeConsultingTeam/invoiceme.git","svn_url":"https://github.com/BoTreeConsultingTeam/invoiceme","homepage":null,"size":1308,"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":28,"forks":0,"open_issues":28,"watchers":0,"default_branch":"master"}},"base":{"label":"BoTreeConsultingTeam:development","ref":"development","sha":"2dec563b4b0d51725b32f7cb9d1144e737b89e8a","user":{"login":"BoTreeConsultingTeam","id":3539381,"avatar_url":"https://avatars.githubusercontent.com/u/3539381?v=3","gravatar_id":"","url":"https://api.github.com/users/BoTreeConsultingTeam","html_url":"https://github.com/BoTreeConsultingTeam","followers_url":"https://api.github.com/users/BoTreeConsultingTeam/followers","following_url":"https://api.github.com/users/BoTreeConsultingTeam/following{/other_user}","gists_url":"https://api.github.com/users/BoTreeConsultingTeam/gists{/gist_id}","starred_url":"https://api.github.com/users/BoTreeConsultingTeam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BoTreeConsultingTeam/subscriptions","organizations_url":"https://api.github.com/users/BoTreeConsultingTeam/orgs","repos_url":"https://api.github.com/users/BoTreeConsultingTeam/repos","events_url":"https://api.github.com/users/BoTreeConsultingTeam/events{/privacy}","received_events_url":"https://api.github.com/users/BoTreeConsultingTeam/received_events","type":"Organization","site_admin":false},"repo":{"id":30966477,"name":"invoiceme","full_name":"BoTreeConsultingTeam/invoiceme","owner":{"login":"BoTreeConsultingTeam","id":3539381,"avatar_url":"https://avatars.githubusercontent.com/u/3539381?v=3","gravatar_id":"","url":"https://api.github.com/users/BoTreeConsultingTeam","html_url":"https://github.com/BoTreeConsultingTeam","followers_url":"https://api.github.com/users/BoTreeConsultingTeam/followers","following_url":"https://api.github.com/users/BoTreeConsultingTeam/following{/other_user}","gists_url":"https://api.github.com/users/BoTreeConsultingTeam/gists{/gist_id}","starred_url":"https://api.github.com/users/BoTreeConsultingTeam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BoTreeConsultingTeam/subscriptions","organizations_url":"https://api.github.com/users/BoTreeConsultingTeam/orgs","repos_url":"https://api.github.com/users/BoTreeConsultingTeam/repos","events_url":"https://api.github.com/users/BoTreeConsultingTeam/events{/privacy}","received_events_url":"https://api.github.com/users/BoTreeConsultingTeam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BoTreeConsultingTeam/invoiceme","description":"Invoice management","fork":false,"url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme","forks_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/forks","keys_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/teams","hooks_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/hooks","issue_events_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/issues/events{/number}","events_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/events","assignees_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/assignees{/user}","branches_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/branches{/branch}","tags_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/tags","blobs_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/git/refs{/sha}","trees_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/statuses/{sha}","languages_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/languages","stargazers_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/stargazers","contributors_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/contributors","subscribers_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/subscribers","subscription_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/subscription","commits_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/commits{/sha}","git_commits_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/git/commits{/sha}","comments_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/comments{/number}","issue_comment_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/issues/comments{/number}","contents_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/contents/{+path}","compare_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/merges","archive_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/downloads","issues_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/issues{/number}","pulls_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/pulls{/number}","milestones_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/milestones{/number}","notifications_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/labels{/name}","releases_url":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/releases{/id}","created_at":"2015-02-18T13:25:29Z","updated_at":"2015-05-05T13:51:14Z","pushed_at":"2015-05-25T07:41:55Z","git_url":"git://github.com/BoTreeConsultingTeam/invoiceme.git","ssh_url":"git@github.com:BoTreeConsultingTeam/invoiceme.git","clone_url":"https://github.com/BoTreeConsultingTeam/invoiceme.git","svn_url":"https://github.com/BoTreeConsultingTeam/invoiceme","homepage":null,"size":1308,"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":28,"forks":0,"open_issues":28,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/pulls/40"},"html":{"href":"https://github.com/BoTreeConsultingTeam/invoiceme/pull/40"},"issue":{"href":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/issues/40"},"comments":{"href":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/BoTreeConsultingTeam/invoiceme/statuses/9cc9a6ad0715a834291c627ba79ad6644f454bf8"}}}}