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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a9bc3e4aeba36e8d79f1ae9da8d8a542d8536a40ef33338bb5b6008b7957816
4
- data.tar.gz: 9a774bbf389710f7abe0fd2aa8a4e212d0198cdc73c4a454be1054680814280d
3
+ metadata.gz: fca3f3d972e2aafb7ad146874d1d4917f5d23795ad7a6b572c4be38e7a278bc0
4
+ data.tar.gz: '09250a044b44518d8cf74ddf543cc2c122a584082a32ba6918c6b3fe2d75f574'
5
5
  SHA512:
6
- metadata.gz: b34df64d7c458ccc596f9d6f3a6ccfb32029c98242406205d87af13b2e2a5dfc0aefb779d2ba81fb36c5f5936c074f64307365ccdc5febddee8f92dee5df4ccf
7
- data.tar.gz: bdb531a26f0e161e58a637ff4f0c1d81b255c7d252a0f7835cc505a748ba119cd4fdec1ded399af018e9e5141903a54d854253ee2e03315b9fd2a2d1d37cd6f7
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?
@@ -1,6 +1,6 @@
1
1
  module ActiveRecord
2
2
  module ActsAs
3
- VERSION = "3.0.0"
3
+ VERSION = "3.0.1"
4
4
  end
5
5
  end
6
6
 
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.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-02-21 00:00:00.000000000 Z
12
+ date: 2018-04-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sqlite3