clark_kent 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/clark_kent/sharing_scope_kind.rb +13 -3
- data/lib/clark_kent/version.rb +1 -1
- 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: fc4b0529d912c86b001696a9a12c67d0115d7b95
|
4
|
+
data.tar.gz: 3f5f8ae4ae7447ee9bd7e3e422422efdf01bb9b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1edbe3a09eaec25efe58d3748e28a7cd0512803cd02a54831207477df6300cf6c20111137cd1feace77bc61dc4b4e7daeddc6265cf763cc885077cd286361680
|
7
|
+
data.tar.gz: 0641e133db74f63392f4e29e164ce485a802194c0eb98f85947aa1323c39499bd83ce931f6be7a58c506b1a1243611f5d0dfc9faf18cc440cff2741551b342ac
|
@@ -30,7 +30,7 @@ module ClarkKent
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def self.custom
|
33
|
-
all.select{|ssk| ['everyone',
|
33
|
+
all.select{|ssk| ['everyone','personal'].exclude? ssk.type}
|
34
34
|
end
|
35
35
|
|
36
36
|
def self.custom_for_user(user)
|
@@ -49,7 +49,10 @@ module ClarkKent
|
|
49
49
|
def self.select_options_for_user(user)
|
50
50
|
sharing_scope_options = {}
|
51
51
|
self.all.each do |sharing_scope_kind|
|
52
|
+
puts sharing_scope_kind.to_yaml
|
52
53
|
if custom.exclude?(sharing_scope_kind) || has_some(sharing_scope_kind.associated_containers_for(user))
|
54
|
+
puts sharing_scope_kind.class_name
|
55
|
+
puts sharing_scope_kind.human_name
|
53
56
|
sharing_scope_options[sharing_scope_kind.human_name] = sharing_scope_kind.class_name
|
54
57
|
end
|
55
58
|
end
|
@@ -67,7 +70,14 @@ module ClarkKent
|
|
67
70
|
end
|
68
71
|
|
69
72
|
def human_name
|
70
|
-
@human_name
|
73
|
+
return @human_name if @human_name.present?
|
74
|
+
if @class_name == ClarkKent.user_class_name
|
75
|
+
@human_name = 'Personal'
|
76
|
+
else
|
77
|
+
@human_name = @class_name.humanize
|
78
|
+
end
|
79
|
+
puts @human_name
|
80
|
+
@human_name
|
71
81
|
end
|
72
82
|
|
73
83
|
def type
|
@@ -86,7 +96,7 @@ module ClarkKent
|
|
86
96
|
case type
|
87
97
|
when 'everyone'
|
88
98
|
[ClarkKent::SharingScope.new('Everyone',self)]
|
89
|
-
when
|
99
|
+
when 'personal'
|
90
100
|
[ClarkKent::SharingScope.new(user,self)]
|
91
101
|
else
|
92
102
|
if associated_containers_for(user).respond_to? :map
|
data/lib/clark_kent/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clark_kent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Draut
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|