Skip to content

Instantly share code, notes, and snippets.

@route
Last active November 25, 2022 10:24
Show Gist options
  • Save route/4540032 to your computer and use it in GitHub Desktop.
Save route/4540032 to your computer and use it in GitHub Desktop.
AR template
class Example < ActiveRecord::Base
## includes
## plugins
## associations
## validations
## callbacks
## attr_*, delegate aliases, accepts_nested_attributes_for
## scopes
## class methods
## public methods
## protected methods
## private methods
end
@Valve
Copy link

Valve commented Nov 13, 2013

Where does accepts_nested_attributes_for fit into?

@route
Copy link
Author

route commented Oct 20, 2014

Put it wherever you need it :) I think it fits good after callbacks since basically it creates public methods or maybe even in plugin section because feels like a plugin... This is just in order to prevent total mess up in models since everybody wants it his way :) Basically as you discuss it with your team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment