Re: [Rails-core] Adding the ability to show causes in the DebugExceptions view

2018-03-08 Thread Rafael Mendonça França
Looks good to me. Please open a pr
On Thu, Mar 8, 2018 at 10:20 PM  wrote:

> Hi all,
>
> The Exception#cause
> 
> method has been added to Ruby 2.1.0 back in 2013. Since then Rails has
> adopted it to replace the #original_exception method in a few classes
> such as the ActiveSupport::Rescuable, and I believe we could take a step
> further to help debug an app in development. One low-hanging fruit that I
> see is to add the ability to show causes in the DebugExceptions view. I
> have made a proof-of-concept implementation to see if it could be really
> useful. Here is a screenshot of what it looks like:
>
>
> 
>
> The code could be found here:
> https://github.com/rails/rails/compare/master...yuki24:show-cause-on-debug-view
>
> Of course, there is going to be more things to take care of, such as
> implementing more frontend features and updating how a TemplateError (which
> already uses #cause) could be shown, but I wanted to get feedback
> (especially on the visual aspect of the PoC) before I invest more time in
> it.
>
> Let me know what you all think.
>
> Thanks,
> Yuki
>
> --
> 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.
>

-- 
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] [Feature][ActiveRecord] Callbacks for `reload`

2018-03-08 Thread Tom Prats
I think it'd be helpful to have callbacks for `reload` so that it'd be 
possible to clear or fetch data from external sources. If you're getting 
fresh data from the database, there's a high chance you might want to clear 
out or manipulate other data associated with your model.

Does anyone else think it would be useful?

Thanks,
Tom

-- 
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] Adding more "did you mean?" suggestions

2018-03-08 Thread yk . nishijima
Hi all,

Disclaimer: I'm the creator of the did_you_mean gem

Now that the development of Rails 6.0 has begun and support for older 
Rubies will be dropped, I think it is time to adopt the did_you_mean gem to 
take Rails' DX up to the next level. Rails already shows task name 
suggestions when a rails g ... command cannot find a task, but there are 
more situations where we could take advantage of it. For example, you will 
see potential messages that could be more helpful if you look up the usages 
of "perhaps" by grep perhaps or ag perhaps.

DidYouMean's spell checker is easy to use. Here are two real-world examples 
of how rake and fastlane use it:

   - https://github.com/ruby/rake/pull/221/files
   - 
   
https://github.com/fastlane/fastlane/blob/94f0d282/fastlane/lib/fastlane/documentation/actions_list.rb#L91-L98
   
Let me know what you all think.

Thanks,
Yuki

-- 
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] Adding the ability to show causes in the DebugExceptions view

2018-03-08 Thread yk . nishijima
Hi all,

The Exception#cause 
 method 
has been added to Ruby 2.1.0 back in 2013. Since then Rails has adopted it 
to replace the #original_exception method in a few classes such as the 
ActiveSupport::Rescuable, and I believe we could take a step further to 
help debug an app in development. One low-hanging fruit that I see is to 
add the ability to show causes in the DebugExceptions view. I have made a 
proof-of-concept implementation to see if it could be really useful. Here 
is a screenshot of what it looks like:



The code could be found 
here: 
https://github.com/rails/rails/compare/master...yuki24:show-cause-on-debug-view

Of course, there is going to be more things to take care of, such as 
implementing more frontend features and updating how a TemplateError (which 
already uses #cause) could be shown, but I wanted to get feedback 
(especially on the visual aspect of the PoC) before I invest more time in 
it.

Let me know what you all think.

Thanks,
Yuki

-- 
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: There should be an UUID class (feature proposal)

2018-03-08 Thread Sebastian Skałacki
One reason is space.  A string representation of UUID is 36 characters long 
(with dashes), and the number it represents is 16 bytes long.  Obviously, 
it's very unlikely that one would run out of disk space on your database 
server because of that.  However UUID columns are often indexed, they can 
even serve as table's primary key.  And for indexes, size matters.  The 
bigger portion of index you can keep in memory, the better it performs.

Another reason is database-agnosticism.  One can use the uuid type in 
config/schema.rb, but then this file won't work with other databases than 
PostgreSQL.  I see no good reason for that.

-- 
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.