drale2k_

Activity Graph

Page 1 of 10 | Next »

2018-11-08

[08:43:52] drale2k_: has joined #ruby
[08:44:09] drale2k_: has joined #RubyOnRails
[08:52:49] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[08:53:44] drale2k_: has joined #RubyOnRails
[08:53:44] drale2k_: has joined #ruby
[10:43:45] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[11:03:00] drale2k_: has joined #RubyOnRails
[11:03:35] drale2k_: has joined #ruby
[14:02:06] drale2k_: *.net *.split

2018-11-07

[20:27:39] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…

2018-11-06

[07:31:49] drale2k_: has joined #ruby
[07:31:57] drale2k_: has joined #RubyOnRails
[09:24:19] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[09:40:40] drale2k_: has joined #RubyOnRails
[09:40:48] drale2k_: has joined #ruby
[09:48:24] drale2k_: Does anyone know if ActiveSupport::TimeZone[+1] will return the same as ActiveSupport::TimeZone[+2] during Daylight Savings ?
[09:49:07] drale2k_: Or does ActiveSupport::TimeZone[+1] always return the same, independent of DST or not
[09:51:22] drale2k_: Radar: no that's just an example. Generally asking
[09:52:01] drale2k_: well the syntax works, it will return a timezone
[09:52:52] drale2k_: but what i want to know is if i can rely on ActiveSupport::TimeZone[UTC_OFFSET] always returning the correct timezone which would mean it knows about DST
[09:54:43] drale2k_: but Asia/Magadan is +11 so it got the ofset correct
[09:56:53] drale2k_: i have a client windows app which will send the UTC time and the UTC offset. I want to store that properly in rails for each record, so later i can show the time in the context of that PC. I would use start_time.in_time_zone("Asia/Magadan") which i would get when the records comes in, using ActiveSupport::TimeZone[UTC_OFFSET]
[09:59:59] drale2k_: hm, do you have a suggestion? Should i store the utc offset (instead of the region string like "Asia/Magadan") + if DST applies at that moment ?
[10:02:52] drale2k_: ok so you would store UTC + offset in a single field, in my case the "start_time" field
[10:02:58] drale2k_: instead of having a separate field with the timezone
[10:13:32] drale2k_: Rails' default created_at and updated_at fields are "timestamp without time zone". At least for me locally

2018-11-05

[12:17:36] drale2k_: has joined #RubyOnRails
[12:17:52] drale2k_: has joined #ruby
[12:31:05] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[13:07:45] drale2k_: has joined #ruby
[13:07:54] drale2k_: has joined #RubyOnRails
[14:26:08] drale2k_: i have records with "start_time" and "end_time" fields and i want those timestamps to store the user timezone
[14:26:26] drale2k_: should i store them as UTC (default) and add the offset ?
[14:26:41] drale2k_: or should i have a separate "timezone" field on each record with the user timezone
[14:34:27] drale2k_: tbuehlmann: so just in UTC +0 ?
[14:39:53] drale2k_: tbuehlmann: the start_time is coming from a client app running on a PC
[14:40:03] drale2k_: i need to preserve the timezone from that PC
[14:41:19] drale2k_: but how does it later know in which timezone the client PC was ?
[14:41:25] drale2k_: i have to store that somewhere
[14:41:54] drale2k_: so would you have a separate "timezone" field or would you add an offset to the start_time timestamp itself ?
[14:43:24] drale2k_: hm right and then use a gem like tzinfo to convert
[14:49:21] drale2k_: tbuehlmann: any idea how i can convert to a format like "Eastern Time (US & Canada)" ?
[14:49:35] drale2k_: from the PC i will get an UTC + offset
[15:04:24] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[15:22:59] drale2k_: has joined #RubyOnRails
[15:23:01] drale2k_: has joined #ruby
[16:54:56] drale2k_: can i rely on ActiveSupport::TimeZone[+1] always returning the correct thing? During daylight savings and without ?
[16:55:20] drale2k_: or would this become ActiveSupport::TimeZone[+2] during daylight savings ?
[17:06:22] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…

2018-10-24

[10:10:42] drale2k_: i am using form_with with default settings which uses "data-remote=true" but when i submit the form it does a normal submit instead of an xhr request and the page reloads
[10:11:35] drale2k_: looking at the generated HTML, it definitely say data-remote="true" on the form
[10:11:51] drale2k_: am i missing somehing ?
[10:25:05] drale2k_: rails ujs should be taking care of that
[10:25:30] drale2k_: but i think i found the issue at least. It works when i add a submit button but when i submit the form with JS then it does a normal submit
[10:25:41] drale2k_: i think i have to use Rails.fire
[10:27:00] drale2k_: yes, this solved it!
[10:27:40] drale2k_: so instead of calling this.form.submit() with vanilla js, you have to use Rails.fire(this.form, 'submit')
[10:29:08] drale2k_: https://github.com/rails/rails/issues/29546
[11:36:05] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[11:47:17] drale2k_: has joined #RubyOnRails
[11:47:23] drale2k_: has joined #ruby
[18:48:51] drale2k_: *.net *.split

2018-10-23

[06:05:13] drale2k_: has joined #ruby
[06:05:27] drale2k_: has joined #RubyOnRails
[08:28:34] drale2k_: I would like to be able to get a blog post via ID or via "alias". Alias i a field i generated when the blog post is generated
[08:29:02] drale2k_: what is the best way to tell rails to first try alias and then fallback to ID if the param is not found as an alias
[10:38:20] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[10:54:01] drale2k_: has joined #ruby
[10:54:11] drale2k_: has joined #RubyOnRails
[12:42:30] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[13:13:21] drale2k_: has joined #ruby
[13:13:23] drale2k_: has joined #RubyOnRails
[13:27:32] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[13:29:17] drale2k_: has joined #ruby
[13:29:44] drale2k_: has joined #RubyOnRails

2018-10-22

[16:47:02] drale2k_: has joined #RubyOnRails
[16:47:02] drale2k_: has joined #ruby
[16:47:24] drale2k_: Is it possible to add a file from disk to rails via Active Storage ?
[16:58:42] drale2k_: nzst: i am already storing them locally. I am talking about grabbing a file from disk instead a form or API
[17:01:28] drale2k_: ah yes that looks like it, thanks
[17:02:43] drale2k_: nzst: do you by any chance know if this will trigger an upload through the rails stack or just move the file on disk and create a db record ?
[17:14:53] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…

2018-09-05

[13:54:30] drale2k_: has joined #RubyOnRails
[13:54:30] drale2k_: has joined #ruby
[14:04:38] drale2k_: Ping timeout: 245 seconds

2018-09-04

[07:58:36] drale2k_: has joined #ruby
[07:58:51] drale2k_: has joined #RubyOnRails
[09:07:13] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[09:23:35] drale2k_: has joined #RubyOnRails
[09:23:41] drale2k_: has joined #ruby
[09:40:26] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[10:02:59] drale2k_: has joined #RubyOnRails
[10:02:59] drale2k_: has joined #ruby
[14:25:41] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[15:05:08] drale2k_: has joined #RubyOnRails
[15:05:20] drale2k_: has joined #ruby
[20:52:41] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…

2018-09-03

[11:23:20] drale2k_: has joined #ruby
[11:23:21] drale2k_: has joined #RubyOnRails
[14:11:29] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[14:36:01] drale2k_: has joined #ruby
[14:36:07] drale2k_: has joined #RubyOnRails
[16:41:05] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…

2018-08-31

[11:02:31] drale2k_: has joined #RubyOnRails
[11:02:37] drale2k_: has joined #ruby
[11:02:53] drale2k_: how come Rails still doesn't have a default assets "fonts" folder -.-
[11:57:30] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[11:58:49] drale2k_: has joined #ruby
[11:59:23] drale2k_: has joined #RubyOnRails
[11:59:34] drale2k_: Client Quit

2018-08-21

[08:40:58] drale2k_: has joined #RubyOnRails
[08:41:11] drale2k_: has joined #ruby
[09:27:26] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[09:39:38] drale2k_: has joined #RubyOnRails
[09:39:43] drale2k_: has joined #ruby
[11:11:41] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[11:24:49] drale2k_: has joined #ruby
[11:24:54] drale2k_: has joined #RubyOnRails
[13:12:59] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[13:30:03] drale2k_: has joined #ruby
[13:30:03] drale2k_: has joined #RubyOnRails
[15:11:37] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[15:33:41] drale2k_: has joined #RubyOnRails
[15:33:47] drale2k_: has joined #ruby
[16:25:49] drale2k_: Read error: Connection reset by peer

