[Rails-core] Re: Ruby 2.7 beginless ranges in where ActiveRecord::QueryMethods#where hash condition.

2020-03-22 Thread Kasper Timm Hansen
Thanks Max, you don't have to both open an issue https://github.com/rails/rails/issues/38777 and start a thread on here. This is in master, scheduled for Rails 6.1, currently. fredag den 20. marts 2020 kl. 20.00.51 UTC+1 skrev Max Calabrese: > > When you use Ruby 2.7.0's new beginless range

Re: [Rails-core] [Proposal] Add additional in-project directory to load custom Rails Command within the app

2020-01-14 Thread Kasper Timm Hansen
Hey Prem, The Rails command infrastructure is still private and I don’t like the current internal API that much. Don’t feel good exposing that. There’s also no way to mark command dependencies yet. Now I did write the initial infrastructure 3-4 years ago for Rails 5.0, so it’s been some time

Re: [Rails-core] Should deprecated (still active) behavior be documented?

2019-12-18 Thread Kasper Timm Hansen
This sounds very abstract yet specific to cases you’ve seen. Where have you found documentation to be missing, rejected or prematurely removed? -- Kasper > On 18 Dec 2019, at 18.54, Jared Beck wrote: > > Hello rails friends, > > I'd like to propose that all documentation contributions for

Re: [Rails-core] [Feature] [ActionPack] Proposal to support column filter for rails routes output on CLI

2019-12-12 Thread Kasper Timm Hansen
We added —expanded to help with the longer lines. You’d have to scroll more, but with a tighter grep I think it could work. -- Kasper > On 9 Dec 2019, at 07.20, Tushar Maroo wrote: > > Hi Again, > > What do you guys think? If all are okay then let me know I will work on a PR. > > Thanks &

Re: [Rails-core] Re: [Feature][ActiveRecord] Finding Orphans

2018-12-13 Thread Kasper Timm Hansen
Once you’re getting down to specific code choices, it’s better in a PR. So feel free to submit one  You also don’t have to get everything right up front as long as you help guide reviewers. For instance, it's fine to submit a piecemeal PR, just describe what you intend to defer for your

Re: [Rails-core] Re: [Feature][ActiveRecord] Find records with present attribute value more easily

2018-12-06 Thread Kasper Timm Hansen
I don’t think these examples have much sway and the problem itself seems sufficiently solved by `where.not(name: nil)` to me. It’s clearer and does map nicely onto the resulting SQL. Yes, sometimes Rails does relish syntactic sugar but that’s when it aids clarity. PS. `having` is already

Re: [Rails-core] [Feature][ActiveStorage] Pre-defined Variants

2018-11-27 Thread Kasper Timm Hansen
I do remember proposing this at one point internally: has_one_attached :avatar do |attachable| attachable.variant :small, resize: ’100x100>’ … end I’m also fine with exposing it as `variant(:small)` or for one offs `variant(:small, caption: ’foo’)`. I’m not looking to see this through

Re: [Rails-core] [Feature] secrets.yml/credentials.yml.enc automatically in .gitignore

2018-07-02 Thread Kasper Timm Hansen
Hey Jennifer, Welcome! That confusing aspect of secrets.yml is exactly why we added credentials. See the motivation up top here: https://github.com/rails/rails/pull/30067 > Den 19. apr. 2018 kl. 05.52 skrev Jennifer Parsons > : > > Hi all, > > I'm new so please forgive me if this has been

Re: [Rails-core] [Feature][ActiveRecord::Enum] Enum maps values to string in the database without hash.

2018-06-21 Thread Kasper Timm Hansen
I’m +1 as I’ve wanted this in the past. I think enum actually did support this but it was never documented (e.g. private API). But I remember something about others having objections to supporting string columns. Perhaps Rafael or Sean? > Den 20. jun. 2018 kl. 22.08 skrev Alberto Almagro : > >

Re: [Rails-core] ActiveJob custom `retry_on` logic fails with `NoMethodError: undefined method 'cause' for SomeError:Class`

2018-04-02 Thread Kasper Timm Hansen
Little late for an April fools there, Aaron  I guess we both should learn to check the master branch  > Den 2. apr. 2018 kl. 19.28 skrev Aaron Kromer : > > Looks like this is already in Rail 5.2. It was fixed on master back in Oct. > 2017 in

Re: [Rails-core] ActiveJob custom `retry_on` logic fails with `NoMethodError: undefined method 'cause' for SomeError:Class`

2018-04-02 Thread Kasper Timm Hansen
Hey, nice catch! Think we should raise the `error` instead of the `exception` here: https://github.com/rails/rails/pull/25991/commits/9d8d4ee05e08b928dbb25bb14e49ea28f30d14c6#diff-59beb0189c8c6bc862edf7fdb84ff5a7R50

Re: [Rails-core] Magic number in tests

2018-01-09 Thread Kasper Timm Hansen
; On Tue, Jan 9, 2018 at 11:37 AM, Kasper Timm Hansen <kas...@gmail.com > <mailto:kas...@gmail.com>> wrote: > I’m -1 on changing that. I think the constant 72 is used directly such that > tests will fail if anybody changes MAX_PASSWORD_LENGTH_ALLOWED. > > With your ch

Re: [Rails-core] Magic number in tests

