lib/avo/app.rb in avo-0.5.0.beta7 vs lib/avo/app.rb in avo-0.5.0.beta8
- old
+ new
@@ -8,27 +8,10 @@
class_attribute :request, default: nil
class_attribute :context, default: nil
class_attribute :license, default: nil
class << self
- # def load_controllers
- # BaseResource.descendants.each do |resource|
- # controller_name = "#{resource.to_s.gsub('Resource', '').pluralize}Controller"
- # puts controller_name.inspect
- # # eval <<DYNAMIC
- # # class #{controller_name} < Avo::ResourcesController
- # # # title :Person
- # # # attribute :name, String
- # # # ...or substitute other stuff in here.
- # # end
- # # DYNAMIC
-
- # Avo.const_set(controller_name.to_sym, Class.new(Avo::ResourcesController))
- # # puts controller_name.inspect
- # end
- # end
-
def boot
init_fields
I18n.locale = Avo.configuration.language_code
@@ -75,34 +58,9 @@
def load_field(method_name, klass)
self.fields.push(
name: method_name,
class: klass,
)
-
- # Avo::Loaders::FieldsLoader.define_method method_name.to_sym do |*args, &block|
- # puts ['Avo::Loaders::FieldsLoader.define_method->', args, block.present?].inspect
-
- # if block.present?
- # puts '111->'.inspect
- # field = klass.new(args[0], **args[1] || {}, &block)
- # else
- # puts '222->'.inspect
- # field = klass.new(args[0], **args[1] || {})
- # end
-
- # puts field.inspect
-
- # self.bag.push field
-
- # # field
- # # if block.present?
- # # field_class = klass::new(args[0], **args[1] || {}, &block)
- # # else
- # # field_class = klass::new(args[0], **args[1] || {})
- # # end
-
- # # klass_entity.add_field(self, field_class)
- # end
end
def init_resources
self.app[:resources] = BaseResource.descendants
.select do |resource|