#RubyOnRails - 06 November 2018
« Back 1 day Forward 1 day »
[06:27:13] dionysus69: So, I decided to go with GKE (google k8s engine) for now, since it relatively simply solves many headaches associated with scaling. If anyone of you doesn't agree, let's discuss ^.^
[08:07:36] otherj: anyone remember how things work with rails 2.3? I am trying to use a version of attachment_fu which claims to work with 2.3, but am having a bit of trouble actually installing it. this legacy app with which I am playing uses an older version in vendor/plugin. I'm trying to remove that and install it via bundler using :git =>. first problem: it doesn't show up under installed gems when I do that. is it better to just put it vendor/gems? any idea
[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:40] Radar: okay. I wasn't sure if that was some made-up syntax or some Rails feature I didn't know of.
[09:52:12] Radar: drale2k_: iirc, the daylight savings timezones are distinct from the non-daylight savings ones. For instance, we have AEST and AEDT where I am. There's also PST + PDT.
[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:53:42] Radar: On my machine, ActiveSupport::TimeZone[+10] returns Brisbane. Which wouldn't be a problem... except Brisbane does not do Daylight Savings. Melbourne (where I am, does)
[09:54:13] Radar: Google says Melbourne's timezone is +11, so really I should be doing that, but then that gives me Asia/Magadan as the timezone. Not ideal.
[09:55:06] Radar: Yeah, that's right. The offset is correct, but +11 is not always going to be _my_ offset. It's going to be either +10 or +11, depending on the time of year.
[09:55:15] Radar: drale2k_: what problem are you aiming to solve with this? Timezones are pretty tricky.
[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:58:22] Radar: Different regions transition to + from DST at different times. I think this might be tricky if you only have the 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:01:15] Radar: drale2k_: well, you can store a UTC time with the relative offset at that point in time, if you've got that information.
[10:02:52] drale2k_: ok so you would store UTC + offset in a single field, in my case the "start_time" field
[10:13:32] drale2k_: Rails' default created_at and updated_at fields are "timestamp without time zone". At least for me locally
[11:38:14] ss942: http://redmine.mydomain.something/wkcrmaccount/edit?account_id=2708&address_id=14127&sort_Zgłoszenia+firmy_by=updated_on-asc
[11:38:14] ss942: http://redmine.mydomain.something/wkcrmaccount/edit?utf8=%E2%9C%93&searchlist=Zg%C5%82oszenia+firmy&cfName=&cfName=&linkTo=
[15:03:27] tycoon177: is there a way to get rack-mini-profiler to work with sql server? i only see postgres and mysql mentioned in the readme, but we use sqlserver and have a route that is misbehaving
[16:20:36] CGibsonmm: when calling a remote: true from a form where is it looking for the file, say i have a file structure of threads/posts/likes/_create.js. if the create link in in the posts show the create is proscessed correct but the js response is not found. how can i point the remote true to point to the likes/_create
[16:22:38] CGibsonmm: No template found for ForumThreads::ForumPosts::LikesController#create, rendering head :no_content
[16:27:54] CGibsonmm: i want it to add a like, then remove the like link from the page and replace it with delete like, i have all the js written its just not finding that js file witch is in forum_posts/links
[16:32:33] Inside: Er.. anyway, your webserver assumes that whenever you access a resource, you have an imaginary .html at the end
[16:32:57] Inside: ie: likes/234634 is internally thought of as requesting a view for likes/234624.html
[16:33:30] Inside: rails by default assumes that you want to render a .html document so it looks in app/views/likes/show.html (or whatever your action is)
[16:39:00] CGibsonmm: yeah it is but on the create i am getting No template found for ForumThreads::ForumPosts::LikesController#create, rendering head :no_content
[16:52:40] CGibsonmm: forum_posts/:forum_post_id/like/new(.:format) forum_threads/forum_posts/likes#new
[16:53:41] CGibsonmm: POST /forum_posts/:forum_post_id/like(.:format) forum_threads/forum_posts/likes#create
[18:53:22] syndikate: Hey, can someone help me understand why this happens? https://github.com/rails/rails/blob/1353610ff2ab4d16d022d5c31d5b4e5d908e05a8/actionpack/lib/action_controller/metal/redirecting.rb#L38
[19:55:57] CGibsonmm: #ids match it just wont update i am running rails 5 and have jquery3 and rails ujs
[20:32:22] iamvery: 👋 i'm doing a little research in preventing cookie replay attacks in rails. The rails guides (https://guides.rubyonrails.org/security.html#replay-attacks-for-cookiestore-sessions) mentions "Including a nonce (a random value) in the session solves replay attacks". Does anyone have an example of this for reference?
[20:33:07] iamvery: I think I understand the idea, but it feels like a solution that may already exist.
[20:37:56] iamvery: oh, i should also mention that i think i understand that the "right" solution is to use a non-cookie session store, but alas i'm still interested in the cookie+nonce solution because reasons :D
[21:35:57] marahin: What is the easiest way to implement ApplePay payments in my Rails app without involving Stripe (clients country is not supported)?
[21:39:03] Radar: marahin: They have an API which is _almost_ as good as Stripe, so I'd recommend you go with them :)
[21:39:24] marahin: yes, I've worked with Braintree in some project like a year ago. I just forgot its even there :P been using Stripe ever since.
[22:57:19] Inside: I could've sworn that this code would work just fine: https://gist.github.com/Insood/c7eafc28a600eafbdb5edf162146d56b