Created
January 9, 2024 12:02
-
-
Save proveeder/1de2e2237da539e3edd0b2bd8a19d040 to your computer and use it in GitHub Desktop.
Sample of rails model class structure sample.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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