Class: UnifyController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- UnifyController
- Defined in:
- app/controllers/unify_controller.rb
Constant Summary
Constants included from ProjectsHelper
ProjectsHelper::CLASSIFIER, ProjectsHelper::CLASSIFIER_ANNOTATION
Instance Method Summary collapse
-
#metadata ⇒ Object
GET /unify/metadata.
-
#relations ⇒ Object
TO preview relationships GET /merge/relations?klass=Otu.
- #set_targets ⇒ Object private
- #unify ⇒ Object
Methods included from RedirectHelper
Methods included from RequestType
Methods included from LogRecent
Methods included from Cookies
#digest_cookie, #digested_cookie_exists?
Methods included from Whitelist
Methods included from ProjectsHelper
#cumulative_gb_per_year, #document_cumulative_gb_per_year, #document_gb_per_year, #gb_per_year, #image_cumulative_gb_per_year, #image_gb_per_year, #invalid_object, #project_classification, #project_link, #project_matches, #project_tag, #projects_list, #projects_search_form, #taxonworks_classification, #week_in_review_graphs
Methods included from Api::Intercept
Methods included from TokenAuthentication
#intercept_project, #intercept_user, #intercept_user_or_project, #project_token_authenticate, #token_authenticate
Instance Method Details
#metadata ⇒ Object
GET /unify/metadata
23 24 25 26 |
# File 'app/controllers/unify_controller.rb', line 23 def object = GlobalID::Locator.locate(params.require(:global_id)) render json: object.(target_project_id: sessions_current_project_id) end |
#relations ⇒ Object
TO preview relationships GET /merge/relations?klass=Otu
18 19 20 |
# File 'app/controllers/unify_controller.rb', line 18 def relations # something params[:klass] end |
#set_targets ⇒ Object (private)
30 31 32 33 |
# File 'app/controllers/unify_controller.rb', line 30 def set_targets @remove_object = GlobalID::Locator.locate(params.require(:remove_global_id)) @keep_object = GlobalID::Locator.locate(params.require(:keep_global_id)) end |
#unify ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'app/controllers/unify_controller.rb', line 5 def unify r = @keep_object.unify( @remove_object, only: params[:only] || [], except: params[:except] || [], preview: params[:preview], target_project_id: sessions_current_project_id ) render json: r end |