11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/generic_resources/acts_as_generic_resource.rb', line 11
def acts_as_generic_resource(permitted_attributes: [], overview_attributes: [])
if permitted_attributes.empty?
permitted_attributes = (self.try(:column_names) || []) - ['id', 'created_at', 'updated_at']
end
if overview_attributes.empty?
overview_attributes = permitted_attributes
end
GenericResource.register_resource!(self, permitted_attributes: permitted_attributes, overview_attributes: overview_attributes)
end
|