{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/wsm_02/pulls/comments/93841262","pull_request_review_id":14375206,"id":93841262,"diff_hunk":"@@ -0,0 +1,70 @@\n+class Dashboard::TimesheetSettingsController < ApplicationController\n+  before_action :authenticate_user!\n+  before_action :authenticate_manager!\n+  before_action :load_timesheet_setting, only: [:edit, :update]\n+  before_action :load_company, except: [:destroy, :show]\n+\n+  def index\n+    @timesheet_setting = TimesheetSetting.find_by company_id: @company.id\n+    if @timesheet_setting &&\n+       @timesheet_setting.value_type == TimesheetSetting.value_types.keys[Settings.timesheet_setting.title]\n+      @value_type = 0\n+    end\n+  end\n+\n+  def new\n+    @timesheet_setting = TimesheetSetting.new\n+  end\n+\n+  def create\n+    @timesheet_setting = TimesheetSetting.new timesheet_setting_params\n+    if @timesheet_setting.save\n+      flash[:success] = t \"dashboard.timesheet_settings.create_successfully\"\n+      redirect_to dashboard_company_timesheet_settings_path\n+    else\n+      render :new\n+    end\n+  end\n+\n+  def edit\n+  end\n+\n+  def update\n+    if @timesheet_setting.update_attributes timesheet_setting_params\n+      if @timesheet_setting.horizontal?\n+        @timesheet_setting.optional_settings[:time_in] = \"\"\n+        @timesheet_setting.optional_settings[:time_out] = \"\"\n+        return render :edit unless @timesheet_setting.save\n+      end\n+      flash[:success] = t \"dashboard.timesheet_settings.update_successfully\"\n+      redirect_to dashboard_company_timesheet_settings_path\n+    else\n+      render :edit\n+    end\n+  end\n+\n+  private\n+\n+  def timesheet_setting_params\n+    params.require(:timesheet_setting).permit(:layout_type, :value_type,\n+      :date_format_type, :start_date, :end_date, :start_row_data,\n+      optional_settings: [:time_in, :time_out, :date, :employee_code, :name,\n+      :key]).merge company_id: @company.id\n+  end\n+\n+  def load_timesheet_setting\n+    @timesheet_setting = TimesheetSetting.find_by_id params[:id]\n+    unless @timesheet_setting\n+      flash[:danger] = t \"dashboard.timesheet_settings.not_found\"\n+      redirect_to dashboard_company_timesheet_settings_path\n+    end\n+  end","path":"app/controllers/dashboard/timesheet_settings_controller.rb","position":61,"original_position":61,"commit_id":"aaed16b7cdb5cf176d71d5de53e7f032cf1472c4","original_commit_id":"aaed16b7cdb5cf176d71d5de53e7f032cf1472c4","user":{"login":"framgia-jenkins-ci","id":16641396,"avatar_url":"https://avatars.githubusercontent.com/u/16641396?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia-jenkins-ci","html_url":"https://github.com/framgia-jenkins-ci","followers_url":"https://api.github.com/users/framgia-jenkins-ci/followers","following_url":"https://api.github.com/users/framgia-jenkins-ci/following{/other_user}","gists_url":"https://api.github.com/users/framgia-jenkins-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia-jenkins-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia-jenkins-ci/subscriptions","organizations_url":"https://api.github.com/users/framgia-jenkins-ci/orgs","repos_url":"https://api.github.com/users/framgia-jenkins-ci/repos","events_url":"https://api.github.com/users/framgia-jenkins-ci/events{/privacy}","received_events_url":"https://api.github.com/users/framgia-jenkins-ci/received_events","type":"User","site_admin":false},"body":"**Reporter**: CHECKSTYLE\n**Rule**: com.puppycrawl.tools.checkstyle.Style/FirstParameterIndentation\n**Severity**: INFO\n**File**: app/controllers/dashboard/timesheet_settings_controller.rb L61\n\nIndent the first parameter one step more than the start of the previous line.\n\n*<this is a auto generated comment from violation-comments-lib F7F8ASD8123FSDF>*\n","created_at":"2016-12-26T04:23:47Z","updated_at":"2016-12-26T04:23:47Z","html_url":"https://github.com/framgia/wsm_02/pull/53#discussion_r93841262","pull_request_url":"https://api.github.com/repos/framgia/wsm_02/pulls/53","_links":{"self":{"href":"https://api.github.com/repos/framgia/wsm_02/pulls/comments/93841262"},"html":{"href":"https://github.com/framgia/wsm_02/pull/53#discussion_r93841262"},"pull_request":{"href":"https://api.github.com/repos/framgia/wsm_02/pulls/53"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/wsm_02/pulls/53","id":99049975,"html_url":"https://github.com/framgia/wsm_02/pull/53","diff_url":"https://github.com/framgia/wsm_02/pull/53.diff","patch_url":"https://github.com/framgia/wsm_02/pull/53.patch","issue_url":"https://api.github.com/repos/framgia/wsm_02/issues/53","number":53,"state":"open","locked":false,"title":"timesheet setting","user":{"login":"tjn0994","id":16161667,"avatar_url":"https://avatars.githubusercontent.com/u/16161667?v=3","gravatar_id":"","url":"https://api.github.com/users/tjn0994","html_url":"https://github.com/tjn0994","followers_url":"https://api.github.com/users/tjn0994/followers","following_url":"https://api.github.com/users/tjn0994/following{/other_user}","gists_url":"https://api.github.com/users/tjn0994/gists{/gist_id}","starred_url":"https://api.github.com/users/tjn0994/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjn0994/subscriptions","organizations_url":"https://api.github.com/users/tjn0994/orgs","repos_url":"https://api.github.com/users/tjn0994/repos","events_url":"https://api.github.com/users/tjn0994/events{/privacy}","received_events_url":"https://api.github.com/users/tjn0994/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-22T05:22:57Z","updated_at":"2016-12-26T04:23:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0da802ece5bdc674274bd7b71c1f32fd6133c890","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/wsm_02/pulls/53/commits","review_comments_url":"https://api.github.com/repos/framgia/wsm_02/pulls/53/comments","review_comment_url":"https://api.github.com/repos/framgia/wsm_02/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/wsm_02/issues/53/comments","statuses_url":"https://api.github.com/repos/framgia/wsm_02/statuses/aaed16b7cdb5cf176d71d5de53e7f032cf1472c4","head":{"label":"tjn0994:timesheet_setting","ref":"timesheet_setting","sha":"aaed16b7cdb5cf176d71d5de53e7f032cf1472c4","user":{"login":"tjn0994","id":16161667,"avatar_url":"https://avatars.githubusercontent.com/u/16161667?v=3","gravatar_id":"","url":"https://api.github.com/users/tjn0994","html_url":"https://github.com/tjn0994","followers_url":"https://api.github.com/users/tjn0994/followers","following_url":"https://api.github.com/users/tjn0994/following{/other_user}","gists_url":"https://api.github.com/users/tjn0994/gists{/gist_id}","starred_url":"https://api.github.com/users/tjn0994/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjn0994/subscriptions","organizations_url":"https://api.github.com/users/tjn0994/orgs","repos_url":"https://api.github.com/users/tjn0994/repos","events_url":"https://api.github.com/users/tjn0994/events{/privacy}","received_events_url":"https://api.github.com/users/tjn0994/received_events","type":"User","site_admin":false},"repo":{"id":74433965,"name":"wsm_02","full_name":"tjn0994/wsm_02","owner":{"login":"tjn0994","id":16161667,"avatar_url":"https://avatars.githubusercontent.com/u/16161667?v=3","gravatar_id":"","url":"https://api.github.com/users/tjn0994","html_url":"https://github.com/tjn0994","followers_url":"https://api.github.com/users/tjn0994/followers","following_url":"https://api.github.com/users/tjn0994/following{/other_user}","gists_url":"https://api.github.com/users/tjn0994/gists{/gist_id}","starred_url":"https://api.github.com/users/tjn0994/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjn0994/subscriptions","organizations_url":"https://api.github.com/users/tjn0994/orgs","repos_url":"https://api.github.com/users/tjn0994/repos","events_url":"https://api.github.com/users/tjn0994/events{/privacy}","received_events_url":"https://api.github.com/users/tjn0994/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tjn0994/wsm_02","description":null,"fork":true,"url":"https://api.github.com/repos/tjn0994/wsm_02","forks_url":"https://api.github.com/repos/tjn0994/wsm_02/forks","keys_url":"https://api.github.com/repos/tjn0994/wsm_02/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tjn0994/wsm_02/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tjn0994/wsm_02/teams","hooks_url":"https://api.github.com/repos/tjn0994/wsm_02/hooks","issue_events_url":"https://api.github.com/repos/tjn0994/wsm_02/issues/events{/number}","events_url":"https://api.github.com/repos/tjn0994/wsm_02/events","assignees_url":"https://api.github.com/repos/tjn0994/wsm_02/assignees{/user}","branches_url":"https://api.github.com/repos/tjn0994/wsm_02/branches{/branch}","tags_url":"https://api.github.com/repos/tjn0994/wsm_02/tags","blobs_url":"https://api.github.com/repos/tjn0994/wsm_02/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tjn0994/wsm_02/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tjn0994/wsm_02/git/refs{/sha}","trees_url":"https://api.github.com/repos/tjn0994/wsm_02/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tjn0994/wsm_02/statuses/{sha}","languages_url":"https://api.github.com/repos/tjn0994/wsm_02/languages","stargazers_url":"https://api.github.com/repos/tjn0994/wsm_02/stargazers","contributors_url":"https://api.github.com/repos/tjn0994/wsm_02/contributors","subscribers_url":"https://api.github.com/repos/tjn0994/wsm_02/subscribers","subscription_url":"https://api.github.com/repos/tjn0994/wsm_02/subscription","commits_url":"https://api.github.com/repos/tjn0994/wsm_02/commits{/sha}","git_commits_url":"https://api.github.com/repos/tjn0994/wsm_02/git/commits{/sha}","comments_url":"https://api.github.com/repos/tjn0994/wsm_02/comments{/number}","issue_comment_url":"https://api.github.com/repos/tjn0994/wsm_02/issues/comments{/number}","contents_url":"https://api.github.com/repos/tjn0994/wsm_02/contents/{+path}","compare_url":"https://api.github.com/repos/tjn0994/wsm_02/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tjn0994/wsm_02/merges","archive_url":"https://api.github.com/repos/tjn0994/wsm_02/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tjn0994/wsm_02/downloads","issues_url":"https://api.github.com/repos/tjn0994/wsm_02/issues{/number}","pulls_url":"https://api.github.com/repos/tjn0994/wsm_02/pulls{/number}","milestones_url":"https://api.github.com/repos/tjn0994/wsm_02/milestones{/number}","notifications_url":"https://api.github.com/repos/tjn0994/wsm_02/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tjn0994/wsm_02/labels{/name}","releases_url":"https://api.github.com/repos/tjn0994/wsm_02/releases{/id}","deployments_url":"https://api.github.com/repos/tjn0994/wsm_02/deployments","created_at":"2016-11-22T04:22:53Z","updated_at":"2016-11-22T03:40:58Z","pushed_at":"2016-12-26T04:22:47Z","git_url":"git://github.com/tjn0994/wsm_02.git","ssh_url":"git@github.com:tjn0994/wsm_02.git","clone_url":"https://github.com/tjn0994/wsm_02.git","svn_url":"https://github.com/tjn0994/wsm_02","homepage":null,"size":1962,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"framgia:master","ref":"master","sha":"a402f758d0f3312b50cb94389f30b48d51cc59b9","user":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"repo":{"id":74431382,"name":"wsm_02","full_name":"framgia/wsm_02","owner":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/framgia/wsm_02","description":null,"fork":false,"url":"https://api.github.com/repos/framgia/wsm_02","forks_url":"https://api.github.com/repos/framgia/wsm_02/forks","keys_url":"https://api.github.com/repos/framgia/wsm_02/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/wsm_02/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/wsm_02/teams","hooks_url":"https://api.github.com/repos/framgia/wsm_02/hooks","issue_events_url":"https://api.github.com/repos/framgia/wsm_02/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/wsm_02/events","assignees_url":"https://api.github.com/repos/framgia/wsm_02/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/wsm_02/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/wsm_02/tags","blobs_url":"https://api.github.com/repos/framgia/wsm_02/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/wsm_02/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/wsm_02/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/wsm_02/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/wsm_02/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/wsm_02/languages","stargazers_url":"https://api.github.com/repos/framgia/wsm_02/stargazers","contributors_url":"https://api.github.com/repos/framgia/wsm_02/contributors","subscribers_url":"https://api.github.com/repos/framgia/wsm_02/subscribers","subscription_url":"https://api.github.com/repos/framgia/wsm_02/subscription","commits_url":"https://api.github.com/repos/framgia/wsm_02/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/wsm_02/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/wsm_02/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/wsm_02/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/wsm_02/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/wsm_02/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/wsm_02/merges","archive_url":"https://api.github.com/repos/framgia/wsm_02/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/wsm_02/downloads","issues_url":"https://api.github.com/repos/framgia/wsm_02/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/wsm_02/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/wsm_02/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/wsm_02/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/wsm_02/labels{/name}","releases_url":"https://api.github.com/repos/framgia/wsm_02/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/wsm_02/deployments","created_at":"2016-11-22T03:40:58Z","updated_at":"2016-12-20T12:16:34Z","pushed_at":"2016-12-26T04:22:50Z","git_url":"git://github.com/framgia/wsm_02.git","ssh_url":"git@github.com:framgia/wsm_02.git","clone_url":"https://github.com/framgia/wsm_02.git","svn_url":"https://github.com/framgia/wsm_02","homepage":null,"size":1950,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":8,"forks":14,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/wsm_02/pulls/53"},"html":{"href":"https://github.com/framgia/wsm_02/pull/53"},"issue":{"href":"https://api.github.com/repos/framgia/wsm_02/issues/53"},"comments":{"href":"https://api.github.com/repos/framgia/wsm_02/issues/53/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/wsm_02/pulls/53/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/wsm_02/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/wsm_02/pulls/53/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/wsm_02/statuses/aaed16b7cdb5cf176d71d5de53e7f032cf1472c4"}}}}
{"actor":{"display_login":"framgia-jenkins-ci"}}