kentouzu 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v0.0.3
2
+
3
+ * Fixed the require in reify. `self.item_type.underscore` instead of `self.item_type.downcase`.
4
+ * Removed debug output from without_drafts.
5
+ * Added with_drafts.
6
+
1
7
  ## v0.0.2
2
8
 
3
9
  * Fixed bug in reify.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kentouzu (0.0.2)
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.6)
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.9.2.2)
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.33)
72
+ tzinfo (0.3.35)
73
73
 
74
74
  PLATFORMS
75
75
  ruby
@@ -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.downcase
37
+ require self.item_type.underscore
38
38
 
39
39
  loaded_object = YAML::load object
40
40
 
@@ -87,16 +87,20 @@ module Kentouzu
87
87
  v ? v.reify(reify_options) : self
88
88
  end
89
89
 
90
- def without_drafts method = nil
90
+ def with_drafts method = nil
91
91
  drafts_were_enabled = self.drafts_enabled_for_model
92
92
 
93
- puts "drafts_were_enabled #{drafts_were_enabled}"
93
+ self.class.drafts_on
94
94
 
95
- self.class.drafts_off
95
+ method ? method.to_proc.call(self) : yield
96
+ ensure
97
+ self.class.drafts_off unless drafts_were_enabled
98
+ end
96
99
 
97
- puts "self.drafts_enabled_for_model #{self.drafts_enabled_for_model}"
100
+ def without_drafts method = nil
101
+ drafts_were_enabled = self.drafts_enabled_for_model
98
102
 
99
- puts method
103
+ self.class.drafts_off
100
104
 
101
105
  method ? method.to_proc.call(self) : yield
102
106
  ensure
@@ -1,3 +1,3 @@
1
1
  module Kentouzu
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
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.2
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-14 00:00:00.000000000 Z
12
+ date: 2012-11-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties