Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby 2.7.5
ruby 3.1.6
22 changes: 21 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,60 @@ Inspired by [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

Note: This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.3.0] - 2025-07-09

### Added

- Added large_text_field_class_name_override and large_text_field_deprecated_class_name_override class methods allowing a model to use a different table for large_text_field support
- Previously the association to the large text file model was created when the module was included. The creation of this association is now delayed until the first field is defined. This allows for a cleaner syntax for setting options.

## [1.1.0] - 2023-05-17

### Fixed

- Relaxed dependency on rails to allow rails 7.

### Added

- Added support for rails 7
- Added appraisal tests for rails 7

### Removed

- Rails 4 and Ruby 2.6 are no longer supported. Automated testing of those versions has been removed.

## [1.0.2] - 2021-10-22

### Fixed

- Bug where reload didn't accept an argument even though ActiveRecord::Persistence#reload can.

## [1.0.1] - 2021-02-16

### Fixed

- Fixed migration to work with Rails 6 (by adding [4.2] suffix).
- Set rails version to < 6.1 since that moved some files around and broke requires.

## [1.0.0] - 2020-05-15

### Added

- Added support for rails 5 and 6.
- Added appraisal tests for all supported rails version: 4/5/6

### Removed

- Support for `protected_parameters` has been removed

## [0.3.2] - 2020-05-03

### Changed

- Replaced dependence on hobo_support with invoca_utils
- Make invoca_utils a declared dependency. (It always was, it just wasn't declared)


[1.3.0]: https://github.com/Invoca/large_text_field/compare/v1.1.0...v1.3.0
[1.1.0]: https://github.com/Invoca/large_text_field/compare/v1.0.2...v1.1.0
[1.0.2]: https://github.com/Invoca/large_text_field/compare/v1.0.1...v1.0.2
[1.0.1]: https://github.com/Invoca/large_text_field/compare/v1.0.0...v1.0.1
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
PATH
remote: .
specs:
large_text_field (1.2.0)
large_text_field (1.3.0)
invoca-utils (~> 0.3)
rails (>= 6.0)

GEM
remote: https://rubygems.org/
specs:
actioncable (6.1.7.3)

Check failure on line 11 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L11

actionpack Warning Message: https://discuss.rubyonrails.org/t/cve-2023-28362-possible-xss-via-user-supplied-values-to-redirect-to/83132 CVE: CVE-2023-28362 Severity: medium

Check failure on line 11 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L11

actionpack Warning Message: https://github.com/rails/rails/security/advisories/GHSA-fwhr-88qx-h9g7 CVE: CVE-2024-28103 Severity: medium

Check failure on line 11 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L11

actionpack Warning Message: https://github.com/rails/rails/security/advisories/GHSA-x76w-6vjr-8xgj CVE: CVE-2024-41128 Severity:

Check failure on line 11 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L11

actionpack Warning Message: https://github.com/rails/rails/security/advisories/GHSA-vfg9-r3fq-jvx4 CVE: CVE-2024-47887 Severity:

Check failure on line 11 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L11

actionpack Warning Message: https://github.com/rails/rails/security/advisories/GHSA-vfm5-rmrh-j26v CVE: CVE-2024-54133 Severity:
actionpack (= 6.1.7.3)

Check failure on line 12 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L12

activesupport Warning Message: https://github.com/rails/rails/releases/tag/v7.0.7.1 CVE: CVE-2023-38037 Severity: medium
activesupport (= 6.1.7.3)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.7.3)
actionpack (= 6.1.7.3)
activejob (= 6.1.7.3)
activerecord (= 6.1.7.3)

Check failure on line 19 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L19

activestorage Warning Message: https://discuss.rubyonrails.org/t/possible-sensitive-session-information-leak-in-active-storage/84945 CVE: CVE-2024-26144 Severity: medium
activestorage (= 6.1.7.3)
activesupport (= 6.1.7.3)
mail (>= 2.7.1)

Check failure on line 22 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L22

actionmailer Warning Message: https://github.com/rails/rails/security/advisories/GHSA-h47h-mwp9-c6q6 CVE: CVE-2024-47889 Severity:
actionmailer (6.1.7.3)
actionpack (= 6.1.7.3)
actionview (= 6.1.7.3)
Expand All @@ -29,16 +29,16 @@
rails-dom-testing (~> 2.0)
actionpack (6.1.7.3)
actionview (= 6.1.7.3)
activesupport (= 6.1.7.3)

Check failure on line 32 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L32

rack Warning Message: https://discuss.rubyonrails.org/t/denial-of-service-vulnerability-in-rack-content-type-parsing/84941 CVE: CVE-2024-25126 Severity: medium

Check failure on line 32 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L32

rack Warning Message: https://discuss.rubyonrails.org/t/possible-dos-vulnerability-with-range-header-in-rack/84944 CVE: CVE-2024-26141 Severity:

Check failure on line 32 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L32

rack Warning Message: https://discuss.rubyonrails.org/t/possible-denial-of-service-vulnerability-in-rack-header-parsing/84942 CVE: CVE-2024-26146 Severity:

Check failure on line 32 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L32

rack Warning Message: https://github.com/rack/rack/security/advisories/GHSA-7g2v-jj9q-g3rg CVE: CVE-2025-25184 Severity:

Check failure on line 32 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L32

rack Warning Message: https://github.com/rack/rack/security/advisories/GHSA-8cgq-6mh2-7j6v CVE: CVE-2025-27111 Severity:

Check failure on line 32 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L32

rack Warning Message: https://github.com/rack/rack/security/advisories/GHSA-7wqh-767x-r66v CVE: CVE-2025-27610 Severity: high

Check failure on line 32 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L32

rack Warning Message: https://github.com/rack/rack-session/security/advisories/GHSA-9j94-67jr-4cqj CVE: CVE-2025-32441 Severity: medium

Check failure on line 32 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L32

rack Warning Message: https://github.com/rack/rack/security/advisories/GHSA-gjh7-p2fx-99vx CVE: CVE-2025-46727 Severity: high
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)

Check failure on line 36 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L36

actiontext Warning Message: https://github.com/rails/rails/security/advisories/GHSA-wwhv-wxv9-rpgw CVE: CVE-2024-47888 Severity:
actiontext (6.1.7.3)
actionpack (= 6.1.7.3)
activerecord (= 6.1.7.3)
activestorage (= 6.1.7.3)
activesupport (= 6.1.7.3)

Check failure on line 41 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L41

nokogiri Warning Message: https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-5w6v-399v-w3cc CVE: GHSA-5w6v-399v-w3cc Severity:

Check failure on line 41 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L41

nokogiri Warning Message: https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-mrxw-mxhj-p664 CVE: GHSA-mrxw-mxhj-p664 Severity: high

Check failure on line 41 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L41

nokogiri Warning Message: https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-r95h-9x8f-r3f7 CVE: GHSA-r95h-9x8f-r3f7 Severity:

Check failure on line 41 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L41

nokogiri Warning Message: https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-vvfq-8hwr-qm4m CVE: GHSA-vvfq-8hwr-qm4m Severity:

Check failure on line 41 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L41

nokogiri Warning Message: https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-xc9x-jj77-9p9j CVE: GHSA-xc9x-jj77-9p9j Severity:
nokogiri (>= 1.8.5)
actionview (6.1.7.3)
activesupport (= 6.1.7.3)
Expand Down Expand Up @@ -96,7 +96,7 @@
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
mini_mime (>= 0.1.1)

Check failure on line 99 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L99

net-imap Warning Message: https://github.com/ruby/net-imap/security/advisories/GHSA-7fc5-f82f-cx69 CVE: CVE-2025-25186 Severity: medium

Check failure on line 99 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L99

net-imap Warning Message: https://github.com/ruby/net-imap/security/advisories/GHSA-j3g3-5qv5-52mj CVE: CVE-2025-43857 Severity:
net-imap
net-pop
net-smtp
Expand Down Expand Up @@ -164,7 +164,7 @@
thor (~> 1.0)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.8.0)

