« Back to channel list

#RubyOnRails - 15 May 2018

« Back 1 day Forward 1 day »
[00:07:11] chouhoulis: has joined #RubyOnRails
[00:08:09] quazimodo: has joined #RubyOnRails
[00:16:31] duderonomy: has joined #RubyOnRails
[00:23:18] cagomez: has joined #RubyOnRails
[00:25:51] Ryanar: has joined #RubyOnRails
[00:34:55] _aeris_: has joined #RubyOnRails
[00:36:51] blackcross: I want to have two model fields that reference a User, namely item.verified_by and item.created_by, what is the best way to implement this? just have verified_by and created_by use an integer to reference User.id or what?
[01:03:28] duderonomy: has joined #RubyOnRails
[01:10:58] cagomez: has joined #RubyOnRails
[01:31:13] eckhardt_: has joined #RubyOnRails
[01:36:25] Jameser: has joined #RubyOnRails
[01:39:15] quazimodo: has joined #RubyOnRails
[01:44:45] arooni_team_b: has joined #RubyOnRails
[01:47:10] mroutis: has joined #RubyOnRails
[01:48:10] GodFather: has joined #RubyOnRails
[01:59:58] chouhoulis: has joined #RubyOnRails
[02:01:05] sevenseacat: has joined #RubyOnRails
[02:07:27] arooni_team_b: has joined #RubyOnRails
[02:17:00] jane_booty_doe: has joined #RubyOnRails
[02:21:04] mjolnird: has joined #RubyOnRails
[02:24:21] moei: has joined #RubyOnRails
[02:41:02] cpruitt: has joined #RubyOnRails
[02:47:38] chouhoulis: has joined #RubyOnRails
[02:48:01] alfiemax: has joined #RubyOnRails
[02:50:20] cpruitt: has joined #RubyOnRails
[02:54:37] gr33nw00d: has joined #RubyOnRails
[02:55:01] gr33nw00d: Is TEXT preferable to VARCHAR(2000) for a longer string?
[02:56:07] fryguy: depends on the rdbms and some access patterns
[02:56:18] fryguy: do some benchmarking and see which better suits your needs for your application
[02:58:04] cpruitt: has joined #RubyOnRails
[03:01:21] orbyt_: has joined #RubyOnRails
[03:12:53] gr33nw00d: It's MySQL and it is frequently accessed. Good idea with the benchmarking, just wondering if there are any best practices
[03:12:55] gr33nw00d: or rules of thumb
[03:17:18] alfiemax: has joined #RubyOnRails
[03:20:15] mroutis: has joined #RubyOnRails
[03:36:43] atrius: has joined #RubyOnRails
[03:50:48] cpruitt: has joined #RubyOnRails
[04:01:15] jcarl43: has joined #RubyOnRails
[04:04:04] jcarl43: has joined #RubyOnRails
[04:05:06] jcarl43: has joined #RubyOnRails
[04:06:02] roshanavand: has joined #RubyOnRails
[04:22:14] cpruitt: has joined #RubyOnRails
[05:06:38] srruby: has joined #RubyOnRails
[05:12:04] srruby: react-rails: I'm starting working on an existing project that is using the react-rails gem. There is a large existing codebase that uses redux. The package.json has lots of dependencies like babel, webpack etc. How do I compile the javascript ? How do I get code reloading in development ?
[05:23:00] kapil___: has joined #RubyOnRails
[05:25:15] cagomez: has joined #RubyOnRails
[05:25:30] ariejan: has joined #RubyOnRails
[05:37:56] ur5us: has joined #RubyOnRails
[05:40:59] KeyJoo: has joined #RubyOnRails
[05:41:50] KeyJoo: has joined #RubyOnRails
[05:46:49] srinidhi: has joined #RubyOnRails
[05:49:34] roshanavand: has joined #RubyOnRails
[05:59:25] reber: has joined #RubyOnRails
[06:02:13] dedeqtor: has joined #RubyOnRails
[06:10:36] sidx64: has joined #RubyOnRails
[06:19:27] za1b1tsu: has joined #RubyOnRails
[06:21:40] conta: has joined #RubyOnRails
[06:22:40] dionysus69: has joined #RubyOnRails
[06:31:17] Dykam: has joined #RubyOnRails
[06:31:24] Dykam: Hey chaps - my load balancer runs on https and uses Nginx reverse proxy to hit my rails servers on http. How do I make Rails helpers generate https links? ( EG edit_product_url(product) )
[06:32:06] Dykam: force_ssl just causes a redirect loop. ( Load balancer terminates https - the rails servers only see http and so redirect back to https ).
[06:38:40] roshanavand: has joined #RubyOnRails
[06:43:11] ikbenhet: has joined #RubyOnRails
[06:45:12] Dykam: Am I correctly registered here? Can I talk on this channel?
[06:47:44] mtkd: has joined #RubyOnRails
[06:50:05] Dykam: Is it normal to have your rails servers running https?
[06:57:18] ariejan: has joined #RubyOnRails
[07:03:10] sidx64: has joined #RubyOnRails
[07:11:13] roshanavand: has joined #RubyOnRails
[07:22:31] armyriad: has joined #RubyOnRails
[07:23:43] Dykam: has joined #RubyOnRails
[07:30:28] cpruitt: has joined #RubyOnRails
[07:30:58] darkhanb: has joined #RubyOnRails
[07:34:41] marr: has joined #RubyOnRails
[07:39:48] atrius: has joined #RubyOnRails
[07:42:55] cpruitt: has joined #RubyOnRails
[07:45:57] dionysus69: with_advisory_lock documentation kind of sucks, I have with_advisory_lock("some_operation") { update_attributes(some_important_attributes) } and run this update in two consoles, but one is hanging waiting for the other, and the other one is looping indefinitely, so it is not unlocking ever
[07:46:06] dionysus69: what am I missing?
[07:48:02] armyriad: has joined #RubyOnRails
[07:55:13] mikecmpbll: has joined #RubyOnRails
[07:57:54] tbuehlmann: can you provide a minimal test case so we can reproduce?
[07:59:53] dionysus69: well that snippet is pretty much it
[08:00:13] dionysus69: update any attribute on a row, and it will be locked
[08:00:21] roshanavand: has joined #RubyOnRails
[08:00:25] dionysus69: do the the same operation on the same row from another console
[08:00:28] dionysus69: and it will reproduce
[08:00:31] tbuehlmann: when I install the gem and do exactly this, will I get the same error?
[08:00:47] dionysus69: no the error actually I will post exactly what I am getting
[08:00:56] dionysus69: just endless loop of pg command
[08:02:10] tbuehlmann: no, just provide a minimal test case we can use to reproduce the problem
[08:02:23] dionysus69: this https://gist.github.com/5f5f2a68e8109e2c83052d465bf85166
[08:02:42] tbuehlmann: use this as a template: https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_master.rb
[08:04:12] dionysus69: that's it https://gist.github.com/webzorg/6bb5cee302e9fa849feab5c2d259bc66
[08:05:08] dionysus69: so I am updating existing value balance + amount, so I hope it is not locking itself, because it needs to first get current value
[08:06:08] ur5us: has joined #RubyOnRails
[08:07:43] dionysus69: oh I understood the template you linked just now
[08:12:44] dionysus69: nice template lol, never worked with a single file rails app before
[08:18:21] roshanavand: has joined #RubyOnRails
[08:18:33] dionysus69: tbuehlmann: here, I made a template but it has misc error https://gist.github.com/21ab7bcea9fd79675bfe1c64b81b86d4
[08:18:40] dionysus69: didn't run migration or something, not sure
[08:20:02] dionysus69: my bad, just change Wallet.find_or_create_by(amount: 1) amount to balance
[08:21:05] dionysus69: cannot test this file concurrently though, no two bundlers can be running together
[08:21:46] webdestroya: has joined #RubyOnRails
[08:23:10] tbuehlmann: use threads then
[08:23:24] dionysus69: hmm, ok let me try
[08:34:20] mikecmpbll: has joined #RubyOnRails
[08:35:52] psychoslave: has joined #RubyOnRails
[08:40:11] dionysus69: I am getting a weird error :\ it works without threads though, throws some active record no table error https://gist.github.com/554e9546b7a75f130c66217f462b55b7
[08:41:12] dionysus69: cannot update
[08:45:10] defsdoor: has joined #RubyOnRails
[08:47:45] sevenseacat: the thread has a different memory database, I presume
[08:48:39] Ergo: has joined #RubyOnRails
[08:48:51] dionysus69: that's out of my scope :D
[08:50:53] cpruitt: has joined #RubyOnRails
[08:52:58] mtkd: has joined #RubyOnRails
[08:54:21] Psy-Q: when writing a controller, if something is a nested resource but can be nested in e.g. 3 different other resources, there's no other choice but to query for params[:other_resource_id] for each of the resources it can be nested in, right?
[08:54:31] tbuehlmann: dionysus69: can you use the database you're using locally in that snippet?
[08:54:48] Psy-Q: e.g. in the index method i'd have to figure out if the request came through /resource1/resource or /resource2/resource
[08:55:01] tbuehlmann: Psy-Q: right. I personally use different controllers then
[08:55:06] dionysus69: hmm I could yea but I will have to trial and error for making a connection
[08:55:21] tbuehlmann: you got this!
[08:56:23] Psy-Q: tbuehlmann: oh, if i namespace a controller as Resource1::ResourceController it will magically apply?
[08:57:13] Psy-Q: like User::AccountsController and Server::AccountsController for example?
[08:57:48] tbuehlmann: actually the opposite of magically, that'd be quite explicit
[08:57:58] tbuehlmann: but yes, you'd have a controller for each nesting
[08:59:52] Psy-Q: ah, lovely, i hadn't thought of that. i can still stick shared logic into a module and include in both
[09:00:32] dionysus69: ok here it is, tbuehlmann https://gist.github.com/webzorg/0865edb1e08592f7170cea820a69e264
[09:00:34] Psy-Q: thanks! i guess i'll have to look at ActionController docs a bit more, i don't know the fancy stuff
[09:00:54] dionysus69: I cannot recreate though, I assume the reason is because it is not running parallel
[09:01:22] dionysus69: I would need multi process approach to simulate multi worker env
[09:01:40] tbuehlmann: different threads have different connections, so that should work?
[09:02:30] dionysus69: but why am I looping in the rails app then
[09:02:53] dionysus69: I am doing it from second console, which should have separate connection with the db also
[09:03:26] tbuehlmann: that looping is trying to aqcuire a lock, so maybe it's locked?
[09:03:38] tbuehlmann: but try to get this snippet running, it will be easier for us then
[09:04:10] dionysus69: this snippet works
[09:04:19] dionysus69: but it is not recreating my looping problem
[09:04:42] drale2k_: has joined #RubyOnRails
[09:06:09] tbuehlmann: dionysus69: it's not a reproduction then
[09:06:38] dionysus69: :S is there a way for this snippet not to bundle before running?
[09:06:49] dionysus69: I could run this file in two consoles, I suspect, then it would reproduce
[09:06:51] tbuehlmann: also, the database is not created in the snippet so I cannot run it
[09:06:58] drale2k_: i have a rest API with an /screenshots endpoint where you can upload single screenshots. Now i would like to add the ability for multiple screenshots and i am thinking about creating a /screenshot_collection resource
[09:07:17] drale2k_: a screenshot_collection would have many screenshots. Is this a good way?
[09:07:27] dionysus69: I commented the db creation block out, I already had it :S
[09:07:54] dionysus69: your database name will be different also
[09:09:25] mikecmpbll: has joined #RubyOnRails
[09:10:09] tbuehlmann: dionysus69: the idea of such a snippet is that we can run it without changing anything
[09:13:19] dionysus69: for this to work generically, you would have to have no password access right with your local user in pg, or you would have to have postgres user/pass which I don't know if you do :)
[09:14:27] tbuehlmann: you can assume that
[09:16:08] Radar: GOOD EVENING
[09:16:51] tuskkk___: How do I set the value (url param) for a model field from the controller to be seen in the view
[09:18:09] tuskkk___: https://bpaste.net/show/1d2c010091c2
[09:18:21] tuskkk___: I feel, this model is not linked to the view ^
[09:19:21] Radar: tuskkk___: first step is that your form should refer to the object that you've got in the controller
[09:19:30] Radar: tuskkk___: form_for @rotation, not form_for :rotation
[09:23:42] Radar: tuskkk___: also: your attr_accessor in the model is probably not going to do what you want it to do. B
[09:24:20] Radar: tuskkk___: Well, is it saving your server or dns attributes to the database? If not, then it's probably because of this line in your model.
[09:24:38] tuskkk___: I don't want it to save, its a DTO
[09:24:44] Radar: Rightio then.
[09:24:46] tuskkk___: well, I want it to be a DTO
[09:24:53] tuskkk___: sorry, am new to all this
[09:25:15] Radar: There are many people who attempt to use attr_accessor as if it were attr_accessible and then are sad when it doesn't work as they thought it would.
[09:25:33] tuskkk___: let me try with @rotatation, thanks
[09:26:04] tbuehlmann: I feel like :rotation will fallback/default to @rotation, but you should change it either way
[09:26:16] tuskkk___: getting, `NoMethodError (undefined method `server=' for nil:NilClass):`
[09:26:31] Radar: Did you find the rotation first?
[09:26:53] Radar: You can't call .server= on @rotation if it doesn't exist yet. Instance variables in Ruby are nil by default.
[09:27:34] tuskkk___: no, I don't have an underlying DAO for rotation, i need to handle it solely through API calls
[09:28:17] Radar: You will need to do something like @rotation = API.call.goes.here
[09:28:23] tuskkk___: basically, I am trying to create a form with this DTO and get the results posted back, on the way I want one of the fields from the url params
[09:28:46] tuskkk___: can't i just create an empty rotataion instead?
[09:29:09] tuskkk___: and pass that object to the view's form
[09:29:30] tuskkk___: somehow I have it in my head, but unable to translate it to rails terms :(
[09:32:41] Radar: tuskkk___: Right. You could do @rotation = Rotation.new and then @rotation.server=
[09:33:39] tuskkk___: Radar: cool, had to revert back to :rotation in the view ;)
[09:34:28] tuskkk___: in rails is there a term for using DTO's like this as form models?
[09:34:58] Radar: tuskkk___: We would probably just call them "Plain Ol Ruby Objects". They don't need to inherit from ApplicationRecord if you're not using a database as the source of that data. You could define a pure class.
[09:35:09] Radar: I will show you, one moment
[09:35:24] tuskkk___: :), just like POJO
[09:35:57] Radar: https://gist.github.com/radar/df0e4d54a92ec64c2ad461f740f975ac
[09:36:20] tuskkk___: yes, that's exactly what I have
[09:36:27] Radar: I think that's all you'll need in this case. Then in the controller: @rotation = Rotation.new <new line> @rotation.server = params[:name]
[09:36:47] tuskkk___: thanks Radar!
[09:52:09] drale2k_: i posted a question regarding allowing multiple screenshots to be sent to a REST API https://stackoverflow.com/questions/50346500/design-rest-api-for-single-and-multiple-items-screenshots
[09:53:50] Radar: drale2k_: why not have users create collections as a separate endpoint (POST /screenshot_collections), and then /screenshot_collections/<id>/screenshots, which will then link the screenshot to a particular collection?
[09:54:42] ur5us: has joined #RubyOnRails
[09:54:48] drale2k_: @Radar good idea but a screenshot is optionally part of a collection
[09:54:53] drale2k_: single screenshots are not in a collection
[09:54:55] Radar: drale2k_: so have both.
[09:55:05] Radar: Have /screenshots and /screenshot_collections/<id>/screenshots.
[09:56:49] drale2k_: the screenshots would come in at once (even multiple) so it would make more sense to create the collection and assign the screenshots in 1 request or ?
[09:56:59] Radar: Two requests.
[09:57:03] drale2k_: with just a POST /screenshot_collections/
[09:57:24] Radar: One to create the collection -- POST /screenshot_collections. Another to create the screenshot -- POST /screenshot_collections/<id>/screenshots
[09:57:30] sagax: has joined #RubyOnRails
[09:57:59] drale2k_: hm ok got it thank you
[10:03:53] cpruitt: has joined #RubyOnRails
[10:04:40] drale2k_: has joined #RubyOnRails
[10:07:42] conta: has joined #RubyOnRails
[10:07:53] mikecmpbll: has joined #RubyOnRails
[10:11:12] schneider: has joined #RubyOnRails
[10:11:41] Jameser: has joined #RubyOnRails
[10:15:07] tpendragon: has joined #RubyOnRails
[10:15:44] sidx64: has joined #RubyOnRails
[10:18:18] dionysus69: how long do you have deadlock_timeout param set in db? default is 1sec
[10:19:50] Fernando-Basso: has joined #RubyOnRails
[10:26:54] ariejan: has joined #RubyOnRails
[10:39:11] sidx64: has joined #RubyOnRails
[10:48:33] alfiemax: has joined #RubyOnRails
[10:49:46] FLeiXiuS: has joined #RubyOnRails
[10:50:01] FLeiXiuS: Do you need x-sendfile-accel if you're using passenger+nginx?
[10:54:29] apparition: has joined #RubyOnRails
[10:58:05] mtkd: has joined #RubyOnRails
[10:58:19] apeiros: has joined #RubyOnRails
[10:59:16] Ericx2x: has joined #RubyOnRails
[11:05:36] sidx64: has joined #RubyOnRails
[11:11:57] conta: has joined #RubyOnRails
[11:13:44] GodFather: has joined #RubyOnRails
[11:17:16] Ryanar: has joined #RubyOnRails
[11:22:21] ikbenhet: has joined #RubyOnRails
[11:25:15] sidx64: has joined #RubyOnRails
[11:25:30] s2013: has joined #RubyOnRails
[11:27:29] drale2k_: has joined #RubyOnRails
[11:29:02] drale2k_: @Radar: regarding the screenshot / collection question. What do think i f i only have a collection and single screenshots is a collection with 1 screenshots
[11:29:13] drale2k_: instead of having screenshot_colelctions and screenshots separately
[11:30:47] cpruitt: has joined #RubyOnRails
[11:35:42] Radar: drale2k_: huh?
[11:36:38] sidx64: has joined #RubyOnRails
[11:38:01] drale2k_: to refresh, i have single screenshots and grouped screenshots and i wanted to make a separate ScreenshotCollection API resource
[11:38:13] drale2k_: you suggested "why not have users create collections as a separate endpoint (POST /screenshot_collections), and then /screenshot_collections/<id>/screenshots, which will then link the screenshot to a particular collection?"
[11:38:27] chouhoulis: has joined #RubyOnRails
[11:38:44] drale2k_: and what iam asking no is what you think of only having /screenshot_collections/ , no matter if 1 or many screenshots
[11:39:00] drale2k_: in case of single screenshots, it would be a collection with 1 screenshot. Do you see a problem with that ?
[11:41:44] andrew91841: has joined #RubyOnRails
[11:50:07] cpruitt: has joined #RubyOnRails
[11:58:33] chouhoulis: has joined #RubyOnRails
[11:58:48] Radar: drale2k_: that sounds reasonable to me
[12:02:36] sidx64: has joined #RubyOnRails
[12:06:37] cpruitt: has joined #RubyOnRails
[12:07:12] drale2k_: @Radar thank you
[12:09:35] Radar: Speaking of reasonable... it'd be a reasonable time for me to go to bed. G'night.
[12:12:24] mroutis: has joined #RubyOnRails
[12:18:41] cagomez: has joined #RubyOnRails
[12:19:25] cpruitt: has joined #RubyOnRails
[12:23:47] roamingdog: has joined #RubyOnRails
[12:26:08] sidx64: has joined #RubyOnRails
[12:28:41] cpruitt: has joined #RubyOnRails
[12:29:03] Cavallari: has joined #RubyOnRails
[12:36:44] cpruitt: has joined #RubyOnRails
[12:38:31] psychoslave: has joined #RubyOnRails
[12:41:22] dionysus69: I have this weird behavior, when I open up couple of consoles, I cannot exit from any of them until I exit all of them
[12:41:33] dionysus69: so when I exit one, it hands while it tries to exit
[12:41:40] dionysus69: when I exit from last one, all of them exit
[12:41:44] sidx64: has joined #RubyOnRails
[12:43:01] psychoslave: has joined #RubyOnRails
[12:50:04] jane_booty_doe: has joined #RubyOnRails
[12:50:34] sidx64: has joined #RubyOnRails
[12:52:15] Ericx2x: has joined #RubyOnRails
[12:52:50] GodFather: has joined #RubyOnRails
[12:58:50] andrew9184: has joined #RubyOnRails
[13:00:09] jane_booty_doe: has joined #RubyOnRails
[13:01:16] ikbenhet: has joined #RubyOnRails
[13:06:58] yaw: has joined #RubyOnRails
[13:09:24] prahal: has joined #RubyOnRails
[13:15:05] tdy: has joined #RubyOnRails
[13:18:56] andrew9184: has joined #RubyOnRails
[13:22:56] duderonomy: has joined #RubyOnRails
[13:24:11] sidx64: has joined #RubyOnRails
[13:33:09] NL3limin4t0r: has joined #RubyOnRails
[13:33:16] tycoon177: Is there a way to have rspec use the middleware in a controller spec?
[13:35:02] tycoon177: My use case is this: All requests when a user is not signed in are automatically redirected back to a login form. We just recently pulled this code out into a reusable gem and transformed it into a Rack middleware vs doing this in a before_action. Now, all of my tests are passing except for the tests that redirect a user back to login. The middleware is mounted, but it's not ever called when doing controller specs
[13:36:23] tbuehlmann: nope, controller specs don't go through the middleware stack but instead call the controller directly
[13:36:50] tycoon177: alright, thanks
[13:36:50] tbuehlmann: you could make it a request spec which is fairly similar but goes through the middleware stack
[13:37:04] tbuehlmann: or even system specs if your rails version allows for it
[13:37:13] tycoon177: I'll have to figure out how to make these controller specs into request specs or something like that
[13:37:35] tycoon177: Some of our apps would be able to use system specs, but others are stuck on rails 3 (but we're working on that too)
[13:38:06] tbuehlmann: best case: just change `get :index` to `get somethings_path` and you're done
[13:38:18] tbuehlmann: (besides moving the file to the right directory)
[13:38:50] tycoon177: we haven't used any request specs in this app, so i'm not super familiar. It'd just be spec/requests instead of spec/controllers, right?
[13:42:50] jane_booty_doe: has joined #RubyOnRails
[13:46:18] jane_booty_doe: has joined #RubyOnRails
[13:47:26] duderonomy: has joined #RubyOnRails
[13:51:04] dionysus69: I am not saving any sensitive data in cookies but just curious, if Mozilla docs say that HttpOnly cookies aren't accessible by javascript API, and are only accessible by the server, why aren't they considered safe enough? They discretely say not to save sensitive info even in HttpOnly cookies.
[13:51:19] duderonomy: has joined #RubyOnRails
[13:52:31] apeiros: dionysus69: because the content is transmitted in plaintext
[13:52:53] dionysus69: but it is encrypted right?
[13:52:56] dionysus69: at least in case of rails
[13:52:57] apeiros: also "not accessible by JS" is a choice by one specific browser (maybe multiple)
[13:53:25] dionysus69: firefox and chrome 50+ versions or so
[13:53:28] apeiros: if you use encrypted cookies, then yes. iirc session cookies are encrypted by default, but others is an opt-in.
[13:53:51] apeiros: yeah, still a choice. nothing forces that behavior and you certainly can't control it.
[13:53:54] tycoon177: tbuehlmann: thanks again! My specs are working when changing it to a request spec :)
[13:57:59] tbuehlmann: tycoon177: great :)
[13:58:09] sidx64: has joined #RubyOnRails
[14:02:46] mtkd: has joined #RubyOnRails
[14:08:49] GodFather: has joined #RubyOnRails
[14:11:51] mroutis: has joined #RubyOnRails
[14:14:54] GodFather: has joined #RubyOnRails
[14:19:13] Fire-Dragon-DoL: has joined #RubyOnRails
[14:22:47] chouhoulis: has joined #RubyOnRails
[14:27:45] GodFather_: has joined #RubyOnRails
[14:28:12] roamingdog: has joined #RubyOnRails
[14:35:30] Inside: has joined #RubyOnRails
[14:37:08] GodFather_: has joined #RubyOnRails
[14:38:33] Inside: heyo - how do I future proof callback chains? I'm on rails 4, but moving to 5 in a bit. So - there's been a change that calling 'false' no longer cancels a callback and that you have to do throw :abort now
[14:38:54] Inside: I'm worried that I'll forget to update this when I move to 5
[14:39:51] jottr: has joined #RubyOnRails
[14:41:21] sidx64: has joined #RubyOnRails
[14:47:58] orbyt_: has joined #RubyOnRails
[14:48:26] NL3limin4t0r: Inside: There is a setting that let you keep the old callback method until you feel safe switching over.
[14:48:49] NL3limin4t0r: Have a look at 4.2 of http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#halting-callback-chains-via-throw-abort
[14:50:11] Saukk: has joined #RubyOnRails
[14:50:49] NL3limin4t0r: If you set `ActiveSupport.halt_callback_chains_on_return_false = false` the old behaviour stays until you are ready.
[14:53:16] kapil___: has joined #RubyOnRails
[14:53:44] NL3limin4t0r: Inside: Have a look at the whole "Upgradeing from Rails 4.2 to Rails 5.0 section". There is changing quite a lot.
[14:57:06] chouhoulis: has joined #RubyOnRails
[14:57:40] Inside: I'm a bit scared to upgrade actually
[14:58:00] Inside: I don't see that much benefit - although... ActiveStorage looks interesting
[15:02:26] GodFather_: has joined #RubyOnRails
[15:02:55] NL3limin4t0r: Inside: Make sure you'll backuped the database as well as the rails folder. When I upgraded from 4.2 to 5.0 most of my issues where with gem dependencies, but I followed the upgrade guide from top to bottom for the 4.2 -> 5.0 upgrade.
[15:04:42] urkle: has joined #RubyOnRails
[15:05:47] orbyt_: has joined #RubyOnRails
[15:06:41] dionysus69: has joined #RubyOnRails
[15:12:36] duderonomy: has joined #RubyOnRails
[15:17:16] steerio: has left #RubyOnRails: ()
[15:19:27] mtkd: has joined #RubyOnRails
[15:23:09] cagomez: has joined #RubyOnRails
[15:28:51] duderonomy: has joined #RubyOnRails
[15:29:28] za1b1tsu: has joined #RubyOnRails
[15:38:47] symsonic: has joined #RubyOnRails
[15:43:57] jcarl43: has joined #RubyOnRails
[15:49:08] quazimodo: has joined #RubyOnRails
[15:50:59] mroutis: has joined #RubyOnRails
[15:56:35] za1b1tsu: has joined #RubyOnRails
[15:56:47] apeiros: has joined #RubyOnRails
[15:59:59] Ericx2x: has joined #RubyOnRails
[16:00:05] apeiros: has joined #RubyOnRails
[16:10:10] NL3limin4t0r: has joined #RubyOnRails
[16:31:12] mroutis_: has joined #RubyOnRails
[16:32:00] s2013: has joined #RubyOnRails
[16:35:59] orbyt_: has joined #RubyOnRails
[16:53:36] ShekharReddy: has joined #RubyOnRails
[16:58:18] regedit: has joined #RubyOnRails
[17:00:09] Fernando-Basso: has joined #RubyOnRails
[17:04:25] kies^: has joined #RubyOnRails
[17:11:47] conta: has joined #RubyOnRails
[17:17:16] eckhardt: has joined #RubyOnRails
[17:25:23] duderonomy: has joined #RubyOnRails
[17:26:38] jottr: has joined #RubyOnRails
[17:26:42] mtkd: has joined #RubyOnRails
[17:39:40] MrPunkin: has joined #RubyOnRails
[17:40:33] prahal: has joined #RubyOnRails
[17:44:43] Cavallari: has joined #RubyOnRails
[17:49:08] psychoslave: has joined #RubyOnRails
[18:05:34] blackmesa: has joined #RubyOnRails
[18:06:09] quazimodo: has joined #RubyOnRails
[18:07:40] mtkd: has joined #RubyOnRails
[18:07:52] tuskkk___: How do we create some extra fields and give them default for an active record extending model?
[18:08:08] tuskkk___: tried doing, attr_accessor
[18:08:24] tuskkk___: and `attribute :locale, :string, default: 'en'`
[18:08:36] tuskkk___: first one gave, undefined method
[18:09:02] chouhoulis: has joined #RubyOnRails
[18:09:07] tacoboy: has joined #RubyOnRails
[18:09:17] dviola: has joined #RubyOnRails
[18:10:55] roamingdog: has joined #RubyOnRails
[18:13:04] alfiemax: has joined #RubyOnRails
[18:18:37] alfiemax: has joined #RubyOnRails
[18:19:06] sameerynho: has joined #RubyOnRails
[18:20:02] ellcs: has joined #RubyOnRails
[18:22:15] tuskkk___: got it, `attr_accessor` actually works, now how to set defaults for it?
[18:30:15] mtkd: has joined #RubyOnRails
[18:34:46] jhass: has joined #RubyOnRails
[18:43:22] MrCrackPotBuilde: has joined #RubyOnRails
[18:44:29] dionysus69: has joined #RubyOnRails
[18:46:40] duderonomy: has joined #RubyOnRails
[18:53:07] duderonomy: has joined #RubyOnRails
[18:54:53] tuskkk___: damn, stuck again, have a form from a custom class, need a dropdown there from one of the fields in a model...
[19:02:25] psychoslave: has joined #RubyOnRails
[19:04:22] alfiemax: has joined #RubyOnRails
[19:05:42] ellcs: has joined #RubyOnRails
[19:08:01] jottr: has joined #RubyOnRails
[19:18:44] KeyJoo: has joined #RubyOnRails
[19:19:33] alfiemax: has joined #RubyOnRails
[19:20:46] vovs03: has joined #RubyOnRails
[19:21:23] mtkd: has joined #RubyOnRails
[19:31:28] orbyt_: has joined #RubyOnRails
[19:33:09] Inside: tuskkk___: o/
[19:33:20] Inside: did you figure it out?
[19:33:30] tuskkk___: thanks for doing the o/
[19:36:21] prahal: has joined #RubyOnRails
[19:37:15] prahal: has joined #RubyOnRails
[19:51:32] cschneid_: has joined #RubyOnRails
[20:00:17] cschneid_: has joined #RubyOnRails
[20:04:51] alfiemax: has joined #RubyOnRails
[20:05:25] Terens: has joined #RubyOnRails
[20:05:55] Terens: does if(x=....).something? does anything?
[20:11:04] baweaver: terens: try it and find out
[20:15:53] Cavallari1: has joined #RubyOnRails
[20:19:05] Cavallari1: has joined #RubyOnRails
[20:19:15] regedit: has joined #RubyOnRails
[20:20:54] bphogan: has joined #RubyOnRails
[20:21:44] GodFather: has joined #RubyOnRails
[20:23:09] regedit: i have 2 Sidekiq::Worker classes, i'd like both of them to perform some interactions with a 3rd party API, rather new to Ruby & RoR, how should i structure this? Create some sort of DoTheApiThing class which both workers will use?
[20:23:14] dblessing: has joined #RubyOnRails
[20:23:30] dyyylan: has joined #RubyOnRails
[20:23:42] Cavallari: has joined #RubyOnRails
[20:27:53] sidx64: has joined #RubyOnRails
[20:30:51] sidx64_: has joined #RubyOnRails
[20:33:48] uks: has joined #RubyOnRails
[20:34:56] za1b1tsu: has joined #RubyOnRails
[20:35:47] sidx64: has joined #RubyOnRails
[20:39:38] fox_mulder_cp: hi, folks. i have a encrypted Rails.application.secrets.secret_key_base in rails 5.2. how i can read and use it in my JWT token sign?
[20:41:53] fox_mulder_cp: regedit lib/ dir?*_
[20:42:39] regedit: what about lib/ ? sorry still rather new to RoR.... any links to relevant docs?
[20:43:05] prahal: has joined #RubyOnRails
[20:43:46] prahal: has joined #RubyOnRails
[20:44:51] mikecmpbll: has joined #RubyOnRails
[20:46:08] sidx64_: has joined #RubyOnRails
[20:47:07] Ergo: has joined #RubyOnRails
[20:48:24] sidx64__: has joined #RubyOnRails
[20:51:01] lypsis: has joined #RubyOnRails
[20:54:14] marr: has joined #RubyOnRails
[20:56:47] Cavallari1: has joined #RubyOnRails
[20:59:36] duderonomy: has joined #RubyOnRails
[20:59:47] blackmesa: has joined #RubyOnRails
[21:02:34] fox_mulder_cp: regedit default lib dir in $app_root
[21:02:53] fox_mulder_cp: you can store in it relevant modules
[21:17:30] mroutis: has joined #RubyOnRails
[21:25:04] orbyt_: has joined #RubyOnRails
[21:30:14] rikkipitt: has joined #RubyOnRails
[21:31:03] jottr: has joined #RubyOnRails
[21:32:40] za1b1tsu: has joined #RubyOnRails
[21:35:30] sidx64: has joined #RubyOnRails
[21:42:15] rikkipitt: has joined #RubyOnRails
[21:43:54] ur5us: has joined #RubyOnRails
[21:45:07] chouhoulis: has joined #RubyOnRails
[22:04:53] jottr: has joined #RubyOnRails
[22:07:10] moei: has joined #RubyOnRails
[22:07:52] mroutis: has joined #RubyOnRails
[22:18:46] alfiemax: has joined #RubyOnRails
[22:25:33] kapil___: has joined #RubyOnRails
[22:27:47] mjolnird: has joined #RubyOnRails
[22:28:35] za1b1tsu: has joined #RubyOnRails
[22:29:21] Radar: GOOD MORNING
[22:29:56] Radar: regedit: yes, that structure sounds reasonable. fox_mulder_cp is suggesting that you put that class inside the lib directory of your Rails application.
[22:30:36] regedit: Radar: GOOD MORNING to you too! XD Thanks!
[22:30:47] Radar: fox_mulder_cp: I don't think Rails.application.secrets.secret_key_base is encrypted. That is the raw value.
[22:31:00] Radar: You can read it by calling Rails.application.secrets.secret_key_base
[22:31:24] Radar: fox_mulder_cp: on production it's supposed to come from an environment variable called ENV["SECRET_KEY_BASE"]
[22:31:29] regedit: Radar: someone else suggested i drop it in Models :shrug: any difference ?
[22:31:57] Radar: regedit: app/workers is probably where I would put it personally. app/models is for classes that interact with a database.
[22:32:51] regedit: app/workers? isn't that where actual worker classes should go, the kinds that are supposed to be perfom()ed as scheduled jobs?
[22:33:02] Radar: Oh sorry, I haven't woken up full yet.
[22:33:18] Radar: Yes, worker classes go in app/workers, code to interact with the API goes in lib.
[22:33:27] regedit: ACTION pours some hawaiian magma on Radar's face
[22:33:34] Radar: ahhh cleansing
[22:34:20] regedit: ok so i make something like lib/apithing.rb containing class ApiThing ?
[22:34:52] regedit: then i require apithing at the top of app/workers/my_process_worker.rb ?
[22:35:13] ur5us: has joined #RubyOnRails
[22:35:16] regedit: awesome :+1: thanks!
[22:35:19] Radar: You should probably check to see if someone else has written a Ruby gem for interacting with this API first... but I'm guessing you've done that already or it's a custom API.
[22:35:46] regedit: ye it seems rather very paranoid-ly protected & secured... almost NDA-like
[22:36:21] regedit: https://www.attomdata.com/
[22:37:32] Radar: Well at least their API comes in JSON flavour.
[22:37:54] Radar: I hope they have some documentation behind a paywall because their site isn't really explanatory at all.
[22:38:37] regedit: yep... all behind paid pricey membership deals...
[22:39:08] regedit: get this - the API is restricted by IP
[22:39:32] regedit: o_O personally i've never seen/heard such a level of API paranoia before
[22:41:17] regedit: https://usercontent.irccloud-cdn.com/file/LRtI3WF8/ParanoiaAPI
[22:45:14] Radar: You haven't worked in this industry long enough then :P
[22:45:43] Radar: "as well as IP ranges" <- 0.0.0.0 - 255.255.255.255 thanks. And whatever the equivalent is in IPV6.
[22:46:01] Radar: What a pain in the ass. Especially if you had some EC2 instances that had dynamic IPs behind an ELB.
[22:46:33] Radar: Seems like an attempt to protect you, but lots more administrative overhead for htem.
[22:49:03] jane_booty_doe: has joined #RubyOnRails
[22:51:00] duderonomy: has joined #RubyOnRails
[22:53:18] gambl0re: has joined #RubyOnRails
[23:08:25] DTZUZO: has joined #RubyOnRails
[23:11:00] Inside: ACTION tears his hair out
[23:11:02] Inside: all my tests stopped working
[23:11:40] Inside: undefined method user for <class(memory address)>
[23:14:36] rikkipitt: has joined #RubyOnRails
[23:16:02] Inside: has left #RubyOnRails: ()
[23:17:31] Inside: has joined #RubyOnRails
[23:19:18] alfiemax: has joined #RubyOnRails
[23:22:10] Inside: Apparently rails doesn't like what I'm doing in this .yml file: https://gist.github.com/Insood/bbd59980a5318c88d08d5996ef376c07
[23:25:29] jottr: has joined #RubyOnRails
[23:28:42] Radar: Inside: I doubt that it says <class(memory address)>. What does it really say?