effective_bootstrap 0.2.0 → 0.2.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c73961161d3573b8a086dceedd1b2b97b5c51d5
|
4
|
+
data.tar.gz: 3e73d0c2f628c120064355648474901ccf88d401
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f50b617e235e67f29da29399ab37e460af5daa2310fbbc9dcbc2b58b6fb8e10fb1be4acaba8f97d226a50ce30c568e1f0ce6af5ab8f5beeed029139e04c7f5ea
|
7
|
+
data.tar.gz: 475fc4f1332c039099623dbdfb011d1105b361b651dca036f59ae9f0a879a88161c47ea2c80a40ac2959f60a914886b0b810879fc33465c8b4b8e6939f943574
|
@@ -126,7 +126,20 @@ module Effective
|
|
126
126
|
return BLANK if options[:label] == false
|
127
127
|
return BLANK if name.kind_of?(NilClass)
|
128
128
|
|
129
|
-
text =
|
129
|
+
text = options[:label].delete(:text)
|
130
|
+
name_to_s = name.to_s
|
131
|
+
|
132
|
+
text ||= (
|
133
|
+
if object && name_to_s.ends_with?('_id')
|
134
|
+
object.class.human_attribute_name(name_to_s.chomp('_id'))
|
135
|
+
elsif object && name_to_s.ends_with?('_ids')
|
136
|
+
object.class.human_attribute_name(name_to_s.chomp('_ids').pluralize)
|
137
|
+
elsif object
|
138
|
+
object.class.human_attribute_name(name)
|
139
|
+
else
|
140
|
+
BLANK
|
141
|
+
end
|
142
|
+
)
|
130
143
|
|
131
144
|
if options[:input][:id]
|
132
145
|
options[:label][:for] = options[:input][:id]
|
@@ -59,7 +59,8 @@ module Effective
|
|
59
59
|
|
60
60
|
def multiple?
|
61
61
|
return @multiple unless @multiple.nil?
|
62
|
-
|
62
|
+
|
63
|
+
@multiple = options.key?(:multiple) ? options.delete(:multiple) : (tags? || name.to_s.ends_with?('_ids'))
|
63
64
|
end
|
64
65
|
|
65
66
|
def tags?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|