VaibhavRajput

Activity Graph

Page 1 of 1

2016-05-13

[10:11:19] VaibhavRajput: has left #RubyOnRails: ()
[10:11:19] VaibhavRajput: has joined #ruby
[10:11:19] VaibhavRajput: has joined #RubyOnRails
[10:11:25] VaibhavRajput: has left #ruby: ()

2016-01-22

[06:09:06] VaibhavRajput: has joined #ruby
[06:09:06] VaibhavRajput: has joined #RubyOnRails
[06:11:18] VaibhavRajput: has left #RubyOnRails: ()
[06:11:24] VaibhavRajput: has left #ruby: ()

2016-01-18

[11:19:12] VaibhavRajput: has joined #ruby
[11:19:12] VaibhavRajput: has joined #RubyOnRails
[11:20:28] VaibhavRajput: Are there any way to upload file (multipart_part post form) with only Net::HTTP::Post
[11:21:15] VaibhavRajput: Are there any way to upload file (multipart_part post form) with only Net::HTTP::Post

2015-12-28

[11:47:08] VaibhavRajput: has joined #RubyOnRails
[11:47:09] VaibhavRajput: has joined #ruby
[11:47:28] VaibhavRajput: has left #ruby: ()

2015-12-07

[09:01:12] VaibhavRajput: has joined #ruby
[09:01:12] VaibhavRajput: has joined #RubyOnRails
[09:01:29] VaibhavRajput: has left #ruby: ()
[09:05:13] VaibhavRajput: I am using ruby 2.0.0 and rails 4.0.0
[09:05:13] VaibhavRajput: I am getting ArgumentError (argument out of range): on ActiveRecord time field. I have time which is greater than 24:00:00. I can't change this. I have tried this http://stackoverflow.com/questions/9131697/rails-active-record-argumenterror-argument-out-of-range-for-time-fields-g. I have overridden ActiveSupport::TimeZone.parse method in config/initializers/name.rb but this didn't work. Can you please help me to make it work?
[09:16:21] VaibhavRajput: yes it is unconventional, unfortunatly I don't permission to change the db schema.
[09:16:43] VaibhavRajput: Is it possible to add some monkey patch?
[09:18:11] VaibhavRajput: my method overriding is not working? Do you have any idea.
[09:19:29] VaibhavRajput: https://gist.github.com/rajputvai/9889b96e1e939c10c476
[09:27:04] VaibhavRajput: meatchicken, ?
[09:45:42] VaibhavRajput: Remote host closed the connection
[09:47:41] VaibhavRajput: has joined #RubyOnRails
[09:47:42] VaibhavRajput: has joined #ruby
[09:56:24] VaibhavRajput: has left #ruby: ()
[10:32:40] VaibhavRajput: sevenseacat, Can you please help me.
[10:33:14] VaibhavRajput: I asked you might have missed.
[10:33:21] VaibhavRajput: I am getting ArgumentError (argument out of range): on ActiveRecord time field. I have time which is greater than 24:00:00. I can't change this. I have tried this http://stackoverflow.com/questions/9131697/rails-active-record-argumenterror-argument-out-of-range-for-time-fields-g. I have overridden ActiveSupport::TimeZone.parse method in config/initializers/name.rb but this didn't work. Can you please help me to make it work?
[10:33:22] VaibhavRajput: I am using ruby 2.0.0 and rails 4.0.0

2015-09-29

[09:17:40] VaibhavRajput: has joined #RubyOnRails
[09:18:56] VaibhavRajput: what is the different between file open with 'w' and FILE:RDWR mode
[09:28:27] VaibhavRajput: has joined #ruby
[09:28:35] VaibhavRajput: what is the different between file open with 'w' and FILE:RDWR mode
[09:28:51] VaibhavRajput: mikecmpbll, Thanks.
[09:31:29] VaibhavRajput: Where will I get more details about File::WRONLY|File::TRUNC|File::CREAT
[09:35:13] VaibhavRajput: jhass, Thanks :)
[09:38:56] VaibhavRajput: has left #RubyOnRails: ()
[09:47:21] VaibhavRajput: utvai/e8b940555d3dfc71a02b
[09:47:21] VaibhavRajput: I have multiple thread which is writing and reading into the same file. I wanted to truncate file before writing into it at the same time other thread can read it. I have added File::LOCK_EX. The issue which I am facing is if two thread tries to write into same file the thread truncate the file write it successfully but the second one will just prepend the content followed by first thread content. gist : https://gist.github.com/rajp
[09:47:31] VaibhavRajput: gist https://gist.github.com/rajputvai/e8b940555d3dfc71a02b
[10:08:11] VaibhavRajput: jhass, can you please elaborate.
[13:27:53] VaibhavRajput: Ping timeout: 250 seconds

2015-09-28

[11:54:05] VaibhavRajput: has joined #RubyOnRails
[12:42:45] VaibhavRajput: How to check if the file is locked or not in ruby?
[12:43:36] VaibhavRajput: rvanlieshout, locked with File.open(path).flock(File::LOCK_EX)
[12:45:29] VaibhavRajput: I have multiple thread which read and write into the file. I want each thread to write it and read it. in this snippet http://douglasfshearer.com/2011/02/13/threadsafe-file-consistency-in-ruby.html. at a time only one thread can write it. other thread will just ignore it if file is locked by some other thread.
[12:47:11] VaibhavRajput: I wanted to make sure that each thread should perform read and write. so to do this I wanted to check if file is locked or not and if it is locked then retry after some times.
[12:47:21] VaibhavRajput: ^ any suggestions?
[12:58:01] VaibhavRajput: rvanlieshout, anything for me?
[13:00:25] VaibhavRajput: lock status from where to fetch?
[13:00:56] VaibhavRajput: I mean how to fetch it from bash.
[13:01:03] VaibhavRajput: I am doing it right now.
[13:02:59] VaibhavRajput: is there any ruby way to check it?
[13:04:34] VaibhavRajput: okay. will see.
[13:15:11] VaibhavRajput: Ping timeout: 240 seconds
[15:07:26] VaibhavRajput: has joined #RubyOnRails

2015-09-18

[11:44:48] VaibhavRajput: has joined #RubyOnRails
[12:24:39] VaibhavRajput: I have a file. Two processes are trying to read same file at same time. the first process will get file data second will not get anything. How I can resolve this so that the both process can get data?
[12:31:51] VaibhavRajput: Yes there is a data in the file.
[12:36:21] VaibhavRajput: It is not happing. The thing is I am also writing something at the end of script. I think issue is this. When first process writes in file the second process tries to read the data and it is not getting it.
[12:37:14] VaibhavRajput: I think I need to add semaphore.
[12:38:51] VaibhavRajput: Yes I think so. it is also multipthreaded script.
[12:39:59] VaibhavRajput: braininjar, Can you please land me to some good article or snippet to understand this.
[12:42:16] VaibhavRajput: braininjar, I am using sidekiq.
[12:42:56] VaibhavRajput: I mean it is background sort running job.
[13:21:23] VaibhavRajput: Ping timeout: 252 seconds
[15:28:25] VaibhavRajput: has joined #RubyOnRails
[16:03:26] VaibhavRajput: Remote host closed the connection
[16:58:02] VaibhavRajput: has joined #RubyOnRails
[18:14:44] VaibhavRajput: Remote host closed the connection

2015-09-01

[05:12:15] VaibhavRajput: has joined #RubyOnRails
[05:12:45] VaibhavRajput: has left #RubyOnRails: ()
[07:13:27] VaibhavRajput: has joined #RubyOnRails

2015-08-11

[06:41:29] VaibhavRajput: has joined #RubyOnRails
[06:47:55] VaibhavRajput: I want to create connection pool "$redis = ConnectionPool::Wrapper.new(size: 10, timeout: 5) { Redis.connect }". Can someone please tell me which is the best place to put it over?
[06:51:42] VaibhavRajput: rushed, Didn't get you sir. :(,

2015-06-29

[12:32:57] VaibhavRajput: has joined #RubyOnRails
[12:33:07] VaibhavRajput: has left #RubyOnRails: ()
[13:42:38] VaibhavRajput: has joined #RubyOnRails

2015-06-26

[04:17:21] VaibhavRajput: has joined #RubyOnRails

2015-06-25

[13:08:04] VaibhavRajput: has joined #RubyOnRails
[13:08:16] VaibhavRajput: has left #RubyOnRails: ()
[15:21:39] VaibhavRajput: has joined #RubyOnRails
[15:41:07] VaibhavRajput: Remote host closed the connection
[16:25:03] VaibhavRajput: has joined #RubyOnRails
[16:47:07] VaibhavRajput: Remote host closed the connection
[17:21:46] VaibhavRajput: has joined #RubyOnRails
[17:45:26] VaibhavRajput: Remote host closed the connection

2015-06-10

[06:08:17] VaibhavRajput: has joined #RubyOnRails

2015-06-09

