Factored out ActiveModel specific code from ActiveRecord module into ActiveModel module

4 views
Skip to first unread message

Brian Cardarella

unread,
Jun 29, 2010, 10:52:58 PM6/29/10
to shoulda
Patch: http://github.com/bcardarella/shoulda/commit/ffa6b2ea3093a8d770f72560e026edd523e6179d

Let me make a case for this before it is rejected.

I have a Rails 3 app I'm building using Mongoid and would like to use
the Shoulda validations as well as write my own specific association
matchers for embed_one, embed_many, embedded_in (as well as other
Mongoid-specific stuff)

My Rails 3 app does not have ActiveRecord at all. So Shoulda will not
load the ActiveRecord modules. But with this patch I can write my own
Mongoid Shoulda modules and just drop in the ActiveModel stuff.

Thoughts?

Brian Cardarella

unread,
Jun 29, 2010, 10:56:55 PM6/29/10
to shoulda
Oh yeah, it's also still backwards compatible with Rails 2. (at least
according to the Shoulda's test suite)

On Jun 29, 10:52 pm, Brian Cardarella <bcardare...@gmail.com> wrote:
> Patch:http://github.com/bcardarella/shoulda/commit/ffa6b2ea3093a8d770f72560...

Brian Cardarella

unread,
Jun 29, 2010, 11:09:46 PM6/29/10
to shoulda
Doh, I forgot to move over the ActiveRecord::Assertions module. This
patch will also be needed: http://github.com/bcardarella/shoulda/commit/017938edcab0f4411a8a883ba19e5e9fca25eb8d
Reply all
Reply to author
Forward
0 new messages