Last active
December 11, 2015 03:19
-
-
Save gumayunov/4536589 to your computer and use it in GitHub Desktop.
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
class Name < AcriveRecord::Base | |
# includes & extensions | |
include Module | |
# constants | |
CONST = 1 | |
# attributes | |
attr_accessor :attribute | |
# mass-asignment constraints | |
attr_accessible :name, :email | |
# associations | |
has_many :items | |
# callbacks | |
after_save :callback | |
# scopes | |
scope :before, lambda { |time| where("created_at < ?", time) } | |
# class methods | |
class << self | |
def foo | |
end | |
end | |
# instance methods | |
def bar | |
end | |
# privates | |
private | |
def baz | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment