goedel 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -6
- data/lib/goedel/statement.rb +3 -2
- data/lib/goedel/version.rb +1 -1
- 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: 1917bed016988ddd73c404116468ffbc71f3a002
|
4
|
+
data.tar.gz: b3a856ace7905a64dd633a7a314afca073e59eac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74786485413661350d823c36f20d51905cc1a0ce6d5589d34997022e714c4efdad51fa526b899157ad44ab4bbf1c24dbc58ff6328a76e26faaf2a88016a189e6
|
7
|
+
data.tar.gz: ebcbc501f73eb19ee864b30310f53aa4b85b66cdef5adad3633ac0b189ea7012eb8b10509a74bf94a3d2bc157cd04becc02d6bf857c24a634a7731945b3d624e
|
data/README.md
CHANGED
@@ -63,17 +63,20 @@ User.create(
|
|
63
63
|
name: "Goedel",
|
64
64
|
address: "123 Incomplete St. Princeton, New Jersey"
|
65
65
|
)
|
66
|
-
```
|
67
66
|
|
68
|
-
|
67
|
+
# You can also override attribute values
|
69
68
|
|
70
|
-
|
69
|
+
Goedel.goedel(
|
70
|
+
last_user,
|
71
|
+
force_attributes: [:address],
|
72
|
+
override_attributes: {"email" => "hide_email@fake.com, }
|
73
|
+
)
|
71
74
|
|
72
|
-
|
75
|
+
```
|
73
76
|
|
74
|
-
|
77
|
+
#### Compatability
|
75
78
|
|
76
|
-
|
79
|
+
Tested with ActiveRecord 4.2.1
|
77
80
|
|
78
81
|
## Contributing
|
79
82
|
|
data/lib/goedel/statement.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
module Goedel
|
2
2
|
class Statement
|
3
|
-
attr_reader :object, :indent, :force_attributes
|
3
|
+
attr_reader :object, :indent, :force_attributes, :override_attributes
|
4
4
|
|
5
5
|
def initialize(object, options={})
|
6
6
|
@object = object
|
7
7
|
@force_attributes = options[:force_attributes] || []
|
8
|
+
@override_attributes = options[:override_attributes] || {}
|
8
9
|
@indent = 2
|
9
10
|
end
|
10
11
|
|
@@ -30,7 +31,7 @@ module Goedel
|
|
30
31
|
val = object.send(attr)
|
31
32
|
obj_attr[prop] = val
|
32
33
|
end
|
33
|
-
obj_attr
|
34
|
+
obj_attr.merge(override_attributes)
|
34
35
|
end
|
35
36
|
|
36
37
|
def model_create
|
data/lib/goedel/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: goedel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Li
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|