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
#!/usr/bin/env ruby | |
require 'yaml' | |
exit_code = 0 | |
if ARGV.length != 1 | |
puts "Usage: ruby validate_ymls.rb directory_absolute_path" | |
exit! | |
end |
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
class DataCenter < ActiveRecord::Base | |
# has configuration_type, configuration_id attributes | |
def config | |
configuration_type.constantize.find(configuration_type) | |
end | |
def config=(config) | |
configuration_type = config.class.name | |
configuration_id = config.id | |
end |