[04:32:53] VaibhavRajput: has joined #RubyOnRails

2015-06-08

[07:14:43] VaibhavRajput: has joined #RubyOnRails
[07:20:36] VaibhavRajput: has left #RubyOnRails: ()
[14:23:41] VaibhavRajput: has joined #RubyOnRails
[15:04:25] VaibhavRajput: Remote host closed the connection
[16:15:19] VaibhavRajput: has joined #RubyOnRails
[16:40:35] VaibhavRajput: Remote host closed the connection

2015-04-16

[04:55:29] VaibhavRajput: I have 'resources :signatures'. I want to add some parameter like :limit, :offset, :keyword to the 'index' only route. May I know how to do this?
[05:03:14] VaibhavRajput: hazelux, my url is signatures/foo/10/100 and I should be able to access params[:keyword], params[:limit] etc.

2015-04-09

[09:25:30] VaibhavRajput: How is it possible to share same database devise auth in two different application? Say I have x1 application which has devise database, I wanted to create x2 application which will use x1 database. How I can integrated devise in x2?
[09:31:30] VaibhavRajput: mikecmpbll, hmmm

2015-03-26

[05:18:15] VaibhavRajput: How to write root routes for authenticated and unauthenticated user without devise?
[05:21:13] VaibhavRajput: cosmicfires, what things you want to put in rails
[05:24:56] VaibhavRajput: please go through the getting started guide of Rails
[05:25:49] VaibhavRajput: Can anyone answer me? How to write root routes for authenticated and unauthenticated user without devise?
[05:30:47] VaibhavRajput: centrx, Naaah, Though can you give me example?
[05:31:45] VaibhavRajput: say root "home#index" for public and root "dashboard#index" for authenticated
[05:34:43] VaibhavRajput: centrx, I don't want to dirty my controllers.
[08:36:50] VaibhavRajput: Can anyone answer me? How to write root routes for authenticated and unauthenticated user without devise?
[08:37:01] VaibhavRajput: say root "home#index" for public and root "dashboard#index" for authenticated
[08:52:15] VaibhavRajput: https://stackoverflow.com/questions/29274209/rails-how-to-write-root-routes-for-authenticated-and-unauthenticated-user-witho
[08:56:31] VaibhavRajput: googled so much but couldn't get any help. Asking again here. How to write root routes for authenticated and unauthenticated user without devise?
[09:01:08] VaibhavRajput: shortCircuit__, I can understand.

2015-01-28

[07:47:17] VaibhavRajput: I wanted to ask user to enter git tag in my capistrano deploy.rb. I am using ask :branch, proc{`git tag`.split("\n")[-2]} which prompt "Please enter branch(v.3.2.2)" I wanted to change it to "Please enter git tag(v.3.2.2)". Can someone please tell me how to do that.
[07:52:33] VaibhavRajput: I wanted to ask user to enter git tag in my capistrano deploy.rb. I am using ask :branch, proc{`git tag`.split("\n")[-2]} which prompt "Please enter branch(v.3.2.2)" I wanted to change it to "Please enter git tag(v.3.2.2)". Can someone please tell me how to do that.
[08:08:04] VaibhavRajput: I need some help with capistrano production.rb server attribute
[08:08:37] VaibhavRajput: it ask to enter plain password and which visible. How to hide it from user?

2015-01-23

