Permalink
Browse files

use version 1.x of with_model to avoid errors in class comparisons

  • Loading branch information...
1 parent 916f97f commit 5ab7dea2f0290237e2462072a1ab3bb156a55b12 @kirkconnell kirkconnell committed Sep 21, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 Gemfile
View
@@ -4,7 +4,7 @@ case ENV["MODEL_ADAPTER"]
when nil, "active_record"
gem "sqlite3"
gem "activerecord", '~> 3.0.9', :require => "active_record"
- gem "with_model"
+ gem "with_model", '~> 0.1.5'
gem "meta_where"
when "data_mapper"
gem "dm-core", "~> 1.0.2"

4 comments on commit 5ab7dea

Contributor

nertzy replied Oct 20, 2011

What were the errors you were seeing? I'm the maintainer of with_model and I'd like to fix them if the problem is on our end.

Thanks!

Contributor

kirkconnell replied Oct 20, 2011

It was a strange thing. Nested models ended up with a different class object id than their original class. To better explain this, supposed you had models Author and Book. In Author we had a has_many :books association. The problem was that the result of author.books.first.class.object_id == Book.object_id was false. This made a couple of specs to fail since they were comparing object arrays.

Contributor

nertzy replied Oct 21, 2011

I ran into something similar earlier. I'm going to work out a minimal test case and see what I can do.

Contributor

nertzy replied Nov 7, 2011

I fixed the issue in with_model. Pull request at #505

Please sign in to comment.