Skip to content
Browse files

Fix spelling mistakes and english in new pitfalls docs

  • Loading branch information...
1 parent 74505cb commit 95018988c766daa3fb8d99e89b84bd4561af0076 @dkubb dkubb committed Apr 1, 2012
Showing with 7 additions and 10 deletions.
  1. +7 −10 docs/pitfalls.md
View
17 docs/pitfalls.md
@@ -1,6 +1,6 @@
---
layout: default
-title: Commom Pitfalls
+title: Common Pitfalls
body_id: docs
created_at: Sun Apr 01 21:13:13 -0700 2012
---
@@ -14,32 +14,29 @@ encounter, along with work-arounds or solutions if possible.
Implicit String property length
-------------------------------
-When declaring a String property, DataMapper will add an implicit length of 50
-characters if nothing is explicitly declared.
+When declaring a String property, DataMapper will add an implicit limit of 50
+characters if no limit is explicitly declared.
For example, the two class declarations have identical behaviour:
-
{% highlight ruby linenos %}
# with an implicit length
class Post
include DataMapper::Resource
property :title, String
end
-{% endhighlight %}
-{% highlight ruby linenos %}
# with an explicit length
class Post
include DataMapper::Resource
property :title, String, :length => 50
end
{% endhighlight %}
-
The reason for this default is that DataMapper needs to know the underlying
column constraints in order to add validations from the property definitions.
Databases will often choose their own arbitrary length constraints if one is not
-declared (often 255 chars). We choose something a bit more restricted as a
-default because we wanted to encourage peolpe to declare it explicitly in their
-model, rather than relying on DM or the DB choosing an implicit limit.
+declared (often defaulting to 255 chars). We choose something a bit more
+restrictive as a default because we wanted to encourage peolpe to declare
+it explicitly in their model, rather than relying on DM or the DB choosing
+an arbitrary limit.

0 comments on commit 9501898

Please sign in to comment.
Something went wrong with that request. Please try again.