[05:38:03] VaibhavRajput: I am new to factorygirl. I have has_many association between user and user_brands. I want to check that user should have atleast one brands. Can someone please help to specify association in factorygirl and access it in rspec my code is here https://gist.github.com/rajputvai/e61af268fdc3bdd584d1
[05:44:06] VaibhavRajput: FactoryGirl and Rspec newbie needed your help
[06:00:43] VaibhavRajput: no any help till now :(
[06:06:04] VaibhavRajput: I am new to factorygirl. I have has_many association between user and user_brands. I want to check that user should have atleast one brands. Can someone please help to specify association in factorygirl and access it in rspec my code is here https://gist.github.com/rajputvai/e61af268fdc3bdd584d1
[06:10:42] VaibhavRajput: test not check. my bad.
[06:12:02] VaibhavRajput: Can you help me to specify association in factorygirl

2014-12-03

[10:07:45] VaibhavRajput: I wanted to append column to the csv file. Can you please tell me how to do that?
[10:07:57] VaibhavRajput: existing csv file.
[10:21:00] VaibhavRajput: I wanted to append column to the csv file. Can you please tell me the ways to do that?

2014-10-15

[13:40:07] VaibhavRajput: I have two tables ATS_DEAL and ATS_CAMPAIGN of non-rials application. I can't alter the schema. I have create model class of those table to access active record. those table has many to many relationship. Now I can't setup HABTM relationship as I can't alter the tables. Can you please tell me how I can access/setup Many to Many (HABTM) relationship among those tables?

2014-09-26

[08:00:20] VaibhavRajput: Can someone please tell me how to prepare array for select_tag

2014-09-18

[12:20:00] VaibhavRajput: I am poor in regex. I wanted to replace '\n' '\r' and ',' with ';' . Can someone please help me write regex for the same?
[12:26:02] VaibhavRajput: universa1, can you please explain me multi-line matching.

2014-08-05

[07:42:49] VaibhavRajput: I have multiple layout application. Can some one please tell me how to get layout name in controller?
[07:48:03] VaibhavRajput: Is there any way to get the current layout in controller?
[07:49:09] VaibhavRajput: OffTheRails, That will work on in view but not in controller.
[07:49:33] VaibhavRajput: as controller variable is not defined in controller.

2014-07-04

[11:46:51] VaibhavRajput: I have {"-1"=>{"0"=>{"0"=>"12", "1"=>"12"}}} this value in params[:data]. I wanted to convert each index and value to integer. Is there any method for that?

2014-07-03

[11:13:09] VaibhavRajput: I have string https://gist.github.com/rajputvai/ae2b1d44ca652914c7b6. I want to add p html tag before each ERROR word in the string. Is there any feature in rails to do so.
[11:15:08] VaibhavRajput: universal, please tell the ruby magic for that.
[11:17:20] VaibhavRajput: universal, do you want me to use split.
[11:19:18] VaibhavRajput: universal, yup.
[11:19:37] VaibhavRajput: universal, resolved. thanks.

2014-06-03

[12:38:00] VaibhavRajput: I have one mysql db server. Two instance(Rails app and daemon-websocket) are accessing same mysql server. Rails app create some record and pass the id of the record to the daemon-websocket. but sometimes at daemon-websocket end, I am getting id is not found error.
[12:39:13] VaibhavRajput: This is basically db cache for two instances are not getting sync up. Can some one has idea how to sync up db cache for multiple instance. so it is available to all instances.
[12:39:38] VaibhavRajput: Yes I am calling that after create.
[12:41:27] VaibhavRajput: trampi, do you know any doc link?
[12:42:17] VaibhavRajput: universa1, yes I am using sidekiq in Rails app and in sidekiq I am calling daemon-websocket with id.
[12:42:33] VaibhavRajput: can you send me sidekiq doc link if you have any.
[12:43:35] VaibhavRajput: universa1, thanks I have to look on links.

2014-05-26

[13:34:25] VaibhavRajput: I have string serialise by $(form).serialize(). How I can deserialise it in rails?
[13:36:08] VaibhavRajput: if I echo it in controller it is giving string.
[13:36:19] VaibhavRajput: Yes I passed it correctly.
[13:39:43] VaibhavRajput: axilla, I know it very well.
[13:40:07] VaibhavRajput: I thought rails may be have inbuilt function.
[13:41:52] VaibhavRajput: https://gist.github.com/rajputvai/109bd46667a0ec80115e
[13:42:07] VaibhavRajput: here is my serialise string.
[13:43:52] VaibhavRajput: its not parsing.
[13:45:11] VaibhavRajput: I have string serialise by $(form).serialize(). How I can deserialise it in rails?
[13:45:17] VaibhavRajput: https://gist.github.com/rajputvai/109bd46667a0ec80115e
[13:45:22] VaibhavRajput: here is my serialise string.
[13:50:46] VaibhavRajput: JSON.parse won't work

2014-05-21

[08:37:19] VaibhavRajput: I am trying to use enum http://edgeapi.rubyonrails.org/classes/ActiveRecord/Enum.html#method-i-enum rails 4
[08:37:52] VaibhavRajput: it gives me error undefined method `enum' for #<Class:0x0000012e813d08>
[08:41:01] VaibhavRajput: ooooppps I am using old rails version so getting error.

2014-05-16

[11:26:37] VaibhavRajput: I have a string "SDC90419-123432-123123-TUR.WAV". I want to grab "TUR" from that string. "TUR" can be anything with any number of the characters but the position of the string("TUR") is fixed from reverse following with extension. Can you please tell me the best method to grab it
[11:48:07] VaibhavRajput: nikecmpbll, Can you please explain me this .match(/-(\w+)\.\w+$/)[1]