Last active
December 13, 2015 17:48
-
-
Save ootoovak/4950519 to your computer and use it in GitHub Desktop.
Something I'm working with at the moment. WIP
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 'active_attr' | |
RELATIVE_APP_PATH = File.expand_path("../../app", __FILE__) | |
def construct_require_path(middle_path, name) | |
"#{RELATIVE_APP_PATH}/#{middle_path}/#{name}.rb" | |
end | |
def require_model(name) | |
require construct_require_path('models', name) | |
end | |
def require_controller(name) | |
require construct_require_path('controllers', name) | |
end | |
def required_constants(class_names) | |
class_names.each do |class_name| | |
unless Object.const_defined?(class_name) | |
Object.const_set(class_name, Class.new) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I may try switch to Virtus (if it serves the same role) instead of Active Attribute down the line as it has more commiters and activity.