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 +4 -4
- data/lib/acts_as/version.rb +1 -1
- data/lib/acts_as.rb +8 -0
- data/spec/acts_as_spec.rb +7 -0
- 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: 331305a38b4977b14717964024b46dee217d8d97
|
4
|
+
data.tar.gz: 5877875beb1520d6d7d5bd432fe2a939676fef14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 960ba568858dea22691683756c693a5000b2399b3909903729239ed68e968c8ab50d39f232c2193a247f96ef2bbfe4214ca51a35a91886177835469491d989b1
|
7
|
+
data.tar.gz: c4635cb0ef46a62abbf6b66843c1c82c7eaf464d85adab78ea8f9f75576010c4a90585943872204ff02a0181496356f450d094b293518445977f4a9aeb0bf26c
|
data/lib/acts_as/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2013-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|