canvas_link_migrator 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e4d3a30191584ee3b4bc14c83f21edecbad0652562590eee989047f99e1d050
4
- data.tar.gz: fb9825fc75bb255068dfb1f5d2f285e332612657690f6bc08933c99ae4d948bb
3
+ metadata.gz: 814327ff4502ff2b1187f0b817659cff573bb272ee7e85ae32685297f985ce55
4
+ data.tar.gz: e8fa4255d9200988f052ddc9b6a4087b72709ce5443c9bbff4558279be38c4c6
5
5
  SHA512:
6
- metadata.gz: 5847f829a7938282cfd2399fe3067dc72a5d248b95c2c38d35716d58ea12a019fff94e5b6cc0b34d09ff0bb4efae0dcc4ebef98baf771f999d9a73c865e9fba5
7
- data.tar.gz: 25e4c872ded3277e7980bd99a7cbfc961d44a1a984840c8bfe8efb24052b0c36e0ac3c6c8e72f10a74072c14072ba89bd96f81305f2261abc0da0a5d67dbc389
6
+ metadata.gz: fc23256c7587decc42dfe9b5677f6299c7ba31cc4aa14e2bda8aca60233ba5ffdc143b205419f4d9fd101b13a52e54a2de896dbd1f038a3d25a44e7d631f54cf
7
+ data.tar.gz: fd8ac04adf9829f958297818be79bff39910259cb9e8bb233689b117deb22cbce21df0c875c8d756e9dfa5c4dafb1ab4b5aaba717cfb10aa1a22d8b9574b52a5
@@ -93,6 +93,7 @@ module CanvasLinkMigrator
93
93
  end
94
94
 
95
95
  def convert_migration_id(type, migration_id)
96
+ type = "modules" if type == "context_modules"
96
97
  id = if CanvasLinkMigrator::LinkParser::KNOWN_REFERENCE_TYPES.include? type
97
98
  resources.dig(type, migration_id, "destination", "id")
98
99
  end
@@ -69,6 +69,12 @@ describe CanvasLinkMigrator::LinkResolver do
69
69
  expect(link[:new_value]).to eq("/courses/2/discussion_topics/10?foo=bar")
70
70
  end
71
71
 
72
+ it "converts module links" do
73
+ link = { link_type: :object, type: "modules", migration_id: "J", query: "?foo=bar" }
74
+ resolver.resolve_link!(link)
75
+ expect(link[:new_value]).to eq("/courses/2/modules/36?foo=bar")
76
+ end
77
+
72
78
  it "converters other links" do
73
79
  link = { link_type: :object, type: "assignments", migration_id: "I", query: "#fie" }
74
80
  resolver.resolve_link!(link)
@@ -69,6 +69,16 @@
69
69
  }
70
70
  }
71
71
  },
72
+ "modules": {
73
+ "J": {
74
+ "destination": {
75
+ "id": "36"
76
+ },
77
+ "source": {
78
+ "id": "22"
79
+ }
80
+ }
81
+ },
72
82
  "wiki_pages": {
73
83
  "A": {
74
84
  "destination": {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canvas_link_migrator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mysti Lilla
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-07-25 00:00:00.000000000 Z
12
+ date: 2023-07-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport