ShelbyTV / shelby_gt

Rails API services for Shelby GT
2 stars 0 forks source link

get rid of ensure_valid_bson_id #81

Closed spinosa closed 12 years ago

spinosa commented 12 years ago

not necessary. Object.find(params[:id]) will just return nil if it's not valid bson.

You can always use BSON::ObjectId.legal? x if you have a specific need

spinosa commented 12 years ago

FYI @hsztul I think the original reason this was put in place is because you can't do something like this Conversation.where(:video_id => "someidstring") you need to do this Conversation.where(:video_id => BSON::ObjectId("someidstring"))

I'm manually converting when needed in my fix...