@@ -248,15 +248,15 @@ create a custom validator file.
248
248
249
249
* All custom validators should be moved to a shared gem.
250
250
* Use named scopes freely.
251
- * When a named scope defined with a lambda and parameters, becomes too
251
+ * When a named scope defined with a lambda and parameters becomes too
252
252
complicated, it is preferable to make a class method instead which serves
253
- the same purpose of the named scope and returns and
253
+ the same purpose of the named scope and returns an
254
254
` ActiveRecord::Relation` object.
255
255
* Beware of the behavior of the ` update_attribute` method. It doesn' t
256
256
run the model validations (unlike `update_attributes`) and could easily corrupt the model state.
257
257
* Use user-friendly URLs. Show some descriptive attribute of the model in the URL rather than its `id`.
258
258
There is more than one way to achieve this:
259
- * Override the `to_param` method of the model. This method is used by Rails for constructing an URL to the object.
259
+ * Override the `to_param` method of the model. This method is used by Rails for constructing a URL to the object.
260
260
The default implementation returns the `id` of the record as a String. It could be overridden to include another
261
261
human-readable attribute.
262
262
@@ -268,7 +268,7 @@ There is more than one way to achieve this:
268
268
end
269
269
```
270
270
In order to convert this to a URL-friendly value, `parameterize` should be called on the string. The `id` of the
271
- object needs to be at the beginning so that it could be found by the `find` method of ActiveRecord.
271
+ object needs to be at the beginning so that it can be found by the `find` method of ActiveRecord.
272
272
273
273
* Use the `friendly_id` gem. It allows creation of human-readable URLs by using some descriptive attribute of the model instead of its `id`.
274
274
0 commit comments