Skip to content

Instantly share code, notes, and snippets.

@thiagovsk
Last active March 16, 2022 02:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thiagovsk/bdcca4e7a8e5bd37a209fef1cbd2a10f to your computer and use it in GitHub Desktop.
Save thiagovsk/bdcca4e7a8e5bd37a209fef1cbd2a10f to your computer and use it in GitHub Desktop.
require "active_support/concern"
module M
extend ActiveSupport::Concern
included do
has_many :things
scope :disabled, -> { where(disabled: true) }
after_commit :send_email
validates :email, length: { maximum: 255 }, email: true
end
def instance_method
end
class_methods do
...
end
private
def send_email
send_emails_here
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment