Write your own
class RemoveTimestamps < ForestAdminDatasourceCustomizer::Plugins::Plugin
def run(datasource, collection, options)
# ... call customization methods here
end
endName
Description
Making your Plugin act differently depending on the Collection
class RemoveTimestamps < ForestAdminDatasourceCustomizer::Plugins::Plugin
def run(datasource, _collection, _options)
datasource.collections.each do |current_collection|
if current_collection.schema[:fields]['createdAt']
current_collection.remove_field('createdAt')
end
if current_collection.schema[:fields]['updatedAt']
current_collection.remove_field('updatedAt')
end
end
end
endLast updated