lib/avo/base_resource.rb in avo-1.4.0.pre.1 vs lib/avo/base_resource.rb in avo-1.4.0
- old
+ new
@@ -59,12 +59,20 @@
end
def get_field_definitions
return [] if self.class.fields.blank?
- self.class.fields.map do |field|
+ fields = self.class.fields.map do |field|
field.hydrate(resource: self, panel_name: default_panel_name, user: user)
end
+
+ if Avo::App.license.invalid? || Avo::App.license.lacks(:custom_fields)
+ fields = fields.reject do |field|
+ field.custom?
+ end
+ end
+
+ fields
end
def get_fields(panel: nil, reflection: nil)
fields = get_field_definitions.select do |field|
field.send("show_on_#{@view}")