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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6e9ee1715570c9e8a97e3212b76ad5a66fb65bb
4
- data.tar.gz: 38bc6aa48979d056cf86ec03903d741d1200eabe
3
+ metadata.gz: c90c95f6d896433e7328bb39122e91ba42dee1e9
4
+ data.tar.gz: 0446d276693782466bfe2439ee861d73f168713b
5
5
  SHA512:
6
- metadata.gz: 8ec4605e84506cf2765025d68812542c37ae548400f6176e78b3d313abe97acbe71eada88542baafdb4d6346c4d0156e4483c7d653b29b62a1060ebe0b4cfb23
7
- data.tar.gz: 6c055ebd63e0abc5a1c00aa472333cfa88b8a3d924bcc574c9b9a08aef5353ef655d7a951188d1955644b4f099678dfc429181298cdc7a3c2113ee47e72b7134
6
+ metadata.gz: 962d43563fc9fa62e3eb786761e7a2ae6bb1839eab4cdba0cadc6fa11f8e246215378ea8d1bc40a5a3bd5a740e724478bff28a07a70619782ffbb6cb27d79415
7
+ data.tar.gz: 7bf74336f03f980392db80d1fdf62c2b556055b6637d7afe1dfd736b5d3bb018b1f2a712c50d3dac5ee53922365e645f38e917fa70b463c611b2ffaa500396e6
@@ -1,3 +1,3 @@
1
1
  module ActsAs
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
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 attribuets that are nested as well' do
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.1
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-07 00:00:00.000000000 Z
11
+ date: 2013-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler