app/controllers/concepts/versions_controller.rb in iqvoc-3.5.7 vs app/controllers/concepts/versions_controller.rb in iqvoc-4.0.0
- old
+ new
@@ -30,11 +30,11 @@
if new_version.valid_with_full_validation?
new_version.save
if RdfStore.update(rdf_url(:id => new_version, :format => :ttl), concept_url(:id => new_version, :format => :ttl))
new_version.update_attribute(:rdf_updated_at, 1.seconds.since)
end
- flash[:notice] = t("txt.controllers.versioning.published")
+ flash[:success] = t("txt.controllers.versioning.published")
redirect_to concept_path(:id => new_version)
else
flash[:error] = t("txt.controllers.versioning.merged_publishing_error")
redirect_to concept_path(:published => 0, :id => new_version)
end
@@ -46,20 +46,20 @@
end
def branch
current_concept = Iqvoc::Concept.base_class.by_origin(params[:origin]).published.last
raise ActiveRecord::RecordNotFound.new("Couldn't find published concept with origin '#{params[:origin]}'") unless current_concept
- raise "There is already an unpublished version for Concept '#{params[:origin]}'" if Iqvoc::Concept.base_class.by_origin(params[:origin]).unpublished.last
+ raise "There already is an unpublished version for concept '#{params[:origin]}'" if Iqvoc::Concept.base_class.by_origin(params[:origin]).unpublished.last
authorize! :branch, current_concept
new_version = nil
ActiveRecord::Base.transaction do
new_version = current_concept.branch(current_user)
new_version.save!
end
- flash[:notice] = t("txt.controllers.versioning.branched")
+ flash[:success] = t("txt.controllers.versioning.branched")
redirect_to edit_concept_path(:published => 0, :id => new_version)
end
def lock
new_version = Iqvoc::Concept.base_class.by_origin(params[:origin]).unpublished.last
@@ -69,11 +69,11 @@
authorize! :lock, new_version
new_version.lock_by_user(current_user.id)
new_version.save :validate => false
- flash[:notice] = t("txt.controllers.versioning.locked")
+ 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
@@ -83,22 +83,23 @@
authorize! :unlock, new_version
new_version.unlock
new_version.save :validate => false
- flash[:notice] = t("txt.controllers.versioning.unlocked")
+ 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]).unpublished.last
raise ActiveRecord::RecordNotFound unless concept
authorize! :check_consistency, concept
if concept.valid_with_full_validation?
- flash[:notice] = t("txt.controllers.versioning.consistency_check_success")
+ flash[:success] = t("txt.controllers.versioning.consistency_check_success")
redirect_to concept_path(:published => 0, :id => concept)
else
flash[:error] = t("txt.controllers.versioning.consistency_check_error")
redirect_to edit_concept_path(:published => 0, :id => concept, :full_consistency_check => "1")
end
@@ -110,10 +111,10 @@
authorize! :send_to_review, concept
concept.to_review
concept.save!
- flash[:notice] = t("txt.controllers.versioning.to_review_success")
+ flash[:success] = t("txt.controllers.versioning.to_review_success")
redirect_to concept_path(:published => 0, :id => concept)
end
end