where-or 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +2 -0
- data/lib/where-or.rb +3 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 570e1bbf0c33343e297c3c359928edebf9b0979e
|
4
|
+
data.tar.gz: 8add070663225de7bab2a8a3786fa944b9c77ea4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: deb95ae420bfeb2bd809d9a70fab3113215800149f77823e846ea4019309c102b61f02925c03f4a781a04703adb95c045b5979ce7be10bba4a2af60304e58363
|
7
|
+
data.tar.gz: 4a079a3599ba1e0da29f8b8cf889f00ede75c467bc0702aa4c030afe918879eeb860659026f7fa6b1f8f0e548687a5bb596ceb9024b842e58e8d9a54b015bb8e
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
[Where or](https://github.com/rails/rails/pull/16052) function backport from Rails 5 for Rails 4.2
|
4
4
|
|
5
|
+
Confirm works from Rails 4.2.3 to 4.2.5. [with some issues](https://github.com/Eric-Guo/where-or/issues?utf8=%E2%9C%93&q=is%3Aissue)
|
6
|
+
|
5
7
|
[](https://badge.fury.io/for/rb/where-or)
|
6
8
|
|
7
9
|
Installation:
|
data/lib/where-or.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
abort "Congrats for being on Rails 5. Now please remove this patch" if
|
1
|
+
abort "Congrats for being on Rails 5. Now please remove this patch" if ActiveRecord::VERSION::MAJOR > 4
|
2
2
|
# Tested on Rails Rails 4.2.3
|
3
|
-
warn "Patching ActiveRecord::Relation#or. This might blow up" if
|
3
|
+
warn "Patching ActiveRecord::Relation#or. This might blow up" if ActiveRecord.version.to_s < '4.2.3'
|
4
4
|
# https://github.com/rails/rails/commit/9e42cf019f2417473e7dcbfcb885709fa2709f89.patch
|
5
5
|
# CHANGELOG.md
|
6
6
|
# * Added the `#or` method on ActiveRecord::Relation, allowing use of the OR
|
@@ -64,7 +64,7 @@ ActiveSupport.on_load(:active_record) do
|
|
64
64
|
#
|
65
65
|
# The two relations must be structurally compatible: they must be scoping the same model, and
|
66
66
|
# they must differ only by +where+ (if no +group+ has been defined) or +having+ (if a +group+ is
|
67
|
-
# present). Neither relation may have a +limit+, +offset+, or +
|
67
|
+
# present). Neither relation may have a +limit+, +offset+, or +distinct+ set.
|
68
68
|
#
|
69
69
|
# Post.where("id = 1").or(Post.where("id = 2"))
|
70
70
|
# # SELECT `posts`.* FROM `posts` WHERE (('id = 1' OR 'id = 2'))
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: where-or
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- Benjamin Fleischer
|
7
8
|
- Eric Guo
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2016-03-12 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rails
|