You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.adoc
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -164,7 +164,7 @@ end
164
164
165
165
=== Nested Routes [[nested-routes]]
166
166
167
-
Use nested routes to express better the relationship between ActiveRecord models.
167
+
Use nested routes to express better the relationship between Active Record models.
168
168
169
169
[source,ruby]
170
170
----
@@ -334,15 +334,15 @@ render status: :forbidden
334
334
335
335
=== Model Classes [[model-classes]]
336
336
337
-
Introduce non-ActiveRecord model classes freely.
337
+
Introduce non-Active Record model classes freely.
338
338
339
339
=== Meaningful Model Names [[meaningful-model-names]]
340
340
341
341
Name the models with meaningful (but short) names without abbreviations.
342
342
343
343
=== ActiveAttr Gem [[activeattr-gem]]
344
344
345
-
If you need model objects that support ActiveRecord behavior (like validation) without the ActiveRecord database functionality use the https://github.com/cgriego/active_attr[ActiveAttr] gem.
345
+
If you need model objects that support Active Record behavior (like validation) without the Active Record database functionality use the https://github.com/cgriego/active_attr[ActiveAttr] gem.
346
346
347
347
[source,ruby]
348
348
----
@@ -370,11 +370,11 @@ Unless they have some meaning in the business domain, don't put methods in your
370
370
These methods are most likely going to be called from the view layer only, so their place is in helpers.
371
371
Keep your models for business logic and data-persistence only.
=== Keep Active Record Defaults [[keep-ar-defaults]]
376
376
377
-
Avoid altering ActiveRecord defaults (table names, primary key, etc) unless you have a very good reason (like a database that's not under your control).
377
+
Avoid altering Active Record defaults (table names, primary key, etc) unless you have a very good reason (like a database that's not under your control).
378
378
379
379
[source,ruby]
380
380
----
@@ -648,7 +648,7 @@ end
648
648
----
649
649
650
650
In order to convert this to a URL-friendly value, `parameterize` should be called on the string.
651
-
The `id` of the object needs to be at the beginning so that it can be found by the `find` method of ActiveRecord.
651
+
The `id` of the object needs to be at the beginning so that it can be found by the `find` method of Active Record.
=== `size` over `count` or `length` [[size-over-count-or-length]]
911
911
912
-
When querying ActiveRecord collections, prefer `size` (selects between count/length behavior based on whether collection is already loaded) or `length` (always loads the whole collection and counts the array elements) over `count` (always does a database query for the count).
912
+
When querying Active Record collections, prefer `size` (selects between count/length behavior based on whether collection is already loaded) or `length` (always loads the whole collection and counts the array elements) over `count` (always does a database query for the count).
913
913
914
914
[source,ruby]
915
915
----
@@ -959,7 +959,7 @@ And you'll have to consider the fact that most non-trivial apps share a database
Enforce foreign-key constraints. As of Rails 4.2, ActiveRecord supports foreign key constraints natively.
962
+
Enforce foreign-key constraints. As of Rails 4.2, Active Record supports foreign key constraints natively.
963
963
964
964
=== Change vs Up/Down [[change-vs-up-down]]
965
965
@@ -1150,7 +1150,7 @@ These texts should be moved to the locale files in the `config/locales` director
1150
1150
1151
1151
=== Translated Labels [[translated-labels]]
1152
1152
1153
-
When the labels of an ActiveRecord model need to be translated, use the `activerecord` scope:
1153
+
When the labels of an Active Record model need to be translated, use the `activerecord` scope:
1154
1154
1155
1155
----
1156
1156
en:
@@ -1167,7 +1167,7 @@ These translations of the attributes will be used as labels in the views.
1167
1167
1168
1168
=== Organize Locale Files [[organize-locale-files]]
1169
1169
1170
-
Separate the texts used in the views from translations of ActiveRecord attributes.
1170
+
Separate the texts used in the views from translations of Active Record attributes.
1171
1171
Place the locale files for the models in a folder `locales/models` and the texts used in the views in folder `locales/views`.
1172
1172
1173
1173
When organization of the locale files is done with additional directories, these directories must be described in the `application.rb` file in order to be loaded.
0 commit comments