Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: drwl/annotaterb
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.14.0
Choose a base ref
...
head repository: drwl/annotaterb
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.15.0
Choose a head ref
  • 9 commits
  • 16 files changed
  • 9 contributors

Commits on Feb 17, 2025

  1. Generate changelog for v4.14.0 (#191)

    Manually generating changelogs for time being.
    drwl authored Feb 17, 2025
    Configuration menu
    Copy the full SHA
    efc56fb View commit details
    Browse the repository at this point in the history

Commits on Mar 3, 2025

  1. Fix changelog_uri in gemspec (#192)

    This repository uses `main` for the default branch. This can reduce a
    redirect when accessing the URI.
    y-yagi authored Mar 3, 2025
    Configuration menu
    Copy the full SHA
    578447a View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2025

  1. feat: add timestamp_columns config option (#173)

    I'm working with a codebase that doesn't use Rails' default timestamp
    columns, so being able to customise those would be helpful. This adds
    `timestamp_columns` as a configurable option for classified sorting, and
    sorts them in config order rather than alphabetical order.
    
    Co-authored-by: Andrew W. Lee <git@drewlee.com>
    pbernays and drwl authored Mar 31, 2025
    Configuration menu
    Copy the full SHA
    fd73335 View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2025

  1. fix: Handle case when table_name_prefix specified as symbol (#208)

    During of annotation of indexes I have received exception
    (`'String#sub': wrong argument type Symbol (expected Regexp)
    (TypeError)`) when some of my AR models use `table_name_prefix` option
    with Symbol value. In this PR I fixed it and added some specs to cover
    it by tests
    
    ENV: Rails 8.0.1, Ruby 3.4.1
    gururuby authored Apr 11, 2025
    Configuration menu
    Copy the full SHA
    df91a4e View commit details
    Browse the repository at this point in the history

Commits on May 30, 2025

  1. Add debug logs for model annotation (#217)

    We have a pretty large monolith (as well as a second database host that
    tends to get bogged down after it runs for a while in development), so
    we find it useful to see some progress indicator while annotations are
    running.
    
    This adds them in for each model when debug is set. This uses `puts` to
    match the current debug log that exists.
    jarredhawkins authored May 30, 2025
    Configuration menu
    Copy the full SHA
    ec48669 View commit details
    Browse the repository at this point in the history
  2. Cache retrieved indexes in ModelWrapper (#215)

    When upgrading rails project with 200+ models from annotate to this gem
    (thanks for creating and maintaining it!), we noticed that annotation
    became a lot slower. We managed to pinpoint the problem to `indexes =
    @klass.connection.indexes(table_name)` which was invoked from
    `AnnotationBuilder::Annotation#columns` for every column of every model.
    
    Original annotate:
    ```
    bundle exec annotate --models  7,72s user 0,82s system 68% cpu 12,553 total
    ```
    Before this change:
    ```
    bundle exec annotaterb models  27,14s user 2,19s system 60% cpu 48,816 total
    ```
    After this change:
    ```
    bundle exec annotaterb models  7,22s user 0,82s system 82% cpu 9,748 total
    ```
    
    Co-authored-by: David Hajčiar <david.hajciar@juicymo.cz>
    Co-authored-by: Andrew W. Lee <git@drewlee.com>
    3 people authored May 30, 2025
    Configuration menu
    Copy the full SHA
    90df34c View commit details
    Browse the repository at this point in the history
  3. feat: identify unique indexes in simple_indexes option (#214)

    When generating simple indexes, there is no identifier for unique
    indexes. This PR updates the `simple_index` option to annotate with
    `uniquely indexed` for unique indexes.
    
    Screenshot from a project I tested with:
    
    ![image](https://github.com/user-attachments/assets/7647959e-1cc9-41d5-bd9d-134a96404dee)
    
    Co-authored-by: Andrew W. Lee <git@drewlee.com>
    amerritt14 and drwl authored May 30, 2025
    Configuration menu
    Copy the full SHA
    208646a View commit details
    Browse the repository at this point in the history
  4. Support the glob pattern in root_dir and model_dir (#198)

    We often want to specify multiple directories in `root_dir` and
    `model_dir`.
    For example, when using engines, packs-rails, etc.
    
    * https://github.com/rubyatscale/packs-rails
    * https://guides.rubyonrails.org/engines.html
    
    This commit supports the glob pattern with these options, making it easy
    to specify multiple directories.
    
    fixes #99
    
    Co-authored-by: Andrew W. Lee <git@drewlee.com>
    sinsoku and drwl authored May 30, 2025
    Configuration menu
    Copy the full SHA
    98d7856 View commit details
    Browse the repository at this point in the history
  5. Bump version to v4.15.0 (#218)

    Manually doing releases until an automated solution is put in place.
    drwl authored May 30, 2025
    Configuration menu
    Copy the full SHA
    78ec7bc View commit details
    Browse the repository at this point in the history
Loading