app/models/unidom/common/concerns/model_extension.rb in unidom-common-1.8 vs app/models/unidom/common/concerns/model_extension.rb in unidom-common-1.8.1

- old
+ new

@@ -31,11 +31,11 @@ where "(#{table_name}.notation -> 'columns' ->> '#{name}')::boolean = :value", value: (value ? true : false) end =end if columns_hash['ordinal'].present?&&:integer==columns_hash['ordinal'].type - validates :ordinal, presence: true, numericality: { integer_only: true, greater_than: 0 } + validates :ordinal, presence: true, numericality: { only_integer: true, greater_than: 0 } scope :ordinal_is, ->(ordinal) { where ordinal: ordinal } end if columns_hash['uuid'].present?&&:uuid==columns_hash['uuid'].type validates :uuid, presence: true, length: { is: 36 } @@ -45,17 +45,17 @@ if columns_hash['elemental'].present?&&:boolean==columns_hash['elemental'].type scope :primary, ->(elemental = true) { where elemental: elemental } end if columns_hash['grade'].present?&&:integer==columns_hash['grade'].type - validates :grade, presence: true, numericality: { integer_only: true, greater_than_or_equal_to: 0 } + validates :grade, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 0 } scope :grade_is, ->(grade) { where grade: grade } scope :grade_higher_than, ->(grade) { where "grade > :grade", grade: grade } scope :grade_lower_than, ->(grade) { where "grade < :grade", grade: grade } end if columns_hash['priority'].present?&&:integer==columns_hash['priority'].type - validates :priority, presence: true, numericality: { integer_only: true, greater_than_or_equal_to: 0 } + validates :priority, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 0 } scope :priority_is, ->(priority) { where priority: priority } scope :priority_higher_than, ->(priority) { where "priority > :priority", priority: priority } scope :priority_lower_than, ->(priority) { where "priority < :priority", priority: priority } end