activerecord-blockwhere 1.0.2 → 1.0.3
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0eff256f2ab545680ad9aa1db2fe9822f752197
|
4
|
+
data.tar.gz: 44e38a8c35aa59c11814b0b298b1152b0b9903c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 174875a0db946f2fa15ba8f2204445935a30af08e82f3b6c84f9b6ffe35b55af7ef762e05f8acf551752e9e3b9d42b3a242460d7b3169e14b025b3cbc5617b38
|
7
|
+
data.tar.gz: abdfb6a391a628d7c3bcc1887e9391d9b94543517bc4301ee43b4ac724211a574a8e4f3a3eaeb76945b3204cf875ba0d8a2df822cd7dccc66e68bc44d56ab89d
|
@@ -17,4 +17,6 @@ end
|
|
17
17
|
ActiveSupport.on_load(:active_record) do
|
18
18
|
ActiveRecord::Relation.send :include, ActiveRecord::Blockwhere
|
19
19
|
Arel::Nodes::Node.send :include, ActiveRecord::Blockwhere::ArelNodeOperations
|
20
|
+
# fix https://github.com/techscore/activerecord-blockwhere/issues/2
|
21
|
+
Arel::Nodes::Unary.send :include, ActiveRecord::Blockwhere::RevertArelNodeOperations
|
20
22
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'active_support/concern'
|
1
2
|
module ActiveRecord
|
2
3
|
module Blockwhere
|
3
4
|
module ArelNodeOperations
|
@@ -17,5 +18,14 @@ module ActiveRecord
|
|
17
18
|
false
|
18
19
|
end
|
19
20
|
end
|
21
|
+
|
22
|
+
# fix https://github.com/techscore/activerecord-blockwhere/issues/2
|
23
|
+
module RevertArelNodeOperations
|
24
|
+
extend ActiveSupport::Concern
|
25
|
+
included do
|
26
|
+
undef_method :&, :|, :empty?
|
27
|
+
define_method(:!, &Object.method(:!))
|
28
|
+
end
|
29
|
+
end
|
20
30
|
end
|
21
31
|
end
|
@@ -33,4 +33,11 @@ describe ActiveRecord::Blockwhere do
|
|
33
33
|
expect(@context.instance_eval { Person.where{ id.eq(params[:id]) }.first } ).to eq @bob
|
34
34
|
end
|
35
35
|
end
|
36
|
+
|
37
|
+
# https://github.com/techscore/activerecord-blockwhere/issues/2
|
38
|
+
context 'Arel::Nodes::Limit and Arel::Nodes::Offset' do
|
39
|
+
it { expect(!Arel::Nodes::Limit.new(10) ).to eq false }
|
40
|
+
it { expect(!Arel::Nodes::Offset.new(10)).to eq false }
|
41
|
+
end
|
42
|
+
|
36
43
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-blockwhere
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yuki teraoka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|