administrate 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of administrate might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/views/fields/boolean/_form.html.erb +2 -0
- data/app/views/fields/boolean/_index.html.erb +1 -0
- data/app/views/fields/boolean/_show.html.erb +1 -0
- data/lib/administrate/base_dashboard.rb +1 -0
- data/lib/administrate/fields/belongs_to.rb +7 -1
- data/lib/administrate/fields/boolean.rb +15 -0
- data/lib/administrate/fields/has_many.rb +4 -4
- data/lib/administrate/version.rb +1 -1
- data/lib/generators/administrate/dashboard/dashboard_generator.rb +4 -3
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9b9090f8ba59a083ec8484f644561d803062d56
|
4
|
+
data.tar.gz: fe9a6db1a0702cb0b1459d3b67385d36641dc0b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd0b3a695b131733a8a2d7a3c433e8babb7afff01acf20655764845bf8baa1f5e3cb847c2262ce566d2de459853dbe71b91a7f1603f24eb918c4234f73ef2288
|
7
|
+
data.tar.gz: aee894ee80ed845e4adc46a969f04192b59e7550c974de023ddb4cb534f1c4cf5008d74634b9dc0bebf80b85072b33077bc0af65a84fa7dec2d2f7d7b69bf521
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= field %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= field %>
|
@@ -12,7 +12,13 @@ module Administrate
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def candidate_records
|
15
|
-
Object.const_get(
|
15
|
+
Object.const_get(associated_class_name).all
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def associated_class_name
|
21
|
+
options.fetch(:class_name, attribute.to_s.camelcase)
|
16
22
|
end
|
17
23
|
end
|
18
24
|
end
|
@@ -21,17 +21,17 @@ module Administrate
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def candidate_records
|
24
|
-
Object.const_get(
|
24
|
+
Object.const_get(associated_class_name).all
|
25
25
|
end
|
26
26
|
|
27
27
|
private
|
28
28
|
|
29
29
|
def associated_dashboard
|
30
|
-
Object.const_get("#{
|
30
|
+
Object.const_get("#{associated_class_name}Dashboard").new
|
31
31
|
end
|
32
32
|
|
33
|
-
def
|
34
|
-
options
|
33
|
+
def associated_class_name
|
34
|
+
options.fetch(:class_name, attribute.to_s.singularize.camelcase)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
data/lib/administrate/version.rb
CHANGED
@@ -4,6 +4,7 @@ module Administrate
|
|
4
4
|
module Generators
|
5
5
|
class DashboardGenerator < Rails::Generators::NamedBase
|
6
6
|
ATTRIBUTE_TYPE_MAPPING = {
|
7
|
+
boolean: "Field::Boolean",
|
7
8
|
date: "Field::DateTime",
|
8
9
|
datetime: "Field::DateTime",
|
9
10
|
float: "Field::Number",
|
@@ -61,11 +62,11 @@ module Administrate
|
|
61
62
|
if relationship.has_one?
|
62
63
|
"Field::HasOne"
|
63
64
|
elsif relationship.collection?
|
64
|
-
"Field::HasMany" +
|
65
|
+
"Field::HasMany" + relationship_options_string(relationship)
|
65
66
|
elsif relationship.polymorphic?
|
66
67
|
"Field::Polymorphic"
|
67
68
|
else
|
68
|
-
"Field::BelongsTo"
|
69
|
+
"Field::BelongsTo" + relationship_options_string(relationship)
|
69
70
|
end
|
70
71
|
end
|
71
72
|
|
@@ -73,7 +74,7 @@ module Administrate
|
|
73
74
|
@klass ||= Object.const_get(class_name)
|
74
75
|
end
|
75
76
|
|
76
|
-
def
|
77
|
+
def relationship_options_string(relationship)
|
77
78
|
if relationship.class_name != relationship.name.to_s.classify
|
78
79
|
options_string(class_name: relationship.class_name)
|
79
80
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: administrate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grayson Wright
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: neat
|
@@ -187,6 +187,9 @@ files:
|
|
187
187
|
- app/views/fields/belongs_to/_form.html.erb
|
188
188
|
- app/views/fields/belongs_to/_index.html.erb
|
189
189
|
- app/views/fields/belongs_to/_show.html.erb
|
190
|
+
- app/views/fields/boolean/_form.html.erb
|
191
|
+
- app/views/fields/boolean/_index.html.erb
|
192
|
+
- app/views/fields/boolean/_show.html.erb
|
190
193
|
- app/views/fields/date_time/_form.html.erb
|
191
194
|
- app/views/fields/date_time/_index.html.erb
|
192
195
|
- app/views/fields/date_time/_show.html.erb
|
@@ -219,6 +222,7 @@ files:
|
|
219
222
|
- lib/administrate/engine.rb
|
220
223
|
- lib/administrate/fields/base.rb
|
221
224
|
- lib/administrate/fields/belongs_to.rb
|
225
|
+
- lib/administrate/fields/boolean.rb
|
222
226
|
- lib/administrate/fields/date_time.rb
|
223
227
|
- lib/administrate/fields/deferred.rb
|
224
228
|
- lib/administrate/fields/email.rb
|