push_type_core 0.8.0.beta.1 → 0.8.0.beta.2

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.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/app/fields/push_type/relation_field.rb +6 -1
  3. data/app/models/concerns/push_type/customizable.rb +10 -0
  4. data/lib/push_type/core/engine.rb +0 -3
  5. data/lib/push_type/primitives/object_type.rb +1 -7
  6. data/lib/push_type/version.rb +1 -1
  7. data/test/dummy/config/initializers/push_type.rb +1 -1
  8. data/test/dummy/config/secrets.yml +2 -2
  9. data/test/dummy/db/schema.rb +1 -1
  10. data/test/dummy/log/test.log +8609 -8227
  11. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/0ANSDcZJu9gPyqtYPIW729qm1kriQ29Vn9LU8T2SGQU.cache +0 -0
  12. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_d65qW7wxRtKVSYpmfSenECz5QUWVI9pppUgV7TA1Rk.cache +0 -0
  13. data/test/fields/push_type/relation_field_test.rb +10 -0
  14. data/test/lib/push_type/primitives_test.rb +1 -0
  15. data/test/models/concerns/push_type/customizable_test.rb +4 -0
  16. data/test/models/push_type/node_test.rb +7 -0
  17. metadata +18 -18
  18. /data/test/dummy/db/migrate/{20160206155134_create_push_type_users.push_type.rb → 20160215150602_create_push_type_users.push_type.rb} +0 -0
  19. /data/test/dummy/db/migrate/{20160206155135_create_push_type_nodes.push_type.rb → 20160215150603_create_push_type_nodes.push_type.rb} +0 -0
  20. /data/test/dummy/db/migrate/{20160206155136_create_push_type_node_hierarchies.push_type.rb → 20160215150604_create_push_type_node_hierarchies.push_type.rb} +0 -0
  21. /data/test/dummy/db/migrate/{20160206155137_create_push_type_assets.push_type.rb → 20160215150605_create_push_type_assets.push_type.rb} +0 -0
  22. /data/test/dummy/db/migrate/{20160206155138_add_field_store_default_values.push_type.rb → 20160215150606_add_field_store_default_values.push_type.rb} +0 -0
  23. /data/test/dummy/db/migrate/{20160206155139_drop_legacy_push_type_taxonomies.push_type.rb → 20160215150607_drop_legacy_push_type_taxonomies.push_type.rb} +0 -0
  24. /data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/{BXXMCMRu7JahLHdf-HLwTSs6u6Pfn4DhDNK5wg5hgy0.cache → BbdqmNmo_cMpT3dnntuUSQnMCU3FOU0qEbTy3ESfBHE.cache} +0 -0
  25. /data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/{TUwu9oRcnc80mNVFDhhX5AqieKa5hmp5Ro9HIoQjdA4.cache → HbQzCpEE_QUF4m04TN_zIYyaX1ZCcx171j2td0cH-Vk.cache} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 736fd951736c5f385dab1cc64436cc1ee814803d
4
- data.tar.gz: d1f4e9137d3be16efb3ab35ace1e2ded80a3e014
3
+ metadata.gz: cce81b8f071f23bb075704f861dc34e79662bb80
4
+ data.tar.gz: d4b74e25ecaedafe986876b434c3d02b0b75ef8a
5
5
  SHA512:
6
- metadata.gz: 38b1f4ad6d34d5dbe7aec1ea6803bfa5e82cc6eecadc637a35f1a0d9bba24b40098415a5f4b6e489aa88b1d97bc2779da7aa1ef2601d2748eb72b55580c9e72b
7
- data.tar.gz: dc61b1b66d2166be460287c81c9ed4e80c9b21441b98d848acc86330fc7417e256b7051f26fff3c3814a19e331eb98a9e889dde7df97d0947e144b1e6c07be0c
6
+ metadata.gz: aa4f954451fb99136dccd62b0f5988b39cbc94900de07fb9ea4b49afb2956369222d1b80af9b7769d792106c96eb26be8a599c43819a377f58c091d161a780cc
7
+ data.tar.gz: 17bdef0e2959c0c48cee41064fa9607813097b478e2e564f320d86411f15a7b8abe13524a01efd1d1c9d8ff7575c87fe55055198db1338de4932afced16e15c7
@@ -75,7 +75,12 @@ module PushType
75
75
  on_instance do |object, field|
