Last Updated: February 25, 2016
·
351
· mbillard

Keep your model classes organized with a model skeleton

Create a skeleton of how you want to structure your model classes and use it whenever you create a new model. You will always know where to find what you need.

Example of my sample_model.rb which I keep in my doc folder.

class ModelName < ActiveRecord::Base
  ### Mixins & Concerns

  ## Associations

  ## Scopes

  ## Validations

  ## Callbacks

  ## Attributes
  attr_accessible ...

  ## State Machine(s)

  ## Members

  private

  ## Validation methods

  ## Callback methods

end