1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-19 13:54:25 +01:00

[bug] unable to create training credit

This commit is contained in:
Sylvain 2017-12-21 11:49:51 +01:00
parent 247c446af0
commit 72634162c6
3 changed files with 29 additions and 1 deletions

View File

@ -4,6 +4,7 @@
- Support for internet explorer 11
- Fix a bug: events order in public list
- Fix a bug: unable to create a training credit
- Corrected typos in documentation (#96)
## v2.6.1 2017 December 14

View File

@ -4,5 +4,9 @@ class Credit < ActiveRecord::Base
has_many :users_credits, dependent: :destroy
validates :creditable_id, uniqueness: { scope: [:creditable_type, :plan_id] }
validates :hours, numericality: { greater_than_or_equal_to: 0 }
validates :hours, numericality: { greater_than_or_equal_to: 0 }, if: :is_not_training_credit?
def is_not_training_credit?
not (creditable_type === 'Training')
end
end

View File

@ -0,0 +1,23 @@
require 'test/unit'
class TrainingTest < Test::Unit::TestCase
# Called before every test method runs. Can be used
# to set up fixture information.
def setup
# Do nothing
end
# Called after every test method runs. Can be used to tear
# down fixture information.
def teardown
# Do nothing
end
# Fake test
def test_fail
fail('Not implemented')
end
end