soulless 0.5.0.rc4 → 0.5.0.rc5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -5
- data/lib/soulless/model.rb +5 -1
- data/lib/soulless/version.rb +1 -1
- data/spec/soulless_spec.rb +12 -9
- 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: 55f2a96f9a0f18a43db7ff06832033aa57bdb84d
|
4
|
+
data.tar.gz: b5dd5bae30504bfb5c17aff8b9745a0142985923
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be0ba0bb958e7049229b0bdd6d0c583e7d2784b9f767ac7e6ff9f3499231c88f8cc25a172d1bdc39d1af968d89ad5b534e9577fe2c83b5862d3804d5626e8e9e
|
7
|
+
data.tar.gz: 9fb3d78389ba6974ad8ff60e6096cfc3efd660eb37f6bb023c8def6d72decbebe5f7bd9f8e013f8889b36052b3031283103026c0fdf7dd3a927d7ec1767e2e88
|
data/README.md
CHANGED
@@ -331,7 +331,7 @@ form.errors.messages # => { name: ["can't be blank"] }
|
|
331
331
|
|
332
332
|
```additional_attributes``` - Used to specify attributes that cannot automatically be added to the form model. These are generally attributes that have been specified using ```attr_accessor```. Accepts a string, symbol or an array of strings and symbols for multiple attributes.
|
333
333
|
|
334
|
-
```validate_attribute_on``` - By default any validation that specifies an ```:on``` option will not be inherited. This option will allow you to inherit a validator that uses the ```:on``` with a specific value. Example usage: ```validate_password_on: :create
|
334
|
+
```validate_attribute_on``` - By default any validation that specifies an ```:on``` option will not be inherited. This option will allow you to inherit a validator that uses the ```:on``` with a specific value. Example usage: ```validate_password_on: :create```. Accepts a string or symbol. This option will accept any value that the Rails ```:on``` validator option can accept.
|
335
335
|
|
336
336
|
### I18n
|
337
337
|
|
@@ -344,8 +344,9 @@ en:
|
|
344
344
|
errors:
|
345
345
|
models:
|
346
346
|
person:
|
347
|
-
|
348
|
-
|
347
|
+
attributes:
|
348
|
+
name:
|
349
|
+
blank: "there's nothing here"
|
349
350
|
```
|
350
351
|
|
351
352
|
For attributes defined as ```has_one``` and ```has_many``` associations use the enclosing class as the locale key's namespace.
|
@@ -356,8 +357,9 @@ en:
|
|
356
357
|
errors:
|
357
358
|
models:
|
358
359
|
person/spouse:
|
359
|
-
|
360
|
-
|
360
|
+
attributes:
|
361
|
+
name:
|
362
|
+
blank: "there's nothing here"
|
361
363
|
```
|
362
364
|
|
363
365
|
## Contributing
|
data/lib/soulless/model.rb
CHANGED
data/lib/soulless/version.rb
CHANGED
data/spec/soulless_spec.rb
CHANGED
@@ -27,26 +27,29 @@ describe Soulless do
|
|
27
27
|
@dummy_class.saved.should be_false
|
28
28
|
end
|
29
29
|
|
30
|
-
it '#update_attributes should
|
31
|
-
@dummy_class.
|
32
|
-
@dummy_class.
|
33
|
-
@dummy_class.email.should == 'yokoono@thebeatles.com'
|
34
|
-
@dummy_class.saved?.should be_true
|
30
|
+
it '#update_attributes should not save' do
|
31
|
+
@dummy_class.assign_attributes(name: 'Yaw', email: 'yokoono@thebeatles.com')
|
32
|
+
@dummy_class.saved?.should be_false
|
35
33
|
end
|
36
34
|
|
37
|
-
it '#
|
35
|
+
it '#assign_attributes should merge new values' do
|
38
36
|
@dummy_class.email = 'yokoono@thebeatles.com'
|
39
|
-
@dummy_class.
|
37
|
+
@dummy_class.assign_attributes(name: 'Yaw')
|
40
38
|
@dummy_class.name.should == 'Yaw'
|
41
39
|
@dummy_class.email.should == 'yokoono@thebeatles.com'
|
42
40
|
end
|
43
41
|
|
44
|
-
it '#
|
42
|
+
it '#assign_attributes should deep merge new values' do
|
45
43
|
@dummy_class = DummyAssociation.new(spouse: { name: 'Megan' })
|
46
|
-
@dummy_class.
|
44
|
+
@dummy_class.assign_attributes(spouse: { name: 'Mary Jane Watson' })
|
47
45
|
@dummy_class.spouse.name.should == 'Mary Jane Watson'
|
48
46
|
end
|
49
47
|
|
48
|
+
it '#update_attributes should save' do
|
49
|
+
@dummy_class.update_attributes(name: 'Yaw', email: 'yokoono@thebeatles.com')
|
50
|
+
@dummy_class.saved?.should be_true
|
51
|
+
end
|
52
|
+
|
50
53
|
it '#persisted? should be false' do
|
51
54
|
@dummy_class.persisted?.should be_false
|
52
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soulless
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.0.
|
4
|
+
version: 0.5.0.rc5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anthony Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|