Commit 4f9d8f39c3985a87c7b8c0438944f84cfa8f10b4
1 parent
17954978
Exists in
master
and in
1 other branch
Simpler App.find_by_id.
Showing
1 changed file
with
1 additions
and
2 deletions
Show diff stats
app/models/app.rb
| ... | ... | @@ -39,9 +39,8 @@ class App |
| 39 | 39 | accepts_nested_attributes_for :issue_tracker, :allow_destroy => true, |
| 40 | 40 | :reject_if => proc { |attrs| !%w(none lighthouseapp redmine pivotal fogbugz mingle).include?(attrs[:issue_tracker_type]) } |
| 41 | 41 | |
| 42 | - # Mongoid Bug: find(id) on association proxies returns an Enumerator | |
| 43 | 42 | def self.find_by_id!(app_id) |
| 44 | - where(:_id => app_id).first || raise(Mongoid::Errors::DocumentNotFound.new(self,app_id)) | |
| 43 | + find app_id | |
| 45 | 44 | end |
| 46 | 45 | |
| 47 | 46 | def self.find_by_api_key!(key) | ... | ... |