2018-08-20

[07:44:04] drale2k_: has joined #ruby
[07:44:04] drale2k_: has joined #RubyOnRails
[08:17:25] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[08:42:06] drale2k_: has joined #ruby
[08:42:18] drale2k_: has joined #RubyOnRails
[08:46:13] drale2k_: Client Quit
[08:56:30] drale2k_: has joined #ruby
[08:56:46] drale2k_: has joined #RubyOnRails
[09:12:51] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[09:30:43] drale2k_: has joined #ruby
[09:30:45] drale2k_: has joined #RubyOnRails
[12:55:28] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[13:24:21] drale2k_: has joined #ruby
[13:24:21] drale2k_: has joined #RubyOnRails
[13:24:39] drale2k_: Client Quit
[13:38:31] drale2k_: has joined #ruby
[13:38:31] drale2k_: has joined #RubyOnRails
[14:51:13] drale2k_: I am storing imagers with ActiveStorage and i am trying to get the image blob of an image and encoded it to abse64
[14:52:19] drale2k_: base64*. using polymorphic_url(image.attachment) i can get the image path but when i try to encode it with "Base64.encode64(File.open(img))" i get the error "No such file or directory @ rb_sysopen at .. location"
[14:52:41] drale2k_: when i try the returned path through the browser, i get the correct image
[14:53:28] drale2k_: i think the problem is that polymorphic_url returns me a routed URL, not the path on disk. Is there a easier way to get the image blob and encode it into base64 ?
[15:44:34] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[16:05:00] drale2k_: has joined #RubyOnRails
[16:05:30] drale2k_: has joined #ruby
[17:39:21] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[18:00:07] drale2k_: has joined #RubyOnRails
[18:00:07] drale2k_: has joined #ruby
[18:07:19] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[23:31:25] drale2k_: has joined #ruby
[23:31:47] drale2k_: has joined #RubyOnRails
[23:34:23] drale2k_: Client Quit

2018-08-19

[19:33:58] drale2k_: has joined #ruby
[19:33:59] drale2k_: has joined #RubyOnRails
[19:34:56] drale2k_: Client Quit

2018-08-17

[08:30:24] drale2k_: has joined #ruby
[08:30:26] drale2k_: has joined #RubyOnRails
[08:30:40] drale2k_: i have strong params like "params.require(:agent).permit.." but i can send updates without nesting the request in the "agent" key
[08:30:41] drale2k_: why is that?
[08:31:22] drale2k_: PUT request to update the resource
[08:31:51] drale2k_: i can just PUT /agents {"name": "newname"} and it will update
[08:32:16] drale2k_: i hm, i don't have anything special. Sure mom
[08:35:16] drale2k_: sevenseacat https://gist.github.com/drale2k/f15b1b876403b7a2d88d0b8b9be40298
[08:37:26] drale2k_: added a comment to the gist with the request
[08:37:48] drale2k_: it seems like it's automatically nesting it anyway
[08:39:56] drale2k_: yes but that is not what i am sending
[08:40:05] drale2k_: i am sending only name which you can see as the first param
[08:44:22] drale2k_: i am sending them using Postman
[08:44:57] drale2k_: yes i have that file, it has a block with contnet "wrap_parameters format: [:json]"
[08:45:22] drale2k_: yes it is a JSON request
[08:45:28] drale2k_: ok hm, is this on by default ?
[08:46:14] drale2k_: yes indeed, i uncommented and it now requires the key
[08:47:16] drale2k_: this was in my inital rails commit. Seems Rails generated that by default
[08:47:27] drale2k_: gonna check with a new app
[08:48:55] drale2k_: ye it does. Good to know
[11:16:12] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[11:27:24] drale2k_: has joined #RubyOnRails
[11:27:26] drale2k_: has joined #ruby
[13:41:21] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[14:09:45] drale2k_: has joined #ruby
[14:09:49] drale2k_: has joined #RubyOnRails
[15:05:51] drale2k_: just wanted to bash it somewhere -.-
[15:09:07] drale2k_: content security policy
[15:09:19] drale2k_: no matter what i change i break something else
[16:04:56] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[16:23:04] drale2k_: has joined #ruby
[16:23:18] drale2k_: has joined #RubyOnRails
[17:55:03] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…

