Skip to content

Commit

Permalink
Temporarily re-add drupal_content_field_image_gallery.rb so the migra…
Browse files Browse the repository at this point in the history
…tion can complete

follow-up to #11371
  • Loading branch information
jywarren authored Sep 6, 2022
1 parent 4efd035 commit cb073ae
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions app/models/drupal_content_field_image_gallery.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
require 'php_serialize'

class DrupalContentFieldImageGallery < ApplicationRecord
self.table_name = 'content_field_image_gallery'
self.primary_keys = :vid, :nid

belongs_to :node, foreign_key: 'nid', dependent: :destroy
belongs_to :drupal_file, foreign_key: 'field_image_gallery_fid', dependent: :destroy

def file
drupal_file
end

def fid
field_image_gallery_fid
end

def image
DrupalFile.find field_image_gallery_fid
end

def description
PHP.unserialize(field_image_gallery_data)['description']
rescue StandardError
''
end
end

0 comments on commit cb073ae

Please sign in to comment.