Skip to content

Releases: rroblak/seed_dump

v3.4.1

24 Dec 15:34
0aa821c

Choose a tag to compare

v3.4.0

03 Dec 17:09
f3b6b59

Choose a tag to compare

What's New

This is a major maintenance release that addresses many long-standing issues and adds new features.

New Features

  • UPSERT_ALL option (#104): Preserves original record IDs using Rails 6+ upsert_all, fixing foreign key references becoming invalid after reimport
  • INSERT_ALL option (#153): Bulk insert using Rails 6+ insert_all for faster imports
  • INCLUDE_ALL option (#147): Include all columns, cleaner alternative to EXCLUDE=""
  • MODEL_LIMITS option (#142): Per-model limit overrides (e.g., MODEL_LIMITS="Teacher:0,Student:50")
  • HEADER option (#126): Add a comment header with timestamp and copyable rake command to seed files

Bug Fixes

  • Foreign key ordering (#78, #83): Models now dumped in dependency order based on belongs_to associations
  • STI deduplication (#120): STI subclasses no longer create duplicate seed entries
  • HABTM deduplication (#26, #114): HABTM models sharing the same join table are deduplicated
  • HABTM private constants (#130): Use const_get for HABTM join models to avoid NameError on import
  • Timezone preservation (#111): Use ISO 8601 format for datetime dumps to preserve timezone info
  • ActionText support (#154): Handle ActionText::Content in seed dumps correctly
  • Tables without primary key (#167): Handle ordering for tables without a primary key (also fixes #138, #123 duplicate records bug)
  • default_scope with select (#165): Handle default_scope with select in COUNT queries
  • Nested Time/BigDecimal (#105): Handle Time/BigDecimal values in nested Hashes and Arrays
  • Non-model AR descendants (#112): Handle abstract classes and other non-model ActiveRecord::Base descendants
  • Model names ending in 's' (#121): Fix incorrect singularization (e.g., "Boss" → "Bos")
  • Pipe compatibility (#150): Use write-only file modes for /dev/stdout and pipe compatibility
  • CarrierWave uploaders (#117): Uploader columns now dump correctly instead of nil
  • Batch size output (#127): BATCH_SIZE now outputs separate method calls per batch

Other Improvements

  • Added created_on/updated_on to default excludes (#128)
  • Date/time formatting updated to use to_fs(:db) when available (#163)
  • Major test suite refactoring with DatabaseCleaner and improved RSpec setup
  • Added Appraisals for testing against Rails 6.1, 7.0, 7.1, 7.2, and 8.0
  • Upgraded rspec to 3.13 for Ruby 3.4 compatibility
  • Updated README with documentation for all new features

Full Changelog: v3.3.1...v3.4.0