Last active
November 15, 2020 03:48
-
-
Save AquisTech/2de18747be681c037c00d26758e25273 to your computer and use it in GitHub Desktop.
Order of elements arrangement in Model
This file contains 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
# encoding | |
class ModelName < ApplicationRecord | |
# require statements | |
# extend Modules | |
# include Modules | |
# Gem/Plugins options | |
# CONSTANTS | |
# Attribute accessors | |
# serialize attributes | |
# validations | |
# Callbacks | |
# before_validation | |
# after_validation | |
# before_save | |
# around_save | |
# Creating an Object | |
# before_create | |
# around_create | |
# after_create | |
# Updating an Object | |
# before_update | |
# around_update | |
# after_update | |
# after_save | |
# Destroying an Object | |
# before_destroy | |
# around_destroy | |
# after_destroy | |
# After manipulation (success/failure) | |
# after_commit | |
# after_rollback | |
# Associations | |
# belongs_to | |
# polymorphic | |
# has_one | |
# has_many (simple) | |
# has_many (using :through) | |
# Association configurations such as 'accepts_nested_attributes_for' statements | |
# Delegates | |
# Scopes | |
# Class Methods | |
# Getter setter | |
# Instance Methods (used in validation blocks) | |
# Instance Methods | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment