2014-09-30 21:05:53 +01:00
|
|
|
module EmptyMetadata
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
2016-05-03 12:33:40 +01:00
|
|
|
after_commit :create_empty_metadata, on: :create
|
2014-09-30 21:05:53 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def create_empty_metadata
|
2014-10-01 21:10:05 +01:00
|
|
|
return if is_a?(Platform) && ( personal? || hidden? )
|
2016-05-28 19:21:02 +01:00
|
|
|
CreateEmptyMetadataJob.perform_async(self.class.name, id)
|
2014-09-30 21:05:53 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|