76
76
  object.class_eval do
77
77
  define_method(field.relation_name.to_sym) do
78
- field.relation_class.find field.json_value unless field.json_value.blank?
78
+ return nil if field.json_value.blank?
79
+ if field.multiple?
80
+ field.relation_class.where id: field.json_value
81
+ else
82
+ field.relation_class.find field.json_value
83
+ end
79
84
  end unless method_defined?(field.relation_name.to_sym)
80
85
  end
81
86
  end
@@ -10,6 +10,16 @@ module PushType
10
10
  @fields ||= {}
11
11
  end
12
12
 
13
+ # Overrides ActiveRecord::Base#attribute_for_inspect
14
+ # Minimises field_store value for more readable inspect
15
+ def attribute_for_inspect(attr_name)
16
+ if attr_name.to_s == 'field_store'
17
+ fields.keys.inspect
18
+ else
19
+ super
20
+ end
21
+ end
22
+
13
23
  private
14
24
 
15
25
  def initialize_fields
@@ -11,9 +11,6 @@ module PushType
11
11
  g.hidden_namespaces << 'push_type:dummy' << 'push_type:field'
12
12
  end
13
13
 
14
- config.autoload_paths << config.root.join('app', 'fields')
15
- config.autoload_paths << config.root.join('app', 'presenters')
16
-
17
14
  config.assets.precompile += %w(
18
15
  *.gif *.jpg *.png *.svg *.eot *.ttf *.woff *.woff2
19
16
  )
@@ -1,13 +1,7 @@
1
1
  module PushType
2
2
  module Primitives
3
3
  class ObjectType < Base
4
-
5
- def to_json
6
- unless value.blank? or value.values.all?(&:blank?)
7
- super
8
- end
9
- end
10
-
4
+ # No overriding behaviour
11
5
  end
12
6
  end
13
7
  end
@@ -1,3 +1,3 @@
1
1
  module PushType
2
- VERSION = '0.8.0.beta.1'
2
+ VERSION = '0.8.0.beta.2'
3
3
  end
@@ -45,6 +45,6 @@ PushType.setup do |config|
45
45
  # secret_access_key: ENV['SECRET_ACCESS_KEY_ID']
46
46
  # }
47
47
 
48
- # config.dragonfly_secret = 'cddb3d46c0d8274b6211613824e13c3240acf6b873554e91622c5c3dc9b71479'
48
+ # config.dragonfly_secret = 'cff3d8baa5f163bd349a990d21afdb87e1040201b79d4ee60b85de437612f500'
49
49
 
50
50
  end
@@ -11,10 +11,10 @@
11
11
  # if you're sharing your code publicly.
12
12
 
13
13
  development:
14
- secret_key_base: d149cd01c6eee217b8287d12912221801883ca082c1ba1c3511b1a5081338da74422e2b029ef2019336ffc4786be44e6b1cf6b6c7452d8ccdd62a1a5416682e6
14
+ secret_key_base: 5df41ef57c375934ba904132a0360ce33bb93049c03a1462004c02fd169c11a54d4772ac444b5410e201e9d746d474010e1021e3d60abf16c5f20dcc36b26015
15
15
 
16
16
  test:
17
- secret_key_base: 599444d947e59bb318b4083a4b8dcdfa6a214b3b677e99dd4354558de92c3d0ddbe8870375b729b874a82d1bc1dc7e80cb17acbc0db4e62ffe542f78ed94fb90
17
+ secret_key_base: eb5539a1682d363d661859b59a0e2045f318d3a4de8303015cad1b36d47a99d971cf517885c4f8f3228c5e06864cfb650e2acabc21d8fb9de8d8c11535f35be7
18
18
 
19
19
  # Do not keep production secrets in the repository,
20
20
  # instead read values from the environment.
@@ -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: 20160206155139) do
14
+ ActiveRecord::Schema.define(version: 20160215150607) do
15
15
 
16
16
  # These are extensions that must be enabled in order to support this database
17
17
  enable_extension "plpgsql"