Commit 79f80705bde485cdee56f91433ee567113011e41

Authored by Tracey Eubanks
1 parent 08e9103f
Exists in master and in 1 other branch production

fixed a mongoid bug created by crack

app/views/errs/fogbugz_body.txt.erb
1 -<% # some sort of stupid mongoid bugg that doesn't allow us to use err.app. have to explicitly search for it %>  
2 -"See this exception on Errbit": <%= app_err_url(App.where(_id: err.app_id).first, err) %> 1 +"See this exception on Errbit": <%= app_err_url(err.app, err) %>
3 <% if notice = err.notices.first %> 2 <% if notice = err.notices.first %>
4 <%= notice.message %> 3 <%= notice.message %>
5 4
app/views/errs/show.html.haml
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 = last_notice_at(@err).to_s(:micro) 11 = last_notice_at(@err).to_s(:micro)
12 - content_for :action_bar do 12 - content_for :action_bar do
13 / some sort of mongoid association bug or something. have to actually search for the stupid app instead of using @err.app 13 / some sort of mongoid association bug or something. have to actually search for the stupid app instead of using @err.app
14 - - if App.where(_id: @err.app_id).first.issue_tracker 14 + - if @err.app.issue_tracker
15 - if @err.issue_link.blank? 15 - if @err.issue_link.blank?
16 %span= link_to 'create issue', create_issue_app_err_path(@app, @err), :method => :post, :class => "#{@app.issue_tracker.issue_tracker_type}_create create-issue" 16 %span= link_to 'create issue', create_issue_app_err_path(@app, @err), :method => :post, :class => "#{@app.issue_tracker.issue_tracker_type}_create create-issue"
17 - else 17 - else
config/initializers/overrides.rb 0 → 100644
@@ -0,0 +1 @@ @@ -0,0 +1 @@
  1 +require Rails.root.join('lib/overrides/mongoid/relations/builder.rb')
lib/overrides/mongoid/relations/builder.rb 0 → 100644
@@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
  1 +module Mongoid
  2 + module Relations
  3 + class Builder
  4 + def query?
  5 + return true unless object.respond_to?(:to_a)
  6 + obj = object.to_a.first
  7 + !obj.is_a?(Mongoid::Document) && !obj.nil?
  8 + end
  9 + end
  10 + end
  11 +end