1. 14 Jun, 2021 2 commits
  2. 12 Jun, 2021 1 commit
  3. 26 Apr, 2021 6 commits
  4. 24 Mar, 2021 1 commit
  5. 18 May, 2020 1 commit
  6. 17 May, 2020 1 commit
  7. 09 May, 2020 1 commit
  8. 08 May, 2020 1 commit
    • Adding option to skip loading models from subdirectories (#767) · 508d06a8
      ethanbresler authored
      Currently, the models annotator automatically attempts to find a class with a matching name at the bottom of project's directory tree before going up into specific engine's models.  This causes issues with models that share names with classes in other engines or lower classes in the project's directory.   This PR adds the option to skip attempts to load classes from lower directories and just uses the model's file path directly. 
      
      #674 
  9. 06 Apr, 2020 1 commit
  10. 05 Apr, 2020 3 commits
    • Fix output for multiline column comments (#779) · 214da4f6
      Troy Rosenberg authored
      Closes #778 
      
      If a column comment includes the newline character, the newline character
      would be "printed" into the annotation block resulting in a line break
      and an uncommented line.
      
      For example, for the following table:
      
      ```
      create_table "users", force: :cascade do |t|
        t.string "name", comment: "This is a comment.\nWith two lines!"
        t.datetime "created_at", precision: 6, null: false
        t.datetime "updated_at", precision: 6, null: false
      end
      ```
      
      annotating the model with the `--with-comment` flag will result in:
      
      ```
      \# == Schema Information
      \#
      \# Table name: users
      \#
      \#  id                                       :bigint           not null, primary key
      \#  name(This is a comment.
      With two lines!) :string
      \#  created_at                               :datetime         not null
      \#  updated_at                               :datetime         not null
      \#
      ```
      
      This uncommented line would result in invalid Ruby and cause the file to
      no longer be valid.
      
      This fix replaces the newline character with an escaped version, so the
      output will look more like:
      
      ```
      \# == Schema Information
      \#
      \# Table name: users
      \#
      \#  id                                       :bigint           not null, primary key
      \#  name(This is a comment.\nWith two lines!):string
      \#  created_at                               :datetime         not null
      \#  updated_at                               :datetime         not null
      \#
      ```
    • Refactor AnnotateRoutes by adding AnnotateRoutes::HeaderGenerator (#790) · d89ddefa
      Shu Fujita authored
      I noticed that `AnnotateRoutes` can be more maintainable by refactoring.
      
      I am planning to refactor `AnnotateRoutes` in this order.
      *   separate logic of `AnnotateRoutes` into `AnnotateRoutes::HeaderGenerator`.
      *   add methods to `AnnotateRoutes::HeaderGenerator` and refactor methods.
      *   add `AnnotateRoutes::AnnotationProcessor` and `AnnotateRoutes::RemovalProcessor`
      
      The final goal of this refactoring is as follows.
      * https://github.com/nard-tech/annotate_models/blob/feature/refactor_annotate_routes/processors/lib/annotate/annotate_routes.rb
      * https://github.com/nard-tech/annotate_models/tree/feature/refactor_annotate_routes/processors/lib/annotate/annotate_routes
      
      So in the first I added `AnnotateRoutes::HeaderGenerator` in order to separate logic of `AnnotateRoutes` in this PR.
      
      When refactor of `AnnotateRoutes` is finished, I would like to refactor `AnnotateModels` in a like way.
    • Fix "undefined method `<'" error message (#774) · d9392d9e
      Erik Kessler authored
      ## Problem
      
      I have some files in the "models" directory that are not true a `Class`. For example, a [`dry-types`](https://dry-rb.org/gems/dry-types/1.2/sum/) sum type:
      
      ```ruby
      # app/models/foo.rb
      Foo = Types::String | Types::Integer
      ```
      
      This results in the following line when I annotate.
      
      ```
      Unable to annotate app/models/foo.rb: undefined method `<' for #<Dry::Struct::Sum:0x00007ff2dd262988>
      ```
      
      Not a blocking issue but somewhat annoying nonetheless.
      
      ## Solution
      
      When annotating a file, check that the file's object is a `Class` to ensure it has the interface we expect.
  11. 31 Mar, 2020 1 commit
  12. 30 Mar, 2020 1 commit
    • Some project clean up (#786) · 1c1c5850
      Andrew W. Lee authored
      This PR does the following:
      * moves code coverage generation to happen when `COVERAGE` environment variable is present.
      * makes integration tests run when when `INTEGRATION_TESTS` is present.
      * moves `ruby-head` from TravisCI build. Previously the configuration allowed for `ruby-head` to be ignored if it failed, but it conflicted with the gem release build job step.
  13. 09 Mar, 2020 1 commit
  14. 08 Mar, 2020 1 commit
  15. 01 Mar, 2020 4 commits
  16. 25 Feb, 2020 1 commit
  17. 20 Feb, 2020 1 commit
  18. 17 Feb, 2020 1 commit
  19. 13 Feb, 2020 2 commits
  20. 11 Feb, 2020 1 commit
    • Add integration tests to project (#747) · ec0b3b61
      Andrew W. Lee authored
      Adds integration tests to the project that's able to run in CI across different ruby versions.
      
      * Adds a Rails 5.2.4.1 app
      * Adds a Rails 6.0.2.1 app
      
      Fixes #733 
  21. 06 Feb, 2020 1 commit
  22. 04 Feb, 2020 1 commit
  23. 01 Feb, 2020 2 commits
  24. 27 Jan, 2020 2 commits
  25. 26 Jan, 2020 2 commits