ActiveStorage validations

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

ActiveStorage validations

Tobias Sandelius
I can't find any docs about attachment validations. Are there any? If not, will it be added?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/dac58df5-4928-4451-9f31-91beca259fec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: ActiveStorage validations

Hassan Schroeder-2
On Fri, Sep 1, 2017 at 11:09 AM, Tobias Sandelius <[hidden email]> wrote:
> I can't find any docs about attachment validations. Are there any? If not,
> will it be added?

Given that the Rails guide

  http://guides.rubyonrails.org/form_helpers.html#uploading-files

references external (non-rails) gems for managing uploaded files
I'd guess the answer to both those is no :-)

Seems like a worthwhile gem idea, though.

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yBQu6TtLC5Kx9ZPuP%2BJ6OV1bh3%3DKD3E9p5XzMSgmvJF-A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: ActiveStorage validations

Tobias Sandelius
The new ActiveStorage framework in Rails 5.2 provide just that, I just cant find anything about validating them.

Den lördag 2 september 2017 kl. 00:15:59 UTC+2 skrev Hassan Schroeder:
On Fri, Sep 1, 2017 at 11:09 AM, Tobias Sandelius <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="xkkw60QcAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">tob...@...> wrote:
> I can't find any docs about attachment validations. Are there any? If not,
> will it be added?

Given that the Rails guide

  <a href="http://guides.rubyonrails.org/form_helpers.html#uploading-files" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fguides.rubyonrails.org%2Fform_helpers.html%23uploading-files\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG3fd5qFikESpr-92LauRcf1jAU-w&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fguides.rubyonrails.org%2Fform_helpers.html%23uploading-files\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG3fd5qFikESpr-92LauRcf1jAU-w&#39;;return true;">http://guides.rubyonrails.org/form_helpers.html#uploading-files

references external (non-rails) gems for managing uploaded files
I'd guess the answer to both those is no :-)

Seems like a worthwhile gem idea, though.

--
Hassan Schroeder ------------------------ <a href="javascript:" target="_blank" gdf-obfuscated-mailto="xkkw60QcAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">hassan.s...@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7c95c1f0-d87d-4a04-9eca-c30d0d0edd59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: ActiveStorage validations

Carlos Ramirez
In reply to this post by Tobias Sandelius
The initial release of Active Storage (as part of Rails 5.2) did not include the ability to validate attachments

Validations are intended to be a part of the Rails 6 release. Work to support this has already begun

In the meantime, if you need validations for Active Storage attachments right now, you can roll your own using custom validators. I have written a few blog posts on the subject that you might find helpful:
Hope that helps!

On Friday, September 1, 2017 at 5:09:37 PM UTC-4, Tobias Sandelius wrote:
I can't find any docs about attachment validations. Are there any? If not, will it be added?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5d3f3686-c515-40d9-acb1-c60fb8d9e62f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.