2018-01-09 Thread Kasper Timm Hansen
I’m -1 on changing that. I think the constant 72 is used directly such that tests will fail if anybody changes MAX_PASSWORD_LENGTH_ALLOWED. With your change in, a later change to MAX_PASSWORD_LENGTH_ALLOWED by some other contributor wouldn’t make any tests fail. Since that constant isn’t meant

Re: [Rails-core] [Feature request] [ActiveRecord] Automatically create scopes for models boolean attributes

2018-01-04 Thread Kasper Timm Hansen
I don’t think we’d like to autogenerate scopes for your models based on the column type, no. You might want to look into using an enum backed by an integer ”status” column instead of the boolean column. That generates a scope as

Re: [Rails-core] [Feature proposal] Enumerable#group_by should take a second block to allow setting the value

2017-12-06 Thread Kasper Timm Hansen
I think we’ll stick with `posts.group_by(&:id).transform_values { |v| v.title.uppercase }` — and it’s not because we don’t `value_fun`!  > Den 5. dec. 2017 kl. 01.48 skrev David Carlin : > > Elixir has a great feature in its Enumerable,group_by/3 function where

Re: [Rails-core] [Feature request] Automatically create GitHub release notes during release process

2017-12-06 Thread Kasper Timm Hansen
Always happy to see a PR  Bear in mind our foremost responsibility is to Rails users and not automated dependency bots. So your PR's success would depend on how much of a benefit you can demonstrate Rails users (or the Rails team) will have from GitHub release notes. For starters, when you

[Rails-core] Rails 5.1.3 released

2017-08-03 Thread Kasper Timm Hansen
Hi everyone, I am happy to announce that Rails 5.1.3 has been released. ## CHANGES since 5.1.2 To view the changes for each gem, please read the changelogs on GitHub: * [Action Cable CHANGELOG](https://github.com/rails/rails/blob/v5.1.3/actioncable/CHANGELOG.md) * [Action Mailer

[Rails-core] Rails 5.0.5 and 5.1.3.rc3 released

2017-07-31 Thread Kasper Timm Hansen
Hi everyone, I am happy to announce that Rails 5.0.5 and 5.1.3.rc3 have been released. If no regressions are found for 5.1.3.rc3, expect the final release on Thursday, August 3, 2017. If you find one, please open an [issue on GitHub](https://github.com/rails/rails/issues/new) and mention me

[Rails-core] Rails 5.0.5.rc2 and 5.1.3.rc2 released

2017-07-25 Thread Kasper Timm Hansen
Hi everyone, I am happy to announce that Rails 5.0.5.rc2 and 5.1.3.rc2 have been released. If no regressions are found, expect the final release on Monday, July 31, 2017. If you find one, please open an [issue on GitHub](https://github.com/rails/rails/issues/new) and mention me

[Rails-core] Rails 5.1.3.rc1 and 5.0.5.rc1 released

2017-07-19 Thread Kasper Timm Hansen
Hi everyone, I am happy to announce that Rails 5.1.3.rc1 and 5.0.5.rc1 have been released. If no regressions are found, expect the final releases Monday, July 24, 2017. If you find one, please open an [issue on GitHub](https://github.com/rails/rails/issues/new) and mention me (@kaspth) on it,

Re: [Rails-core] [Feature Idea] Adding a Generator for Thor Commands

2017-04-19 Thread Kasper Timm Hansen
Pull requests are made to get feedback, so if you’ve got the code why not just open one? :D Feel free to use "r? @kaspth" to assign it to me. > Den 14. apr. 2017 kl. 23.56 skrev Joshua Klina : > > Hi Kasper, > > I started diving into this and added a way to

Re: [Rails-core] [Feature Idea] Adding a Generator for Thor Commands

2017-04-10 Thread Kasper Timm Hansen
Happy to hear it! > Den 10. apr. 2017 kl. 20.14 skrev Joshua Klina : > > Thanks for the roadmap! I'll go ahead and see if I can start chipping away at > this! > > Cheers, > Josh > > On Thursday, April 6, 2017 at 6:39:40 PM UTC-6, Joshua Klina wrote: > While Rails has

Re: [Rails-core] [Feature Idea] Adding a Generator for Thor Commands

2017-04-09 Thread Kasper Timm Hansen
Great blog post!  I think the answer you’re looking for is: yet. We want apps to be able to write full fledged commands for all the reasons you mention, we just haven’t finished it up… yet. That’s why there’s no documentation and the reason for the rough edge you mention at the end of your

Re: [Rails-core] Collection caching: render to strings

2017-03-21 Thread Kasper Timm Hansen
iew/lib/action_view/renderer/partial_renderer.rb#L326> > Den 20. mar. 2017 kl. 21.44 skrev Gleb Mazovetskiy <glex@gmail.com>: > > No, a collection cache render returns a single string. > > > On Mon, 20 Mar 2017, 19:15 Kasper Timm Hansen, <kas...@gmail.com > <

Re: [Rails-core] Proposal: Multiple Validation Contexts

2015-09-30 Thread Kasper Timm Hansen
Already on master: https://github.com/rails/rails/pull/21069. Reported in This Week in Rails here: https://rails-weekly.ongoodbits.com/2015/09/11/performance-mysql-prepared-statements-and-more ;) > Den 29. sep. 2015 kl. 20.17 skrev Nam Chu Hoai : > > Hey all, > >