Skip to content

Commit

Permalink
update cloning docs to accurately reflect that asset associations wil…
Browse files Browse the repository at this point in the history
…l be cloned
  • Loading branch information
Jason Fine committed Mar 12, 2024
1 parent 16d65c3 commit 0424e60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ spec/dummy/public/uploads/*

/vendor
docker-compose.override.yml
.env
.env
mysql
node_modules
6 changes: 2 additions & 4 deletions docs/features/cloning.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ That's all for basic set-up.

If you want complete control over which attributes and associations are cloned, we wouldn't call you a control freak. We've baked in some nice simple methods to make this possible.

**Note:** Asset cloning is not currently supported, so if you try to pass in those associations, cloning will fail.
**Note:** Asset cloning is supported.

## Whitelisting Attributes

Expand All @@ -69,13 +69,11 @@ end

Belongs_to associations are automatically copied over, unless you are whitelisting attributes and forget to/ purposely don't add it there. For the rest of the associations you may have (i.e. has_one, has_many, has_and_belongs_to_many, has_many_through), you may use the `associations_for_cloning` method by passing in array of symbols.

**Note:** Any images or files you have will **not** be copied along, if you have included those relationships.

**Example**

```ruby
def associations_for_cloning
[:aromas, :events]
[:aromas, :events, :bottle_shot_image]
end
```

Expand Down

0 comments on commit 0424e60

Please sign in to comment.