This file contains hidden or 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
# frozen_string_literal: true | |
namespace :validations do | |
desc 'List all model validations defined by schema_validations' | |
task list: :environment do | |
LIST_OUTPUT = STDOUT | |
VALIDATIONS = Hash.new | |
# monkey patch SchemaValidations to extract validation metadata instead of applying them | |
# gem source: lib/schema_validations/active_record/validations.rb |
This file contains hidden or 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
# Package matcher | |
# Description | |
# As the owner of an online store, you need to fulfill orders everyday. To optimize the packing of each order, you decide to write an algorithm to match boxes and items based on their respective sizes. | |
# You have access to the following two boxes: | |
# - A medium box (identifier: M) | |
# - A large box (identifier: L) | |
# When possible, you should try to fit multiple items in the same box but boxes can only contain one type of product. | |
# This is the list of items you sell along with associated boxes: | |
# - Camera (identifier: Cam): one can fit in a medium box, and up to two can fit in a large box |
OlderNewer