trailblazer / cells

View components for Ruby and Rails.
https://trailblazer.to/2.1/docs/cells.html
3.07k stars 236 forks source link

Add deprecation warning for Cell::Concept #436

Closed george-carlin closed 7 years ago

george-carlin commented 8 years ago

The TRB book makes heavy use of Cell::Concept, and I wasn't sure what the difference is between this and Cell::ViewModel or Trailblazer::Cell... and on having a look in the source, I spotted this easy-to-miss comment.

Cell::Concept is no longer under active development. Please switch to Trailblazer::Cell.

This PR makes this warning more obvious by moving it from a comment to a puts statement when you initialize a new Cell::Concept. I realise that putting this in the initialize method isn't ideal, but Ruby's own deprecate method requires you to specify a specific method that's deprecated rather than deprecating the class as a whole. (None of the answers to this SO question really strike me as great solutions to the 'how do I deprecate an entire class?' question.)

Apologies if this class isn't actually "deprecated" in the sense that you're planning on removing it (as opposed to leaving it in there but not continuing active development on it.)

timoschilling commented 8 years ago

We should that merge wenn we know which way we go with Cells 5