Skip to content

Commit

Permalink
[#133] Fix that we were trying use regex to match ID as single digit …
Browse files Browse the repository at this point in the history
…and this did not work for more than 10 files in id
  • Loading branch information
vipulnsward committed Mar 24, 2024
1 parent ca2192e commit 63d83c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ The helper is detecting the value of the `multiple` property based on the mount
### File and Group wrappers

When you mount either Uploadcare File or Group to an attribute, this attribute is getting wrapped with
a Uploadcare object. This feature adds some usefull methods to the attribute.
a Uploadcare object. This feature adds some useful methods to the attribute.

#### Uploadcare File

Expand All @@ -300,7 +300,7 @@ class Post < ApplicationRecord
end
```

And then you create a new Post object specifying a CDN-url for your prevously uploaded Uploadcare file:
And then you create a new Post object specifying a CDN-url for your previously uploaded Uploadcare file:

```console
$ post = Post.create(picture: "https://ucarecdn.com/2d33999d-c74a-4ff9-99ea-abc23496b052/")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module ActiveRecord
module MountUploadcareFileGroup
extend ActiveSupport::Concern

GROUP_ID_REGEX = /\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b~\d/.freeze
GROUP_ID_REGEX = /\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b~\d+/.freeze

def build_uploadcare_file_group(attribute)
cdn_url = attributes[attribute.to_s].to_s
Expand Down

0 comments on commit 63d83c9

Please sign in to comment.