Skip to content

Commit

Permalink
Merge branch 'development' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
benwbrum committed Oct 31, 2020
2 parents 18e7a35 + b123d88 commit 04b8d98
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
13 changes: 11 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,17 @@ def page_params(page)

def track_action
extras = {}
extras[:collection_id] = @collection.id if @collection
extras[:collection_title] = @collection.title if @collection
if @collection
if @collection.is_a? DocumentSet
extras[:document_set_id] = @collection.id
extras[:document_set_title] = @collection.title
extras[:collection_id] = @collection.collection.id
extras[:collection_title] = @collection.collection.title
else
extras[:collection_id] = @collection.id
extras[:collection_title] = @collection.title
end
end
extras[:work_id] = @work.id if @work
extras[:work_title] = @work.title if @work
extras[:page_id] = @page.id if @page
Expand Down
13 changes: 2 additions & 11 deletions app/controllers/notes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ def create
# add param-loaded associations
@note.page = @page
@note.work = @work
if @collection.is_a?(Collection)
@note.collection = @collection
else
@note.collection = @collection.collection
end
@note.collection = @work.collection
@note.user = current_user

respond_to do |format|
Expand Down Expand Up @@ -68,12 +64,7 @@ def record_deed
deed.note = @note
deed.page = @page
deed.work = @work
if @collection.is_a?(Collection)
deed.collection = @collection
else
deed.collection = @collection.collection
end

deed.collection = @work.collection
deed.deed_type = DeedType::NOTE_ADDED
deed.user = current_user

Expand Down

0 comments on commit 04b8d98

Please sign in to comment.