Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump papertrail version #12930

Merged
merged 10 commits into from
Dec 12, 2019
Merged

Bump papertrail version #12930

merged 10 commits into from
Dec 12, 2019

Conversation

lomky
Copy link
Contributor

@lomky lomky commented Dec 10, 2019

Bumps #12617

Description

Bumps PaperTrail to 9.1/9.2/10./10.3
(Going to push for the highest non-breaking!)

This gives us the ability to explicitly call for a papertrail creation without callbacks

Acceptance Criteria

  • Papertrail continues to work!

Testing Plan

  1. Run the test suite
  2. Manually test in console

@lomky lomky self-assigned this Dec 10, 2019
@codeclimate
Copy link

codeclimate bot commented Dec 10, 2019

Code Climate has analyzed commit 76e7e79 and detected 0 issues on this pull request.

View more on Code Climate.

Copy link
Contributor

@hschallhorn hschallhorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@lomky lomky added the Ready-to-Merge This PR is ready to be merged and will be picked up by va-bot to automatically merge to master label Dec 11, 2019
Copy link
Contributor

@pkarman pkarman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

please manually test in UAT on merge

@va-bot va-bot merged commit a4d7590 into master Dec 12, 2019
@va-bot va-bot deleted the kat/12617_bump_papertrail branch December 12, 2019 14:15
@lomky
Copy link
Contributor Author

lomky commented Dec 12, 2019

Confirmed versions are still being created in UAT

irb(main):037:0> PaperTrail.version
=> "10.3.1"
irb(main):029:0> task = Task.find(2)
[2019-12-12 14:28:41 -0500]   Task Load (1.3ms)  SELECT  "tasks".* FROM "tasks" WHERE "tasks"."id" = $1 LIMIT $2  [["id", 2], ["LIMIT", 1]]
=> #<JudgeTask id: 2, appeal_id: 13, status: "in_progress", ...>
irb(main):030:0> orig_user = task.assigned_to
irb(main):031:0> task.versions.count
=> 0
irb(main):032:0> new_user = User.first
irb(main):033:0> task.update!(assigned_to: new_user)
[2019-12-12 14:29:19 -0500]    (1.0ms)  BEGIN
[2019-12-12 14:29:19 -0500]   Appeal Load (1.1ms)  SELECT  "appeals".* FROM "appeals" WHERE "appeals"."id" = $1 LIMIT $2  [["id", 13], ["LIMIT", 1]]
[2019-12-12 14:29:19 -0500]   SQL (1.2ms)  UPDATE "tasks" SET "assigned_to_id" = $1, "updated_at" = $2 WHERE "tasks"."id" = $3  [["assigned_to_id", 74], ["updated_at", "2019-12-12 19:29:19.144796"], ["id", 2]]
PaperTrail whodunnit = CASEFLOW1
================================================================================
[2019-12-12 14:29:19 -0500]   SQL (1.0ms)  INSERT INTO "versions" ("item_type", "item_id", "event", "object", "created_at", "object_changes") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"  [["item_type", "Task"], ["item_id", 2], ["event", "update"], ["object", "---\nid: 2\nappeal_id: 13\nstatus: in_progress\ntype: JudgeTask\ninstructions: \nassigned_to_id: 87\nassigned_by_id: \nassigned_at: 2018-09-10 12:49:41.146208000 Z\nstarted_at: 2018-12-17 23:43:55.929012000 Z\ncreated_at: 2018-09-10 12:49:41.146208000 Z\nupdated_at: 2018-12-17 23:43:55.929012000 Z\nappeal_type: Appeal\nplaced_on_hold_at: \non_hold_duration: \nassigned_to_type: User\nparent_id: \nclosed_at: \n"], ["created_at", "2019-12-12 19:29:19.144796"], ["object_changes", "---\nassigned_to_id:\n- 87\n- 74\nupdated_at:\n- 2018-12-17 23:43:55.929012000 Z\n- 2019-12-12 19:29:19.144796905 Z\n"]]
[2019-12-12 14:29:19 -0500]    (1.7ms)  COMMIT
=> true
irb(main):034:0> task.update!(assigned_to: orig_user)
[2019-12-12 14:29:29 -0500]    (1.0ms)  BEGIN
[2019-12-12 14:29:29 -0500]   SQL (1.2ms)  UPDATE "tasks" SET "assigned_to_id" = $1, "updated_at" = $2 WHERE "tasks"."id" = $3  [["assigned_to_id", 87], ["updated_at", "2019-12-12 19:29:29.634355"], ["id", 2]]
PaperTrail whodunnit = CASEFLOW1
================================================================================
[2019-12-12 14:29:29 -0500]   SQL (1.0ms)  INSERT INTO "versions" ("item_type", "item_id", "event", "object", "created_at", "object_changes") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"  [["item_type", "Task"], ["item_id", 2], ["event", "update"], ["object", "---\nid: 2\nappeal_id: 13\nstatus: in_progress\ntype: JudgeTask\ninstructions: \nassigned_to_id: 74\nassigned_by_id: \nassigned_at: 2018-09-10 12:49:41.146208000 Z\nstarted_at: 2018-12-17 23:43:55.929012000 Z\ncreated_at: 2018-09-10 12:49:41.146208000 Z\nupdated_at: 2019-12-12 19:29:19.144796905 Z\nappeal_type: Appeal\nplaced_on_hold_at: \non_hold_duration: \nassigned_to_type: User\nparent_id: \nclosed_at: \n"], ["created_at", "2019-12-12 19:29:29.634355"], ["object_changes", "---\nassigned_to_id:\n- 74\n- 87\nupdated_at:\n- 2019-12-12 19:29:19.144796905 Z\n- 2019-12-12 19:29:29.634355446 Z\n"]]
[2019-12-12 14:29:29 -0500]    (1.6ms)  COMMIT
=> true
irb(main):035:0> task.versions.count
=> 2
irb(main):036:0> task.versions                                                                                                                                                    
[2019-12-12 14:29:50 -0500]   PaperTrail::Version Load (1.2ms)  SELECT  "versions".* FROM "versions" WHERE "versions"."item_id" = $1 AND "versions"."item_type" = $2 ORDER BY "versions"."created_at" ASC, "versions"."id" ASC LIMIT $3  [["item_id", 2], ["item_type", "Task"], ["LIMIT", 11]]
=> #<ActiveRecord::Associations::CollectionProxy [#<PaperTrail::Version id: 1067, item_type: "Task", item_id: 2, event: "update", whodunnit: nil, object: "---\nid: 2\nappeal_id: 13\nstatus: in_progress\ntype: ...", created_at: "2019-12-12 19:29:19", object_changes: "---\nassigned_to_id:\n- 87\n- 74\nupdated_at:\n- 2018-1...", request_id: nil>, #<PaperTrail::Version id: 1068, item_type: "Task", item_id: 2, event: "update", whodunnit: nil, object: "---\nid: 2\nappeal_id: 13\nstatus: in_progress\ntype: ...", created_at: "2019-12-12 19:29:29", object_changes: "---\nassigned_to_id:\n- 74\n- 87\nupdated_at:\n- 2019-1...", request_id: nil>]>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready-to-Merge This PR is ready to be merged and will be picked up by va-bot to automatically merge to master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants