Skip to content

Commit 4b7dd26

Browse files
committed
Fix bug : Production NameError: uninitialized constant TeamsController::BSON
1 parent f1fa8fd commit 4b7dd26

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

app/controllers/invitations_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def show
66
store_location! unless signed_in?
77
session[:referred_by] = params[:r]
88
record_event("viewed", what: "invitation")
9-
rescue Mongoid::Errors::DocumentNotFound
9+
rescue ActiveRecord::RecordNotFound
1010
invitation_failed!
1111
end
1212

app/controllers/teams_controller.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def followed
2020
end
2121

2222
def show
23-
23+
#FIXME
2424
show_params = params.permit(:job_id, :refresh, :callback, :id, :slug)
2525

2626
respond_to do |format|
@@ -43,20 +43,19 @@ def show
4343
format.json do
4444
options = { :expires_in => 5.minutes }
4545
options[:force] = true if !show_params[:refresh].blank?
46-
Team
4746
response = Rails.cache.fetch(['v1', 'team', show_params[:id], :json], options) do
4847
begin
4948
@team = team_from_params(slug: show_params[:slug], id: show_params[:id])
5049
@team.public_json
51-
rescue Mongoid::Errors::DocumentNotFound
50+
rescue ActiveRecord::RecordNotFound
5251
return head(:not_found)
5352
end
5453
end
5554
response = "#{show_params[:callback]}({\"data\":#{response}})" if show_params[:callback]
5655
render :json => response
5756
end
5857
end
59-
rescue BSON::InvalidObjectId
58+
rescue
6059
redirect_to teamname_url(:slug => params[:id])
6160
end
6261

app/models/team/search_wrapper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def updated_at
1414
end
1515

1616
def to_key
17-
item.try(:to_key) || BSON::ObjectId(item[:id])
17+
item.try(:to_key)
1818
end
1919

2020
def name

0 commit comments

Comments
 (0)