mongoid_taggable_with_context.gemspec still refers to mongoid beta
iRonin opened this issue · 10 comments
Would you mind fixing mongoid version referrence in mongoid_taggable_with_context.gemspec
?
I've just tried to install the gem and got:
Bundler could not find compatible versions for gem "mongoid":
In Gemfile:
mongoid_taggable_with_context depends on
mongoid (~> 2.0.0.beta.20)
mongoid (2.1.2)
It seems the latest mongoid ( 2.1.4 at the moment) is broken. previous_changes
is not working and always giving back nil. This causes the specs to fail. For this reason your pull request is reverted as well.
As you can see I was trying to install your gem with mongoid 2.1.2.
I think the problem is that to work with Mongoid 2.1.2
, usually the gemspec would use ~> 2.1.0
, which would allow use of the broken 2.1.4
release as well.
I did some changes to my code to work around the problem with the previous_changes
. Here is the new rules:
If you want to use mongoid-2.1.x, please use mongoid_taggable_with_context-0.7.x.
If you want to use mongoid-2.0.x, please use mongoid_taggable_with_context-0.6.x.
That's all!
That's odd, because I tried it on 2.1.2 as well just in case, and it broke the same way...
For the curious, here is something to demonstrate the difference:
class Foo
include Mongoid::Document
after_create :print_previous_changes_after_create
after_save :print_previous_changes_after_save
field :name
def print_previous_changes_after_create
p "previous_changes in after create callback"
p previous_changes
end
def print_previous_changes_after_save
p "previous_changes in after save callback"
p previous_changes
end
end
a = Foo.create!(:name => "asdf")
a.previous_changes
a.name = "bar"
a.save!
a.previous_changes
previous_changes inside the callbacks behaves differently between mongoid-2.0.x and mongoid-2.1.x.
In the Rakefile
there is still this line:
gem.add_runtime_dependency 'mongoid', '~> 2.0.0.beta.20'
And it prevents me from installing the gem.
Great, thank you!
Not working for mongoid (2.3.2)
Bundler could not find compatible versions for gem "mongoid":
In Gemfile:
mongoid_taggable_with_context (> 0.7.2) depends on> 2.1.0)
mongoid (
mongoid (2.3.2)
Thank you!