This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sumatosoft task: | |
# Find probability of sum of thrown dice. | |
# Input: | |
# M - dice count (positive integer) | |
# N - sum (positive integer) | |
# Output: | |
# probability (rounded) | |
# | |
# Solution: | |
# Probability equals to count valid permutations of dice values for |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module GeneralHelper | |
def permitted_params | |
@permitted_params ||= declared(params, include_missing: false) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Event < ActiveRecord::Base | |
STATUSES = [ :cancelled, :in_progress, :completed, :invoiced ] | |
enum status: STATUSES | |
... | |
end |