#RubyOnRails - 18 February 2019
« Back 1 day Forward 1 day »
[03:18:27] hnanon: If I have an inclusion validation, for example, is a presence validation redundant?
[08:33:55] GeorgesLeYeti: I have an important issue with my rails application. I'm using puma and in my puma_access.log all the parameters are visible and not filtered, even the password is writing in clear.
[08:35:04] GeorgesLeYeti: I already add the Rails.application.config.filter_parameters += [:password] in my initializers
[08:51:07] randohinn: Say I have something like this in my routes file: https://paste.debian.net/1068659/ Is it possible to have a middleware, that will run on only the subdomains?
[15:00:49] GeorgesLeYeti: But I have 1 Product which has has_many ProductStep and has_many ProductLanguage.
[15:03:03] GeorgesLeYeti: But I have in my product_language a column name default_attribute. If my default_attribute is set to true then my product_language has has_many product_steps through product but if it set to false then it only has has_many product_steps
[15:12:54] prestorium: Hi. I'm writing a simple API that must receive a file upload. This file will be between 400 MB and 2 GB. How can I test that?
[15:13:38] prestorium: I don't want to commit a 400 MB file to my repository to act as a test file. But I also don't want to hardcode /path/to/big/file.gz on my tests.
[15:15:29] prestorium: Is there something like FactoryBot for files? Like: create_file('10M', 'application/x-gzip') ?
[16:07:16] ss942: What should I know if I want to create redmine plugin that adds pagination to Documents?
[16:07:16] ss942: Can I write totally my own view and override route of main app by route inside my plugin somehow?
[16:07:16] ss942: I have a little experience with RoR , I just wrote some features for an redmine open source plugin like 6 months ago, and it was last time I seen Ruby.
[16:10:13] prestorium: ss942 did you check http://www.redmine.org/projects/redmine/wiki/Hooks_List#View-hooks ?
[16:34:31] Inside: I'm trying to have a base "User" model which can have multiple "Identities" - where identities are either their active directory login or a token
[17:44:23] Inside: specifically the issue that I'm having is that I've defined the strategy, but I can't seem to get it to load
[17:59:06] Devalo: Good evening. I have a question. I've been away from rails for a bit. Just returned, and trying to set up a new project. I get an error I've never seen before: Active Record adapter. Missing a gem it depends on? sqlite3 is not part of the bundle. I've removed sqlite from the gemfile, cause I want to use postgresql instead.
[18:12:14] Devalo: Dev. It's been a while since I've coded on this computer too, so one thing leads to another. Apparently I need fix some postgresql configs first...
[18:14:47] Inside: FYI: if you're making code changes and they're not evident when you refresh/restart... 1) spring stop 2) remove spring & listen gems
[18:33:09] Devalo: big ecommerce gem. It was abandoned couple of years ago when I used rails. I see some fresh commits lol
[21:19:52] DoctorMonocular: hey, so I have a range of TimeWithZones, and I try to compare 2 ranges that are identical like range_1 == range_2 -- this returns false. I check range_1.first == range_2.first #=> true, and range_1.last == range_2.last #=> true
[21:20:13] DoctorMonocular: I don't get how the first and last of a range could be equal but the ranges are unequal
[21:20:47] DoctorMonocular: the usual thing with times is that the usec is different, but in this case it's not true, they are all manually set to zero
[21:25:35] DoctorMonocular: according to the ruby docs, it doesn't just do object identity, it actually compares values
[21:27:10] DoctorMonocular: but also when I try just having a TimeWithZone instance I can do: t == t.dup #=> true
[21:53:22] DoctorMonocular: no, I am manually making a timewithzone and manually setting usec to 0 on it
[22:37:48] kandayoo: Hi! Is there any way to disable CSRF cookies? A lot of users are getting errors because they open many tabs across the website then login -- Invalidating the previous session secret.
[23:30:37] Anubix: Hello, I plan to build app to proccess 100k API json data, which database and technologies to use to be most effective?
[23:35:21] Anubix: After I process all API datas, will work with them no longer in JSON format, just classic CRUD operations. Mongo is still fine for that? And thanks for oj, i am looking on it.
[23:41:25] havenwood: Anubix: What does "process 100k json data" mean? 100k per what time period? How big? Have a bench?
[23:42:27] havenwood: Anubix: Here's a very specific benchmark with various JSON libs: https://github.com/kostya/benchmarks#json
[23:43:15] Anubix: havenwood: Yes its not secret. I will proccess data from this api: https://api.pathofexile.com/public-stash-tabs
[23:45:24] Anubix: So at the start i have to process everything and load it to database. Then follow new jsons that are adding probably one per minute. So after big load data on begin, then its fine on performance.
[23:47:19] havenwood: Anubix: Are you thinking to use ActiveJob to fetch and process the JSON in parallel?
[23:47:55] DoctorMonocular: you're going to need a big hard drive to hold 800gigs in the database alone though, and you're gonig to have to make sure that api you're hitting is fine with having those 800gigs downloaded from it
[23:48:42] DoctorMonocular: unless it's 8mb total? In which case there's no problem, that's not a lot of data to process
[23:49:48] Anubix: havenwood: what is IO? Yes on begin I will have to do it batches, 60 per minute shoudl be fine, it should be done after one day.
[23:50:48] havenwood: Anubix: Postgres has HStore or these days JSONB. I think you'd need to tell us more about how you intend to query it for us to give good suggestions.
[23:52:23] DoctorMonocular: 800gb of traffic, followed by you storing most of it in a database row--that is going to take disk space
[23:53:38] Anubix: havenwood: it's a game, so there are in-game items mostly, so I will search them for example by name of item.
[23:55:01] Anubix: and second important thing, old data i can throw away in future, because they were sold/removed, so db will be much more smaller.
[23:58:51] Anubix: There are some stats for website which do the very similar thing - https://poe.ninja/stats and they proccesed 57.54 TB, but its for few years