Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #33 from radar/dep-between

Deprecate `between` method for ActiveRecord
  • Loading branch information...
commit dd65a41998a9eab1dd58433194c7f585b7fddd00 2 parents fbe35c8 + bc8244c
@johnnyshields johnnyshields authored
Showing with 9 additions and 4 deletions.
  1. +5 −3 UPGRADING
  2. +4 −1 lib/by_star/orm/active_record/by_star.rb
View
8 UPGRADING
@@ -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
View
5 lib/by_star/orm/active_record/by_star.rb
@@ -18,7 +18,10 @@ def between_times_query(start, finish, options={})
scope
end
- 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
protected
Please sign in to comment.
Something went wrong with that request. Please try again.