push_type_core 0.5.0.alpha.5 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/fields/push_type/asset_field.rb +5 -1
- data/app/fields/push_type/markdown_field.rb +2 -5
- data/app/fields/push_type/matrix_field.rb +1 -1
- data/app/fields/push_type/node_field.rb +9 -2
- data/app/fields/push_type/repeater_field.rb +1 -1
- data/app/fields/push_type/taxonomy_field.rb +4 -2
- data/lib/push_type/fields/relations.rb +3 -3
- data/lib/push_type/version.rb +1 -1
- data/test/dummy/config/initializers/push_type.rb +1 -1
- data/test/dummy/config/secrets.yml +2 -2
- data/test/dummy/db/schema.rb +1 -1
- data/test/dummy/log/test.log +7124 -2620
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/{YfvOcAtfd0a4AoZRwhfEPbutzGvytNV3PLH99tHHVec.cache → M0EVptJKeB1GMjwoMb3w3mgp8VB55MSbItnFhItY4hA.cache} +1 -1
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/{-Sjd8yE8radAZWLZz1Hn9eTc5vPZke6_-U1eg-KNjy8.cache → g97nJc5YmnbscVR5pZZoxgfj652ml7dLjUIu0FHDwLA.cache} +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/utXmZy0kE8zUnHIqwtbjUUJlYlFcGDJreK2YPDuR3n8.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/{RwmiAHIoiRN917L4TQ8saQaj1DsQgMpS97RYvkK2D5M.cache → vlJujjzOikOTUvCvT3C4o3vK0ySfxbQQ3RBE37vXH0U.cache} +0 -0
- data/test/dummy/tmp/generators/config/initializers/push_type.rb +38 -0
- data/test/dummy/tmp/generators/config/routes.rb +59 -0
- data/test/fields/push_type/asset_field_test.rb +37 -0
- data/test/fields/push_type/date_field_test.rb +14 -0
- data/test/fields/push_type/markdown_field_test.rb +35 -0
- data/test/fields/push_type/matrix_field_test.rb +35 -0
- data/test/fields/push_type/node_field_test.rb +71 -0
- data/test/fields/push_type/number_field_test.rb +13 -0
- data/test/fields/push_type/repeater_field_test.rb +21 -0
- data/test/fields/push_type/select_field_test.rb +40 -0
- data/test/fields/push_type/tag_list_field_test.rb +33 -0
- data/test/fields/push_type/taxonomy_field_test.rb +57 -0
- data/test/fields/push_type/text_field_test.rb +12 -0
- data/test/fields/push_type/time_field_test.rb +15 -0
- data/test/lib/push_type/field_type_test.rb +1 -57
- data/test/test_helper.rb +11 -1
- metadata +66 -42
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/H3MYWnNh74SPmIVutQpgqiLFgQBaPIZ8rUXz8S1IXfQ.cache +0 -1
- data/test/dummy/tmp/generators/app/models/category.rb +0 -6
- data/test/dummy/tmp/generators/app/views/taxonomies/category.html.erb +0 -3
- /data/test/dummy/db/migrate/{20150601132816_create_push_type_users.push_type.rb → 20150716155017_create_push_type_users.push_type.rb} +0 -0
- /data/test/dummy/db/migrate/{20150601132817_create_push_type_nodes.push_type.rb → 20150716155018_create_push_type_nodes.push_type.rb} +0 -0
- /data/test/dummy/db/migrate/{20150601132818_create_push_type_node_hierarchies.push_type.rb → 20150716155019_create_push_type_node_hierarchies.push_type.rb} +0 -0
- /data/test/dummy/db/migrate/{20150601132819_create_push_type_assets.push_type.rb → 20150716155020_create_push_type_assets.push_type.rb} +0 -0
- /data/test/dummy/db/migrate/{20150601132820_create_push_type_taxonomies.push_type.rb → 20150716155021_create_push_type_taxonomies.push_type.rb} +0 -0
- /data/test/dummy/db/migrate/{20150601132821_create_push_type_taxonomy_hierarchies.push_type.rb → 20150716155022_create_push_type_taxonomy_hierarchies.push_type.rb} +0 -0
- /data/test/dummy/db/migrate/{20150601132822_add_field_store_default_values.push_type.rb → 20150716155023_add_field_store_default_values.push_type.rb} +0 -0
- /data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/{H_FtcM4uZms6K7jOADXRW2-Q5luNbbboPJ8haQyA17A.cache → 0tutfZEltPbqMrjMJpcgLOWDEBEA1_i4wAlgfGmDMaM.cache} +0 -0
- /data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/{0_aw7up97T_NTvobuzf-o1Xpynz3Eqo7lyRTdE_M3kg.cache → 5hBD45unr3-A8x6pxXjxq708mnY9gJisy1yA5AojZWQ.cache} +0 -0
- /data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/{khjpnuHaHw24GnTbWlsRS6uIuTqIkrfvc2dY1aZWtpk.cache → DIGO2XX0gV_Ebgs43ap-65y0MyrcySF3iz56xum2NCQ.cache} +0 -0
- /data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/{I6zXuKkTIFbRK1A1tWK7nMeIhOXwx4iMRyZCdQatqy8.cache → MSjNaQjz3SH1LnDyk7nWta_i3hcCEV9m1eoNFbOXjwI.cache} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6aa55009b4f8a6c03b6fb102406df0571d67b025
|
4
|
+
data.tar.gz: 84db15a256012cfade4359e65df44e3ad25c6e0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23d987c95bedbc81a6391c0204cb1d6b499b8dc98ad70d291f0a8f348423264b0cf76a030a6e233d0b11644363726ac1a5f307203354ab3fa895bff600408225
|
7
|
+
data.tar.gz: 1bd32879b186951bbf24ac36320fdbd101b75547040a7e9f30e0fdba476cc12e83dc2941f6741d000a6e7ae0d71e0db8e6ff69197b5bc1757e620c897cd4f5d7
|
@@ -9,10 +9,14 @@ module PushType
|
|
9
9
|
"#{ name }-asset-modal"
|
10
10
|
end
|
11
11
|
|
12
|
+
def relation_class
|
13
|
+
PushType::Asset
|
14
|
+
end
|
15
|
+
|
12
16
|
initialized_on_node do |object, field|
|
13
17
|
object.class_eval do
|
14
18
|
define_method field.name.to_sym do
|
15
|
-
|
19
|
+
field.relation_class.not_trash.find send(field.json_key) if send(field.json_key).present?
|
16
20
|
end
|
17
21
|
end
|
18
22
|
end
|
@@ -13,10 +13,6 @@ module PushType
|
|
13
13
|
underline: true
|
14
14
|
}
|
15
15
|
|
16
|
-
def form_helper
|
17
|
-
@opts[:form_helper] || :text_area
|
18
|
-
end
|
19
|
-
|
20
16
|
def markdown
|
21
17
|
@markdown ||= Redcarpet::Markdown.new(renderer, @opts[:extensions])
|
22
18
|
end
|
@@ -29,7 +25,8 @@ module PushType
|
|
29
25
|
object.presenter_class.class_eval do
|
30
26
|
|
31
27
|
define_method field.name.to_sym do
|
32
|
-
|
28
|
+
raw = super()
|
29
|
+
fields[field.json_key].markdown.render raw unless raw.nil?
|
33
30
|
end
|
34
31
|
|
35
32
|
end
|
@@ -5,15 +5,22 @@ module PushType
|
|
5
5
|
|
6
6
|
options template: 'relation', field_options: {}, root: '/'
|
7
7
|
|
8
|
+
def relation_class
|
9
|
+
super
|
10
|
+
rescue NameError
|
11
|
+
PushType::Node
|
12
|
+
end
|
13
|
+
|
8
14
|
def relation_root
|
9
|
-
root =
|
15
|
+
root = relation_class.not_trash
|
16
|
+
root = root.find_by_path(@opts[:root].split('/')) unless @opts[:root] == '/'
|
10
17
|
root or raise "Cannot find root node at path '#{ @opts[:root] }'"
|
11
18
|
end
|
12
19
|
|
13
20
|
initialized_on_node do |object, field|
|
14
21
|
object.class_eval do
|
15
22
|
define_method field.name.to_sym do
|
16
|
-
field.relation_class.find send(field.json_key) if send(field.json_key).present?
|
23
|
+
field.relation_class.not_trash.find send(field.json_key) if send(field.json_key).present?
|
17
24
|
end
|
18
25
|
end
|
19
26
|
end
|
@@ -7,12 +7,12 @@ module PushType
|
|
7
7
|
(name.singularize + suffix).to_sym
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
11
|
-
@opts[:
|
10
|
+
def relation_class
|
11
|
+
(@opts[:class] || name).to_s.classify.constantize
|
12
12
|
end
|
13
13
|
|
14
14
|
def relation_root
|
15
|
-
|
15
|
+
relation_class
|
16
16
|
end
|
17
17
|
|
18
18
|
def relation_tree
|
data/lib/push_type/version.rb
CHANGED
@@ -33,6 +33,6 @@ PushType.setup do |config|
|
|
33
33
|
# secret_access_key: ENV['SECRET_ACCESS_KEY_ID']
|
34
34
|
# }
|
35
35
|
|
36
|
-
# config.dragonfly_secret = '
|
36
|
+
# config.dragonfly_secret = 'ecd8c099d97873bfcba21a3f63d298e86a7b4342be8493eb56b291d0ca46b187'
|
37
37
|
|
38
38
|
end
|
@@ -11,10 +11,10 @@
|
|
11
11
|
# if you're sharing your code publicly.
|
12
12
|
|
13
13
|
development:
|
14
|
-
secret_key_base:
|
14
|
+
secret_key_base: b88deb276072e733b6a6b83a5d5362b6e21a3b0d083b025c5317c5f5a52c037bf58548da93d789c587f33d73484df50681fd5389ba378a9c3a2431cc1a01ad7f
|
15
15
|
|
16
16
|
test:
|
17
|
-
secret_key_base:
|
17
|
+
secret_key_base: 2bdc9c611035f1a8d28c68f1fccfc3a9917277fb2785620953a8d30c8665e88a0f5fd52195a4e815f63687233bc57fa358aad0a71d8531d64f252b44841d25c8
|
18
18
|
|
19
19
|
# Do not keep production secrets in the repository,
|
20
20
|
# instead read values from the environment.
|
data/test/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20150716155023) do
|
15
15
|
|
16
16
|
# These are extensions that must be enabled in order to support this database
|
17
17
|
enable_extension "plpgsql"
|