Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
require 'yaml'
exit_code = 0
if ARGV.length != 1
puts "Usage: ruby validate_ymls.rb directory_absolute_path"
exit!
end
@endzyme
endzyme / classes.rb
Created October 20, 2012 00:25 — forked from kalleth/classes.rb
hmm, polymorphism?
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