active_repository 0.0.4 → 0.0.5
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.
- data/README.md +14 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -46,7 +46,20 @@ Or install it yourself as:
|
|
46
46
|
|
47
47
|
## Usage
|
48
48
|
|
49
|
-
|
49
|
+
Firstly you must inherit ActiveRepository::Base:
|
50
|
+
|
51
|
+
class User < ActiveHash::Base
|
52
|
+
# Defines the fields of the class
|
53
|
+
fields :name, :email, :birthdate
|
54
|
+
|
55
|
+
# Defines the class responsible for persisting data
|
56
|
+
set_model_class(Country)
|
57
|
+
|
58
|
+
# Set this to true in order to ignore model_class attribute and persist in memory
|
59
|
+
set_save_in_memory(true)
|
60
|
+
end
|
61
|
+
|
62
|
+
Then it is just using it as if it was your ActiveRecord model or Mongoid Document.
|
50
63
|
|
51
64
|
## Contributing
|
52
65
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_repository
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: active_hash
|