kentouzu 0.0.2 → 0.0.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.
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +4 -4
- data/lib/kentouzu/draft.rb +1 -1
- data/lib/kentouzu/has_drafts.rb +9 -5
- data/lib/kentouzu/version.rb +1 -1
- metadata +2 -2
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
kentouzu (0.0.
|
4
|
+
kentouzu (0.0.3)
|
5
5
|
activerecord (~> 3.0)
|
6
6
|
railties (~> 3.0)
|
7
7
|
|
@@ -37,7 +37,7 @@ GEM
|
|
37
37
|
i18n (0.6.1)
|
38
38
|
journey (1.0.4)
|
39
39
|
json (1.7.5)
|
40
|
-
multi_json (1.3.
|
40
|
+
multi_json (1.3.7)
|
41
41
|
rack (1.4.1)
|
42
42
|
rack-cache (1.2)
|
43
43
|
rack (>= 0.4)
|
@@ -52,7 +52,7 @@ GEM
|
|
52
52
|
rake (>= 0.8.7)
|
53
53
|
rdoc (~> 3.4)
|
54
54
|
thor (>= 0.14.6, < 2.0)
|
55
|
-
rake (0.
|
55
|
+
rake (10.0.1)
|
56
56
|
rdoc (3.12)
|
57
57
|
json (~> 1.4)
|
58
58
|
rspec (2.11.0)
|
@@ -69,7 +69,7 @@ GEM
|
|
69
69
|
tilt (~> 1.1, != 1.3.0)
|
70
70
|
thor (0.16.0)
|
71
71
|
tilt (1.3.3)
|
72
|
-
tzinfo (0.3.
|
72
|
+
tzinfo (0.3.35)
|
73
73
|
|
74
74
|
PLATFORMS
|
75
75
|
ruby
|
data/lib/kentouzu/draft.rb
CHANGED
@@ -34,7 +34,7 @@ class Draft < ActiveRecord::Base
|
|
34
34
|
|
35
35
|
unless object.nil?
|
36
36
|
#This appears to be necessary if for some reason the draft's model hasn't been loaded (such as when done in the console).
|
37
|
-
require self.item_type.
|
37
|
+
require self.item_type.underscore
|
38
38
|
|
39
39
|
loaded_object = YAML::load object
|
40
40
|
|
data/lib/kentouzu/has_drafts.rb
CHANGED
@@ -87,16 +87,20 @@ module Kentouzu
|
|
87
87
|
v ? v.reify(reify_options) : self
|
88
88
|
end
|
89
89
|
|
90
|
-
def
|
90
|
+
def with_drafts method = nil
|
91
91
|
drafts_were_enabled = self.drafts_enabled_for_model
|
92
92
|
|
93
|
-
|
93
|
+
self.class.drafts_on
|
94
94
|
|
95
|
-
|
95
|
+
method ? method.to_proc.call(self) : yield
|
96
|
+
ensure
|
97
|
+
self.class.drafts_off unless drafts_were_enabled
|
98
|
+
end
|
96
99
|
|
97
|
-
|
100
|
+
def without_drafts method = nil
|
101
|
+
drafts_were_enabled = self.drafts_enabled_for_model
|
98
102
|
|
99
|
-
|
103
|
+
self.class.drafts_off
|
100
104
|
|
101
105
|
method ? method.to_proc.call(self) : yield
|
102
106
|
ensure
|
data/lib/kentouzu/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kentouzu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
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-11-
|
12
|
+
date: 2012-11-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|