acts_as 0.2.0 → 0.2.2

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
  SHA1:
3
- metadata.gz: c7912bee92e4c32fc30f7ee224dad9d7b30db39c
4
- data.tar.gz: b3e1764d00459b9cb8d0e49220f0f4fe73bae8af
3
+ metadata.gz: 331305a38b4977b14717964024b46dee217d8d97
4
+ data.tar.gz: 5877875beb1520d6d7d5bd432fe2a939676fef14
5
5
  SHA512:
6
- metadata.gz: 541b744acc4b81aadf1da41e8f3a965c769f1877f13f4dff5f081f50b02b5bdda5aefe0855424ef10112db1c1775a696bb8916a3023c6d0aff4e578623189321
7
- data.tar.gz: c15b5e5c57411b02490cbf19e7b2ce8375a393798e91f1acac0f66272167368ce9fc95f5e7676b15e11b3bbf8485f7c77abc3f2d68b24062c64471a7552a6d58
6
+ metadata.gz: 960ba568858dea22691683756c693a5000b2399b3909903729239ed68e968c8ab50d39f232c2193a247f96ef2bbfe4214ca51a35a91886177835469491d989b1
7
+ data.tar.gz: c4635cb0ef46a62abbf6b66843c1c82c7eaf464d85adab78ea8f9f75576010c4a90585943872204ff02a0181496356f450d094b293518445977f4a9aeb0bf26c
@@ -1,3 +1,3 @@
1
1
  module ActsAs
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.2"
3
3
  end
data/lib/acts_as.rb CHANGED
@@ -17,6 +17,14 @@ module ActsAs
17
17
  end
18
18
  end
19
19
 
20
+ def update_column(name, value)
21
+ if (association = self.class.acts_as_fields.detect { |k,v| v.include?(name.to_s) }.try(:first)).present?
22
+ send(association).update_column name, value
23
+ else
24
+ super
25
+ end
26
+ end
27
+
20
28
  private
21
29
 
22
30
  def acts_as_field_match?(method)
data/spec/acts_as_spec.rb CHANGED
@@ -91,4 +91,11 @@ describe ActsAs do
91
91
  rebel.previous_changes.should include('strength')
92
92
  end
93
93
  end
94
+
95
+ describe '#update_column' do
96
+ it 'should pass through to acted models' do
97
+ rebel.update_column :strength, 23
98
+ rebel.strength.should == 23
99
+ end
100
+ end
94
101
  end
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.2.0
4
+ version: 0.2.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-06-14 00:00:00.000000000 Z
11
+ date: 2013-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler