ombulabs/claude-code_rails-upgrade-skill / rails-upgrade
rails-upgrade
VerifiedAnalyzes Rails applications and generates comprehensive upgrade reports with breaking changes, deprecations, and step-by-step migration guides for Rails 2.3 through 8.1. Use when upgrading Rails applications, planning multi-hop upgrades, querying version-specific changes, or answering what stands between the app and the next Rails version. Based on FastRuby.io methodology and "The Complete Guide to Upgrade Rails" ebook.
detection-scripts/patterns/rails-80-patterns.expectations.yml
View on GitHub# Fixture expectations for rails-80-patterns.yml.
#
# Keyed by variable_name (matching the entries in rails-80-patterns.yml). For
# each pattern you cover, list:
# match - lines the pattern MUST flag
# no_match - lines it MUST NOT flag (safe code + known false-positive traps)
#
# A line is "flagged" when the entry's `pattern` regex matches it AND the
# entry's `exclude` regex (when present) does not: a per-line grep + grep -v.
#
# Run with:
# bin/test-patterns rails-upgrade/detection-scripts/patterns/rails-80-patterns.yml
#
# The patterns without an entry here predate the expectations tooling. Add
# entries as they are revisited.
TO_TIME_PRESERVES_TIMEZONE:
match:
# load_defaults 5.0 to 7.2 leaves the value at :offset, so 8.0 warns
- " config.load_defaults 7.2"
- " config.load_defaults 7.1"
- " config.load_defaults 6.0"
- " config.load_defaults 5.2"
# quoted and parenthesized forms
- " config.load_defaults \"7.2\""
- " config.load_defaults '6.1'"
- " config.load_defaults(7.0)"
no_match:
# load_defaults 8.0 sets :zone, 8.0 does not warn
- " config.load_defaults 8.0"
- " config.load_defaults 8.1"
- " config.load_defaults \"8.0\""
# generated template interpolates the running version
- " config.load_defaults Rails::VERSION::STRING.to_f"
# commented-out line
- " # config.load_defaults 7.2"
TO_TIME_PRESERVES_TIMEZONE_ASSIGNMENT:
match:
# Rails 4.2 generated initializer, still warns on 8.0
- "ActiveSupport.to_time_preserves_timezone = true"
- " config.active_support.to_time_preserves_timezone = :offset"
- " config.active_support.to_time_preserves_timezone = false"
- "Rails.application.config.active_support.to_time_preserves_timezone = nil"
no_match:
# the opt-in itself does not warn on 8.0
- " config.active_support.to_time_preserves_timezone = :zone"
- "Rails.application.config.active_support.to_time_preserves_timezone = :zone"
# commented-out line in new_framework_defaults_8_0.rb
- "# Rails.application.config.active_support.to_time_preserves_timezone = :offset"
# reading the value
- " if ActiveSupport.to_time_preserves_timezone"
READ_ENCRYPTED_SECRETS:
match:
- " config.read_encrypted_secrets = true"
- " config.read_encrypted_secrets = false"
- "Rails.application.config.read_encrypted_secrets = true"
no_match:
- " config.require_master_key = true"
- " config.secret_key_base = ENV[\"SECRET_KEY_BASE\"]"
# commented-out line
- " # config.read_encrypted_secrets = true"
RUBY_VERSION:
# Rails 8.0 requires Ruby >= 3.2.0 (rails gemspec). Lines come from the
# Gemfile, .ruby-version and .tool-versions.
match:
- "ruby \"3.1.6\""
- "ruby '~> 3.1.4'"
- "ruby \"~> 2.7\""
- "3.1.6"
- "ruby-3.0.7"
- "ruby 2.7.8"
no_match:
- "ruby \"3.2.6\""
- "ruby \"~> 3.1\""
- "ruby \">= 3.1.0\""
- "3.3.6"
- "ruby 3.4.1"
- "3.10.0"
- "gem \"rack\", \"3.1.8\""
ENV_SCHEMA_CACHE:
match:
- "ENV[\"SCHEMA_CACHE\"] = \"tmp/schema_cache.yml\""
- "path = ENV['SCHEMA_CACHE']"
# the variable set in a CI step or script
- " run: SCHEMA_CACHE=db/cache.yml bin/rails db:schema:cache:dump"
- "export SCHEMA_CACHE=db/cache.yml"
no_match:
# the replacement key in database.yml
- " schema_cache_path: db/cache.yml"
- "ENV[\"SCHEMA_CACHE_PATH\"]"
- "MY_SCHEMA_CACHE=1"
- "SCHEMA_CACHE_PATH=db/cache.yml"
ROUTES_MULTIPLE_PATHS:
match:
- " get \"/old1\", \"/old2\", to: \"foo#bar\""
- " get '/a', '/b', to: 'x#y'"
- " match \"a\", \"b\", via: [:get, :post]"
- " post(:create, :update)"
- " get :search, :filter"
- " delete \"/a\", \"/b\""
no_match:
- " get \"/a\", to: \"foo#bar\""
- " get \"/a\", :to => \"foo#bar\""
- " get :search, on: :collection"
- " get :search, :on => :collection"
- " get \"/a\", \"to\": \"x#y\""
- " get \"photos/:id\", to: \"photos#show\", as: :photo"
# an Array path draws no route on 7.2 or 8.0; not the deprecated shape
- " get [\"/old1\", \"/old2\"], to: \"foo#bar\""
- " target \"/a\", \"/b\""
- " # get \"/a\", \"/b\""
WARN_ON_RECORDS_FETCHED:
match:
- " config.active_record.warn_on_records_fetched_greater_than = 1000"
- "Rails.application.config.active_record.warn_on_records_fetched_greater_than = 1000"
- "ActiveRecord.warn_on_records_fetched_greater_than = 1000"
no_match:
# commented line, as in the 7.1 new_framework_defaults initializer
- "# Rails.application.config.active_record.warn_on_records_fetched_greater_than = 1000"
- " # config.active_record.warn_on_records_fetched_greater_than = 1000"
ALLOW_DEPRECATED_SINGULAR_ASSOCIATIONS_NAME:
match:
- " config.active_record.allow_deprecated_singular_associations_name = false"
- "Rails.application.config.active_record.allow_deprecated_singular_associations_name = false"
- "ActiveRecord.allow_deprecated_singular_associations_name = false"
no_match:
# commented line, as in the 7.1 new_framework_defaults initializer
- "# Rails.application.config.active_record.allow_deprecated_singular_associations_name = false"
- " # config.active_record.allow_deprecated_singular_associations_name = false"
COMMIT_TRANSACTION_ON_NON_LOCAL_RETURN:
match:
- " config.active_record.commit_transaction_on_non_local_return = true"
- "Rails.application.config.active_record.commit_transaction_on_non_local_return = true"
- "ActiveRecord.commit_transaction_on_non_local_return = true"
no_match:
# commented line, as in the 7.1 new_framework_defaults initializer
- "# Rails.application.config.active_record.commit_transaction_on_non_local_return = true"
- " # config.active_record.commit_transaction_on_non_local_return = true"
UNSIGNED_FLOAT_DECIMAL:
match:
- " t.unsigned_float :amount"
- " t.unsigned_decimal :price, precision: 10, scale: 2"
no_match:
# still supported, not deprecated
- " t.unsigned_integer :count"
- " t.unsigned_bigint :count"
# the replacement
- " t.float :amount, unsigned: true"
BENCHMARK_MS:
match:
- " elapsed = Benchmark.ms { run }"
- "ms = ::Benchmark.ms do"
no_match:
# the replacement
- " elapsed = Benchmark.realtime { run } * 1000"
- "Benchmark.msecs"
- "MyBenchmark.ms { run }"
RAKE_STATS:
match:
- " run: bin/rake stats"
- " - bundle exec rake stats"
no_match:
# the replacement
- " run: bin/rails stats"
- "rake statsd:flush"
- "rake stats_report"
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| planning-and-task-breakdownaddyosmani/agent-skillsBreaks work into ordered tasks. Use when you have a spec or clear requirements and need to break work into implementable tasks. Use when a task feels too large to start, when you need to estimate scope, or when parallel work is possible. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| screenpipethedotmack/claude-memSearch screen and audio history recorded by Screenpipe and optionally save selected context into claude-mem. Use when the user asks to recall desktop activity, a meeting, or something seen in another app through Screenpipe. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| contact-widgetnexu-io/open-designSelf-contained floating chat widget with welcome screen, social links, meeting button, and message input. Single HTML file, zero dependencies. | Stars: 108k | Updated | Claude CodeCodex | Verified | Install |
| meeting-notesnexu-io/open-designMeeting notes page — title bar with attendees, agenda checklist, decisions block, action items table with owners + dates, and a "next meeting" footer. Use when the brief mentions "meeting notes", "minutes", "1:1 notes", "all-hands recap", or "会议纪要". | Stars: 108k | Updated | Claude CodeCodex | Verified | Install |