trailblazer / cells

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

Have in-house implementation of classify that does not singularize #330

Closed firedev closed 9 years ago

firedev commented 9 years ago

Cell are using classify: https://github.com/apotonick/cells/blob/master/lib/cell/concept.rb#L9

That is using singularize:

# File activesupport/lib/active_support/inflector/methods.rb, line 178
def classify(table_name)
  # strip out any leading schema name
  camelize(singularize(table_name.to_s.sub(/.*\./, '')))
end

Which leads to unwanted behaviour since we're not dealing with table_name here:

concept('calendar/stats', month)
=> uninitialized constant Calendar::Stat

I suggest to have an in-house classify method that doesn't do singularize on the Cell name.

firedev commented 9 years ago
uninitialized constant Shared::NoDatum
Extracted source (around line #4):

  = concept('shared/no_data').call