Skip to content

Instantly share code, notes, and snippets.

@proveeder
Created January 9, 2024 12:02
Show Gist options
  • Select an option

  • Save proveeder/1de2e2237da539e3edd0b2bd8a19d040 to your computer and use it in GitHub Desktop.

Select an option

Save proveeder/1de2e2237da539e3edd0b2bd8a19d040 to your computer and use it in GitHub Desktop.
Sample of rails model class structure sample.
# frozen_string_literal: true
class ModelName < ApplicationRecord
# INCLUDES
# DEFAULT SCOPE
# CONSTANTS
# ATTR ACCESSORS
# ATTRIBUTES
# ENUMS
# RELATIONS
# VALIDATIONS
# CALLBACKS
# NESTED ATTRIBUTES
# SCOPES
# ACTS_AS, GEOCODED_BY, AUTOSTRIP_ATTRIBUTES, ATTACHED FILES, other non-standard keywords
# CLASS METHODS
# PRIVATE CLASS METHODS
# INSTANCE METHODS
# PRIVATE METHODS
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment