acts_as 0.3.1 → 0.3.2
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/lib/acts_as/version.rb +1 -1
- data/lib/acts_as.rb +1 -1
- data/spec/acts_as_spec.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c90c95f6d896433e7328bb39122e91ba42dee1e9
|
|
4
|
+
data.tar.gz: 0446d276693782466bfe2439ee861d73f168713b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 962d43563fc9fa62e3eb786761e7a2ae6bb1839eab4cdba0cadc6fa11f8e246215378ea8d1bc40a5a3bd5a740e724478bff28a07a70619782ffbb6cb27d79415
|
|
7
|
+
data.tar.gz: 7bf74336f03f980392db80d1fdf62c2b556055b6637d7afe1dfd736b5d3bb018b1f2a712c50d3dac5ee53922365e645f38e917fa70b463c611b2ffaa500396e6
|
data/lib/acts_as/version.rb
CHANGED
data/lib/acts_as.rb
CHANGED
|
@@ -69,7 +69,7 @@ module ActsAs
|
|
|
69
69
|
expanded_attrs = {}
|
|
70
70
|
|
|
71
71
|
attrs.each do |attr, value|
|
|
72
|
-
if (association = acts_as_fields_match(attr))
|
|
72
|
+
if (association = acts_as_fields_match(attr)) && !self.columns.map(&:name).include?(attr.to_s)
|
|
73
73
|
expanded_attrs[new.send(association).class.table_name] = { attr => value }
|
|
74
74
|
else
|
|
75
75
|
expanded_attrs[attr] = value
|
data/spec/acts_as_spec.rb
CHANGED
|
@@ -110,9 +110,11 @@ describe ActsAs do
|
|
|
110
110
|
expect {
|
|
111
111
|
Rebel.where('strength = ?', 12).any?
|
|
112
112
|
}.to raise_error(ActiveRecord::StatementInvalid)
|
|
113
|
+
|
|
114
|
+
Rebel.where(name: rebel.name).should include(rebel)
|
|
113
115
|
end
|
|
114
116
|
|
|
115
|
-
it 'should auto-expand acted
|
|
117
|
+
it 'should auto-expand acted attributes that are nested as well' do
|
|
116
118
|
pending 'support nested attributes'
|
|
117
119
|
xwing = XWing.create!(rebel: rebel)
|
|
118
120
|
XWing.joins(rebel: :clan).where(rebel: {strength: rebel.strength}).should include(xwing)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: acts_as
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- winfred
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-07-
|
|
11
|
+
date: 2013-07-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|