Skip to content

Commit

Permalink
Alphabetize things
Browse files Browse the repository at this point in the history
* `config/routes.rb`
* `spec/factories.rb`
* validations and their tests
* associations and their tests
* CSS attributes
  • Loading branch information
Dan Croak authored and Dan Croak committed Oct 2, 2012
1 parent 1026997 commit d2f8173
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion style/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ Naming
* Treat acronyms as words in names (`XmlHttpRequest` not `XMLHTTPRequest`),
even if the acronym is the entire name (`class Html` not `class HTML`).

CSS
---

* Order properties within rule sets alphabetically.

JavaScript
----------

Expand Down Expand Up @@ -117,8 +122,11 @@ Rails
* Keep the `db/schema.rb` under version control.
* If there are default values, set them in migrations.
* Name initializers for their gem name.
* Order ActiveRecord associations alphabetically by attribute name.
* Order ActiveRecord validations alphabetically by attribute name.
* Order controller contents: filters, public methods, private methods.
* Order model contents: constants, macros, public methods, private methods.
* Order resourceful routes alphabetically by name.
* Put application-wide partials in the
[`app/views/application`](http://goo.gl/5Z8Vv) directory.
* Use `_path`, not `_url`, for named routes everywhere except mailer views.
Expand Down Expand Up @@ -151,7 +159,9 @@ Testing
* Don't prefix `it` block descriptions with 'should'.
* Name outer `describe` blocks after the method under test. Use `.method`
for class methods and `#method` for instance methods.
* Order factories.rb: sequences, traits, factory definitions.
* Order ActiveRecord association tests alphabetically by attribute name.
* Order ActiveRecord validation tests alphabetically by attribute name.
* Order `factories.rb` contents: sequences, traits, factory definitions.
* Order factory attributes: implicit attributes, explicit attributes,
child factory definitions. Each section's attributes are alphabetical.
* Order factory definitions alphabetically by factory name.
Expand Down

0 comments on commit d2f8173

Please sign in to comment.