Skip to content

Commit

Permalink
These logs will be removed - Added just for testing on stage (#1082)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwinisukale authored Jan 8, 2024
1 parent 5296107 commit d461d90
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/models/concerns/indexable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module Indexable

included do
after_commit on: %i[create update] do
Rails.logger.info "[Event Data Import Message] After commit"
# use index_document instead of update_document to also update virtual attributes
unless %w[Prefix ProviderPrefix ClientPrefix].include?(self.class.name)
IndexJob.perform_later(self)
Expand All @@ -21,8 +22,10 @@ module Indexable
end

if instance_of?(DataciteDoi) || instance_of?(OtherDoi) || instance_of?(Doi)
Rails.logger.info "[Event Data Import Message] #{aasm_state} #{to_jsonapi.inspect} its a DOI"
if aasm_state == "findable"
changed_attributes = saved_changes
Rails.logger.info "[Event Data Import Message] #{aasm_state} #{changed_attributes.inspect} before call"
relevant_changes = changed_attributes.keys & %w[related_identifiers creators funding_references aasm_state]
if relevant_changes.any?
send_import_message(to_jsonapi)
Expand Down

0 comments on commit d461d90

Please sign in to comment.