activerecord-draft_records 0.2.0 → 0.3.0
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/VERSION +1 -1
- data/lib/active_record/draft_records.rb +3 -3
- metadata +13 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
@@ -39,7 +39,7 @@ module ActiveRecord
|
|
39
39
|
end
|
40
40
|
|
41
41
|
# Override valid? to automatically and temporarily set it as a draft for the validation.
|
42
|
-
def valid?
|
42
|
+
def valid?(context = nil)
|
43
43
|
self.draft, is_draft = false, self.draft
|
44
44
|
super
|
45
45
|
ensure
|
@@ -50,7 +50,7 @@ module ActiveRecord
|
|
50
50
|
def save_and_attempt_to_undraft
|
51
51
|
if self.draft?
|
52
52
|
self.draft = false if self.valid?
|
53
|
-
save(false)
|
53
|
+
save(:validate => false)
|
54
54
|
else
|
55
55
|
save
|
56
56
|
end
|
@@ -60,7 +60,7 @@ module ActiveRecord
|
|
60
60
|
# and saving the record ignoring the validations.
|
61
61
|
def save_as_draft
|
62
62
|
self.draft = true
|
63
|
-
save(false)
|
63
|
+
save(:validate => false)
|
64
64
|
end
|
65
65
|
|
66
66
|
# Attempt to save the record, if any validation fails, save it as a draft.
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-draft_records
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 19
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
|
-
-
|
8
|
+
- 3
|
8
9
|
- 0
|
9
|
-
version: 0.
|
10
|
+
version: 0.3.0
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Rodrigo Kochenburger
|
@@ -14,16 +15,18 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-10-16 00:00:00 -03:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: rspec
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 13
|
27
30
|
segments:
|
28
31
|
- 1
|
29
32
|
- 2
|
@@ -35,9 +38,11 @@ dependencies:
|
|
35
38
|
name: database_cleaner
|
36
39
|
prerelease: false
|
37
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
38
42
|
requirements:
|
39
43
|
- - ">="
|
40
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 15
|
41
46
|
segments:
|
42
47
|
- 0
|
43
48
|
- 5
|
@@ -79,23 +84,27 @@ rdoc_options:
|
|
79
84
|
require_paths:
|
80
85
|
- lib
|
81
86
|
required_ruby_version: !ruby/object:Gem::Requirement
|
87
|
+
none: false
|
82
88
|
requirements:
|
83
89
|
- - ">="
|
84
90
|
- !ruby/object:Gem::Version
|
91
|
+
hash: 3
|
85
92
|
segments:
|
86
93
|
- 0
|
87
94
|
version: "0"
|
88
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
89
97
|
requirements:
|
90
98
|
- - ">="
|
91
99
|
- !ruby/object:Gem::Version
|
100
|
+
hash: 3
|
92
101
|
segments:
|
93
102
|
- 0
|
94
103
|
version: "0"
|
95
104
|
requirements: []
|
96
105
|
|
97
106
|
rubyforge_project:
|
98
|
-
rubygems_version: 1.3.
|
107
|
+
rubygems_version: 1.3.7
|
99
108
|
signing_key:
|
100
109
|
specification_version: 3
|
101
110
|
summary: Add support for draft models (incomplete models) to ActiveRecord
|