|
|
|
@ -3,6 +3,8 @@ class Impediment < Task |
|
|
|
|
|
|
|
|
|
after_save :update_blocks_list |
|
|
|
|
|
|
|
|
|
validate :validate_blocks_list |
|
|
|
|
|
|
|
|
|
safe_attributes "blocks_ids", |
|
|
|
|
:if => lambda {|impediment, user| |
|
|
|
|
(impediment.new_record? && user.allowed_to?(:create_impediments, impediment.project)) || |
|
|
|
@ -56,10 +58,6 @@ class Impediment < Task |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def validate |
|
|
|
|
validate_blocks_list |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def validate_blocks_list |
|
|
|
|
if blocks_ids.size == 0 |
|
|
|
|
errors.add :blocks_ids, :must_block_at_least_one_issue |
|
|
|
|