vedu

Activity Graph

Page 1 of 8 | Next »

2018-08-29

[02:42:51] vedu: *.net *.split

2018-08-06

[08:01:44] vedu: has joined #ruby
[08:05:13] vedu: Hello. I am unable to get `rake task` working in my project https://github.com/vedant1811/customer-records. Currently it runs with "0 runs, 0 assertions, 0 failures, 0 errors, 0 skips"

2017-11-09

[03:56:39] vedu: Ping timeout: 240 seconds

2017-10-30

[14:33:09] vedu: Ping timeout: 246 seconds
[15:44:08] vedu: has joined #RubyOnRails

2017-10-24

[15:49:20] vedu: Hey folks. Are there specific IRC channels or Mailing lists for rails jobs?
[16:03:36] vedu: cabotto: oh. how can I join the channel?
[16:05:28] vedu: cabotto: nevermind. got it. thanks! :)
[17:00:16] vedu: mustmodify: etag ?

2017-09-28

[04:13:41] vedu: Ping timeout: 240 seconds
[06:24:19] vedu: has joined #RubyOnRails

2017-09-13

[00:13:16] vedu: Ping timeout: 276 seconds
[05:38:43] vedu: has joined #RubyOnRails

2017-09-12

2017-08-28

[13:32:26] vedu: Hello. How do you store and search production logs? Some third party service like AWS cloud watch or just save the files and awk|grep

2017-08-16

[11:04:10] vedu: noob_on_rails: that probably means there is no modem with id 234
[11:05:10] vedu: and in the logs you can see the request path, HTTP verb, and params (as a hash)
[11:08:36] vedu: Cork: nice catch :)

2017-08-15

[18:44:14] vedu: has left #ruby: ("Konversation terminated!")

2017-08-11

[09:10:36] vedu: mr_blue: as in? you want to check GA is sending events?
[09:16:20] vedu: mr_blue: I'm not sure there's an easy way to set up a test for it. I just run my app in dev env and see events popup realtime in GA
[09:16:37] vedu: I use 2 different apps so that data is not mangled

2017-08-09

[11:42:49] vedu: Hello. Any ideas on this one: https://stackoverflow.com/questions/45561040/how-to-globally-include-ruby-modules-in-js-erb-files-using-webpack

2017-08-07

[06:40:55] vedu: has joined #RubyOnRails

2017-08-06

[19:07:54] vedu: *.net *.split
[19:08:28] vedu: has joined #ruby

2017-07-24

[12:43:51] vedu: Hello. I am transitioning my html/css into a react. How can I decide should I go with a SPA with rails as an API, or, use HTML and the 'react_component' helper?

2017-07-21

[14:48:57] vedu: ule: yes it is possible
[14:50:59] vedu: ule: you are probably looking for `user = User.includes(:company).first`. Now `user.company` will not run another SQL query. ref: http://guides.rubyonrails.org/active_record_querying.html#eager-loading-multiple-associations
[14:51:46] vedu: raz: Hi, you got your answer?
[14:54:39] vedu: raz: it is very much possible to use UUIDs as primary keys. You just need some config
[14:58:21] vedu: raz: oh sorry my bad
[14:59:01] vedu: you can just use the string data type right?

2017-07-18

[02:13:59] vedu: *.net *.split
[02:14:28] vedu: has joined #ruby
[10:12:57] vedu: has joined #RubyOnRails
[13:20:07] vedu: ule: Could you gist your code
[13:21:47] vedu: ule: its hard to understand. You are saying that you want to do something like MyModel.new(name = nil, email = nil, address = nil, phone = nil) ?
[13:22:33] vedu: ule: this is the correct way. how is permitted_params defined?
[13:22:58] vedu: yeah I think I would agree with tbuehlmann_

2017-07-10

