Commit c00f1ebe5ba072f01fa866e2adf37ca6eee79f7b

Authored by Vasiliy Ermolovich
2 parents 8e95f6c6 64aebf9f
Exists in master and in 1 other branch production

Merge pull request #299 from lest/patch-1

Cleanup code
app/controllers/apps_controller.rb
@@ -80,7 +80,7 @@ class AppsController < InheritedResources::Base @@ -80,7 +80,7 @@ class AppsController < InheritedResources::Base
80 end 80 end
81 end 81 end
82 82
83 - def initialize_subclassed_notification_service 83 + def initialize_subclassed_notification_service
84 # set the app's notification service 84 # set the app's notification service
85 if params[:app][:notification_service_attributes] && notification_type = params[:app][:notification_service_attributes][:type] 85 if params[:app][:notification_service_attributes] && notification_type = params[:app][:notification_service_attributes][:type]
86 if NotificationService.subclasses.map(&:name).concat(["NotificationService"]).include?(notification_type) 86 if NotificationService.subclasses.map(&:name).concat(["NotificationService"]).include?(notification_type)
app/models/issue_trackers/github_issues_tracker.rb
@@ -35,7 +35,7 @@ if defined? Octokit @@ -35,7 +35,7 @@ if defined? Octokit
35 end 35 end
36 36
37 begin 37 begin
38 - issue = client.create_issue(project_id, issue_title(problem), body_template.result(binding).unpack('C*').pack('U*'), options = {}) 38 + issue = client.create_issue(project_id, issue_title(problem), body_template.result(binding).unpack('C*').pack('U*'))
39 problem.update_attributes( 39 problem.update_attributes(
40 :issue_link => issue.html_url, 40 :issue_link => issue.html_url,
41 :issue_type => Label 41 :issue_type => Label
@@ -54,4 +54,4 @@ if defined? Octokit @@ -54,4 +54,4 @@ if defined? Octokit
54 "https://github.com/#{project_id}/issues" 54 "https://github.com/#{project_id}/issues"
55 end 55 end
56 end 56 end
57 -end  
58 \ No newline at end of file 57 \ No newline at end of file
  58 +end
app/models/notice.rb
@@ -13,7 +13,7 @@ class Notice @@ -13,7 +13,7 @@ class Notice
13 field :current_user, :type => Hash 13 field :current_user, :type => Hash
14 field :error_class 14 field :error_class
15 delegate :lines, :to => :backtrace, :prefix => true 15 delegate :lines, :to => :backtrace, :prefix => true
16 - delegate :app, :to => :err 16 + delegate :app, :problem, :to => :err
17 17
18 belongs_to :err 18 belongs_to :err
19 belongs_to :backtrace, :index => true 19 belongs_to :backtrace, :index => true
@@ -36,8 +36,6 @@ class Notice @@ -36,8 +36,6 @@ class Notice
36 scope :reverse_ordered, order_by(:created_at.desc) 36 scope :reverse_ordered, order_by(:created_at.desc)
37 scope :for_errs, lambda {|errs| where(:err_id.in => errs.all.map(&:id))} 37 scope :for_errs, lambda {|errs| where(:err_id.in => errs.all.map(&:id))}
38 38
39 - delegate :app, :problem, :to => :err  
40 -  
41 def user_agent 39 def user_agent
42 agent_string = env_vars['HTTP_USER_AGENT'] 40 agent_string = env_vars['HTTP_USER_AGENT']
43 agent_string.blank? ? nil : UserAgent.parse(agent_string) 41 agent_string.blank? ? nil : UserAgent.parse(agent_string)