kentouzu 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/kentouzu/has_drafts.rb +3 -3
- data/lib/kentouzu/version.rb +1 -1
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/kentouzu/has_drafts.rb
CHANGED
@@ -47,7 +47,7 @@ module Kentouzu
|
|
47
47
|
Draft.where(:item_type => self.name, :event => 'create')
|
48
48
|
end
|
49
49
|
|
50
|
-
define_singleton_method "all_with_reified_#{drafts_association_name.to_s}".to_sym do |order_by = Kentouzu.timestamp_field|
|
50
|
+
define_singleton_method "all_with_reified_#{drafts_association_name.to_s}".to_sym do |order_by = Kentouzu.timestamp_field, &block|
|
51
51
|
existing_drafts = Draft.where("`drafts`.`item_type` = \"#{self.name}\" AND `drafts`.`item_id` IS NOT NULL").group_by { |draft| draft.item_id }.map { |k, v| v.sort_by { |draft| draft.created_at }.first }
|
52
52
|
|
53
53
|
new_drafts = Draft.where("`drafts`.`item_type` = \"#{self.name}\" AND `drafts`.`item_id` IS NULL")
|
@@ -66,8 +66,8 @@ module Kentouzu
|
|
66
66
|
|
67
67
|
all_objects = (existing_objects + existing_reified_objects + new_reified_objects).sort_by { |object| object.send order_by }
|
68
68
|
|
69
|
-
if
|
70
|
-
all_objects.select! { |object|
|
69
|
+
if block
|
70
|
+
all_objects.select! { |object| block.call(object) }
|
71
71
|
end
|
72
72
|
|
73
73
|
all_objects
|
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.10
|
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: 2013-
|
12
|
+
date: 2013-10-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
@@ -259,7 +259,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
259
259
|
version: '0'
|
260
260
|
segments:
|
261
261
|
- 0
|
262
|
-
hash:
|
262
|
+
hash: 671730910949720598
|
263
263
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
264
264
|
none: false
|
265
265
|
requirements:
|
@@ -268,7 +268,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
268
268
|
version: '0'
|
269
269
|
segments:
|
270
270
|
- 0
|
271
|
-
hash:
|
271
|
+
hash: 671730910949720598
|
272
272
|
requirements: []
|
273
273
|
rubyforge_project: kentouzu
|
274
274
|
rubygems_version: 1.8.25
|