« Back to channel list

#RubyOnRails - 07 November 2018

« Back 1 day Forward 1 day »
[00:10:18] ariedler: has joined #RubyOnRails
[00:17:19] mangold: has joined #RubyOnRails
[00:20:40] Milos: has joined #RubyOnRails
[00:25:52] tdy: has joined #RubyOnRails
[00:36:41] sevenseacat: has joined #RubyOnRails
[00:48:56] hd1: has joined #RubyOnRails
[01:10:08] blackmesa: has joined #RubyOnRails
[01:11:29] jane_booty_doe: has joined #RubyOnRails
[01:14:25] chouhoulis: has joined #RubyOnRails
[01:19:35] sameerynho: has joined #RubyOnRails
[01:29:37] jetchisel: has joined #RubyOnRails
[01:32:01] fourcolors: has joined #RubyOnRails
[01:32:57] fourcolors: Hey, I'm having a really tough time getting some params in my rails controller. I'm trying to do something like `params.permit(:options).permit(:include)` so I can request optional data in my API but that always returns params not permitted
[01:33:40] fourcolors: Any chance there is a different way to do it
[01:33:56] sevenseacat: so what does your code look like, what params are you submitting and what error are you getting?
[01:38:05] hd1: has left #RubyOnRails: ()
[01:38:08] orbyt_: has joined #RubyOnRails
[01:41:18] fourcolors: my controller looks like this https://pastebin.com/4pPj52CQ
[01:42:03] fourcolors: I'd like to be able to pass in options[:include][:some_model] into my controller
[02:19:08] Exuma: has joined #RubyOnRails
[02:42:32] amincd: has joined #RubyOnRails
[02:43:30] amincd: Hi, I'm trying to create an array of couplets, meaning sets of two instances of a model, and then render that array of couplets as an json. How would I craft the serializer to work with that? More generally, how does one make a serializer handle a nested array?
[02:57:40] ariedler: has joined #RubyOnRails
[03:03:09] Saukk: has joined #RubyOnRails
[03:05:02] mangold: has joined #RubyOnRails
[03:20:25] sameerynho: has joined #RubyOnRails
[03:21:31] za1b1tsu: has joined #RubyOnRails
[03:34:50] GodFather: has joined #RubyOnRails
[04:10:09] braincrash: has joined #RubyOnRails
[04:12:54] lunarkitty7: has joined #RubyOnRails
[04:13:05] srinidhi: has joined #RubyOnRails
[04:21:08] darkhanb: has joined #RubyOnRails
[04:40:37] conta: has joined #RubyOnRails
[04:42:34] ivanskie: has joined #RubyOnRails
[04:58:30] ariedler: has joined #RubyOnRails
[05:06:45] ariedler: has joined #RubyOnRails
[05:07:23] sameerynho: has joined #RubyOnRails
[05:22:31] mangold: has joined #RubyOnRails
[05:34:41] kapil____: has joined #RubyOnRails
[05:42:58] cgfbee: has joined #RubyOnRails
[05:44:50] Dimik: has joined #RubyOnRails
[05:58:59] GodFather: has joined #RubyOnRails
[06:14:55] conta: has joined #RubyOnRails
[06:22:31] reber: has joined #RubyOnRails
[06:34:37] ur5us: has joined #RubyOnRails
[06:56:50] Exagone313: has joined #RubyOnRails
[07:00:58] eckhardt: has joined #RubyOnRails
[07:07:27] ariedler: has joined #RubyOnRails
[07:07:52] roshanavand: has joined #RubyOnRails
[07:18:57] roshanavand1: has joined #RubyOnRails
[07:23:14] whysthatso: has joined #RubyOnRails
[07:49:13] GodFather: has joined #RubyOnRails
[07:55:51] srinidhi: has joined #RubyOnRails
[08:31:44] mangold: has joined #RubyOnRails
[08:34:12] zmo: has joined #RubyOnRails
[09:07:46] JamieD: has joined #RubyOnRails
[09:08:31] ariedler: has joined #RubyOnRails
[09:13:19] blackmesa: has joined #RubyOnRails
[09:14:22] sevenseacat: has joined #RubyOnRails
[09:26:02] ariedler: has joined #RubyOnRails
[09:30:51] Psy-Q: is there something that makes symmetric encryption of certain values that go into the database easier? i need to store passwords encrypted at rest but decrypt them and give them out as plaintext to authenticated clients (they don't need to have a matching public key)
[09:33:11] tbuehlmann: I don't fully understand the question, but there's the attr_encrypted gem which can encrypt stuff before storing it in the database and decrypt when you want to read it
[09:33:21] Psy-Q: oh, that should be exactly right
[09:33:39] sevenseacat: we've used that gem before with great success
[09:33:40] Psy-Q: it should only protect from e.g. misconfigured database privileges that might allow other tenants of the same DB cluster to read the data
[09:34:02] tbuehlmann: I second that, working great for us, too
[09:35:15] Psy-Q: that looks exactly like what i want, thanks :) i was pondering to do it with plain OpenSSL::Cipher but it looks like that gem takes care of all that already
[09:47:12] Guest53511: has joined #RubyOnRails
[09:55:17] conta1: has joined #RubyOnRails
[10:00:52] Xiti: has joined #RubyOnRails
[10:09:30] mangold: has joined #RubyOnRails
[10:11:47] conta1: has joined #RubyOnRails
[10:18:48] za1b1tsu: has joined #RubyOnRails
[10:36:17] apparition: has joined #RubyOnRails
[10:41:09] tuor: has joined #RubyOnRails
[10:46:36] Cork: is it possible to get ActionMailer#deliver_later to do a deliver_now in testing?
[10:46:39] srinidhi: has joined #RubyOnRails
[10:47:17] conta1: has joined #RubyOnRails
[10:50:02] Psy-Q: somehow the magic that makes the unencrypted attribute names work isn't working
[10:50:39] Psy-Q: i renamed my password to encrypted_password and gave it an encrypted_password_iv, but it looks like the call for e.g. password=(foo) isn't being intercepted
[11:00:57] dionysus69: has joined #RubyOnRails
[11:06:17] conta1: has joined #RubyOnRails
[11:26:59] ariedler: has joined #RubyOnRails
[11:29:54] Psy-Q: hrm, yeah, something is fishy with that
[11:29:58] Psy-Q: also: DEPRECATION WARNING: password is not an attribute known to Active Record. This behavior is deprecated and will be removed in the next version of Rails.
[11:30:54] Psy-Q: i can't use the attribute e.g in a before_validation hook, i can use it "plainly" if i just do dbu = DatabaseUser.new; dbu.password = 'foobar'
[11:35:32] ariedler: has joined #RubyOnRails
[11:37:14] conta1: has joined #RubyOnRails
[11:46:02] mangold: has joined #RubyOnRails
[11:49:35] sandstrom: has joined #RubyOnRails
[11:55:08] ariedler: has joined #RubyOnRails
[12:11:02] lankanmon: has joined #RubyOnRails
[12:11:30] whysthatso: has joined #RubyOnRails
[12:39:24] conta1: has joined #RubyOnRails
[12:40:33] Psy-Q: ah, i see. the docs point at an outdated version
[12:50:12] Psy-Q: nope, it still explodes when assigning anything to e.g. self.password. maybe something changed in ActiveRecord since the last release of that gem
[12:52:37] voolik: has joined #RubyOnRails
[12:56:00] JamieD: has joined #RubyOnRails
[12:58:59] nicolasb: has joined #RubyOnRails
[13:05:07] GodFather: has joined #RubyOnRails
[13:12:06] hays: has joined #RubyOnRails
[13:17:28] Guest53511: has joined #RubyOnRails
[13:19:24] Psy-Q: nah, that error was on me. but it seems to be unable to deal with any previously existing records because they lack an IV
[13:40:18] Psy-Q: so either you use this gem from the very start of your project or not at all? that's odd
[13:41:09] Guest53511: has joined #RubyOnRails
[13:45:30] Psy-Q: i'll detect if there's an IV and try to generate one if not, reload and resave all the records, that might work
[13:56:25] Psy-Q: grmpf, that doesn't work either
[13:59:22] Psy-Q: oh i see, it's a bug in attr_encrypted itself: https://github.com/attr-encrypted/attr_encrypted/pull/320
[14:03:08] conta: has joined #RubyOnRails
[14:07:06] dionysus69: at which stage of deployment I should precompile assets when deploying with kubernetes? if I precompile and run rails s in dockerfile, precompilation happens everytime, I thought of precompiling locally and then copying assets in the docker container. does that sound legit?
[14:13:17] reber: has joined #RubyOnRails
[14:29:03] DTZUZO: has joined #RubyOnRails
[14:41:10] za1b1tsu: has joined #RubyOnRails
[15:00:10] zming: has joined #RubyOnRails
[15:00:58] conta: has joined #RubyOnRails
[15:06:01] Guest53511: has joined #RubyOnRails
[15:27:41] mangold: has joined #RubyOnRails
[15:31:28] lexileo: has joined #RubyOnRails
[15:47:13] hadifarnoud: has joined #RubyOnRails
[16:00:39] Dbugger: has joined #RubyOnRails
[16:04:16] orbyt_: has joined #RubyOnRails
[16:06:38] eddof13: has joined #RubyOnRails
[16:08:25] jetchisel: has joined #RubyOnRails
[16:12:53] hadifarnoud: has joined #RubyOnRails
[16:13:43] hadifarnoud: has joined #RubyOnRails
[16:14:33] hadifarnoud: has joined #RubyOnRails
[16:16:43] eddof13: has joined #RubyOnRails
[16:20:10] chouhoulis: has joined #RubyOnRails
[16:20:59] chouhoulis: has joined #RubyOnRails
[16:48:11] mangold: has joined #RubyOnRails
[16:52:08] jetchisel: has joined #RubyOnRails
[16:59:25] blackmesa1: has joined #RubyOnRails
[17:08:03] Xiti: has joined #RubyOnRails
[17:11:31] beowuff: has joined #RubyOnRails
[17:13:32] Inside: has joined #RubyOnRails
[17:15:13] darkhanb: has joined #RubyOnRails
[17:15:32] orbyt_: has joined #RubyOnRails
[17:26:02] Saukk: has joined #RubyOnRails
[17:34:44] chouhoulis: has joined #RubyOnRails
[17:38:14] darkhanb: has joined #RubyOnRails
[17:40:20] chouhoulis: has joined #RubyOnRails
[17:46:39] chouhoulis: has joined #RubyOnRails
[17:47:19] srinidhi: has joined #RubyOnRails
[17:47:46] JamieD: has joined #RubyOnRails
[17:52:17] chouhoulis: has joined #RubyOnRails
[17:56:57] za1b1tsu: has joined #RubyOnRails
[18:02:11] SteenJobs: has joined #RubyOnRails
[18:09:37] jesfre: has joined #RubyOnRails
[18:36:44] eckhardt_: has joined #RubyOnRails
[18:39:34] keegnotrub: has joined #RubyOnRails
[18:44:34] lxsameer: has joined #RubyOnRails
[18:46:02] cjohnson: I'm taking a handful of existing routes and moving them into a namespace. I need to set up batch redirects for all the old used-to-be top level routes into the namespaced ones
[18:46:08] cjohnson: What's the appropriate way to do this?
[18:46:56] cjohnson: So https://gist.github.com/chrisjohnson/cb921cb44153869b1e5b5c5f1f901bfe these routes used to be top-level. I need to redirect /login to /my-thing/login, /opportunities/foo -> /my-thing/opportunities/key, etc
[18:58:46] havenwood: cjohnson: hrm, my first thought is something like: get 'opportunities/:key', to: redirect('/clinical-alerts-plus/opportunities/%{key}')
[18:59:19] havenwood: cjohnson: seems there might be a better way, but unsure ¯\_(ツ)_/¯
[19:00:14] havenwood: I don't know of a `forward_to_namespace` type block. Hmmm
[19:02:23] cjohnson: Yeah ideally I would not have to redefine every route twice. That said, I can do that, but then how do I handle resource/resources?
[19:02:43] cjohnson: Do I have to convert those to individual get/post/put/etc?
[19:07:42] whysthatso: has joined #RubyOnRails
[19:14:20] za1b1tsu: has joined #RubyOnRails
[19:19:09] whysthatso: has joined #RubyOnRails
[19:23:21] cjohnson: There's no such thing as a POST redirect right?
[19:23:36] cjohnson: For my single POST route, I will just have to do a direct route match and then redirect after it's posted right
[19:24:08] weaksauce: has joined #RubyOnRails
[19:27:11] JamieD: has joined #RubyOnRails
[19:49:22] blackmesa: has joined #RubyOnRails
[19:51:49] appelzaf: has joined #RubyOnRails
[19:52:44] choke: has joined #RubyOnRails
[19:53:19] appelzaf: Hey all, trying to reduce connection churn with resque forking. Is before_fork; disconnect/after_fork reconnect still the best way to do it, or could I simply use after_fork;ActiveRecord::Base.clear_active_connections! or something else?
[19:55:59] ur5us: has joined #RubyOnRails
[20:00:57] appelzaf: Or otherwise, disconnect! vs clear_all_connections! which is better in the context of forking?
[20:02:30] za1b1tsu: has joined #RubyOnRails
[20:03:10] keegnotrub: has joined #RubyOnRails
[20:07:29] defsdoor: has joined #RubyOnRails
[20:13:46] SteenJobs: has joined #RubyOnRails
[20:22:51] davidh38: has joined #RubyOnRails
[20:23:06] davidh38: i have a form form_tag(url_for_options = {}, options = {}, &block)
[20:23:20] davidh38: and i call with form_tag('/posts')
[20:23:45] davidh38: why does it work? there are two arguemnts as hashes
[20:31:09] Inside: you might want to paste code
[20:31:22] appelzaf: disconnect! vs clear_all_connections! which is better in the context of forking?
[20:32:24] choke: has joined #RubyOnRails
[20:35:35] blackmesa: has joined #RubyOnRails
[20:47:53] iamdevnul: has joined #RubyOnRails
[20:48:01] mattwc: has joined #RubyOnRails
[20:49:16] ppl: has joined #RubyOnRails
[20:49:21] jhill: has joined #RubyOnRails
[20:50:01] abartov: has joined #RubyOnRails
[21:04:03] beholders_eye: has joined #RubyOnRails
[21:04:10] appelzaf: disconnect! vs clear_all_connections! which is better in the context of forking?
[21:04:16] jesfre: has joined #RubyOnRails
[21:04:50] eckhardt_: has joined #RubyOnRails
[21:07:13] za1b1tsu: has joined #RubyOnRails
[21:07:17] SteenJobs: has joined #RubyOnRails
[21:14:47] ebl: has joined #RubyOnRails
[21:15:21] ebl: has left #RubyOnRails: ()
[21:15:42] eckhardt_: has joined #RubyOnRails
[21:21:56] Radar: GOOD MORNING
[21:22:27] Radar: davidh38: it works because the other arguments are optional
[21:23:05] davidh38: @Radar thanks!
[21:23:37] davidh38: @Inside yes, should have pasted it directly, ty for caring
[21:25:59] Inside: I misread your question
[21:26:01] Inside: what Radar said
[21:28:11] beholders_eye: has joined #RubyOnRails
[21:29:11] kapil____: has joined #RubyOnRails
[21:38:00] roshanavand: has joined #RubyOnRails
[21:38:11] ellcs: has joined #RubyOnRails
[21:39:51] mochiyoda: has joined #RubyOnRails
[21:41:43] nexraf1: has joined #RubyOnRails
[22:02:04] hightower2: has joined #RubyOnRails
[22:05:05] lypsis: has joined #RubyOnRails
[22:05:19] hightower2: Hey, how do I return an ActiveRecord::Relation that points to all results in a table?
[22:08:07] lypsis: has joined #RubyOnRails
[22:15:18] Inside: Model.all ?
[22:16:09] mochiyoda: has joined #RubyOnRails
[22:19:19] Radar: what Inside said
[22:24:32] OrangeManBad: has joined #RubyOnRails
[22:32:21] dbugger_: has joined #RubyOnRails
[22:36:54] hive-mind: has joined #RubyOnRails
[22:37:26] SteenJobs: has joined #RubyOnRails
[22:38:18] jesfre: has joined #RubyOnRails
[22:40:12] nicolasb: has joined #RubyOnRails
[22:48:37] hightower2: hehe figured it myself through a couple tests too, thanks for the confirmation :)
[22:54:34] choke: has joined #RubyOnRails
[22:55:10] za1b1tsu: has joined #RubyOnRails
[23:01:33] kapil____: Hello how to get all columns from sql Type?
[23:04:35] Inside: Model.columns_hash
[23:05:02] Inside: depends on what data you need? just the name of the columns?
[23:05:10] Inside: Model.columns_hash.keys for that
[23:05:55] kapil____: Inside: but Model is not a table.
[23:06:11] Inside: I don't understand your question then
[23:06:33] kapil____: https://gist.github.com/kapilpipaliya/97c5b861c8e48c842a25b7aa1f27a1df
[23:07:00] kapil____: i have this type. i want to get its columns from rails. how to create Model for it?
[23:09:28] Inside: that's beyond me - sorry
[23:28:50] za1b1tsu: has joined #RubyOnRails
[23:42:20] choke: has joined #RubyOnRails
[23:51:11] nexraf1: has joined #RubyOnRails
[23:58:51] daemonwrangler: has joined #RubyOnRails