Page 1 of 17 | Next »
[08:14:38] shortCircuit__: I wanted to know, that give on timezone in ZZZZ format like +0530 how to convert a Time.now to that timezone?
[10:01:56] shortCircuit__: So presently we have this csv import thing. where we are doing CSV.foreach and inserting records like Store.create(record) . I understand that this is a bad approach. A better approach is to save an array of records and then run a records.each_slice(n) and then do Store.create(sliced_array_of_record)
[10:02:39] shortCircuit__: my question is, given a csv file of say 6000-7000 or 10k lines, is it a good idea to use a variable to store the array?
[10:03:37] shortCircuit__: can the app run out of memory? if yes, then what is a better option? without using any sidekiq things.
[10:04:06] shortCircuit__: I was thinking if it was possible to read a CSV file in batches, but that is not that simple I guess
[14:04:48] shortCircuit__: I have a question, The problem I have is, I am using a sidekiq worker to lookup data from db and then push to kafka. sidekiq has a concurrency of 20 nd database has a pool size of 10. Now when I try to push say a 100 or even 5 messages from rails c. Some of the jobs are enqueued for some time and most jobs fail saying Activerecord Conncetionpool couldn't obttain connecttion in 5 seconds
[14:08:10] shortCircuit__: But when I change the synchronous delivery to asynchronous the jobs pass without gettting stuck in enqueued. So my question is, is it possible that because the kafka delivery is synchronous and some of them remain in enqueued state the database connection is not released.
[14:09:24] shortCircuit__: Linell: when I make the concurrency and database pool size same, the errors are definitly reduced. But is it the only reason?
[14:14:47] shortCircuit__: Linell: do you think that unless an enqueued worker finishes the database connection is not released?
[14:17:13] shortCircuit__: oh ok. then that might explain the issue. because most times the number of enqueued jobs is same as the database connection pool. I need to recheck this
[14:27:22] shortCircuit__: Linell: https://github.com/mperham/sidekiq/issues/2624#issuecomment-278737024 this is the best. here it says it sidekiq calls AR::Base.clear_active_connections!
[14:31:26] shortCircuit__: but when is this called? does it mean it releases the connection after the record has been fetched?
[11:00:13] shortCircuit__: Is there a way to create a httpresponse object with nil body and 503 status code
[11:06:04] shortCircuit__: Net::HTTPResponse.new("1.1", 503, "hello").body this doesn't work. says `undefined method `closed?' for nil:NilClass`
[11:06:49] shortCircuit__: saw it in the doc https://apidock.com/ruby/v2_5_5/Net/HTTPResponse/new/class
[11:36:59] shortCircuit__: phaul the problem is a little deep. I have to introduce hystrix in an existing rails project. The project uses faraday as an http client. So I wrote a middleware that wraps the faraday's http call (@app.call env). The problem is if the request fails, and it goes to fallback, I can't just return false, I need to return a, say, mock http response object that has success? and status, body etc
[15:55:16] shortCircuit__: After doing all this, end of day, after sending PR, I realized there is no easy way to see a dashboard :D
[06:22:36] shortCircuit__: I am having a problem while writing spec for a method that has a method that accepts a block.
[06:22:53] shortCircuit__: https://gist.github.com/ikouchiha47/fffdfd491a8df4212db0f1824df29762 this is the gist
[06:23:18] shortCircuit__: but if I comment out the particular lines in the code, rspec seems to run successfully
[06:27:00] shortCircuit__: I need a bit of help. Most rails applications in my organization has a code in intializer to check required ENV variables. My job is to migrate the routes. But I don't want to setup all of them and get stuck in figuring the ENV values.
[06:27:23] shortCircuit__: Is there a way to only generate the routes. without having to intervene the initializers/ files
[06:54:44] shortCircuit__: what does this build_app do https://github.com/rails/rails/blob/b5db73076914e7103466bd76bec785cbcfe88875/actionpack/test/dispatch/routing/custom_url_helpers_test.rb#L119
[09:03:34] shortCircuit__: Jruby is such a pain inducer. :( I do a java_import and in rspec every time I do a expect_any_instance of it says wrong number of arguments 0 for 1 .. and then I end up just doing a double .. but that just defeats the purpose of the test. and now I don't know wether the code will actually work
[09:11:15] shortCircuit__: what is the better way to do the test? avoiding any_instance . changing the code structure and maybe instead of intializing a class inside a method , inject it? Although that could end up into too many injections
[09:13:46] shortCircuit__: I meant a lot of paramters in the method. I actually haven't seen code like that, thats why I don't know if that like a normal thing or antipattern .
[05:05:59] shortCircuit__: I wanted to know how to implement bignum ? (not specific with any language). Bignum is treated as if it were an infinite-length bitstring with 2’s complement representation. is what the ruby docs said. but there is nothing more. :(
[06:21:22] shortCircuit__: I met matsumoto at the kerala ruby conf. he is super awesome. I asked him how did you have the perseverance to write a huge language.
[06:33:04] shortCircuit__: https://gist.github.com/argentum47/8be5227aa0f1302c3d3da1f6d61f3a1b I just copy pasted the code. don't show it to anyone. So. those lines L15 L31. these often end up failing, saying expected 1 or 2 got 2 or 3 (consequtively). but they don't fail all the time. If I re run then it generally works
[07:05:58] shortCircuit__: well I am not sure. like its not a code problem. its a setup problem. and there is not database cleaner. only config.use_transactional_fixtures = true this is there. I feel they should be in order. like if retries one time then the count should be 1 , next time should be 2
[07:13:33] shortCircuit__: login request model is simple https://gist.github.com/argentum47/8be5227aa0f1302c3d3da1f6d61f3a1b#file-login_request-rb
[07:15:42] shortCircuit__: there is no gemefile like parallel test or something. I am trying to find where that configuration is and what is it.
[07:01:56] shortCircuit__: needed to ask a question. doesn't rails escape html tags and stuff to prevent xss
[07:03:28] shortCircuit__: Radar nothing much. things in life change very fast. I have been tossed from golang to nginx and lua and then again rails .. :D
[07:06:26] shortCircuit__: having an issue where people are able to write some script tags in email. and then when a verifcation link is sent (not in gmail though) they get some html tags attached to it. I am wondering how :D
[07:11:58] shortCircuit__: I agree. But I really don;t know why. Like there are some people, people really don't get mad at. In real world I just avoid people.
[10:00:45] shortCircuit__: I am using rails-api .. so can;t use the actionview helpers sanitize method to sanitize before saving to database
[12:27:05] shortCircuit__: I have a question. in rails say, there is a file where they have defined, class Notification::EmailTemplate and there is another file where there is module Notification; class EmailUpdate < EmailTemplate; now my question is if I do `include Sanitizer` inside the former class, will rails be able to find the methods it in the later ?
[13:13:09] shortCircuit__: I have a module inside app/controllers/datacleaner.rb .. and I want to include it in app/response_formats/v1/regirstration_success.rb . like class V1:RegistrationSuccess; include ::DataCleaner wouldn't work, what is the correct way to do it. I can actually put it from app controller to lib/
[08:14:51] shortCircuit__: need some help with doing internalisation.. I am doing like this I18n.l(5.months.from_now, format: "%d %B %Y", locale: :id) .. but August is written as August .. not Augustus or whatever.. how to do this correctly
[08:15:32] shortCircuit__: also tried setting I18n.locale = :id and l(5.months.from_now, format: ...) still same
[07:42:14] shortCircuit__: I was trying to understand how rails builds associations when we write something like has_one and has_many .. I have found one intriguing thing .. Reflection and I also looked through the Association inheritance tree .. I also saw Hasone builder .. but I am not beiing able to understand what I sought in the first place
[08:19:46] shortCircuit__: the question is when I write something like class User has_many :profiles .. how dows active record work / what does it do to ensure that an user object will have a .profiles method. How role does Reflection in association.rb play?
[08:26:58] shortCircuit__: I first started here https://github.com/rails/rails/blob/master/activerecord/lib/active_record/associations.rb, and after that from associations/has_one.rb and singular_association.rb I reached https://github.com/rails/rails/blob/master/activerecord/lib/active_record/associations/builder/association.rb .. but after that I can't understand what is happening
[11:03:42] shortCircuit__: I have a module Abc which has a method foo and I also have a class Def which include Abc and also has a method foo .. now c = Def.new .. c.foo calls the class's foo ... how do I call the module's foo .... like a delegate or something
[18:47:31] shortCircuit__: hi.. I need some help with authenticating with captcha .. I need some ideas ... is someone willing to discuss
[19:33:15] shortCircuit__: there was something similar to even machine in rails . I can't rememeber .. maybe it started with A . it was in the spree gem I think .. or maybe I am wrong .. I just can't remember
[10:36:26] shortCircuit__: I have a strange problem, I am using debian gnome with a zsh terminal .. I can't type 'x' in irb or pry
[19:43:37] shortCircuit__: I had a question regarding rails catching .. I have never implemented one myself ..
[19:44:36] shortCircuit__: I have an autocomplete box .. where it sends requests (ajax) now I want to cache that result for say like 13 seconds ... I did something like this https://github.com/argentum47/location-share-web-app/blob/master/app/controllers/users_controller.rb#L13
[10:56:57] shortCircuit__: I have not done rails for about 4 months straight .. I have forgotten a few things ..
[10:58:36] shortCircuit__: https://gist.github.com/aghosh47/9ea236a36503e0258aa46db7b5e92a94 in my controller, is it possible to save the location and location_user data altogether at the same time .I mean I can thhink of doing location.save! followed by location_user.save but that feels not rails-ish