record_history 0.8.2 → 0.8.3

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.
Files changed (3) hide show
  1. data/README.md +48 -0
  2. data/lib/record_history/version.rb +1 -1
  3. metadata +1 -1
data/README.md CHANGED
@@ -0,0 +1,48 @@
1
+ # record_history
2
+
3
+ ActiveRecord history
4
+
5
+ ## Installation
6
+
7
+ ```
8
+ gem install record_history
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ # activate history logging for model
14
+ class Item < ActiveRecord::Base
15
+ has_record_history
16
+ end
17
+
18
+ # activate history logging for model (only for "name" field)
19
+ class Item < ActiveRecord::Base
20
+ has_record_history :only => [:name]
21
+ end
22
+
23
+ # activate history logging for model (except 'name' field)
24
+ class Item < ActiveRecord::Base
25
+ has_record_history :ignore => [:name]
26
+ end
27
+
28
+ # activate history logging for model (on update)
29
+ class Item < ActiveRecord::Base
30
+ has_record_history :on => [:update]
31
+ end
32
+
33
+ # get history for object
34
+ item = Item.first
35
+ history = item.first.record_history
36
+ history.first.old_value
37
+ hostory.first.new_value
38
+
39
+
40
+ # declare that User is author for some record_history items
41
+ class User < ActiveRecord::Base
42
+ is_record_history_author
43
+ end
44
+
45
+ # get record_history items created by user
46
+ User.first.written_history
47
+
48
+
@@ -1,3 +1,3 @@
1
1
  module RecordHistory
2
- VERSION = "0.8.2"
2
+ VERSION = "0.8.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: record_history
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: