govuk_content_models 13.4.0 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +3 -0
- data/lib/govuk_content_models/version.rb +1 -1
- metadata +3 -6
- data/app/models/attachment.rb +0 -20
- data/test/models/attachment_test.rb +0 -13
data/CHANGELOG.md
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: govuk_content_models
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 14.0.0
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -348,7 +348,6 @@ files:
|
|
|
348
348
|
- app/models/artefact.rb
|
|
349
349
|
- app/models/artefact_action.rb
|
|
350
350
|
- app/models/artefact_external_link.rb
|
|
351
|
-
- app/models/attachment.rb
|
|
352
351
|
- app/models/business_support/business_size.rb
|
|
353
352
|
- app/models/business_support/business_type.rb
|
|
354
353
|
- app/models/business_support/location.rb
|
|
@@ -412,7 +411,6 @@ files:
|
|
|
412
411
|
- test/models/artefact_external_link_test.rb
|
|
413
412
|
- test/models/artefact_tag_test.rb
|
|
414
413
|
- test/models/artefact_test.rb
|
|
415
|
-
- test/models/attachment_test.rb
|
|
416
414
|
- test/models/business_support/business_size_test.rb
|
|
417
415
|
- test/models/business_support/business_type_test.rb
|
|
418
416
|
- test/models/business_support/location_test.rb
|
|
@@ -468,7 +466,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
468
466
|
version: '0'
|
|
469
467
|
segments:
|
|
470
468
|
- 0
|
|
471
|
-
hash:
|
|
469
|
+
hash: 4433079101509813617
|
|
472
470
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
473
471
|
none: false
|
|
474
472
|
requirements:
|
|
@@ -477,7 +475,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
477
475
|
version: '0'
|
|
478
476
|
segments:
|
|
479
477
|
- 0
|
|
480
|
-
hash:
|
|
478
|
+
hash: 4433079101509813617
|
|
481
479
|
requirements: []
|
|
482
480
|
rubyforge_project:
|
|
483
481
|
rubygems_version: 1.8.23
|
|
@@ -492,7 +490,6 @@ test_files:
|
|
|
492
490
|
- test/models/artefact_external_link_test.rb
|
|
493
491
|
- test/models/artefact_tag_test.rb
|
|
494
492
|
- test/models/artefact_test.rb
|
|
495
|
-
- test/models/attachment_test.rb
|
|
496
493
|
- test/models/business_support/business_size_test.rb
|
|
497
494
|
- test/models/business_support/business_type_test.rb
|
|
498
495
|
- test/models/business_support/location_test.rb
|
data/app/models/attachment.rb
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
require 'attachable'
|
|
2
|
-
|
|
3
|
-
class Attachment
|
|
4
|
-
include Mongoid::Document
|
|
5
|
-
include Mongoid::Timestamps
|
|
6
|
-
include Attachable
|
|
7
|
-
|
|
8
|
-
field :title
|
|
9
|
-
field :filename
|
|
10
|
-
attaches :file, with_url_field: true, update_existing: true
|
|
11
|
-
|
|
12
|
-
embedded_in :specialist_document_edition
|
|
13
|
-
|
|
14
|
-
validates_with SafeHtml
|
|
15
|
-
|
|
16
|
-
# TODO: Move this to a domain object in specialist publisher
|
|
17
|
-
def snippet
|
|
18
|
-
"[InlineAttachment:#{filename}]"
|
|
19
|
-
end
|
|
20
|
-
end
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
require "test_helper"
|
|
2
|
-
|
|
3
|
-
class AttachmentTest < ActiveSupport::TestCase
|
|
4
|
-
should "generate a snippet" do
|
|
5
|
-
attachment = Attachment.new(
|
|
6
|
-
title: "Supporting attachment",
|
|
7
|
-
filename: "document.pdf"
|
|
8
|
-
)
|
|
9
|
-
expected_snippet = "[InlineAttachment:document.pdf]"
|
|
10
|
-
|
|
11
|
-
assert_equal expected_snippet, attachment.snippet
|
|
12
|
-
end
|
|
13
|
-
end
|