Skip to content

Commit c0edf66

Browse files
authored
Merge pull request #253 from koic/use_proper_names_of_rails_compornents
Use proper names of Rails compornents
2 parents 4c7b11d + 6386f77 commit c0edf66

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

README.adoc

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ end
164164

165165
=== Nested Routes [[nested-routes]]
166166

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.
168168

169169
[source,ruby]
170170
----
@@ -334,15 +334,15 @@ render status: :forbidden
334334

335335
=== Model Classes [[model-classes]]
336336

337-
Introduce non-ActiveRecord model classes freely.
337+
Introduce non-Active Record model classes freely.
338338

339339
=== Meaningful Model Names [[meaningful-model-names]]
340340

341341
Name the models with meaningful (but short) names without abbreviations.
342342

343343
=== ActiveAttr Gem [[activeattr-gem]]
344344

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.
346346

347347
[source,ruby]
348348
----
@@ -370,11 +370,11 @@ Unless they have some meaning in the business domain, don't put methods in your
370370
These methods are most likely going to be called from the view layer only, so their place is in helpers.
371371
Keep your models for business logic and data-persistence only.
372372

373-
== Models: ActiveRecord [[activerecord]]
373+
== Models: Active Record [[activerecord]]
374374

375-
=== Keep ActiveRecord Defaults [[keep-ar-defaults]]
375+
=== Keep Active Record Defaults [[keep-ar-defaults]]
376376

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).
378378

379379
[source,ruby]
380380
----
@@ -648,7 +648,7 @@ end
648648
----
649649

650650
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.
652652

653653
==== `friendly_id` Gem
654654

@@ -766,7 +766,7 @@ else
766766
end
767767
----
768768

769-
== Models: ActiveRecord Queries [[activerecord-queries]]
769+
== Models: Active Record Queries [[activerecord-queries]]
770770

771771
=== Avoid Interpolation [[avoid-interpolation]]
772772

@@ -831,7 +831,7 @@ User.where(first_name: 'Bruce', last_name: 'Wayne').take
831831
832832
# bad
833833
User.find_by_email(email)
834-
# bad, deprecated in ActiveRecord 4.0, removed in 4.1+
834+
# bad, deprecated in Active Record 4.0, removed in 4.1+
835835
User.find_by_first_name_and_last_name('Bruce', 'Wayne')
836836
837837
# good
@@ -909,7 +909,7 @@ SELECT\n users.id, accounts.plan\n FROM\n users\n INNER JOIN\n acount
909909

910910
=== `size` over `count` or `length` [[size-over-count-or-length]]
911911

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).
913913

914914
[source,ruby]
915915
----
@@ -959,7 +959,7 @@ And you'll have to consider the fact that most non-trivial apps share a database
959959

960960
=== Foreign Key Constraints [[foreign-key-constraints]]
961961

962-
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.
963963

964964
=== Change vs Up/Down [[change-vs-up-down]]
965965

@@ -1150,7 +1150,7 @@ These texts should be moved to the locale files in the `config/locales` director
11501150

11511151
=== Translated Labels [[translated-labels]]
11521152

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:
11541154

11551155
----
11561156
en:
@@ -1167,7 +1167,7 @@ These translations of the attributes will be used as labels in the views.
11671167

11681168
=== Organize Locale Files [[organize-locale-files]]
11691169

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.
11711171
Place the locale files for the models in a folder `locales/models` and the texts used in the views in folder `locales/views`.
11721172

11731173
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.
@@ -1357,7 +1357,7 @@ obj.try! :fly
13571357
obj&.fly
13581358
----
13591359

1360-
=== ActiveSupport Aliases [[active_support_aliases]]
1360+
=== Active Support Aliases [[active_support_aliases]]
13611361

13621362
Prefer Ruby's Standard Library methods over `ActiveSupport` aliases.
13631363

@@ -1372,9 +1372,9 @@ Prefer Ruby's Standard Library methods over `ActiveSupport` aliases.
13721372
'the day'.end_with? 'ay'
13731373
----
13741374

1375-
=== ActiveSupport Extensions [[active_support_extensions]]
1375+
=== Active Support Extensions [[active_support_extensions]]
13761376

1377-
Prefer Ruby's Standard Library over uncommon ActiveSupport extensions.
1377+
Prefer Ruby's Standard Library over uncommon Active Support extensions.
13781378

13791379
[source,ruby]
13801380
----
@@ -1391,7 +1391,7 @@ Prefer Ruby's Standard Library over uncommon ActiveSupport extensions.
13911391

13921392
=== `inquiry` [[inquiry]]
13931393

1394-
Prefer Ruby's comparison operators over ActiveSupport's `Array#inquiry`, and `String#inquiry`.
1394+
Prefer Ruby's comparison operators over Active Support's `Array#inquiry`, and `String#inquiry`.
13951395

13961396
[source,ruby]
13971397
----

0 commit comments

Comments
 (0)