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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f06ea851e7a0daf23c2e2b0b60fff9b1eda4d119
4
- data.tar.gz: ec8c7184fcfd823c8e878b429b6637f235a8ae2d
3
+ metadata.gz: c9dbd63db4f35b9bcf1058b5aab5eddc9767076d
4
+ data.tar.gz: 7558de09b058f70d8ae4d241a9aefbc9d840713b
5
5
  SHA512:
6
- metadata.gz: dd00ad60982e68344132be45d5c20ad44cc92b89b7e240f46c01278365edc06c7df7b3cf908d4f40ec3cc98b82cd528bf17d2cb26d82a66c505aa7e50353595b
7
- data.tar.gz: '04480e1c5ee8bf6666d02e85401b3072ac41562292b9ca214f203b6a3c864b5990fae4723aefbfdd06cca6d43def89da9735f5b81409c83967d88acc251e246c'
6
+ metadata.gz: 5e1077c3cdd20bcf178e3e925185ee6a6c2e3ad50f6007b5b3121b7474cbe217339466ecebf32f4eb8a1a340d9a0210a0bc99ee563ca717dd1b593d00ad90afd
7
+ data.tar.gz: 2e56b171c714e73afc562503bb6d0e5cb1f37c987e40a73852b33aa10b0db6d902ddde1629f634727a227b476d6ae1d1fe0616ba65f1447c70d27e0f06df28ad
data/README.md CHANGED
@@ -44,7 +44,7 @@ $ bin/rails db:migrate
44
44
  Clone the repository.
45
45
 
46
46
  ```sh
47
- $ git clone https://github.com/jasl/form_core.git
47
+ $ git clone https://github.com/jasl-lab/form_core.git
48
48
  ```
49
49
 
50
50
  Change directory
@@ -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, read_only: 1, hidden: 2}
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 == :read_only
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FormCore
4
- VERSION = "0.0.11"
4
+ VERSION = "0.0.12"
5
5
  end
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.11
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-24 00:00:00.000000000 Z
11
+ date: 2017-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails