unidom-score 0.4.1 → 1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eb608b3d49013e5c4ca4684d3a02d36b1449ec10
4
- data.tar.gz: f655368a2e50b3178806c387f970fc26d0e791e9
3
+ metadata.gz: 2772ca63bdbb1123a7403050b2d2b2a2a770c7cf
4
+ data.tar.gz: 19c2f02b4c5d8a6591967cb1e962fece81c31e21
5
5
  SHA512:
6
- metadata.gz: b2e8f61f9801c0461b7cc3273e07d659f5e8ceeb81f132aa976e8c13ae958f6d5a7637a3235a868c24205c7bfe6777f13c709229cb6ed103be6476ffd99f6063
7
- data.tar.gz: 1e5e2274a73be367ceb4127096f52ca16b8ae4595796ca1b1f219f4f7cb59e294cf26ca8410d6a16a406382a44b3c9aa5baae12497ca4538a2899f04cca0554f
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', total_score: 100
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: 0, less_than_or_equal_to: 1_000_000_000 }
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: 0, less_than_or_equal_to: 1_000_000_000 }
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: 0, less_than_or_equal_to: 1_000_000_000 }
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, allow_blank: true, length: { in: 2..columns_hash['name'].limit }
13
- validates :total_score, presence: true, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 1_000_000_000 }
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, null: true, default: nil, limit: 200
11
- t.decimal :total_score, null: false, default: 0.0, precision: 12, scale: 2
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
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Score
3
- VERSION = '0.4.1'.freeze
3
+ VERSION = '1.0'.freeze
4
4
  end
5
5
  end
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.1
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-06 00:00:00.000000000 Z
11
+ date: 2016-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common