Check failure on line 167 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L167

rexml Warning Message: https://github.com/ruby/rexml/security/advisories/GHSA-vg3r-rm7w-2xgh CVE: CVE-2024-35176 Severity: medium

Check failure on line 167 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L167

rexml Warning Message: https://github.com/ruby/rexml/security/advisories/GHSA-4xqq-m2hx-25v8 CVE: CVE-2024-39908 Severity: medium

Check failure on line 167 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L167

rexml Warning Message: https://www.ruby-lang.org/en/news/2024/08/01/dos-rexml-cve-2024-41123 CVE: CVE-2024-41123 Severity: medium

Check failure on line 167 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L167

rexml Warning Message: https://www.ruby-lang.org/en/news/2024/08/01/dos-rexml-cve-2024-41946 CVE: CVE-2024-41946 Severity: medium

Check failure on line 167 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L167

rexml Warning Message: https://github.com/ruby/rexml/security/advisories/GHSA-vmwr-mc7x-5vc3 CVE: CVE-2024-43398 Severity: medium

Check failure on line 167 in Gemfile.lock

View check run for this annotation

Security Scanner as a Service / Bundle Audit

Gemfile.lock#L167

rexml Warning Message: https://github.com/ruby/rexml/security/advisories/GHSA-2rxp-v6pw-ch6m CVE: CVE-2024-49761 Severity: high
rexml (3.2.5)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
Expand Down
37 changes: 24 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ characters. Defining new fields on models does not require database migrations.
central table that is polymorphically associated with the model, but they act like a column on the same model.

## How do I use it?

In you Gemfile add:

```
Expand All @@ -13,8 +14,8 @@ In you Gemfile add:

There will be database migration you need to run to define the table, so go ahead and run that...

Any class that wants to define a large text field should include **::LargeTextField::Owner**,
and then define text fields by calling the **large_text_field** macro.
Any class that wants to define a large text field should include **::LargeTextField::Owner**,
and then define text fields by calling the **large_text_field** macro.

For example the following is a `Library` class that has large text fields for `notes` and `description`.

Expand All @@ -27,25 +28,35 @@ class Library < ApplicationRecord
end
```

That's it! You can then access `notes` and `description` as if they were columns on your class.
That's it! You can then access `notes` and `description` as if they were columns on your class.

The `large_text_field` macro takes the following options...

* **maximum: number** - The maximum length of a large text field. By default this is 5,000,000 characters,
but it can be set to less using this option.
* **singularize_errors: boolean** - should validation messages be singularized.
- **maximum: number** - The maximum length of a large text field. By default this is 5,000,000 characters,
but it can be set to less using this option.
- **singularize_errors: boolean** - should validation messages be singularized.

Large text fields defaults to an empty string. You cannot store `nil` in a large text field.
Large text fields defaults to an empty string. You cannot store `nil` in a large text field.

**Please note:** Large text field uses the *before_save* callback on the class that is the owner for book-keeping.
Callbacks are great, but if there are multiple handlers for the same callback the order in which they are called is
not predictable. If you want to make changes to large_text_field values in the before_save callback, use the
**large_text_field_save** callback instead. This will be called before the large text field book-keeping so your
changes will be saved. For example, this will call the `save_preprocess` method on your class before the large text
**Please note:** Large text field uses the _before_save_ callback on the class that is the owner for book-keeping.
Callbacks are great, but if there are multiple handlers for the same callback the order in which they are called is
not predictable. If you want to make changes to large_text_field values in the before_save callback, use the
**large_text_field_save** callback instead. This will be called before the large text field book-keeping so your
changes will be saved. For example, this will call the `save_preprocess` method on your class before the large text
fields are saved...

```ruby
set_callback(:large_text_field_save, :before, :save_preprocess)
```

This project rocks and uses MIT-LICENSE. You should too.
Added class methods:

```ruby
large_text_field_deprecated_class_name_override "LargeTextField::NamedTextValue"
large_text_field_class_name_override "MyCustomLargeTextField"
```

You will not generally need this support; however, it can be helpful when trying to separate a model into a
different database.

This project rocks and uses MIT-LICENSE. You should too.
3 changes: 2 additions & 1 deletion lib/large_text_field/named_text_value.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
module LargeTextField
class NamedTextValue < ApplicationRecord
# Schema
# field_name :string, :limit => 255
# field_name :string, :limit => 255
# foo :string
# value :text, :null=>true, :limit => MYSQL_MEDIUM_TEXT_UTF8_LIMIT
#
# index [ :owner_type, :owner_id, :field_name ], :name => 'large_text_field_by_owner_field', :unique=>true
Expand Down
74 changes: 62 additions & 12 deletions lib/large_text_field/owner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,25 @@ module Owner
include ActiveSupport::Callbacks

included do
has_many(
:large_text_fields,
class_name: "LargeTextField::NamedTextValue",
as: :owner,
autosave: true,
dependent: :destroy,
inverse_of: :owner
)
validate :validate_large_text_fields
before_save :write_large_text_field_changes
define_callbacks :large_text_field_save

class_attribute :large_text_field_options
self.large_text_field_options = {}

class_attribute :initialized
self.initialized = false

class_attribute :large_text_field_class_name
self.large_text_field_class_name = "LargeTextField::NamedTextValue"
class_attribute :large_text_field_class
self.large_text_field_class = LargeTextField::NamedTextValue

class_attribute :large_text_field_deprecated_class_name
self.large_text_field_deprecated_class_name = nil
class_attribute :large_text_field_deprecated_class
self.large_text_field_deprecated_class = nil
end

def dup
Expand All @@ -42,7 +47,13 @@ def reload(options = nil)
end

def text_field_hash
@text_field_hash ||= large_text_fields.build_hash { |text_field| [text_field.field_name, text_field] }
unless @text_field_hash
@text_field_hash = large_text_fields.build_hash { |text_field| [text_field.field_name, text_field] }
if large_text_field_deprecated_class_name
deprecated_large_text_fields.each { |text_field| @text_field_hash[text_field.field_name] ||= text_field }
end
end
@text_field_hash
end

def text_field_hash_loaded?
Expand All @@ -61,7 +72,7 @@ def set_text_field(original_field_name, original_value)
if (field = text_field_hash[field_name])
field.value = value
else
text_field_hash[field_name] = LargeTextField::NamedTextValue.new(owner: self, field_name: field_name, value: value)
text_field_hash[field_name] = large_text_field_class.new(owner: self, field_name:, value:)
end
end

Expand Down Expand Up @@ -91,7 +102,10 @@ def validate_large_text_fields
def write_large_text_field_changes
run_callbacks(:large_text_field_save)

@text_field_hash = text_field_hash.compact.select { |_key, value| value.value.presence }
@text_field_hash = text_field_hash
.compact
.select { |_key, value| value.value.presence }
.transform_values { |value| value.is_a?(large_text_field_class) ? value : large_text_field_class.new(owner: self, field_name: value.field_name, value: value.value) }
self.large_text_fields = text_field_hash.values.compact
true
end
Expand All @@ -103,7 +117,43 @@ def _clear_text_field_on_dup
end

module ClassMethods
def large_text_field_class_name_override(value)
self.large_text_field_class_name = value
self.large_text_field_class = Object.const_get(value)
end

def large_text_field_deprecated_class_name_override(value)
self.large_text_field_deprecated_class_name = value
self.large_text_field_deprecated_class = Object.const_get(value)
end

def initialize_large_text_field
return if initialized # skip if already initialized

has_many(
:large_text_fields,
class_name: large_text_field_class_name,
as: :owner,
autosave: true,
dependent: :destroy,
inverse_of: :owner
)
if large_text_field_deprecated_class_name
has_many(
:deprecated_large_text_fields,
class_name: large_text_field_deprecated_class_name,
as: :owner,
autosave: true,
dependent: :destroy,
inverse_of: :owner
)
end
self.initialized = true
end

def large_text_field(field_name, maximum: nil, singularize_errors: false)
initialize_large_text_field # ensure the association is initialized

field_name = field_name.to_s

# validate custom maximum
Expand All @@ -117,7 +167,7 @@ def large_text_field(field_name, maximum: nil, singularize_errors: false)
end
end

large_text_field_options[field_name] = { maximum: maximum, singularize_errors: singularize_errors }
large_text_field_options[field_name] = { maximum:, singularize_errors: }
define_method(field_name) { get_text_field(field_name) }
define_method("#{field_name}=") { |value| set_text_field(field_name, value) }
define_method("#{field_name}_changed?") { text_field_changed(field_name) }
Expand Down
2 changes: 1 addition & 1 deletion lib/large_text_field/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module LargeTextField
VERSION = "1.2.0"
VERSION = "1.3.0"
end
6 changes: 6 additions & 0 deletions test/dummy/app/models/dummy_large_text_value.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# frozen_string_literal: true

class DummyLargeTextValue < ApplicationRecord
belongs_to :owner, polymorphic: true, inverse_of: :large_text_fields
self.table_name = "dummy_large_text_fields"
end
14 changes: 14 additions & 0 deletions test/dummy/app/models/person.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

class Person < ApplicationRecord
include ::LargeTextField::Owner

# Schema
# name :string, :limit => 255

large_text_field_class_name_override "DummyLargeTextValue"
large_text_field_deprecated_class_name_override "LargeTextField::NamedTextValue"

large_text_field :story
large_text_field :resume
end
34 changes: 34 additions & 0 deletions test/dummy/config/storage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
test:
service: Disk
root: <%= Rails.root.join("tmp/storage") %>

local:
service: Disk
root: <%= Rails.root.join("storage") %>

# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
# amazon:
# service: S3
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
# region: us-east-1
# bucket: your_own_bucket

# Remember not to checkin your GCS keyfile to a repository
# google:
# service: GCS
# project: your_project
# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
# bucket: your_own_bucket

# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
# microsoft:
# service: AzureStorage
# storage_account_name: your_account_name
# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
# container: your_container_name

# mirror:
# service: Mirror
# primary: local
# mirrors: [ amazon, google, microsoft ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

class CreateDummyLargeTextFields < (Rails::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[4.2] : ActiveRecord::Migration)
def self.up
# rubocop:disable Rails/CreateTableWithTimestamps
create_table :dummy_large_text_fields do |t|
t.string :field_name, null: false
t.text :value, char_limit: 5_592_405, limit: 16_777_215
t.integer :owner_id, null: false
t.string :owner_type, null: false
end
# rubocop:enable Rails/CreateTableWithTimestamps
add_index :dummy_large_text_fields, %i[owner_type owner_id field_name], unique: true, name: 'dummy_large_text_field_by_owner_field'
end

def self.down
drop_table :dummy_large_text_fields
end
end
9 changes: 9 additions & 0 deletions test/dummy/db/migrate/20250604150254_create_people.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class CreatePeople < ActiveRecord::Migration[6.1]
def change
create_table :people do |t|
t.string :name

t.timestamps
end
end
end
16 changes: 15 additions & 1 deletion test/dummy/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2016_02_17_033529) do
ActiveRecord::Schema.define(version: 2025_06_04_150254) do

create_table "dummy_large_text_fields", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.string "field_name", null: false
t.text "value", size: :medium
t.integer "owner_id", null: false
t.string "owner_type", null: false
t.index ["owner_type", "owner_id", "field_name"], name: "dummy_large_text_field_by_owner_field", unique: true
end

create_table "large_text_fields", id: :integer, charset: "utf8mb3", force: :cascade do |t|
t.string "field_name", null: false
Expand All @@ -24,4 +32,10 @@
t.string "name", null: false
end

create_table "people", charset: "utf8mb3", force: :cascade do |t|
t.string "name"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end

end
Loading