Sha256: 4aa535f3913175dc441f10f1a4389a42dc92830e38094a64567114c9813c23ce
Contents?: true
Size: 939 Bytes
Versions: 15
Compression:
Stored size: 939 Bytes
Contents
module ForestLiana class ControllerFactory def self.define_controller(active_record_class, service) class_name = active_record_class.table_name.classify module_name = class_name.deconstantize name = module_name if module_name name += class_name.demodulize ForestLiana::UserSpace.const_set("#{name}Controller", service) end def self.get_controller_name(active_record_class) class_name = active_record_class.table_name.classify module_name = class_name.deconstantize name = module_name if module_name name += class_name.demodulize "ForestLiana::UserSpace::#{name}Controller" end def controller_for(active_record_class) controller = Class.new(ResourcesController) { } ForestLiana::ControllerFactory.define_controller(active_record_class, controller) controller end end end
Version data entries
15 entries across 15 versions & 1 rubygems