ecs: fix weigths weight && fix style

dev_cs
p31729568 5 years ago
parent 4b760f5512
commit 098f4ced06

@ -1,6 +1,8 @@
class EcCourseSupport < ApplicationRecord
default_scope { order(position: :asc) }
alias_attribute :weights, :weigths
belongs_to :ec_course
belongs_to :ec_graduation_subitem

@ -1,4 +1,3 @@
# TODO:: change table column :weigths => :weight
class EcCourseTarget < ApplicationRecord
belongs_to :ec_course
@ -8,6 +7,8 @@ class EcCourseTarget < ApplicationRecord
has_many :ec_course_achievement_methods, dependent: :destroy
has_many :ec_achievement_evaluation_relates, dependent: :destroy
alias_attribute :weight, :weigths
validates :content, presence: true
validates :standard_grade, numericality: { only_integer: true, greater_than: 0 }
validates :weight, presence: true, numericality: { less_than_or_equal_to: 1, greater_than_or_equal_to: 0 }

@ -3,3 +3,4 @@ json.extract! ec_graduation_subitem, :id, :position, :content, :ec_graduation_re
json.graduation_requirement_position ec_graduation_subitem.ec_graduation_requirement.position
json.course_supports ec_graduation_subitem.ec_course_supports, partial: 'ec_course_support', as: :ec_course_support
json.weights_total ec_graduation_subitem.ec_course_supports.to_a.sum(&:weights)

@ -15,7 +15,7 @@
background: #fff;
.ant-steps-item {
flex: unset;
flex: unset !important;
&-container {
margin-left: 0;

Loading…
Cancel
Save