Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 4.2.6 Bug-Fixes #16

Open
JackWells opened this issue Apr 21, 2016 · 1 comment
Open

Rails 4.2.6 Bug-Fixes #16

JackWells opened this issue Apr 21, 2016 · 1 comment

Comments

@JackWells
Copy link

JackWells commented Apr 21, 2016

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?

@bekicot
Copy link

bekicot commented May 16, 2016

Just in case some one doesn't understand the fix of first error. Follow this step

  • bundle open erd
  • replace all occurrence of YOUR_ERD_PATH with the path returned by above command
find YOUR_ERD_PATH/app/views/erd/erd/ -type f -exec sed -i 's#/assets/erd/#/erd/#g' {} +
find YOUR_ERD_PATH/app/assets/javascripts/erd/ -type f -exec sed -i 's#/assets/erd/#/erd/#g' {} +
find YOUR_ERD_PATH/app/assets/stylesheets/erd/ -type f -exec sed -i 's#/assets/erd/#/erd/#g' {} +
find YOUR_ERD_PATH/vendor/assets/stylesheets/ -type f -exec sed -i 's#/assets/erd/#/erd/#g' {} +
  • Run above command on terminal

Anyway, just to confirm it also affected me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants