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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c713233632c5883a0b9301ababaa0c191c04783e
4
- data.tar.gz: 757aa589bcd14cf2d463017abdb630684e4f9aea
3
+ metadata.gz: fc4b0529d912c86b001696a9a12c67d0115d7b95
4
+ data.tar.gz: 3f5f8ae4ae7447ee9bd7e3e422422efdf01bb9b7
5
5
  SHA512:
6
- metadata.gz: f9f654364134d628e8dc3af8ffa8ca7f107ab0005fcc5054816e00d07d3b73aca5926080a7988c16aa50103a441ba6a321d16a3e1b3dc3de28696b2054b61e7a
7
- data.tar.gz: 79c47a7f585dc0d5d1e505ba8dfa6f4ebd3badf205fce71c1e71c67ec4d56a802197d6e0d7d21cad42d9dc899d5cc8076ce5977d26dbcb22833871cb465c473b
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',ClarkKent.user_class_name.underscore].exclude? ssk.type}
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 ||= @class_name.humanize
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 ClarkKent.user_class_name.underscore
99
+ when 'personal'
90
100
  [ClarkKent::SharingScope.new(user,self)]
91
101
  else
92
102
  if associated_containers_for(user).respond_to? :map
@@ -1,3 +1,3 @@
1
1
  module ClarkKent
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
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.3
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-08 00:00:00.000000000 Z
11
+ date: 2015-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails