Flowdock
v3.0.0 - Show latest stable - 0 notes

Active Model Naming

Creates a model_name method on your object.

To implement, just extend ActiveModel::Naming in your object:

  class BookCover
    extend ActiveModel::Naming
  end

  BookCover.model_name        # => "BookCover"
  BookCover.model_name.human  # => "Book cover"

Providing the functionality that ActiveModel::Naming provides in your object is required to pass the Active Model Lint test. So either extending the provided method below, or rolling your own is required..

Show files where this module is defined (1 file)
Register or log in to add new notes.