Team manager | Scrum master | Senior Rails programmer.

Rails + oauth-plugin + mongodb – Part 1: Provider

Recently I had a chance to work with Oauth and Rails using oauth-plugin and mongodb. Although oauth-plugin itself has a documentation but actually doesn’t cover the mongoid part detailed enough. Also I found this very good tutorial but it’s for SQLite3 only: Oauth Provider, Oauth Consumer

Base on the above posts, to get Rails and oauth-plugin working with mongodb, you need to do some changes.

So I think we should remove the :include => [:client_application] option in User model, then add .includes(:client_application) to the controller as above.

6. Issues with oauth-plugin + mongoid

You can make these below changes yourself or simply get from here. I folked from original repo and modified.

You will encounter these one when you trying to connect consumer with provider on step 5 in consumer guide.
– Dynamic finders don’t seem to work. You’ll get the exception with ‘findbykey’, we need to modify the oauth-plugin gem directly (as the author hasn’t provide a fix yet).
Do this commands:

Adding pressure to your team is like adding salt to your food: if you add a little bit, everything will be fine, and the result will be better; if you add more, the result might be better, but your health will suffer; if you add even more, you’ve just ruined everything, and you need to ... »

I’ve seen people juggle time to be able to schedule all meetings that they were supposed to have. But is that necessary? Is it a sin to have a sprint with no retrospective? A day without a standup meeting? Or a process with no meetings at all? In this post, I’ll discuss the possibilities that ... »

For a while now, I’ve had the tagline you see on this site’s header as of this writing: No, I don’t work in NYC, DC, or the valley, and I’m cool with that. Like many (if not most) of you, I’m regularly contacted by recruiters. Unsurprisingly, they generally haven’t learned anything specific about me, aside [...]

Ruby class variables don’t see a lot of use, largely due to one of their more interesting properties — inheriting classes see (and modify) the same object as their parent. Still, you will at some point find yourself using them, so it’s good to understand as much as possible about their behavior. Since modules can [...]

Recently, a really great article was published over on the Code Climate Blog. Titled “7 Patterns to Refactor Fat ActiveRecord Models”, it’s a must read for everyone who works with Rails. If you haven’t read it, go do so. Seriously. I’ll wait. Anyway, at the very top of this list is a recommendation to extract [...]