[06:39:50] vedu: ryzokuken: !code
[06:40:06] vedu: ryzokuken: paste your code in gist.github.com
[06:42:48] vedu: ryzokuken: no either one is good :)
[06:43:54] vedu: ryzokuken: your test is fine. The error is probably in your controller
[06:44:07] vedu: add that code to your original question
[07:03:54] vedu: ryzokuken: it looks fine. Do you have a before_filter or before_action? What do the logs say?
[07:12:18] vedu: ryzokuken: this is pretty subjective. everything looks fine and there is no error
[07:12:39] vedu: you should tail your test.log while the test is being run
[10:58:24] vedu: LiamW: yes. You can check out the routing guide
[10:59:07] vedu: dionysus69: you can do a inner join probably. No need to write raw SQL in that case
[11:03:48] vedu: dionysus69: gist your code, with the results
[11:25:51] vedu: LiamW: sorry my bad. There is nothing like that. Monkey patching is the only option. https://stackoverflow.com/a/34798146/1396264
[11:27:00] vedu: dionysus69: show the command that you ran as well. Best to show input/output in the same file. I still cant understand what do you need

2017-07-07

[05:46:10] vedu: Hello. I am having a strange issue with selecting my ruby version. I have ruby-2.4.1 but `rails s` says I have 2.3.3. terminal outputs: https://gist.github.com/vedant1811/a38fb048381747d8860a1661fcd3c765
[06:11:51] vedu: desnudopenguino: I'm using chruby
[07:19:57] vedu: dminuoso: I was continuously opening new shells, but was the same thing
[07:20:33] vedu: Finally I reinstalled ruby and removed the gems to fix the problem
[07:27:40] vedu: dminuoso: the funny thing is, the error was I have 2.3.3. But I never installed ruby 2.3.3. I switched from 2.2.4 to 2.4.1
[07:40:48] vedu: dminuoso: ubuntu
[07:45:09] vedu: dminuoso: omg I was pretty sure I didn't. I just removed them
[07:47:21] vedu: dminuoso: no it's not being used. `which ruby` gives me '/home/vedant/.rubies/ruby-2.4.1/bin/ruby'
[07:47:50] vedu: and `which rails`: /home/vedant/.gem/ruby/2.4.1/bin/rails
[07:53:09] vedu: dminuoso: then how can I find out?
[08:12:56] vedu: dminuoso: hmm. lets hope that doesn't
[09:20:08] vedu: Hello. My puma is not restarting on deploy. Full question with code: https://stackoverflow.com/questions/44967067/cap-deploy-doesnt-restart-puma-but-cap-deploy-restart-does

2017-07-06

[08:13:44] vedu: Is there a nil safe way of calling the method '[]'. Like `array[1]` should return nil, if array is nil
[08:18:48] vedu: sevenseacat: I'm extracting the first name of a user, like `user&.name&.split(' ').&get(0)`
[08:20:47] vedu: sevenseacat: If the record isn't created as yet
[08:22:35] vedu: It is possible in some corner cases. Obviously I would do nil check instead of letting my app crash

2017-06-20

[00:17:32] vedu: *.net *.split
[00:22:42] vedu: has joined #RubyOnRails

2017-06-15

[07:00:48] vedu: Hello. I am having trouble serving static assets from webpack. Details: https://stackoverflow.com/questions/44543725/how-to-use-css-with-webpack-in-a-rails-app
[07:03:29] vedu: dminuoso: yes. the js parts are loading correctly
[07:17:04] vedu: dminuoso: ok I'll check it that out

2017-06-14

[06:10:35] vedu: Hello. Why should we have create and edit actions on a singular resource, like User?
[06:12:36] vedu: I mean why 2 actions. Both the actions effectively will do he sae thing

2017-06-12

[09:26:32] vedu: hello. I am trying to integrate react into my rails app using https://github.com/reactjs/react-rails
[09:26:34] vedu: but I am unable to get a basic component going. code: https://gist.github.com/vedant1811/060a824034234e27771d0d402c49c68b
[10:23:44] vedu: dminuoso: I have an existing that I will be migrating
[10:24:20] vedu: dminuoso: why should I keep away from react-rails
[10:24:28] vedu: what do you suggest?
[10:25:59] vedu: dminuoso: yeah I thought I will be re-writing the entire view layer
[10:27:25] vedu: dminuoso: but then how did you guys implement it. Ran a separate server for react?
[10:29:53] vedu: dminuoso: oh okay
[10:30:40] vedu: I am using webpack only. But it's in the same rails app

2017-06-07

[13:46:49] vedu: hello. How are you folks using react in your rails app? Do you use facebook's reactjs/react-rails or shakacode's react_on_rails?
[13:52:33] vedu: alexfu: what is your issue? can you paste code
[13:55:52] vedu: alexfu: do not begin your links with '/'
[13:57:49] vedu: doesn't sound right
[13:58:26] vedu: but I cant help you more without code

2017-06-03

[13:45:13] vedu: hello. I just upgraded to rails 5 and I am getting this error on boot in development: https://gist.github.com/vedant1811/218a8be9ea06fac8217305d1660ae7d0

2017-05-12

[06:22:39] vedu: has joined #ruby
[06:22:39] vedu: has joined #RubyOnRails

2017-05-11

[15:43:20] vedu: matthewd: nice catch :)
[17:51:39] vedu: Quit: ZNC - http://znc.in

2017-05-10

[08:26:55] vedu: frojnd: you can use javascript to do that
[08:59:09] vedu: Hello. How can I create and call custom methods in my ActiveJob class? Something like PushNotificationJob.incoming_message(message).perform_later and PushNotificationJob.welcome(user).perform_later
[09:02:16] vedu: lupine: but if I create separate classes there would be lot of common code. Or I should create a common base class?

2017-05-09

[10:45:20] vedu: Hello. What is the default rails cache_store ? I have a single server setup and I want cache some numbers app wide. something like file store should work fine
[11:16:50] vedu: universa1: Here it is written that FileStore is the default

2017-05-04

[14:02:29] vedu: Hello. How can I send a blank value from my f.number_field ?
[14:27:35] vedu: ravster: yeah
[15:00:30] vedu: ravster: I did hack it already. But I want to set it to nil on update, based on a related radio button. So once it gets a value, I cannot set it to nil

2017-04-26

[01:37:30] vedu: Ping timeout: 260 seconds
[01:43:52] vedu: has joined #ruby
[06:51:56] vedu: has joined #RubyOnRails

2017-04-20

[09:33:19] vedu: Hello. How can I pass a variable to my mail template after my mailer action is executed? The variable is created in the action
[10:17:02] vedu: tbuehlmann: oh sorry. I was creating the instance variable in a an after_action

2017-03-24

[10:17:49] vedu: has joined #ruby
[10:18:44] vedu: Hello. I am trying to send a simple post request but I get this error: Errno::ECONNREFUSED: Connection refused - connect(2) for nil port 443. Full code and error: https://gist.github.com/vedant1811/3056891ae7b93cec0721a1f668ae83e7
[10:23:37] vedu: Burgestrand: thanks. that was my problem

2017-03-22

[10:52:58] vedu: Guest77850: yes both methods are possible
[10:53:11] vedu: but wildly different use-cases
[10:53:32] vedu: Guest77850: yes
[10:54:11] vedu: Guest77850: checkout rails cache
[10:55:23] vedu: Guest77850: I am not following you. seems like you need only the user session. not the rails cache
[10:56:32] vedu: DeusNeusEx: what is your error?
[10:58:07] vedu: DeusNeusEx: Oh okay. not sure. maybe try putting a space before your '='
[10:58:25] vedu: Guest77850: Not possible
[10:59:14] vedu: The session is always stored in the browser cookie. But it is encrypted so you don't have to worry
[11:02:24] vedu: DeusNeusEx: highly unlikely. You are using the basic AR features
[11:04:26] vedu: Guest77850: yes :)

2017-03-15

[15:50:36] vedu: Quit: ZNC - http://znc.in
[15:52:57] vedu: has joined #RubyOnRails

2017-03-13

