Refactorings and gui improvements
This commit is contained in:
parent
c965e03e5a
commit
d1294c2fc4
46 changed files with 358 additions and 128020 deletions
|
|
@ -18,7 +18,7 @@ class Element < ApplicationRecord
|
|||
def level
|
||||
return nil
|
||||
return nil unless success_criteria.all(&:result)
|
||||
|
||||
element
|
||||
min_failed = success_criteria.select(&:failed?).map(&:level).min
|
||||
possible_levels = success_criteria.select(&:passed?).map(&:level).uniq
|
||||
|
||||
|
|
@ -37,4 +37,8 @@ class Element < ApplicationRecord
|
|||
Rails.logger.debug("element: position #{position}")
|
||||
self.position ||= (page.elements.pluck(:position).max || 0) + 1
|
||||
end
|
||||
|
||||
def number
|
||||
"#{page.position}.#{position}"
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue