Skip to content

Rails 4.2.6 Bug-Fixes #16

Description

@JackWells

Just began testing with the below fixes, so no guarantees.

  1. Asset names passed to helpers should not include the "/assets/" prefix.
    The error points to app/views/erd/erd/erd.html.erb. I can generate the pdf diagram ok by running 'erd' from the Rails-Root folder. This code pattern has now been made breaking** in Rails 4.2, and affects many files within the gem's install folder. The first to fail was /erd-0.4.0/app/views/erd/erd/_model.html.erb.

My fix was to run the following (adjust to your gem install path):
find .../.rvm/gems/ruby-2.2.1/gems/erd-0.4.0/app/views/erd/erd/ -type f -exec sed -i 's#/assets/erd/#/erd/#g' {} +
find .../.rvm/gems/ruby-2.2.1/gems/erd-0.4.0/app/assets/javascripts/erd/ -type f -exec sed -i 's#/assets/erd/#/erd/#g' {} +
find .../.rvm/gems/ruby-2.2.1/gems/erd-0.4.0/app/assets/stylesheets/erd/ -type f -exec sed -i 's#/assets/erd/#/erd/#g' {} +
find .../.rvm/gems/ruby-2.2.1/gems/erd-0.4.0/vendor/assets/stylesheets/ -type f -exec sed -i 's#/assets/erd/#/erd/#g' {} +

  1. 'Asset filtered out and will not be served:' error.
    This can be fixed by putting the following in /config/initializers/assets
    Rails.application.config.assets.precompile += %w( erd/* )

BTW - great gem, and thank you for creating something that should have been built into Rails since at least version 1.1 - I had this core Gui-functionality at my fingertips 20+ years ago in other environments. Cheers!

** I am not sure why the Rails team thinks it is so imperative to break working, readable code - disregarding thousands of hours of others' lives and making Rails coders look slow and buggy in so doing. Backwards compatibility for reasonable, 5 year periods, would reflect app-lifespans. Maybe they can create their own "Fedorails" to "play" on, and let the rest of us serve our clients?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions