unidom-score 0.4.1 → 1.0
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/app/models/unidom/score/score_item.rb +1 -1
- data/app/models/unidom/score/score_item_template.rb +1 -1
- data/app/models/unidom/score/score_sheet.rb +1 -1
- data/app/models/unidom/score/score_sheet_template.rb +2 -2
- data/db/migrate/20060101000000_create_unidom_score_sheet_templates.rb +2 -2
- data/lib/unidom/score/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: 2772ca63bdbb1123a7403050b2d2b2a2a770c7cf
|
4
|
+
data.tar.gz: 19c2f02b4c5d8a6591967cb1e962fece81c31e21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6efd0bea590033c7b1d10b7b51a4ca14de3ccb48cef6430431c1b0c05075bd3d66cd5d493a69369f2d3c83bad28ba8bf049aeac50f62fac1a8f85b63d4ece960
|
7
|
+
data.tar.gz: f643e2673e18798193e418878e5c90b13059a2f4e60a72067bd5c16c0c2891e873fd90fd1e8e8438fcc725b33bcb05a708caed0f398d305dfdece8728b1fda64
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ The migration versions start with 200601.
|
|
37
37
|
|
38
38
|
```ruby
|
39
39
|
company = Unidom::Party::Company.create! name: 'Xerox'
|
40
|
-
sheet_template = Unidom::Score::ScoreSheetTemplate.create! subject: company, name: 'Survey 2003',
|
40
|
+
sheet_template = Unidom::Score::ScoreSheetTemplate.create! subject: company, name: 'Survey 2003', score: 100
|
41
41
|
|
42
42
|
item_template_1 = Unidom::Score::ScoreItemTemplate.create! sheet: sheet_template, title: 'Q1: What is your name?', score: 60
|
43
43
|
item_template_2 = Unidom::Score::ScoreItemTemplate.create! sheet: sheet_template, title: 'Q2: How old are you?', score: 40
|
@@ -10,7 +10,7 @@ class Unidom::Score::ScoreItem < Unidom::Score::ApplicationRecord
|
|
10
10
|
include Unidom::Common::Concerns::ModelExtension
|
11
11
|
|
12
12
|
validates :title, allow_blank: true, length: { in: 2..columns_hash['title'].limit }
|
13
|
-
validates :score, presence: true, numericality: { greater_than_or_equal_to:
|
13
|
+
validates :score, presence: true, numericality: { greater_than_or_equal_to: -1_000_000_000, less_than_or_equal_to: 1_000_000_000 }
|
14
14
|
|
15
15
|
belongs_to :sheet, class_name: 'Unidom::Score::ScoreSheet', foreign_key: :sheet_id
|
16
16
|
belongs_to :template, class_name: 'Unidom::Score::ScoreItemTemplate', foreign_key: :template_id
|
@@ -9,7 +9,7 @@ class Unidom::Score::ScoreItemTemplate < Unidom::Score::ApplicationRecord
|
|
9
9
|
include Unidom::Common::Concerns::ModelExtension
|
10
10
|
|
11
11
|
validates :title, presence: true, length: { in: 2..columns_hash['title'].limit }
|
12
|
-
validates :score, presence: true, numericality: { greater_than_or_equal_to:
|
12
|
+
validates :score, presence: true, numericality: { greater_than_or_equal_to: -1_000_000_000, less_than_or_equal_to: 1_000_000_000 }
|
13
13
|
|
14
14
|
belongs_to :sheet, class_name: 'Unidom::Score::ScoreSheetTemplate'
|
15
15
|
|
@@ -11,7 +11,7 @@ class Unidom::Score::ScoreSheet < Unidom::Score::ApplicationRecord
|
|
11
11
|
include Unidom::Common::Concerns::ModelExtension
|
12
12
|
|
13
13
|
validates :name, allow_blank: true, length: { in: 2..columns_hash['name'].limit }
|
14
|
-
validates :score, presence: true, numericality: { greater_than_or_equal_to:
|
14
|
+
validates :score, presence: true, numericality: { greater_than_or_equal_to: -1_000_000_000, less_than_or_equal_to: 1_000_000_000 }
|
15
15
|
|
16
16
|
belongs_to :template, class_name: 'Unidom::Score::ScoreSheetTemplate', foreign_key: :template_id
|
17
17
|
belongs_to :scorer, polymorphic: true
|
@@ -9,8 +9,8 @@ class Unidom::Score::ScoreSheetTemplate < Unidom::Score::ApplicationRecord
|
|
9
9
|
|
10
10
|
include Unidom::Common::Concerns::ModelExtension
|
11
11
|
|
12
|
-
validates :name,
|
13
|
-
validates :
|
12
|
+
validates :name, allow_blank: true, length: { in: 2..columns_hash['name'].limit }
|
13
|
+
validates :score, presence: true, numericality: { greater_than_or_equal_to: -1_000_000_000, less_than_or_equal_to: 1_000_000_000 }
|
14
14
|
|
15
15
|
belongs_to :subject, polymorphic: true
|
16
16
|
|
@@ -7,8 +7,8 @@ class CreateUnidomScoreSheetTemplates < ActiveRecord::Migration
|
|
7
7
|
t.references :subject, type: :uuid, null: false,
|
8
8
|
polymorphic: { null: false, default: '', limit: 200 }
|
9
9
|
|
10
|
-
t.string :name,
|
11
|
-
t.decimal :
|
10
|
+
t.string :name, null: true, default: nil, limit: 200
|
11
|
+
t.decimal :score, null: false, default: 0.0, precision: 12, scale: 2
|
12
12
|
|
13
13
|
t.text :description
|
14
14
|
t.text :instruction
|
data/lib/unidom/score/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-score
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0
|
4
|
+
version: '1.0'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Topbit Du
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|