[17:29:52] vedu: Ping timeout: 260 seconds
[17:35:28] vedu: has joined #RubyOnRails

2017-03-12

[03:36:49] vedu: *.net *.split
[03:39:20] vedu: has joined #RubyOnRails

2016-07-25

[08:11:24] vedu: Hello. What are the uses of rendering partials from the controller? Only for AJAX requests like this one: http://stackoverflow.com/a/10539558/1396264 or some more?
[08:11:53] vedu: I couldn't find rendering partials from controllers in rails guides

2016-07-24

[14:34:08] vedu: Hello, I am doing `format.js { render action: 'error'}`. How can I see what is the js that gets generated?

2016-07-23

[06:01:37] vedu: Why is it specified gen_random_uuid() rather than using the default uuid_generate_v4() for UUID primary keys? ref: http://guides.rubyonrails.org/active_record_postgresql.html#uuid-primary-keys

2016-07-20

[06:57:27] vedu: ewilliam: it is okay, but you may have better luck at #ruby
[11:31:11] vedu: yottanami: the correct way to do it is, Tour.tour_types[:international]
[11:34:16] vedu: jhass: I have this in my code: `Model.where(status: [ Model.statuses[:accepted], Model.statuses[:paid_for_comcard] ])` and it works fine
[11:38:20] vedu: jhass: yeah it will work from rails 5.0 onwards: http://api.rubyonrails.org/classes/ActiveRecord/Enum.html . It doesnt work in 4.2: http://api.rubyonrails.org/v4.2/classes/ActiveRecord/Enum.html
[11:39:19] vedu: yottanami: you have to do what jhass suggested: .where(tour: {tour_type: Tour.tour_types[:international]})
[11:39:28] vedu: yottanami: which rails version are you using?
[11:40:15] vedu: jhass: haha. probably
[11:42:05] vedu: jhass: but if you think of it, once it is accepted, it is a breaking change to go back to the "expected behaviour". So they probably had to fix it in rails 5.0
[11:44:57] vedu: finnnnnnnnnnn: you want to find one user or many users?
[11:52:41] vedu: AimlessRaven: it won't. you can put the code in a method and call that method again
[11:54:20] vedu: AimlessRaven: code

2016-07-18

[12:17:48] vedu: Hello, How can I generate scaffold_controller without the `respond_to` blocks?
[12:18:14] vedu: I just want to render HTML

2016-07-14

[08:28:12] vedu: Hello. I have some assets (scss and js) that are specific to some views. Is it correct to load them in the body of the specific view? Uptil now I am including all assets in layouts/application.html.erb
[08:30:27] vedu: mikecmpbll: really? Doesn't feel right to include all the various assets even when the particular page is not using them. Plus, I will have to worry about namespace collisions in css
[08:31:41] vedu: hmm okay cool :)
[09:51:27] vedu: _bart: better to pass everything as parameters and not access other varibles. accessing class methods is fine
[10:04:44] vedu: _bart: think of it this way. you are issuing a command that will run sometime in the future. Its best to have everything encapsulated in that command rather than have it access some state than may change in between the time the command was issued and it was actually executed
[10:09:18] vedu: _bart: If you need to create a class object, create a new one inside the perform. But this is as much info I can give without code
[10:11:33] vedu: drale2k: yeah. You can always create a new model for the existing join later if you need.
[10:11:57] vedu: yep. agreeing with mikecmpbll

2016-07-13

[05:15:00] vedu: atom_: remove the starting #
[06:47:12] vedu: abhvl: code?
[08:14:04] vedu: GorillaApe: !code
[08:14:27] vedu: sevenseacat: why isn't ^ working :(
[08:24:13] vedu: sevenseacat: aah :)

2016-07-12

[08:27:08] vedu: Guys, any thoughts on this: https://www.reddit.com/r/rails/comments/4sfyxy/polymer_vs_bootstrap_vs/
[09:39:54] vedu: GorillaApe: did you try `echo $RAILS_ENV`
[09:41:11] vedu: hmmm. hard to say
[10:28:08] vedu: rubyonrails578: has_many /?
[10:32:08] vedu: rubyonrails578: I mean I use has_many: inside your serializer. for has_one/belongs_to just use attributes:
[14:22:22] vedu: but I agree
[14:30:19] vedu: yottanami: you could do a yaml dump. (there is a gem for it). and then load the yaml back in seeds.rb
[14:35:05] vedu: yottanami: doesn't look like a database dump. This is a ruby object dump
[14:36:08] vedu: yottanami: check this out: https://github.com/yamldb/yaml_db . for loading from the seeds.rb just invoke the required rake task
[14:46:22] vedu: yottanami: yes, I just told you. ^^

2016-07-05

[00:12:23] vedu: has joined #RubyOnRails
[00:12:23] vedu: has joined #ruby

2016-07-04

[23:51:28] vedu: Ping timeout: 264 seconds

2016-07-02

[05:04:52] vedu: *.net *.split
[09:58:51] vedu: has joined #RubyOnRails
[09:58:51] vedu: has joined #ruby

2016-06-22

[12:45:02] vedu: has joined #ruby
[12:47:05] vedu: Hello. I have an array of hashes. How can I get an array of values of particular key in the hashes? Something like `@array.map(&[:key])`?
[12:50:29] vedu: pontiki_: yeah that would work. I guess there's no shorthand for it

2016-06-19

[02:03:28] vedu: Ping timeout: 264 seconds
[02:11:44] vedu: has joined #RubyOnRails
[04:26:49] vedu: Ping timeout: 260 seconds
[04:35:27] vedu: has joined #RubyOnRails

2016-06-10

[08:45:57] vedu: Hello. What is the "rails way" to rotate logs? (in rails 4.2) I want to delete the old log files rather than compressing and keeping them
[08:48:05] vedu: norc: I am using the default rails logger. But I still got a 4.7G log file :(
[08:49:18] vedu: norc: so some configuration must be required
[09:07:34] vedu: norc: what should the file path be here: config.logger = Logger.new(<file_path>, 0, 1.kilobyte) ?
[09:10:14] vedu: norc: right :)
[14:24:30] vedu: What is correct way to rotate logs in production? I tried this, but in vain: http://stackoverflow.com/questions/37750650/rails-how-to-correctly-rotate-logs
[14:26:11] vedu: workmad3: I just want to delete the logs if they get over 1 MB
[14:26:23] vedu: that SO question is asked by me
[14:42:01] vedu: axilla: yeah I am going through that :)
[14:55:18] vedu: axilla: do you use it in production? I got a crash due a race condition when I was using the ruby log rotate. This wont happen in logrotate?
[15:10:39] vedu: tubbo: okay that settles it then :D

2016-06-09

[09:46:38] vedu: has joined #RubyOnRails
[09:47:26] vedu: Hello. I am running a query as Photo.where(id: photo_ids) but I get an error if all the ids are not valid. How can get the valid items ignoring the ones that are invalid?
[09:59:11] vedu: tbuehlmann: Cannot find all records for "Photo". Found 11 expected 12
[10:05:22] vedu: tbuehlmann: I am not getting it again :( but it was a an ActiveRecord::RecordNotFound
[10:05:36] vedu: But anyway, it seems its working now :D

2016-06-05

[03:50:04] vedu: Ping timeout: 260 seconds
[03:51:45] vedu: has joined #RubyOnRails
[05:20:04] vedu: Write error: Connection reset by peer

2016-06-03

[10:05:49] vedu: Ping timeout: 260 seconds
[10:13:47] vedu: has joined #RubyOnRails
[10:25:04] vedu: Ping timeout: 260 seconds
[10:41:45] vedu: has joined #RubyOnRails

2016-05-31

[14:25:50] vedu: Hello. I am getting this error while trying to run raw SQL: https://gist.github.com/vedant1811/f2c5d5943f5608055cfea393fc9b83c6 probably more of an SQL question
[14:25:57] vedu: Any ideas?
[14:28:11] vedu: norc: no. :)

