📜  rails include dynamic - Ruby 代码示例

📅  最后修改于: 2022-03-11 15:04:49.589000             🧑  作者: Mango

代码示例1
p =  self.user.company.subdomain + ".rb"
if File.exists?(Rails.root + "lib/" + p)
myself = self
class_eval do
  include self.const_get(myself.user.company.subdomain.capitalize.to_sym)
end
self.custom_add_url