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 AttachedValidator < ActiveModel::EachValidator | |
# Active Storage validator to ensure that an attachment is attached. | |
# | |
# usage: | |
# validates :upload, attached: true | |
# | |
def validate_each(record, attribute, _value) | |
return if record.send(attribute).attached? | |
errors_options = {} |
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
threads=1 | |
task-workers=0 | |
out-of-order-eval=false | |
max-prefetch=0 | |
minibatch-size=1 | |
nncache=0 | |
smart-pruning-factor=0 |
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
require 'yaml' | |
Track = Struct.new :title, :duration | |
# An Album represents an audio medium which has title, | |
# interpret, a pause duration between tracks and a list | |
# of individual tracks. | |
class Album | |
attr_reader :title, :interpret, :pause |