form_core 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/form_core/concerns/models/field.rb +3 -2
- data/lib/form_core/concerns/models/form.rb +2 -1
- data/lib/form_core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9dbd63db4f35b9bcf1058b5aab5eddc9767076d
|
4
|
+
data.tar.gz: 7558de09b058f70d8ae4d241a9aefbc9d840713b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e1077c3cdd20bcf178e3e925185ee6a6c2e3ad50f6007b5b3121b7474cbe217339466ecebf32f4eb8a1a340d9a0210a0bc99ee563ca717dd1b593d00ad90afd
|
7
|
+
data.tar.gz: 2e56b171c714e73afc562503bb6d0e5cb1f37c987e40a73852b33aa10b0db6d902ddde1629f634727a227b476d6ae1d1fe0616ba65f1447c70d27e0f06df28ad
|
data/README.md
CHANGED
@@ -6,7 +6,8 @@ module FormCore::Concerns
|
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
|
8
8
|
included do
|
9
|
-
enum accessibility: {read_and_write: 0,
|
9
|
+
enum accessibility: {read_and_write: 0, readonly: 1, hidden: 2},
|
10
|
+
_prefix: :access
|
10
11
|
|
11
12
|
serialize :validations
|
12
13
|
serialize :options
|
@@ -51,7 +52,7 @@ module FormCore::Concerns
|
|
51
52
|
default_value = overrides.fetch(:default_value, self.default_value)
|
52
53
|
model.attribute name, stored_type, default: default_value
|
53
54
|
|
54
|
-
if accessibility == :
|
55
|
+
if accessibility == :readonly
|
55
56
|
model.attr_readonly name
|
56
57
|
end
|
57
58
|
|
@@ -18,8 +18,9 @@ module FormCore::Concerns
|
|
18
18
|
overrides: {})
|
19
19
|
check_model_validity! model
|
20
20
|
|
21
|
+
global_overrides = overrides.fetch(:_global, {})
|
21
22
|
fields_scope.call(fields).each do |f|
|
22
|
-
f.interpret_to model, overrides: overrides.fetch(f.name, {})
|
23
|
+
f.interpret_to model, overrides: global_overrides.merge(overrides.fetch(f.name, {}))
|
23
24
|
end
|
24
25
|
|
25
26
|
model
|
data/lib/form_core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: form_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jasl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|