custom_fielder 0.5.6 → 0.5.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14bb25c7560988128c0116a39625e48079613203
4
- data.tar.gz: c7df21ddbc7f88803abeddbe1a5a73db441c9262
3
+ metadata.gz: 9439a06e0eb1e9a999f50de592dbf8450e8337de
4
+ data.tar.gz: e4d3f9b9c1a4ff3ae81f35af6ae85bdf68d2e2da
5
5
  SHA512:
6
- metadata.gz: b2aef1b8e8a958efaad915d2000dd37ce6a8c14af4e6604b9fad6d84901443760367bd3e018637ec6647a12709d3dafe63780095d4d7d2f1d851fa6909da2ab1
7
- data.tar.gz: 331032e4148bf33be01b01269089d8826cbe769d75e7622aba6097e74a6ec92bcdd16339dbd233a8332847a13174f6b472afe7e8216be35e96d37b158fab74ab
6
+ metadata.gz: 2e4a9af79b87f83d457ce584d10231ea2dd7d15a2944be38dee663235c75d80d4666a83ed310a506f849252da35d6b29d620566af2019b66e5e42c8085fd3d9c
7
+ data.tar.gz: 7abc545e853aeafb53bed45ab0d1f45913835defa27fcb3cf85cabda595377a84140c3c2a82f745e170c7291355190780af996f1ac186941defbdaaa890c6f3f
@@ -2,9 +2,17 @@ module CustomFielder
2
2
  class FieldAttributes < ActiveRecord::Base
3
3
  has_many :custom_fields
4
4
 
5
+ before_save :serialize_allowed_values
6
+
5
7
  validates :name, presence: true
6
8
  validates :field_type, presence: true,
7
9
  inclusion: { in: %w[Array Integer Float Date DateTime Boolean String] }
8
10
  validates :allow_blank, inclusion: { in: [true, false] }
11
+
12
+ private
13
+
14
+ def serialize_allowed_values
15
+ allowed_values = allowed_values.to_s
16
+ end
9
17
  end
10
18
  end
@@ -13,6 +13,9 @@ module CustomFielder
13
13
  class_name: 'CustomFielder::FieldAttributes',
14
14
  source: :field_attributes
15
15
 
16
+ accepts_nested_attributes_for :custom_fielder_custom_fields, allow_destroy: true
17
+ accepts_nested_attributes_for :custom_fielder_field_attributes, allow_destroy: false
18
+
16
19
  alias_method :custom_fields, :custom_fielder_custom_fields
17
20
  alias_method :custom_field_attributes, :custom_fielder_field_attributes
18
21
 
@@ -1,3 +1,3 @@
1
1
  module CustomFielder
2
- VERSION = "0.5.6"
2
+ VERSION = "0.5.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: custom_fielder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Hurst
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-27 00:00:00.000000000 Z
11
+ date: 2016-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails