Skip to content

Fixture files that start with <% (erb) insert doc inside the erb block #345

Description

@kwerle

Steps to reproduce the problem

My yaml fixture

<%
define some hash
loop_times do
%>
some:
    block: of stuff
<%
end
%>
etc...

annotaterb models --force

Expected behavior

The schema information should NOT be placed in the erb block.

Actual behavior

The schema information goes into the erb block.

<%
# == Schema Information
# ...
define some hash
loop_times do
%>
some:
    block: of stuff
<%
end
%>
...

Your .annotaterb.yml configuration

---
active_admin: false
additional_file_patterns: []
routes: false
models: true
position_in_routes: before_doc
position_in_class: before_doc
position_in_test: before_doc
position_in_fixture: before_doc
position_in_factory: before_doc
position_in_serializer: before_doc
show_foreign_keys: true
show_complete_foreign_keys: false
show_indexes: true
simple_indexes: false
model_dir:
  - app/models
root_dir:
  - ""
include_version: false
require: []
exclude_tests: false
exclude_fixtures: false
exclude_factories: false
exclude_serializers: false
exclude_scaffolds: true
exclude_controllers: true
exclude_helpers: true
exclude_sti_subclasses: false
ignore_model_sub_dir: false
ignore_columns:
ignore_routes:
ignore_unknown_models: false
hide_limit_column_types: integer,bigint,boolean
hide_default_column_types: json,jsonb,hstore
skip_on_db_migrate: false
format_bare: true
format_rdoc: false
format_yard: false
format_markdown: false
sort: false
force: false
frozen: <%= !ENV["TESTING_ANNOTATED_MODELS"].to_s.empty? %>
classified_sort: true
trace: false
wrapper_open:
wrapper_close:
with_comment: true

Environment

  • AnnotateRb version: github main branch
  • Ruby version: 4.0
  • Ruby on Rails version: 8.0
  • Database adapter (e.g., sqlite3, pg, mysql2): mysql2 0.5.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions