lib/mongoid/compatibility/version.rb in mongoid-compatibility-0.5.0 vs lib/mongoid/compatibility/version.rb in mongoid-compatibility-0.5.1
- old
+ new
@@ -6,9 +6,17 @@
const_set "V#{v}", Mongoid::VERSION =~ Regexp.new("^#{v}\.")
define_method "mongoid#{v}?" do
!!Mongoid::Compatibility::Version::ClassMethods.const_get("V#{v}")
end
+
+ define_method "mongoid#{v}_or_newer?" do
+ Gem::Version.new(Mongoid::VERSION).segments.first >= v
+ end
+
+ define_method "mongoid#{v}_or_older?" do
+ Gem::Version.new(Mongoid::VERSION).segments.first <= v
+ end
end
end
extend ClassMethods
end