Skip to content

Commit

Permalink
Updated documentation to specify how Attachment types are specified a…
Browse files Browse the repository at this point in the history
…nd removed plugin.groovy.
  • Loading branch information
neilabdev committed May 25, 2021
1 parent f3e9216 commit 4261c28
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,38 @@ Add The Following to your `build.gradle`:

```groovy
dependencies {
compile ':remora:1.0.1'
compile ':remora:1.0.2'
}
```

Optionally Add default mappings to `application.groovy`:

```groovy
import com.neilab.plugins.remora.Attachment
import com.neilab.plugins.remora.AttachmentUserType
grails.gorm.default.mapping = {
"user-type" type: AttachmentUserType, class: Attachment
}
```

Without which you must specify the type in your domain:

```groovy
class User {
Attachment photo
static remora = [
photo: [
styles: [
thumb: [width: 50, height: 50, mode: 'fit'],
medium: [width: 250, height: 250, mode: 'scale']
]
]
]
static mapping = {
photo type: AttachmentUserType // Type must be specified here.
}
}
```

Expand Down
6 changes: 0 additions & 6 deletions grails-app/conf/plugin.groovy

This file was deleted.

0 comments on commit 4261c28

Please sign in to comment.