NoamB/sorcery — pull request #538 by arnvald (2014-04-30 05:28:48+00:00)
Title: Rails 4.1 compatibility - change way we include Sorcery::Model

I think we should add Rails 4.1 Gemfile to Travis matrix. I'll add it later today.
Current tests are passing locally, I also checked this code agains my example app with Mongoid and AR.

Problem description:
Sorcery does not work on Rails 4.1 due to the fact that we use `included` block for Mongoid code. As Mongoid::Document already has `included` block, an error is raised.

Solution:
This solution may seem an overkill, and the code for Mongoid does not look very pretty, but I think it's actually an improvement.
Until now we call `include Sorcery::Model` and we call `class_eval` on the class the module was included in. This is actually perfect case for using `extend` instead of `include`. So right now we're going to `extend Sorcery::Model` for all ORMs except Mongoid, where we directly include `Sorcery::Model` to `Mongoid::Document::ClassMethods` (I tried to find another solution, but so far I didn't succeed)

@kirs can you have a quick look at the code? Maybe you'll notice something I should improve here