form_core 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/app/models/form_core/field.rb +2 -0
- data/app/models/form_core/form.rb +2 -0
- data/db/migrate/20170430190404_create_forms.rb +1 -1
- data/db/migrate/20170430191336_create_fields.rb +2 -2
- data/lib/form_core/concerns/models/field.rb +3 -1
- data/lib/form_core/version.rb +1 -1
- data/lib/form_core/virtual_model.rb +0 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0ff92c104fbdbeb9f7fbd170b34868a2697ea1e
|
4
|
+
data.tar.gz: 28003e17cc44fd89b86cb9c2019527332902f081
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c9c08f314a65c66bb211e61855e0f933292897a46231cb07f21e2c637fcb6486efd6f0844759d4a6a8188ecbd874fbab161fb014a632889d2d876b2d9cb058a
|
7
|
+
data.tar.gz: b1b79bd8edb0470183f4ec3c616a19d7912ef8e34fdb935e65647d1491348e6f23d86ce0ec8338850d0ab916c4dcb7bf2a40e7e0379765abbb6cb8b283c2dbfb
|
data/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
class CreateFields < ActiveRecord::Migration[5.1]
|
2
2
|
def change
|
3
|
-
create_table :
|
3
|
+
create_table :fields do |t|
|
4
4
|
t.string :name, null: false
|
5
5
|
t.integer :accessibility, null: false
|
6
6
|
t.text :validations
|
7
7
|
t.text :options
|
8
8
|
t.string :type, null: false, index: true
|
9
|
-
t.references :form, foreign_key:
|
9
|
+
t.references :form, foreign_key: true
|
10
10
|
|
11
11
|
t.timestamps
|
12
12
|
end
|
@@ -5,6 +5,8 @@ module FormCore::Concerns
|
|
5
5
|
module Field
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
|
8
|
+
NAME_REGEX = /\A[a-z_][a-z_0-9]*\z/
|
9
|
+
|
8
10
|
included do
|
9
11
|
enum accessibility: {read_and_write: 0, readonly: 1, hidden: 2},
|
10
12
|
_prefix: :access
|
@@ -16,7 +18,7 @@ module FormCore::Concerns
|
|
16
18
|
presence: true,
|
17
19
|
uniqueness: {scope: :form},
|
18
20
|
exclusion: {in: FormCore.reserved_names},
|
19
|
-
format: {with:
|
21
|
+
format: {with: NAME_REGEX}
|
20
22
|
validates :accessibility,
|
21
23
|
inclusion: {in: self.accessibilities.keys.map(&:to_sym)}
|
22
24
|
|
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.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jasl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
86
|
version: '0'
|
87
87
|
requirements: []
|
88
88
|
rubyforge_project:
|
89
|
-
rubygems_version: 2.6.
|
89
|
+
rubygems_version: 2.6.13
|
90
90
|
signing_key:
|
91
91
|
specification_version: 4
|
92
92
|
summary: A Rails engine providing ability to generate dynamic form.
|