Skip to content
Browse files

Deprecate `between` method for ActiveRecord, as it is set in the glob…

…al ActiveRecord::Model scope and is likely to conflict with other gems.
  • Loading branch information...
1 parent 88131f4 commit bc8244ce7ff638fa8a2860f15c917ddae89c5844 @johnnyshields johnnyshields committed Jan 14, 2014
Showing with 9 additions and 4 deletions.
  1. +5 −3 UPGRADING
  2. +4 −1 lib/by_star/orm/active_record/by_star.rb
@@ -1,9 +1,11 @@
Upgrading to ByStar 2.2.0
-* For Mongoid only, ByStar's `.between` method has been removed and replaced with `.between_times`
-(previously `.between_times` was an alias to `.between`). Mongoid already provides a native `.between`
-finder method that we do not want to mask. ActiveRecord users may continue to use either method.
+* ActiveRecord: the `between` method has been deprecated as of version 2.2.0, and will be removed in version 3.3.0.
+Please use `between_times` instead.
+* Mongoid: the `between` method has been removed as of version 2.2.0, as it conflicts with the native Mongoid `between`
+method. Please use `between_times` instead.
* Chronic gem (used for time string parsing) has been removed as a hard dependency for ByStar,
however it is still supported. If you would like to use Chronic with ByStar, please explicitly
5 lib/by_star/orm/active_record/by_star.rb
@@ -18,7 +18,10 @@ def between_times_query(start, finish, options={})
- alias_method :between, :between_times
+ def between(*args)
+ ActiveSupport::Deprecation.warn 'ByStar `between` method will be removed in v3.0.0. Please use `between_times`'
+ between_times(*args)
+ end

0 comments on commit bc8244c

Please sign in to comment.
Something went wrong with that request. Please try again.