active_record-acts_as 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_record/acts_as/querying.rb +2 -1
- data/lib/active_record/acts_as/version.rb +1 -1
- data/spec/acts_as_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fca3f3d972e2aafb7ad146874d1d4917f5d23795ad7a6b572c4be38e7a278bc0
|
4
|
+
data.tar.gz: '09250a044b44518d8cf74ddf543cc2c122a584082a32ba6918c6b3fe2d75f574'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9506c230f4cdfd794577cfabed81f585aebea3f186aab5e9320618cff93e06bcf6bad26779d0f56fe7a56a48f9aceb5a97b92f77309deb1a012c8fd4c2a155c2
|
7
|
+
data.tar.gz: 24d5a09f532342ccd38b83cec45e3b6f45e74e1c2ae9b6e1a75e02aa30f20b87fa51559b636f64ef78a1257b31bfbe26cb3a34a4a72c6501e04c48c8292a3567
|
@@ -13,7 +13,8 @@ module ActiveRecord
|
|
13
13
|
opts, acts_as_opts = opts.stringify_keys.partition do |k, v|
|
14
14
|
v.is_a?(Hash) ||
|
15
15
|
k =~ /\./ ||
|
16
|
-
column_names.include?(k.to_s)
|
16
|
+
column_names.include?(k.to_s) ||
|
17
|
+
attribute_method?(k.to_s)
|
17
18
|
end.map(&:to_h)
|
18
19
|
|
19
20
|
if acts_as_opts.any?
|
data/spec/acts_as_spec.rb
CHANGED
@@ -481,6 +481,16 @@ RSpec.describe "ActiveRecord::Base model with #acts_as called" do
|
|
481
481
|
end
|
482
482
|
end
|
483
483
|
|
484
|
+
describe 'relational methods' do
|
485
|
+
it "allows relational members in query conditions" do
|
486
|
+
magenta_collection = PenCollection.new
|
487
|
+
magenta_pen = magenta_collection.pens.build(color: "magenta", price: 1.0, name: "magenta")
|
488
|
+
magenta_collection.save!
|
489
|
+
|
490
|
+
expect(Pen.where(pen_collection: magenta_pen.pen_collection).take!).to eq(magenta_pen)
|
491
|
+
end
|
492
|
+
end
|
493
|
+
|
484
494
|
describe '.find_by' do
|
485
495
|
it 'respects supermodel attributes' do
|
486
496
|
expect(Pen.find_by(name: 'red pen')).to eq(@red_pen)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record-acts_as
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hassan Zamani
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-04-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sqlite3
|