trailblazer / cells-haml

Haml integration for Cells
https://github.com/trailblazer/cells-haml
MIT License
5 stars 13 forks source link

Upgrading to to 0.10.0 breaks Rails.env? #4

Closed samstickland closed 8 years ago

samstickland commented 8 years ago

Hi,

I've just upgraded from 0.0.8 to 0.0.10 and now I get errors when I try to access Rails.env from inside a cell:

  Failure/Error: Rails.env.test? ? 'Add' : raw('<i class="icon-plus"></i>')

  NoMethodError:
    undefined method `env' for Cell::Haml::Rails:Module

Dropping back to down 0.0.8 works for me.

(This strange bit of code is because trying to click a link made entirely from an icon-moon font fails on Codeship).

timoschilling commented 8 years ago

Change your code to ::Rails.env.test? ? 'Add' : raw('<i class="icon-plus"></i>')

samstickland commented 8 years ago

Ah gotcha. It's because it was resolving to this new module?

https://github.com/trailblazer/cells-haml/blob/41c9d481e2b91366e386f18c264ce9d599b01db5/lib/cell/haml/rails.rb

2016-05-01 16:19 GMT+01:00 Timo Schilling notifications@github.com:

Change your code to ::Rails.env.test? ? 'Add' : raw('<i class="icon-plus">')

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/trailblazer/cells-haml/issues/4#issuecomment-216049121

timoschilling commented 8 years ago

Yes, thats the reason.