diff --git a/app/controllers/collections/versions_controller.rb b/app/controllers/collections/versions_controller.rb index 7203121de..5d462983f 100644 --- a/app/controllers/collections/versions_controller.rb +++ b/app/controllers/collections/versions_controller.rb @@ -28,7 +28,7 @@ def merge ActiveRecord::Base.transaction do new_version.rdf_updated_at = nil new_version.publish - new_version.unlock + if new_version.publishable? new_version.save @@ -63,7 +63,7 @@ def branch new_version = nil ActiveRecord::Base.transaction do - new_version = current_collection.branch(current_user) + new_version = current_collection.branch new_version.save! end flash[:success] = t('txt.controllers.versioning.branched') @@ -71,45 +71,6 @@ def branch end end - def lock - new_version = Iqvoc::Collection.base_class. - by_origin(params[:origin]). - unpublished. - last! - - if new_version.locked? - raise "Collection '#{new_version.origin}' is already locked." - end - - authorize! :lock, new_version - - new_version.lock_by_user(current_user.id) - new_version.save validate: false - - flash[:success] = t('txt.controllers.versioning.locked') - redirect_to edit_collection_path(new_version, published: 0) - end - - def unlock - new_version = Iqvoc::Collection.base_class. - by_origin(params[:origin]). - unpublished. - last! - - unless new_version.locked? - raise "Collection '#{new_version.origin}' is not locked." - end - - authorize! :unlock, new_version - - new_version.unlock - new_version.save validate: false - - flash[:success] = t('txt.controllers.versioning.unlocked') - - redirect_to collection_path(new_version, published: 0) - end - def consistency_check collection = Iqvoc::Collection.base_class. by_origin(params[:origin]). @@ -136,9 +97,6 @@ def to_review authorize! :send_to_review, collection collection.to_review - authorize! :unlock, collection - collection.unlock - collection.save! flash[:success] = t('txt.controllers.versioning.to_review_success') redirect_to collection_path(collection, published: 0) diff --git a/app/controllers/concepts/hierarchical_controller.rb b/app/controllers/concepts/hierarchical_controller.rb index 709699f23..8be7b91f1 100644 --- a/app/controllers/concepts/hierarchical_controller.rb +++ b/app/controllers/concepts/hierarchical_controller.rb @@ -72,8 +72,7 @@ def index url: url, update_url: move_concept_url(c), glance_url: glance_concept_url(c, format: :html), - published: (c.published?) ? true : false, - locked: (can?(:branch, c) || can?(:update, c) ? false : true) + published: (c.published?) ? true : false } end render json: concepts diff --git a/app/controllers/concepts/versions_controller.rb b/app/controllers/concepts/versions_controller.rb index 0f3d753f3..f3f17bb09 100644 --- a/app/controllers/concepts/versions_controller.rb +++ b/app/controllers/concepts/versions_controller.rb @@ -33,7 +33,7 @@ def merge ActiveRecord::Base.transaction do new_version.rdf_updated_at = nil new_version.publish - new_version.unlock + if new_version.publishable? new_version.save @@ -68,7 +68,7 @@ def branch new_version = nil ActiveRecord::Base.transaction do - new_version = current_concept.branch(current_user) + new_version = current_concept.branch new_version.save! Iqvoc.change_note_class.create! do |note| note.owner = new_version @@ -85,45 +85,6 @@ def branch end end - def lock - new_version = Iqvoc::Concept.base_class. - by_origin(params[:origin]). - unpublished. - last! - - if new_version.locked? - raise "Concept with origin '#{new_version.origin}' is already locked." - end - - authorize! :lock, new_version - - new_version.lock_by_user(current_user.id) - new_version.save validate: false - - flash[:success] = t('txt.controllers.versioning.locked') - redirect_to edit_concept_path(published: 0, id: new_version) - end - - def unlock - new_version = Iqvoc::Concept.base_class. - by_origin(params[:origin]). - unpublished. - last! - - unless new_version.locked? - raise "Concept with origin '#{new_version.origin}' is not locked." - end - - authorize! :unlock, new_version - - new_version.unlock - new_version.save validate: false - - flash[:success] = t('txt.controllers.versioning.unlocked') - - redirect_to concept_path(published: 0, id: new_version) - end - def consistency_check concept = Iqvoc::Concept.base_class. by_origin(params[:origin]). @@ -150,9 +111,6 @@ def to_review authorize! :send_to_review, concept concept.to_review - authorize! :unlock, concept - concept.unlock - concept.save! flash[:success] = t('txt.controllers.versioning.to_review_success') redirect_to concept_path(published: 0, id: concept) diff --git a/app/controllers/concepts_controller.rb b/app/controllers/concepts_controller.rb index 9a7a2d017..aed77c994 100644 --- a/app/controllers/concepts_controller.rb +++ b/app/controllers/concepts_controller.rb @@ -161,8 +161,6 @@ def create @concept.assign_attributes(concept_params) @datasets = datasets_as_json - @concept.lock_by_user(current_user.id) - if @concept.save flash[:success] = I18n.t('txt.controllers.versioned_concept.success') redirect_to concept_path(published: 0, id: @concept.origin) diff --git a/app/controllers/concepts_movement_controller.rb b/app/controllers/concepts_movement_controller.rb index 186d0e7fd..b4489b16b 100644 --- a/app/controllers/concepts_movement_controller.rb +++ b/app/controllers/concepts_movement_controller.rb @@ -70,7 +70,7 @@ def concept_version(concept) result = draft.first else # create a new version - result = concept.branch(current_user) + result = concept.branch result.save! end diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 029167c02..97ee6385e 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -28,9 +28,9 @@ def concept_index order_params = params[:sort] #FIXME: how to order by state in database? order_params = sanatize_order order_params - order_params = order_params.gsub('value', 'labels.value').gsub('locking_user', 'users.surname').gsub('follow_up', 'concepts.follow_up').gsub('updated_at', 'concepts.updated_at') + order_params = order_params.gsub('value', 'labels.value').gsub('follow_up', 'concepts.follow_up').gsub('updated_at', 'concepts.updated_at') - concepts = concepts.includes(:pref_labels, :locking_user).references(:pref_labels).references(:locking_user).order(order_params) + concepts = concepts.includes(:pref_labels).references(:pref_labels).order(order_params) else concepts = concepts.includes(:pref_labels).order('labels.value') end @@ -51,9 +51,9 @@ def collection_index collections = sort == 'DESC' ? collections.reverse : collections elsif params[:sort] order_params = sanatize_order params[:sort] - order_params = order_params.gsub('value', 'labels.value').gsub('locking_user', 'users.surname').gsub('updated_at', 'concepts.updated_at') + order_params = order_params.gsub('value', 'labels.value').gsub('updated_at', 'concepts.updated_at') - collections = collections.includes(:pref_labels, :locking_user).references(:pref_labels).references(:locking_user).order(order_params) + collections = collections.includes(:pref_labels).references(:pref_labels).order(order_params) else collections = collections.includes(:pref_labels).order('labels.value') end @@ -102,7 +102,7 @@ def sanatize_order search_params return '' if search_params.include?(';') param_array = search_params.split(',').compact.select do |order_column| column_and_order = order_column.split(' ') - column_and_order.count == 2 && ['value', 'locking_user', 'follow_up', 'updated_at'].include?(column_and_order[0]) && ['ASC', 'DESC'].include?(column_and_order[1]) + column_and_order.count == 2 && ['value', 'follow_up', 'updated_at'].include?(column_and_order[0]) && ['ASC', 'DESC'].include?(column_and_order[1]) end param_array.join(',') end diff --git a/app/controllers/reverse_matches_controller.rb b/app/controllers/reverse_matches_controller.rb index e506fc49b..43d69b3e9 100644 --- a/app/controllers/reverse_matches_controller.rb +++ b/app/controllers/reverse_matches_controller.rb @@ -11,10 +11,9 @@ def add_match render_response :mapping_exists and return if matches ActiveRecord::Base.transaction do - unpublished_concept = @published_concept.branch(@botuser) + unpublished_concept = @published_concept.branch unpublished_concept.save! @target_match_class.constantize.create(concept_id: unpublished_concept.id, value: @uri) - unpublished_concept.unlock unpublished_concept.publish! @published_concept.destroy! end @@ -23,7 +22,7 @@ def add_match end def remove_match - unpublished_concept = @published_concept.branch(@botuser) + unpublished_concept = @published_concept.branch unpublished_concept.save! match = @target_match_class.constantize.find_by(concept_id: unpublished_concept.id, value: @uri) if match.nil? @@ -32,7 +31,6 @@ def remove_match end ActiveRecord::Base.transaction do match.destroy! - unpublished_concept.unlock unpublished_concept.publish! @published_concept.destroy! end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b86babdaf..657d55520 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -20,14 +20,6 @@ module ApplicationHelper no: '✗' } - def user_details(user) - details = mail_to(user.email, user.name) - if user.telephone_number? - details << ' ' << user.telephone_number - end - details - end - # Formats a list of items or returns a remark if no items where given def item_listing(items, &block) return ' '.html_safe if items.empty? diff --git a/app/models/ability.rb b/app/models/ability.rb index 298c24d40..7b5b597dc 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -23,11 +23,10 @@ def initialize(user = nil) if user.owns_role?(:editor) || user.owns_role?(:publisher) || user.owns_role?(:administrator) # Editors and above ... can :read, [::Concept::Base, ::Collection::Base, ::Label::Base] can :create, [::Concept::Base, ::Collection::Base, ::Label::Base] - can [:update, :destroy, :unlock], [::Concept::Base, ::Collection::Base, ::Label::Base], locked_by: user.id, published_at: nil - can :lock, [::Concept::Base, ::Collection::Base, ::Label::Base], locked_by: nil, published_at: nil + can [:update, :destroy], [::Concept::Base, ::Collection::Base, ::Label::Base], published_at: nil can :check_consistency, [::Concept::Base, ::Collection::Base, ::Label::Base], published_at: nil can :send_to_review, [::Concept::Base, ::Collection::Base, ::Label::Base] do |object| - !object.in_review? && object.locked_by == user.id + !object.in_review? end can :branch, [::Concept::Base, ::Collection::Base, ::Label::Base], &@@if_published end @@ -35,19 +34,19 @@ def initialize(user = nil) if user.owns_role?(:match_editor) can :read, ::Concept::Base can :create, ::Concept::Base - can [:update, :lock], ::Concept::Base, locked_by: user.id, published_at: nil - can :lock, ::Concept::Base, locked_by: nil, published_at: nil + can :update, ::Concept::Base, published_at: nil + can :lock, ::Concept::Base, published_at: nil can :branch, ::Concept::Base, &@@if_published end if user.owns_role?(:publisher) || user.owns_role?(:administrator) # Publishers and above ... can :merge, [::Concept::Base, ::Collection::Base, ::Label::Base] do |object| - !object.published? && (!object.locked? || object.locked_by == user.id) + !object.published? end end if user.owns_role?(:administrator) - can [:update, :destroy, :unlock], [::Concept::Base, ::Label::Base], published_at: nil # Mustn't be locked by myself + can [:update, :destroy], [::Concept::Base, ::Label::Base], published_at: nil can :manage, User can :manage, Iqvoc.config diff --git a/app/models/concept/base.rb b/app/models/concept/base.rb index 7d9bfa8d5..ec667c950 100644 --- a/app/models/concept/base.rb +++ b/app/models/concept/base.rb @@ -401,7 +401,7 @@ def self.with_pref_labels end def self.for_dashboard - unpublished_or_follow_up.includes(:pref_labels, :locking_user) + unpublished_or_follow_up.includes(:pref_labels) end def self.parentless diff --git a/app/models/concept/relation/base.rb b/app/models/concept/relation/base.rb index e37a000f6..5c582783e 100644 --- a/app/models/concept/relation/base.rb +++ b/app/models/concept/relation/base.rb @@ -73,7 +73,7 @@ def self.unpublished end def self.target_in_edit_mode - joins(:target).merge(Concept::Base.in_edit_mode).references(:concepts) + joins(:target).merge(Concept::Base.unpublished).references(:concepts) end # ********* Methods diff --git a/app/models/concerns/versioning.rb b/app/models/concerns/versioning.rb index 3a29ca9c4..2c5c5e5c5 100644 --- a/app/models/concerns/versioning.rb +++ b/app/models/concerns/versioning.rb @@ -25,11 +25,6 @@ module Versioning class_name: name, optional: true - belongs_to :locking_user, - foreign_key: 'locked_by', - class_name: 'AbstractUser', - optional: true - after_initialize do disable_validations_for_publishing end @@ -48,10 +43,6 @@ def unpublished where(published_at: nil) end - def locked - where(arel_table[:locked_by].not_eq(nil)) - end - def published_with_newer_versions # published objects without objects which have a new one in editing published_objects = arel_table[:published_at].not_eq(nil).and(arel_table[:origin].not_in(unpublished.map(&:origin))) @@ -70,10 +61,6 @@ def editor_selectable ) end - def in_edit_mode - where(arel_table[:locked_by].not_eq(nil)) - end - def unpublished_or_follow_up where( arel_table[:published_at].eq(nil).or( @@ -99,9 +86,8 @@ def includes_to_deep_cloning end end # module ClassMethods - def branch(user) + def branch new_version = self.deep_clone(include: self.class.includes_to_deep_cloning) - new_version.lock_by_user(user.id) new_version.increment(:rev) new_version.published_version_id = self.id new_version.unpublish @@ -114,20 +100,10 @@ def editor_selectable? published? || read_attribute(:published_version_id).blank? end - def lock_by_user(user_id) - tap do - write_attribute(:locked_by, user_id) - end - end - def never_published? unpublished? && rev == 1 end - def locked? - locked_by? - end - def state if published? I18n.t('txt.common.state.published') @@ -138,12 +114,6 @@ def state end end - def unlock - tap do - write_attribute(:locked_by, nil) - end - end - def in_review? read_attribute(:to_review).present? end diff --git a/app/views/collections/show_unpublished.html.erb b/app/views/collections/show_unpublished.html.erb index 64be7e35b..909f42ac0 100644 --- a/app/views/collections/show_unpublished.html.erb +++ b/app/views/collections/show_unpublished.html.erb @@ -3,9 +3,6 @@ <%= alert :info, :header => t('txt.common.unpublished_version') + "." do %> <%= t("txt.views.versioning.current_revision", :rev => @collection.rev) %> - <% if @collection.locked? %> - <%= t("txt.views.versioning.in_ongoing_editing_by", :user => @collection.locking_user.name) %> - <% end %> <% end %>
@@ -24,15 +21,10 @@ collection_versions_to_review_path(:origin => @collection.origin), :class => 'btn btn-outline-secondary' %> <% end %> - <% if @collection.locked? %> - <%= button_to t("txt.views.versioning.unlock"), - collection_versions_unlock_path(:origin => @collection.origin), :class => 'btn btn-outline-secondary' if can?(:unlock, @collection) %> + <% if can?(:update, @collection) %> <%= link_to t("txt.views.versioning.edit_mode"), - edit_collection_path(:published => 0, :id => @collection.origin), - :class => 'btn btn-outline-secondary' if can?(:update, @collection) %> - <% else %> - <%= button_to t("txt.views.versioning.to_edit_mode"), - collection_versions_lock_path(:origin => @collection.origin), :class => 'btn btn-outline-secondary' if can?(:lock, @collection) %> + edit_collection_path(:published => 0, :id => @collection.origin), + :class => 'btn btn-outline-secondary' %> <% end %> <% if can?(:destroy, @collection) %> diff --git a/app/views/concepts/notifications/_referenced_concepts.html.erb b/app/views/concepts/notifications/_referenced_concepts.html.erb index 81b6e1624..92f2a9856 100644 --- a/app/views/concepts/notifications/_referenced_concepts.html.erb +++ b/app/views/concepts/notifications/_referenced_concepts.html.erb @@ -6,7 +6,6 @@ <%= concept_relation.class.model_name.human %> <%= link_to(concept_relation.target.pref_label.to_s, concept_path(:published => 0, :id => concept_relation.target)) %> - <%= t("txt.common.editor") %> <%= user_details(concept_relation.target.locking_user) %> <% end %> diff --git a/app/views/concepts/show_unpublished.html.erb b/app/views/concepts/show_unpublished.html.erb index 474027d99..cfc6ec49f 100644 --- a/app/views/concepts/show_unpublished.html.erb +++ b/app/views/concepts/show_unpublished.html.erb @@ -5,9 +5,6 @@ <%= alert :info, :header => t('txt.common.unpublished_version') + "." do %> <%= t("txt.views.versioning.current_revision", :rev => @concept.rev) %> - <% if @concept.locked? %> - <%= t("txt.views.versioning.in_ongoing_editing_by", :user => @concept.locking_user.name) %> - <% end %> <% end %> <% if @jobs && @jobs.any? %> @@ -30,15 +27,10 @@ concept_versions_to_review_path(:origin => @concept.origin), :class => 'btn btn-outline-secondary' %> <% end %> - <% if @concept.locked? %> - <%= button_to t("txt.views.versioning.unlock"), - concept_versions_unlock_path(:origin => @concept.origin), :class => 'btn btn-outline-secondary' if can?(:unlock, @concept) %> + <% if can?(:update, @concept) %> <%= link_to t("txt.views.versioning.edit_mode"), - edit_concept_path(:published => 0, :id => @concept.origin), - :class => 'btn btn-outline-secondary' if can?(:update, @concept) %> - <% elsif can?(:lock, @concept) %> - <%= button_to t("txt.views.versioning.to_edit_mode"), - concept_versions_lock_path(:origin => @concept.origin), :class => 'btn btn-outline-secondary' %> + edit_concept_path(:published => 0, :id => @concept.origin), + :class => 'btn btn-outline-secondary' if can?(:update, @concept) %> <% end %> <% if can?(:destroy, @concept) %> diff --git a/app/views/dashboard/_table.html.erb b/app/views/dashboard/_table.html.erb index 915de9ef8..1fa9a3967 100644 --- a/app/views/dashboard/_table.html.erb +++ b/app/views/dashboard/_table.html.erb @@ -2,7 +2,6 @@ <%= t("txt.views.dashboard.value") %><%= sorting_controls_for(:value) %> - <%= t("txt.views.dashboard.locking_user") %><%= sorting_controls_for(:locking_user) %> <% unless @items.first.class == Iqvoc::Collection.base_class %> <%= t("txt.views.dashboard.follow_up") %><%= sorting_controls_for(:follow_up) %> <% end %> @@ -22,13 +21,6 @@ <%= render item.class.edit_link_partial_name, :item => item %> - - <% if item.locking_user.present? %> - - <%= item.locking_user.initials %> - - <% end %> - <% unless item.class == Iqvoc::Collection.base_class %> <%= l(item.follow_up) if item.follow_up.present? %> diff --git a/config/locales/de.yml b/config/locales/de.yml index 5b8f419cb..bbf59cec5 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -292,7 +292,6 @@ de: delete_copy: "Kopie löschen" delete_confirm: "Kopie wirklich löschen?" versioning_mode: "Neue Version erstellen" - unlock: "Entsperren" preview_new_version: "Vorschau der Version in Bearbeitung" consistency_check: "Konsistenz prüfen" current_revision: "Aktuelle Revision %{rev}" @@ -310,7 +309,6 @@ de: dashboard: type: "Typ" value: "Name" - locking_user: "Gesperrt" follow_up: "Wiedervorlage" updated_at: "Geändert am" to_review: "Vorlage zur Freigabe" @@ -380,11 +378,7 @@ de: published_with_warning: "Instanz wurde erfolgreich veröffentlicht, hat aber keine Relationen zu anderen Instanzen." merged_delete_error: "Das alte Label konnte nicht gelöscht werden." merged_publishing_error: "Instanz konnte nicht veröffentlicht werden - bitte führen Sie eine Konsistenzprüfung durch." - branched: "Instanzkopie wurde erfolgreich angelegt und für andere Benutzer gesperrt." - locked: "Instanz wurde für andere User gesperrt." - lock_error: "Instanz ist bereits gesperrt." - unlocked: "Instanz wurde für andere User entsperrt." - unlock_error: "Instanz ist bereits entsperrt." + branched: "Instanzkopie wurde erfolgreich angelegt." new_version_blank_error: "Es existiert noch keine neue Version." delete: "Instanz löschen." consistency_check_success: "Instanz ist konsistent." diff --git a/config/locales/en.yml b/config/locales/en.yml index 48d19c940..bdce7cfe1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -303,7 +303,6 @@ en: delete_copy: "Delete copy" delete_confirm: "Do you really want to delete this copy?" versioning_mode: "Create new version" - unlock: "Unlock" preview_new_version: "Preview of the version in editing" consistency_check: "Check consistency" current_revision: "Current revision %{rev}" @@ -320,7 +319,6 @@ en: dashboard: type: "Type" value: "Name" - locking_user: "Locked by" follow_up: "Follow up" updated_at: "Updated at" to_review: "Submission for review" @@ -390,11 +388,7 @@ en: published_with_warning: "Instance has been successfully published, but it has no relations!" merged_delete_error: "Label could not be deleted." merged_publishing_error: "Instance could not be published - please consult the consistency check." - branched: "Instance copy has been created and locked." - locked: "Instance has been locked." - lock_error: "Instance is already locked." - unlocked: "Instance has been unlocked." - unlock_error: "Instance has been alraedy unlocked." + branched: "Instance copy has been created." to_review_success: "Sent to review." to_review_error: "Can't send to review." new_version_blank_error: "A new version does not yet exist!" diff --git a/config/locales/pt.yml b/config/locales/pt.yml index 527bdc499..a3acde11b 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -234,7 +234,6 @@ pt: delete: "Excluir cópia" delete_confirm: "Você realmente deseja excluir esta cópia?" versioning_mode: "Criar nova versão" - unlock: "Destravar" preview_new_version: "Pré-visualização da versão em alteração" consistency_check: "Verificar consistência" current_revision: "Revisão atual %{rev}" @@ -250,7 +249,6 @@ pt: dashboard: type: "Tipo" value: "Nome" - locking_user: "Travado por" follow_up: "Reapresentar" updated_at: "Atualizado em" to_review: "Submissão para revisão" @@ -301,10 +299,6 @@ pt: merged_delete_error: "Não foi possível excluir o rótulo!" merged_publishing_error: "Não foi possível lançar a instância!" branched: "Cópia da instância foi criada e travada." - locked: "Instância foi travada." - lock_error: "Instância já foi travada!" - unlocked: "Instância foi destravada." - unlock_error: "Instância já foi destravada!" to_review_success: "Enviado para revisão com sucesso." to_review_error: "Não foi possível enviar para revisão." new_version_blank_error: "Ainda não existe uma nova versão!" diff --git a/config/routes.rb b/config/routes.rb index b94a34bdd..d32c12a51 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -51,8 +51,6 @@ post 'concepts/:origin/branch' => 'concepts/versions#branch', as: 'concept_versions_branch' post 'concepts/:origin/merge' => 'concepts/versions#merge', as: 'concept_versions_merge' - post 'concepts/:origin/lock' => 'concepts/versions#lock', as: 'concept_versions_lock' - post 'concepts/:origin/unlock' => 'concepts/versions#unlock', as: 'concept_versions_unlock' post 'concepts/:origin/to_review' => 'concepts/versions#to_review', as: 'concept_versions_to_review' get 'concepts/:origin/consistency_check' => 'concepts/versions#consistency_check', as: 'concept_versions_consistency_check' @@ -60,8 +58,6 @@ post 'collections/:origin/branch' => 'collections/versions#branch', as: 'collection_versions_branch' post 'collections/:origin/merge' => 'collections/versions#merge', as: 'collection_versions_merge' - post 'collections/:origin/lock' => 'collections/versions#lock', as: 'collection_versions_lock' - post 'collections/:origin/unlock' => 'collections/versions#unlock', as: 'collection_versions_unlock' post 'collections/:origin/to_review' => 'collections/versions#to_review', as: 'collection_versions_to_review' get 'collections/:origin/consistency_check' => 'collections/versions#consistency_check', as: 'collection_versions_consistency_check' diff --git a/db/migrate/20231012135837_remove_locked_by.rb b/db/migrate/20231012135837_remove_locked_by.rb new file mode 100644 index 000000000..f16eddcb1 --- /dev/null +++ b/db/migrate/20231012135837_remove_locked_by.rb @@ -0,0 +1,6 @@ +class RemoveLockedBy < ActiveRecord::Migration[7.0] + + def change + remove_column :concepts, :locked_by + end +end diff --git a/test/controllers/reverse_match_test.rb b/test/controllers/reverse_match_test.rb index 45dbc3272..49ac4ba4c 100644 --- a/test/controllers/reverse_match_test.rb +++ b/test/controllers/reverse_match_test.rb @@ -43,7 +43,7 @@ class ReverseMatchTest < ActionController::TestCase RDFAPI.devour c, 'skos:prefLabel', '"Airsoft"@en' c.publish c.save - new_version = c.branch @admin + new_version = c.branch new_version.save end diff --git a/test/integration/collection_circularity_test.rb b/test/integration/collection_circularity_test.rb index 40be6bb04..2bf1ebf48 100644 --- a/test/integration/collection_circularity_test.rb +++ b/test/integration/collection_circularity_test.rb @@ -20,11 +20,11 @@ class CollectionCircularityTest < ActionDispatch::IntegrationTest setup do login('administrator') - @coll1 = Iqvoc::Collection.base_class.new.lock_by_user(@user.id).tap { |c| c.save } + @coll1 = Iqvoc::Collection.base_class.new.tap { |c| c.save } RDFAPI.devour @coll1, 'skos:prefLabel', '"coll1"@en' - @coll2 = Iqvoc::Collection.base_class.new.lock_by_user(@user.id).tap { |c| c.save } + @coll2 = Iqvoc::Collection.base_class.new.tap { |c| c.save } RDFAPI.devour @coll2, 'skos:prefLabel', '"coll2"@en' - @coll3 = Iqvoc::Collection.base_class.new.lock_by_user(@user.id).tap { |c| c.save } + @coll3 = Iqvoc::Collection.base_class.new.tap { |c| c.save } RDFAPI.devour @coll3, 'skos:prefLabel', '"coll3"@en' @concept1 = Concept::SKOS::Base.new.publish.tap { |c| c.save } diff --git a/test/integration/concept_collection_assignment_test.rb b/test/integration/concept_collection_assignment_test.rb index 61fde0065..af7b493fc 100644 --- a/test/integration/concept_collection_assignment_test.rb +++ b/test/integration/concept_collection_assignment_test.rb @@ -43,7 +43,7 @@ class ConceptCollectionAssignmentTest < ActionDispatch::IntegrationTest visit concept_path(concept, lang: 'en', format: 'html') click_link_or_button 'Create new version' - assert page.has_content? 'Instance copy has been created and locked.' + assert page.has_content? 'Instance copy has been created.' collection_origins = [@sports_coll, @hobbies_coll].map(&:origin).join(', ') fill_in 'concept_assigned_collection_origins', with: collection_origins diff --git a/test/models/deep_cloning_test.rb b/test/models/deep_cloning_test.rb index 3f0c1e0da..f9017a36a 100644 --- a/test/models/deep_cloning_test.rb +++ b/test/models/deep_cloning_test.rb @@ -87,7 +87,7 @@ def after_setup end test 'should deep clone concept' do - root_concept_dup = @root_concept1.branch @admin + root_concept_dup = @root_concept1.branch root_concept_dup.save # test narrower @@ -105,7 +105,7 @@ def after_setup end test 'should deep clone collection' do - root_collection_dup = @root_collection.branch @admin + root_collection_dup = @root_collection.branch root_collection_dup.save # test subcollections