custom_fielder 0.5.6 → 0.5.8
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: 9439a06e0eb1e9a999f50de592dbf8450e8337de
|
4
|
+
data.tar.gz: e4d3f9b9c1a4ff3ae81f35af6ae85bdf68d2e2da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
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.
|
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-
|
11
|
+
date: 2016-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|