Skip to content
This repository was archived by the owner on Apr 17, 2018. It is now read-only.

Commit 9501898

Browse files
committed
Fix spelling mistakes and english in new pitfalls docs
1 parent 74505cb commit 9501898

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

docs/pitfalls.md

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
layout: default
3-
title: Commom Pitfalls
3+
title: Common Pitfalls
44
body_id: docs
55
created_at: Sun Apr 01 21:13:13 -0700 2012
66
---
@@ -14,32 +14,29 @@ encounter, along with work-arounds or solutions if possible.
1414
Implicit String property length
1515
-------------------------------
1616

17-
When declaring a String property, DataMapper will add an implicit length of 50
18-
characters if nothing is explicitly declared.
17+
When declaring a String property, DataMapper will add an implicit limit of 50
18+
characters if no limit is explicitly declared.
1919

2020
For example, the two class declarations have identical behaviour:
21-
2221
{% highlight ruby linenos %}
2322
# with an implicit length
2423
class Post
2524
include DataMapper::Resource
2625

2726
property :title, String
2827
end
29-
{% endhighlight %}
3028

31-
{% highlight ruby linenos %}
3229
# with an explicit length
3330
class Post
3431
include DataMapper::Resource
3532

3633
property :title, String, :length => 50
3734
end
3835
{% endhighlight %}
39-
4036
The reason for this default is that DataMapper needs to know the underlying
4137
column constraints in order to add validations from the property definitions.
4238
Databases will often choose their own arbitrary length constraints if one is not
43-
declared (often 255 chars). We choose something a bit more restricted as a
44-
default because we wanted to encourage peolpe to declare it explicitly in their
45-
model, rather than relying on DM or the DB choosing an implicit limit.
39+
declared (often defaulting to 255 chars). We choose something a bit more
40+
restrictive as a default because we wanted to encourage peolpe to declare
41+
it explicitly in their model, rather than relying on DM or the DB choosing
42+
an arbitrary limit.

0 commit comments

Comments
 (0)