Re: [Rails-core] Reducing ActionCable dependencies?

2016-01-05 Thread Rafael Mendonça França
Mike, the Rails core already agreed that this would be the best direction but nobody yet had time to work on this. If you want to work on this it would be awesome. Let us know if you need something from our side. If you want to discuss I can invite you to our private Basecamp project. On Tue,

Re: [Rails-core] Pessimistic Locking

2016-01-05 Thread alexander . maznev
>From my understanding serializable can have a noticeable effect on performance because of large transactions which can be partially processed before being aborted (vs. row locking at the start of the transaction) - of course for one specific case I think both would be fine - but more generally

[Rails-core] Reducing ActionCable dependencies?

2016-01-05 Thread Mike Perham
I've noticed that Rails's gem dependency count has gone from 34 in 4.2.4 to 55 in 5.0.beta1. I think much of this is due to pulling in all of Celluloid and EventMachine via ActionCable. I'd be interesting in working to minimize this footprint, perhaps by using concurrent-ruby's thread pools r

Re: [Rails-core] Use refinements for ActiveSupport in Rails 6?

2016-01-05 Thread Xavier Noria
On Tue, Jan 5, 2016 at 10:10 PM, Matt Jones wrote: Based on > https://github.com/ruby/ruby/blob/v2_1_0/doc/syntax/refinements.rdoc , > there does not appear to be a way for a `require`d file to trigger `using` > in the parent file: > Right now, each file in Rails core is responsible for loading

Re: [Rails-core] Use refinements for ActiveSupport in Rails 6?

2016-01-05 Thread Matt Jones
> On Jan 1, 2016, at 10:31 AM, Xavier Noria wrote: > > Let me give you some context and some initial thoughts. > > > Context > > In general, Rails makes extensive use of class reopening. > > For some time loading AS was all or nothing, but some years ago there was an > effort to separate mo

Re: [Rails-core] Pessimistic Locking

2016-01-05 Thread Ufuk Kayserilioglu
Since you are already working with transactions and since serializable transactions alone solve your example problem, I guess you can use the built-in support for specifying an isolation level for transactions that exists since Rails 4 [1]. Do you still need any extra pessimistic locking given t

Re: [Rails-core] Bulk INSERTs in Active Record

2016-01-05 Thread Nick Rogers
I use the active_record_import gem. https://github.com/zdennis/activerecord-import https://github.com/zdennis/activerecord-import/wiki It works well and is fairly mature and still maintained. I don't believe it implements COPY, as that tend to be very DBMS-specific in syntax, but the way it opt

[Rails-core] Need help with my Duration-related pull requests

2016-01-05 Thread Andrey Novikov
Hello to everyone in core team and thank you for your hard work in Rails! I have some pull requests related to ActiveSupport::Duration class. They are pretty aged and mostly finished and I'm waiting for feedback to completely finish them. 1. #22806 — Change 1.week to create 1 week durations

Re: [Rails-core] Pessimistic Locking

2016-01-05 Thread Al Tenhundfeld
Not sure what you mean about Rails "not supporting real database foreign keys". 1) They are officially supported (as of Rails 4.2, I think) and documented in the RailsGuides. 2) It's always been easy to add support via gem

Re: [Rails-core] Bulk INSERTs in Active Record

2016-01-05 Thread Geoffrey Roguelon
Hi, If you are looking for performance, you should use the database interface directly like COPY for simple case like text, CSV or I think JSON. Furthermore, you are talking to use a gem for this feature but I discovered that gem https://github.com/jamis/bulk_insert which provides the bulk impo

Re: [Rails-core] Bulk INSERTs in Active Record

2016-01-05 Thread Nicolas Cavigneaux
Le 5 janv. 2016 à 15:23, Andrew Kaspick a écrit : > Sounds useful, but likely a better fit for a standalone gem... at least to > start. Sound useful to me too but I agree it should be a gem. -- Nicolas Cavigneaux www.bounga.org www.cavigneaux.net -- You received this message because you

Re: [Rails-core] Bulk INSERTs in Active Record

2016-01-05 Thread Andrew Kaspick
Sounds useful, but likely a better fit for a standalone gem... at least to start. On Tue, Jan 5, 2016 at 9:20 AM, Andrey Novikov wrote: > Hi Greg. > > I am interested in bulk inserts as active Rails user. > > The use cases for that are somewhat rare, but when you need for example > import some

Re: [Rails-core] Bulk INSERTs in Active Record

2016-01-05 Thread Andrey Novikov
Hi Greg. I am interested in bulk inserts as active Rails user. The use cases for that are somewhat rare, but when you need for example import some dictionary from 15 GB XML file to your DB, that will take literally days to complete, and one of the bottlenecks (except XML parsing) will be a lot

Re: [Rails-core] Pessimistic Locking

2016-01-05 Thread alexander . maznev
Here is one example from production - an order has a fulfillment - the fulfillment can be deleted if it is not 'shipped', very roughly: # update transaction do fulfillment.status = 'shipped' fulfillment.save! StockMovement.new(fulfillment).save end # delete transaction do fulfillment.

Re: [Rails-core] Bulk INSERTs in Active Record

2016-01-05 Thread Greg Navis
Hey! I'd love to receive some feedback and guidance. The most important thing for me is: is this something we'd like to have in Active Record? If so, I'd be able to start working on this next week. If not, I'd love to contribute in another way. Best regards -- Greg Navis On Fri, Dec 11, 2015 at