[Rails-core] Re: Bump minimum SQLite version to 3.8 for Rails 6

2018-05-23 Thread Yasuo Honda
This proposal has been implemented for Rails 6 by this pull request 
https://github.com/rails/rails/pull/32923 

Thanks,
--
Yasuo Honda

On Thursday, May 17, 2018 at 8:35:33 PM UTC+9, Yasuo Honda wrote:
>
> Hi, 
>
> I'd like to propose that Rails 6 requires SQLite 3.8 or higher. 
>
> These OS versions have SQLite 3.8 or higher by default. 
>
> - macOS 10.10 (Yosemite) or higher 
> - Ubuntu 14.04 LTS or higher 
>
> There was a similar discussion for Rails 5 two years ago, yes I 
> requested that one. 
> https://groups.google.com/forum/#!topic/rubyonrails-core/Mm4ZN_g1RXk 
>
> Since two years passed since my previous request, Ubuntu 12.04 LTS 
> support has been dropped and newer macOS versions have been released. 
> I think it is good time to bump the minimum version of SQLite for 
> Rails 6. 
>
> Also, bumping SQLite version 3.8 will allow supporting `alter_table` 
> method for the table with foreign keys by this pull request: 
>
> "Disable foreign keys during `alter_table` for sqlite3 adapter" 
> https://github.com/rails/rails/pull/32865 
> requires SQLite 3.8 to support `defer_foreign_keys` pragma. 
>
> Please review my proposal. I am ready to open a pull request. 
>
> Thanks, 
> -- 
> Yasuo Honda 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.


[Rails-core] Re: [ActiveStorage] Feature Request: attachment validations

2018-05-23 Thread Luis Felipe Sanchez
I think this would be a great feature to have. Looking around the code I 
find that one main issue is that doing attribute assignment like 
`@record.file=attachable`
uploads the attachable to the service right away. We could make it so that 
`ActiveStorage::Attached` stores the attachable as an instance variable and 
a new method called `attach!` actually uploads the file.
Then one could validate that `file.content_type` is valid.
On Monday, April 2, 2018 at 8:36:22 AM UTC-5, Matt Yanchek wrote:
>
> Hey all, with ActiveStorage coming out very soon I am very quickly finding 
> a need for some validations for attachments before storing. Some very quick 
> validation helpers would be great for example content type and size would 
> be huge wins in protecting an application that is expecting to only allow 
> images.
>
> Just a quick example:
>
> class User < ApplicationRecord 
>   has_one_attached :avatar
>  
>   validates :avatar, attachment: { content_types: 'image/*', size: 50 }
> end
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.