2016-05-26

[08:38:45] vedu: BaNzounet: ^
[08:40:33] vedu: I just added `dependent: :destroy` to my polymorphic association. Now how I can delete the existing orphaned records? Doing something like `Photo.where(photoable: nil).count` give me 0
[08:41:40] vedu: BaNzounet: rename the column?
[08:42:38] vedu: BaNzounet: oh sorry, disregard that
[08:44:32] vedu: BaNzounet: What?!
[08:44:51] vedu: exactly!
[08:45:10] vedu: BaNzounet: for once I thought you need both users table and organization table
[08:46:07] vedu: Looks like you don't need the user table.
[08:48:54] vedu: (re-asking) I just added `dependent: :destroy` to my polymorphic association. Now how I can delete the existing orphaned records? Doing something like `Photo.where(photoable: nil).count` gives me 0

2016-05-24

[08:50:39] vedu: for all my tests, I am getting this error: `NoMethodError: undefined method `type' for nil:NilClass`. How can I get a stack trace or something to debug this
[08:51:48] vedu: ok got it. log/test.log :)
[09:35:52] vedu: walidvb_: I am getting errors running rake test. rails s works fine
[10:21:00] vedu: How can I assert if my model object was touched? i.e. its updated_at was changed
[10:24:34] vedu: rvanlieshout: there's only a assert_difference and it checks for a particular difference
[10:27:57] vedu: rvanlieshout: yes
[10:28:35] vedu: universal: yeah I am copying the `assert_difference` source and creating a assert_change
[10:38:43] vedu: rvanlieshout: updated_at should be changed, but its difference wont be one
[10:44:37] vedu: rvanlieshout: no. have a look at its method signature: assert_difference(expression, difference = 1, message = nil, &block)
[10:58:31] vedu: Hello. I am getting a totally unrelated (so I feel) SQL error while trying to create a record. code and error: https://gist.github.com/vedant1811/f0bb74f26d4913945f3d55052703bd39
[11:12:36] vedu: Can anyone understand why postgreSQL is giving me an error for no reason! code and error: https://gist.github.com/vedant1811/f0bb74f26d4913945f3d55052703bd39
[11:18:16] vedu: rvanlieshout: Its has_one, not belongs_to. come back from lunch then please help me out
[11:18:48] vedu: fox_mulder_cp: you are running it locally?
[11:20:12] vedu: fox_mulder_cp: kill all your delayed_job processes, and then run the code, then see how many entries are created in the delayed_job table
[12:22:30] vedu: Can anyone understand why postgreSQL is giving me an error for no reason! code and error: https://gist.github.com/vedant1811/f0bb74f26d4913945f3d55052703bd39

2016-05-21

[07:00:29] vedu: barhum2013: I would say no. You would have to secure both the servers
[07:01:05] vedu: If you are so paranoid about security, write functional and intgration tests for it

2016-05-19

[10:20:01] vedu: universa1: is Ryan Bates here, maybe we could ask him why did he remove it :)
[10:21:17] vedu: universa1: hehe. okay. I'll do this and tell you how it went ;-)
[11:30:03] vedu: has joined #ruby
[11:31:49] vedu: Hello. I want to POST to my slack webhook but I am getting a 400 response. The same request is working from postman and curl. Code and response: https://gist.github.com/vedant1811/68018643a380fe9e9e58d822904c611f
[11:38:58] vedu: toretore: curl -X POST --data-urlencode 'payload={"text": "This is posted to #non-tech and comes from a bot named webhookbot."}' https://hooks.slack.com/services/...
[11:40:33] vedu: jhass: yeah, let me go through it :)
[11:43:18] vedu: jhass: okay I got it working using Net::HTTP.post_form uri, "payload" => '{"text": "This is a line of text in a channel.\nAnd this is another line of text."}'. thanks :)
[13:42:34] vedu: has left #ruby: ("Konversation terminated!")