Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update Readme

  • Loading branch information...
commit 485d8a0973f68a9f9919140cc8cdbd2df7074a52 1 parent 36d7047
@jgaskins authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 README.md
View
7 README.md
@@ -106,20 +106,21 @@ class UserMapper < Perpetuity::Mapper
end
class ArticleMapper < Perpetuity::Mapper
- attribute :author
+ attribute :author, User
end
```
This allows you to write the following:
```ruby
-article = Article.first
+article = ArticleMapper.first
+ArticleMapper.load_association! article, :author
user = article.author # Lazy-loaded
```
## Customizing persistence
-Setting the ID of a record to a custom value (rather than using the DB default)
+Setting the ID of a record to a custom value rather than using the DB default. *Note: This doesn't work yet.*
```ruby
class ArticleMapper < Perpetuity::Mapper
Please sign in to comment.
Something went wrong with that request. Please try again.