acts_as 0.1.1 → 0.2.0

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: 4ba14af8fa70697f7fb73d98603803dba5d45960
4
- data.tar.gz: af54cf74f118c481339507a63edc61e11583ea24
3
+ metadata.gz: c7912bee92e4c32fc30f7ee224dad9d7b30db39c
4
+ data.tar.gz: b3e1764d00459b9cb8d0e49220f0f4fe73bae8af
5
5
  SHA512:
6
- metadata.gz: e0749e06b1dd10faff18141970375ff3311940f50ba599cfaae50b0cbd15f5ce9e92ba976e73931a834a923d24aeb78c9c9cea0c17b5e8aaaec002f052b91df6
7
- data.tar.gz: 23d6dbd8a70960c27ba5019c1fa14dc867c89103ea3112010775df02afaab10539829dd8e059f7fe9e5f18f175743b36e863aa23772d7f4cc2b3235c5722bd05
6
+ metadata.gz: 541b744acc4b81aadf1da41e8f3a965c769f1877f13f4dff5f081f50b02b5bdda5aefe0855424ef10112db1c1775a696bb8916a3023c6d0aff4e578623189321
7
+ data.tar.gz: c15b5e5c57411b02490cbf19e7b2ce8375a393798e91f1acac0f66272167368ce9fc95f5e7676b15e11b3bbf8485f7c77abc3f2d68b24062c64471a7552a6d58
@@ -1,3 +1,3 @@
1
1
  module ActsAs
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/acts_as.rb CHANGED
@@ -10,6 +10,13 @@ module ActsAs
10
10
  base.extend ClassMethods
11
11
  end
12
12
 
13
+ def previous_changes
14
+ self.class.acts_as_fields.keys.map{ |association| send(association).previous_changes }
15
+ .reduce(super) do |current, association_changes|
16
+ current.merge(association_changes)
17
+ end
18
+ end
19
+
13
20
  private
14
21
 
15
22
  def acts_as_field_match?(method)
data/spec/acts_as_spec.rb CHANGED
@@ -82,4 +82,13 @@ describe ActsAs do
82
82
  it { should respond_to(:cool?)}
83
83
  specify { rebel.should_not be_cool }
84
84
  end
85
+
86
+ describe '#previous_changes' do
87
+ it 'should account for acted models' do
88
+ rebel.strength = 12
89
+ rebel.name = 'bob'
90
+ rebel.save
91
+ rebel.previous_changes.should include('strength')
92
+ end
93
+ end
85
94
  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.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - winfred
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-03 00:00:00.000000000 Z
11
+ date: 2013-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler