diff --git a/app/serializers/activity_serializer.rb b/app/serializers/activity_serializer.rb index f8e3824b1..9892fd70d 100644 --- a/app/serializers/activity_serializer.rb +++ b/app/serializers/activity_serializer.rb @@ -15,9 +15,7 @@ class ActivitySerializer attribute "prov:wasAttributedTo" do |object| url = Rails.env.production? ? "https://api.datacite.org" : "https://api.test.datacite.org" - if object.username.present? - object.username.to_s.include?(".") ? url + "/clients/" + object.username : url + "/providers/" + object.username - end + object.username.include?(".") ? url + "/clients/" + object.username : url + "/providers/" + object.username end attribute "prov:wasGeneratedBy" do |object| diff --git a/db/schema.rb b/db/schema.rb index 509c3a96b..bc2bdaf4c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -251,44 +251,15 @@ t.string "source_relation_type_id", limit: 191 t.string "target_relation_type_id", limit: 191 t.index ["created_at", "indexed_at", "updated_at"], name: "index_events_on_created_indexed_updated" - t.index ["doi_id", "relation_type_id"], name: "index_events_on_doi_id", length: { doi_id: 100 } + t.index ["created_at"], name: "index_events_on_source_id_created_at" + t.index ["relation_type_id"], name: "index_events_on_doi_id" t.index ["source_doi", "source_relation_type_id"], name: "index_events_on_source_doi", length: { source_doi: 100 } - t.index ["source_id", "created_at"], name: "index_events_on_source_id_created_at" - t.index ["subj_id", "obj_id", "source_id", "relation_type_id"], name: "index_events_on_multiple_columns", unique: true, length: { subj_id: 191, obj_id: 191 } + t.index ["subj_id", "obj_id", "relation_type_id"], name: "index_events_on_multiple_columns", unique: true, length: { subj_id: 191, obj_id: 191 } t.index ["target_doi", "target_relation_type_id"], name: "index_events_on_target_doi", length: { target_doi: 100 } t.index ["updated_at"], name: "index_events_on_updated_at" t.index ["uuid"], name: "index_events_on_uuid", unique: true, length: 36 end - create_table "lhma_2020_02_03_11_33_29_151_events", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t| - t.text "uuid", null: false - t.text "subj_id", null: false - t.text "obj_id" - t.string "source_id", limit: 191 - t.string "aasm_state" - t.string "state_event" - t.text "callback" - t.text "error_messages" - t.text "source_token" - t.datetime "created_at", precision: 3, null: false - t.datetime "updated_at", precision: 3, null: false - t.datetime "indexed_at", default: "1970-01-01 00:00:00", null: false - t.datetime "occurred_at" - t.string "message_action", limit: 191, default: "create", null: false - t.string "relation_type_id", limit: 191 - t.text "subj", limit: 16777215 - t.text "obj", limit: 16777215 - t.integer "total", default: 1 - t.string "license", limit: 191 - t.text "doi_id" - t.index ["created_at", "indexed_at", "updated_at"], name: "index_events_on_created_indexed_updated" - t.index ["relation_type_id"], name: "index_events_on_doi_id" - t.index ["source_id", "created_at"], name: "index_events_on_source_id_created_at" - t.index ["subj_id", "obj_id", "source_id", "relation_type_id"], name: "index_events_on_multiple_columns", unique: true, length: { subj_id: 191, obj_id: 191 } - t.index ["updated_at"], name: "index_events_on_updated_at" - t.index ["uuid"], name: "index_events_on_uuid", unique: true, length: 36 - end - create_table "media", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT", force: :cascade do |t| t.datetime "created" t.string "media_type", limit: 80 @@ -359,4 +330,4 @@ add_foreign_key "dataset", "datacentre", column: "datacentre", name: "FK5605B47847B5F5FF" add_foreign_key "media", "dataset", column: "dataset", name: "FK62F6FE44D3D6B1B" add_foreign_key "metadata", "dataset", column: "dataset", name: "FKE52D7B2F4D3D6B1B" -end +end \ No newline at end of file