large_text_field 0.3.0.pre.1 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +6 -2
- data/Rakefile +5 -5
- data/db/migrate/20110217210640_add_large_text_fields.rb +3 -2
- data/lib/large_text_field.rb +1 -2
- data/lib/large_text_field/engine.rb +2 -0
- data/lib/large_text_field/named_text_value.rb +1 -3
- data/lib/large_text_field/owner.rb +8 -4
- data/lib/large_text_field/version.rb +3 -1
- data/test/dummy/Rakefile +3 -1
- data/test/dummy/app/assets/config/manifest.js +1 -0
- data/test/dummy/app/models/library.rb +2 -1
- data/test/dummy/config.ru +2 -0
- data/test/dummy/config/application.rb +3 -1
- data/test/dummy/config/boot.rb +4 -2
- data/test/dummy/config/database.yml +1 -1
- data/test/dummy/config/environment.rb +3 -1
- data/test/dummy/config/environments/development.rb +2 -3
- data/test/dummy/config/environments/production.rb +2 -0
- data/test/dummy/config/environments/test.rb +2 -3
- data/test/dummy/db/migrate/20160217033529_create_libraries.rb +2 -0
- data/test/dummy/db/schema.rb +6 -7
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +0 -4233
- data/test/dummy/script/rails +4 -2
- data/test/large_text_field_test.rb +2 -0
- data/test/test_helper.rb +11 -2
- data/test/unit/dummy/library_test.rb +2 -0
- data/test/unit/large_text_field/name_text_value_test.rb +2 -0
- data/test/unit/large_text_field/owner_test.rb +14 -16
- metadata +20 -27
data/test/dummy/script/rails
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
5
|
|
4
|
-
APP_PATH = File.expand_path('
|
5
|
-
require File.expand_path('
|
6
|
+
APP_PATH = File.expand_path('../config/application', __dir__)
|
7
|
+
require File.expand_path('../config/boot', __dir__)
|
6
8
|
require 'rails/commands'
|
data/test/test_helper.rb
CHANGED
@@ -1,11 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
ENV["RAILS_ENV"] = "test"
|
2
4
|
|
3
|
-
require File.expand_path(
|
5
|
+
require File.expand_path('dummy/config/environment.rb', __dir__)
|
4
6
|
require "rails/test_help"
|
5
|
-
require "invoca/utils"
|
6
7
|
require "rr"
|
7
8
|
require "shoulda"
|
8
9
|
require "minitest/unit"
|
10
|
+
require 'minitest/reporters'
|
11
|
+
|
12
|
+
junit_output_dir = ENV['JUNIT_OUTPUT_DIR'].presence || "test/reports"
|
13
|
+
Minitest::Reporters.use! [
|
14
|
+
Minitest::Reporters::DefaultReporter.new,
|
15
|
+
Minitest::Reporters::JUnitReporter.new(junit_output_dir)
|
16
|
+
]
|
17
|
+
|
9
18
|
require "pry"
|
10
19
|
|
11
20
|
def large_description
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'test_helper'
|
2
4
|
|
3
5
|
module LargeTextField
|
@@ -5,26 +7,22 @@ module LargeTextField
|
|
5
7
|
context "updating in large_text_field_save hook" do
|
6
8
|
{ 'empty string' => '', 'non empty string' => 'this is some text' }.each do |name, value|
|
7
9
|
should "be able to assign #{name}" do
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
Library.default_notes = "none_set"
|
15
|
-
end
|
10
|
+
Library.default_notes = value
|
11
|
+
@library = Library.create!(name: "Smithsonian")
|
12
|
+
assert_equal value, @library.notes
|
13
|
+
assert_equal value, @library.reload.notes
|
14
|
+
ensure
|
15
|
+
Library.default_notes = "none_set"
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
should "raise error on saving nil value" do
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
@library = Library.create!(name: "Smithsonian")
|
24
|
-
end
|
25
|
-
ensure
|
26
|
-
Library.default_notes = "none_set"
|
20
|
+
Library.default_notes = :nil
|
21
|
+
assert_raises RuntimeError do
|
22
|
+
@library = Library.create!(name: "Smithsonian")
|
27
23
|
end
|
24
|
+
ensure
|
25
|
+
Library.default_notes = "none_set"
|
28
26
|
end
|
29
27
|
end
|
30
28
|
|
@@ -300,7 +298,7 @@ module LargeTextField
|
|
300
298
|
assert_equal "The main research library of the University of Cambridge in England", @library.reload.description
|
301
299
|
end
|
302
300
|
|
303
|
-
should "delete large text fields when the owner is destroyed"do
|
301
|
+
should "delete large text fields when the owner is destroyed" do
|
304
302
|
assert_equal 0, LargeTextField::NamedTextValue.count
|
305
303
|
|
306
304
|
@library = Library.create!(name: "Cambridge University Library", description: "in england")
|
metadata
CHANGED
@@ -1,62 +1,54 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: large_text_field
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Invoca
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: invoca-utils
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '4.2'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '7'
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
38
|
-
- - "
|
41
|
+
- - ">="
|
39
42
|
- !ruby/object:Gem::Version
|
40
43
|
version: '4.2'
|
41
|
-
-
|
42
|
-
name: hobo_support
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
44
|
+
- - "<"
|
46
45
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '2.2'
|
46
|
+
version: '7'
|
55
47
|
description: Large text fields are kept in a central table, and polymorphically associated
|
56
|
-
with your models. Access and
|
48
|
+
with your models. Access and assignment should behave as if it was a column on
|
57
49
|
the same table.
|
58
50
|
email:
|
59
|
-
-
|
51
|
+
- development@invoca.com
|
60
52
|
executables: []
|
61
53
|
extensions: []
|
62
54
|
extra_rdoc_files: []
|
@@ -72,6 +64,7 @@ files:
|
|
72
64
|
- lib/large_text_field/version.rb
|
73
65
|
- test/dummy/README.rdoc
|
74
66
|
- test/dummy/Rakefile
|
67
|
+
- test/dummy/app/assets/config/manifest.js
|
75
68
|
- test/dummy/app/models/library.rb
|
76
69
|
- test/dummy/config.ru
|
77
70
|
- test/dummy/config/application.rb
|
@@ -108,12 +101,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
108
101
|
version: '0'
|
109
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
103
|
requirements:
|
111
|
-
- - "
|
104
|
+
- - ">="
|
112
105
|
- !ruby/object:Gem::Version
|
113
|
-
version:
|
106
|
+
version: '0'
|
114
107
|
requirements: []
|
115
|
-
|
116
|
-
rubygems_version: 2.6.13
|
108
|
+
rubygems_version: 3.0.1
|
117
109
|
signing_key:
|
118
110
|
specification_version: 4
|
119
111
|
summary: Add large text fields to models without database migrations
|
@@ -122,6 +114,7 @@ test_files:
|
|
122
114
|
- test/unit/large_text_field/name_text_value_test.rb
|
123
115
|
- test/unit/large_text_field/owner_test.rb
|
124
116
|
- test/dummy/app/models/library.rb
|
117
|
+
- test/dummy/app/assets/config/manifest.js
|
125
118
|
- test/dummy/test/fixtures/text_field_owners.yml
|
126
119
|
- test/dummy/config/environments/production.rb
|
127
120
|
- test/dummy/config/environments/development.rb
|