2018-08-16

[07:40:08] drale2k_: has joined #ruby
[07:40:46] drale2k_: has joined #RubyOnRails
[07:48:18] drale2k_: I have a question https://stackoverflow.com/questions/51872067/post-data-not-showing-up-in-params-for-custom-route
[07:52:40] drale2k_: sevenseacat: yes, updated
[07:58:16] drale2k_: oh dam* got it. I am using Postman (an app for making requests) and i had set Content header to JSON but it was checked off for some reason on the left -.-
[07:58:18] drale2k_: Thanks guys
[07:59:17] drale2k_: i set in my API namespace in my routes "{ :format => 'json' }". Seems that means ignore anything not JSON
[08:00:16] drale2k_: i thought it would interpret anything by default as JSON if no Content header was set
[08:23:03] drale2k_: when sending data to a resource which will be sent to another API and the results stored, should that initial request be a POST or PUT?
[08:24:21] drale2k_: in the end (3rd party API result ) it is creating a new record but the initial data sent is not stored
[08:27:07] drale2k_: za1b1tsu: by never you mean also not for updating records ?
[08:31:17] drale2k_: kk, easy to remember will stick with that :P
[08:35:56] drale2k_: za1b1tsu: i got some guy coming over teaching him CSS so i probably can trickle it down and let him pay his cut
[08:37:03] drale2k_: we can run this like Herbalife
[08:37:41] drale2k_: would even be a good fit for a blockchain
[09:02:49] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[09:43:50] drale2k_: has joined #RubyOnRails
[09:44:07] drale2k_: has joined #ruby
[10:01:43] drale2k_: I have an array of datasets coming in which i am sending of to a Google API. How should deal with that data? Should i create a GooelAPI module or should i create a model with ActiveModel and run the background job from there?
[10:02:07] drale2k_: the problem i am running it with the model is that i need an array (a collection) Can I do that with ActiveModel ?
[10:02:27] drale2k_: i have an array of locations coming in
[10:03:19] drale2k_: or should i just take the incoming data and pass it into a module i put into lib/ and let it take care of it
[11:00:54] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[11:24:29] drale2k_: has joined #ruby
[11:24:34] drale2k_: has joined #RubyOnRails
[11:25:25] drale2k_: any issues with calling a Background Job from a controller and making a HTTP request to an external API within the job ?
[11:25:44] drale2k_: or should jobs only be called from Models
[12:27:43] drale2k_: Quit: Textual IRC Client: www.textualapp.com

2018-08-15

[15:38:08] drale2k_: has joined #RubyOnRails
[15:38:20] drale2k_: has joined #ruby
[15:39:00] drale2k_: in my API, i have defined a route as a member of a resource like "post :location". In my controller i have the "location" method but i can't access the data sent via post
[15:39:08] drale2k_: how to deal with custom POST routes in rails ?
[15:39:25] drale2k_: i don't have a model backing this. Do i have to permit params and how ?
[16:27:19] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[18:19:38] drale2k_: has joined #RubyOnRails
[18:19:48] drale2k_: has joined #ruby
[18:30:30] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[18:35:04] drale2k_: has joined #RubyOnRails
[18:35:34] drale2k_: has joined #ruby
[18:42:11] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[19:01:05] drale2k_: has joined #ruby
[19:01:24] drale2k_: has joined #RubyOnRails
[19:10:11] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[19:47:57] drale2k_: has joined #RubyOnRails
[19:48:08] drale2k_: has joined #ruby
[21:09:42] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…

2018-08-11

[16:45:11] drale2k_: has joined #RubyOnRails
[16:45:33] drale2k_: Client Quit
[16:46:51] drale2k_: has joined #RubyOnRails
[16:47:03] drale2k_: has joined #ruby
[17:06:18] drale2k_: Quit: My MacBook has gone to sleep. ZZZzzz…
[17:36:26] drale2k_: has joined #RubyOnRails
[17:36:38] drale2k_: has joined #ruby
[18:23:07] drale2k_: Quit: Textual IRC Client: www.textualapp.com