+
+ def self.searchable_columns operator
+ super - ["manifest_text"]
+ end
+
+ def self.full_text_searchable_columns
+ super - ["manifest_text"]
+ end
+
+ protected
+ def portable_manifest_text
+ self.class.munge_manifest_locators(manifest_text) do |match|
+ if match[2] # size
+ match[1] + match[2]
+ else
+ match[1]
+ end
+ end
+ end
+
+ def compute_pdh
+ portable_manifest = portable_manifest_text
+ (Digest::MD5.hexdigest(portable_manifest) +
+ '+' +
+ portable_manifest.bytesize.to_s)
+ end
+
+ def computed_pdh
+ if @computed_pdh_for_manifest_text == manifest_text
+ return @computed_pdh
+ end
+ @computed_pdh = compute_pdh
+ @computed_pdh_for_manifest_text = manifest_text.dup
+ @computed_pdh
+ end
+
+ def ensure_permission_to_save
+ if (not current_user.andand.is_admin and
+ (replication_confirmed_at_changed? or replication_confirmed_changed?) and
+ not (replication_confirmed_at.nil? and replication_confirmed.nil?))
+ raise ArvadosModel::PermissionDeniedError.new("replication_confirmed and replication_confirmed_at attributes cannot be changed, except by setting both to nil")
+ end
+ super
+ end