Skip to content

Instantly share code, notes, and snippets.

@hadees
Created September 20, 2016 01:44
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 hadees/bd60a71b3e0c267b873195e8ea70bb23 to your computer and use it in GitHub Desktop.
Save hadees/bd60a71b3e0c267b873195e8ea70bb23 to your computer and use it in GitHub Desktop.
Model Template
<% module_namespacing do -%>
class <%= class_name %> < <%= parent_class_name.classify %>
### Default Scope
### Includes and Extensions
### Constants
### Virtual attributes
### Associations
<% attributes.select(&:reference?).each do |attribute| -%>
belongs_to :<%= attribute.name %><%= ', polymorphic: true' if attribute.polymorphic? %>
<% end -%>
### Callbacks
### Validations
### Scopes
### Other
### Class methods
### Instance methods
end
<% end -%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment