« Back to channel list

#RubyOnRails - 08 December 2018

« Back 1 day Forward 1 day »
[00:05:01] kapil____: has joined #RubyOnRails
[00:10:50] desperek: has joined #RubyOnRails
[00:11:07] fcser__: has joined #RubyOnRails
[00:13:55] beingjohnm_: has joined #RubyOnRails
[00:14:34] salasrod_: has joined #RubyOnRails
[00:18:16] webdestroyaz: has joined #RubyOnRails
[00:19:13] syndikate: has joined #RubyOnRails
[00:20:45] Ropeney: has joined #RubyOnRails
[00:21:50] tweaks: has left #RubyOnRails: ()
[00:26:31] Jervis_: has joined #RubyOnRails
[00:30:22] bambanx: has joined #RubyOnRails
[00:52:34] blackmesa: has joined #RubyOnRails
[00:53:10] agent_white: has joined #RubyOnRails
[00:56:48] beingjohnm: has joined #RubyOnRails
[01:29:54] carbone5: has joined #RubyOnRails
[01:42:45] orbyt_: has joined #RubyOnRails
[01:50:49] carbone5: has joined #RubyOnRails
[02:05:43] carbone5: has joined #RubyOnRails
[02:23:57] gavit: has joined #RubyOnRails
[02:24:27] gavit: Hi, should the following still work in rails 5.2? - https://www.thegreatcodeadventure.com/managing-multiple-databases-in-a-single-rails-application/
[02:41:32] potatoes_: has joined #RubyOnRails
[02:41:52] potatoes_: hey guys this might be a sily question - I have enabled semantic logger and added an HTTPS appender, how do I disable log disk logging?
[02:43:19] potatoes_: I have googled several terms and am having not much luck, if there is a good resource that I should look at to properly address this let me know thanks.
[02:48:11] andrew_v: has joined #RubyOnRails
[02:50:18] andrew_v: anyone use actioncable? about to start working with in, but was wondering how you handle access control. example: someone subscribes to group_#{group.id}, then later is removed from the group. can you remove that user from subscriptions on the server?
[02:51:57] andrew_v: and similarly (but less important), can you disconnect a user if a token expires?
[02:54:30] sevenseacat: has joined #RubyOnRails
[02:57:44] gavit: has joined #RubyOnRails
[02:58:23] rodd: has joined #RubyOnRails
[02:59:06] gavit: What would be the way to convert a timestamp on db level: select applicant_given_name, applicant_surname, TO_TIMESTAMP(validity_from/1000) from security_id;
[03:03:33] jenrzzz: has joined #RubyOnRails
[03:07:12] andrew_v: gavit, might depend on your database. have you looked at time/timestamp function for whichever you're using (mysql?)?
[03:07:55] gavit: andrew_v: it works in postgresql
[03:07:55] gavit: just want the validity in some kind of readable format (its stored in the db as a epoch timestamp*1000 (dont know why)
[03:08:28] gavit: just not sure on how to run it in rails
[03:12:37] gavit: andrew_v: any idea?
[03:12:39] andrew_v: something like Model.select('to_timestamp(...) as validity_from').first ?
[03:13:24] gavit: andrew_v: I do that in my model?
[03:14:06] andrew_v: you should try it in a single query to see if it does what you want/expect :)
[03:14:17] gavit: I'd like to be able to do something like SecurityId.validity_from and get the timestamp
[03:14:56] andrew_v: not sure if there's a way to tell the model to add that to every select
[03:19:21] andrew_v: if you only need to do it in a small number of queries, you can do something like: (in model) def self.readable_validity; return self.select('to_timestamp ... as validity_from', '*'); end then in your query: Model.readable_validity.where(...)
[03:23:21] gavit: I was hoping that just like how you can define a table with self.table_name you could do something with the fields
[03:34:58] gavit: andrew_v: DateTime.strptime((expiry_date/1000).to_s, "%s") seems to work :(
[03:41:57] ariedler: has joined #RubyOnRails
[04:10:05] braincrash: has joined #RubyOnRails
[05:22:54] uks: has joined #RubyOnRails
[05:44:53] Saukk: has joined #RubyOnRails
[06:33:44] Dbugger: has joined #RubyOnRails
[06:52:47] cnsvc: has joined #RubyOnRails
[06:53:52] jetchisel: has joined #RubyOnRails
[07:12:32] Jnco: has joined #RubyOnRails
[07:13:24] buyfn: has joined #RubyOnRails
[07:24:13] srinidhi: has joined #RubyOnRails
[07:27:55] Jnco: Anyone feel like helping me convert a doc into a html.slim file I'm having a heck of a time
[07:43:37] ariedler: has joined #RubyOnRails
[07:56:03] Jnco: anyone know a simple was to take a docx file and get it into html/slim
[08:02:33] sevenseacat: https://rubygems.org/gems/html2slim
[08:02:44] sevenseacat: yeah, manually probably :P
[08:05:54] lankanmon: has joined #RubyOnRails
[08:34:39] reber: has joined #RubyOnRails
[09:15:44] ellcs: has joined #RubyOnRails
[09:26:34] Andr3as: i have a string like 'ESZ8-CME' and i have a model where i want to store a string "pattern" like 'ES??-CME' .. what i want to achieve is to find the corresponding element when i query for 'ESZ8-CME'
[09:28:48] Andr3as: there are other strings as well like "NQZ8-CME" or "@ESZ18"
[09:29:24] blackmesa: has joined #RubyOnRails
[09:30:32] Andr3as: anyone with a hint on how to achieve that?
[09:42:22] roshanavand: has joined #RubyOnRails
[09:44:32] ariedler: has joined #RubyOnRails
[09:50:47] uks: has joined #RubyOnRails
[10:10:41] maryo: has joined #RubyOnRails
[10:40:08] maryo: has joined #RubyOnRails
[10:46:16] ur5us: has joined #RubyOnRails
[11:07:16] jottr: has joined #RubyOnRails
[11:12:13] gavit: has joined #RubyOnRails
[11:19:15] akosednar: has joined #RubyOnRails
[11:35:03] lexileo: has joined #RubyOnRails
[11:45:16] ariedler: has joined #RubyOnRails
[11:50:10] maryo: has joined #RubyOnRails
[11:54:19] gavit: I'm using gem 'webpacker' but I can't seem to load the js. I have run webpack-dev-server, and modified content_securoty_policy.rb How do I check what else could be wrong.
[11:57:25] jottr: has joined #RubyOnRails
[12:02:32] xall: has joined #RubyOnRails
[12:10:32] lankanmon: has joined #RubyOnRails
[12:11:41] dviola: has joined #RubyOnRails
[12:27:59] gavit: hmm, the js works, its just jquery that doesnt seem to :(
[12:35:02] za1b1tsu: has joined #RubyOnRails
[12:35:31] Andr3as: could someone pls take a look at that gist? https://gist.github.com/awunder/b9492a5182272a7260edb2929bef95c6
[12:35:53] Andr3as: i'm going crazy and wonder why i cant iterate through the elements..(?)
[12:36:27] sevenseacat: are you wanting map instead of each?
[12:36:39] sevenseacat: you're not doing anything in the each block
[12:37:07] Andr3as: sevenseacat: am still at that issue above..
[12:37:32] Andr3as: even a puts r.id doesnt "work"
[12:38:16] sevenseacat: define 'doesn't work'
[12:38:24] Andr3as: see updated gist
[12:38:29] Andr3as: same output as without
[12:38:43] sevenseacat: what are you trying to do?
[12:38:49] gavit: sevenseacat: lemme see if I can elaborate
[12:40:54] Andr3as: sevenseacat: at the end of the day i want to get the BrokerInstrument whose symbol "match" (e.g.) "CLZ8-CME"
[12:41:05] sevenseacat: what's that got to do with your gist?
[12:41:11] gavit: sevenseacat: https://dpaste.de/KNGC
[12:41:59] Andr3as: well.. i thought i simplify the gist
[12:42:00] sevenseacat: without knowing what that bootstrap file is, can't help you
[12:42:42] gavit: sevenseacat: its bootstrap version 3 installed via npm
[12:42:56] sevenseacat: doens't help. check the docs for the library
[12:47:09] Andr3as: sevenseacat: i did another update.. this time with my poor attempt to get the id
[12:47:31] scrooloose: has joined #RubyOnRails
[12:47:56] sevenseacat: Andr3as: again, are you looking for map instead of each? each will evaluate the block, but not return the result
[12:48:56] Andr3as: ok.. so map... i will read a bit
[12:50:25] gavit: sevenseacat: okay, thanks I'll go look again
[12:52:29] Andr3as: sevenseacat: you think broker_instruments.map {|bi| bi.id if trade_executions[r][2].match bi.symbol }.first sounds good?
[12:52:56] sevenseacat: I don't think that's going to do what you want
[12:53:04] sevenseacat: but then again, I don't know what you want
[12:54:34] Andr3as: hmm, it gives me 1 which is the id of the BrokerInstrument i'd expect it to return
[12:56:02] kapil____: has joined #RubyOnRails
[12:56:04] sevenseacat: I think you want find instead of map there
[12:56:19] sevenseacat: otherwise you'll end up with a list of [nil, id, id, nil] etc.
[12:57:11] Andr3as: the thing is, i have a "pattern" stored in the DB.. like "ES..-CME" and when i import a file, i have a string "ESZ8-CME"
[12:57:25] sevenseacat: no, with the code
[12:59:04] Andr3as: hmm, i though find needs an id but i do not have an id?
[13:00:14] Andr3as: but thanks for the heads up, if i change the string its more like [nil, 5] - so my above code def wont work
[13:01:05] gavit: odd, I swapped import 'bootstrap' with import 'bootstrap/dist/js/bootstrap.min.js'; and I get an error: Bootstrap's JavaScript requires jQuery. Looks more prosmising
[13:02:45] Andr3as: sevenseacat: select might do what i need...
[13:02:50] Andr3as: https://stackoverflow.com/a/13485482/6844761
[13:03:35] Andr3as: broker_instruments.select {|bi| bi.id if trade_executions[r][2].match bi.symbol }.first.instrument
[13:12:55] nopolitica: has joined #RubyOnRails
[13:18:00] KeyJoo: has joined #RubyOnRails
[13:22:22] nopolitica: has joined #RubyOnRails
[13:23:25] nopolitica: has joined #RubyOnRails
[13:53:58] KeyJoo: has joined #RubyOnRails
[14:24:11] weird_error: has joined #RubyOnRails
[14:31:48] defsdoor: has joined #RubyOnRails
[14:35:54] maryo: has joined #RubyOnRails
[14:44:36] blackmesa: has joined #RubyOnRails
[14:54:12] andrew_v: anyone use actioncable? about to start working with in, but was wondering how you handle access control. example: someone subscribes to group_#{group.id}, then later is removed from the group. can you remove that user from subscriptions on the server?
[15:22:22] weird_error: has joined #RubyOnRails
[15:55:35] weird_error: has joined #RubyOnRails
[16:09:22] weird_error: has joined #RubyOnRails
[16:30:07] cnsvc: has joined #RubyOnRails
[16:30:37] fragamus: has joined #RubyOnRails
[16:33:07] andrew_v: has joined #RubyOnRails
[16:40:30] maryo: has joined #RubyOnRails
[16:56:40] alfiemax: has joined #RubyOnRails
[16:56:49] alfiemax: hi everyone...
[16:56:58] alfiemax: anyone here?? being a weekend and all..
[16:57:47] alfiemax: i'm looking for someone who can point me to the code in rails source code where the routes are generated.. routes.. it's helpers.. and the output of rake routes
[17:10:44] havenwood: AlHafoudh: `rake routes` gives you a deprecation warning! https://github.com/rails/rails/blob/master/railties/lib/rails/tasks/routes.rake#L7
[17:10:52] havenwood: AlHafoudh: oops, sorry - wrong nick
[17:30:49] maryo: has joined #RubyOnRails
[17:42:09] reber: has joined #RubyOnRails
[18:22:19] blackmesa: has joined #RubyOnRails
[18:30:37] cnsvc: has joined #RubyOnRails
[18:36:43] Dimik: has joined #RubyOnRails
[18:50:44] weird_error: has joined #RubyOnRails
[18:56:32] maryo: has joined #RubyOnRails
[19:19:31] _aeris_: has joined #RubyOnRails
[19:28:08] Puffball: has joined #RubyOnRails
[20:08:01] potatoes_: has joined #RubyOnRails
[20:09:17] potatoes_: Good Morning kind folks, I have been searching around good with terms like 'disable ruby logging' OR 'disabling writing logs to disk in ruby' and the likes and I really have not figured out to just have my logger send over the network using my Semantic Logger gem. Any helpful hints or suggestions or a resource or search I may not have tried that might bare more relevant results. Thank You and Good Morning again.
[20:11:15] havenwood: potatoes_: Are you asking about a Rack app? Rails?
[20:11:46] potatoes_: havenwood: Ruby on Rails my good man
[20:11:56] havenwood: potatoes_: Ah, right - the channel...
[20:11:58] potatoes_: i mean person.
[20:12:08] havenwood: I thought we were in #ruby >.>
[20:12:15] potatoes_: havenwood: you aren't wrong to ask, some people don't prepare :)
[20:13:24] havenwood: potatoes_: config.logger = Logger.new File::NULL
[20:13:59] potatoes_: @havenwood I presume in my environment file?
[20:14:16] havenwood: potatoes_: aye
[20:14:54] potatoes_: thanks i'll give that a whirl :crosses_fingers: :)
[20:15:33] potatoes_: havenwood: actually since u seem to be a bright lad, lemme ask you 1 other quick q - do you have any alternatives to Capistrano, i'm not a huge fan.
[20:15:41] potatoes_: Or at least opinions on the matter.
[20:15:44] havenwood: potatoes_: Mina
[20:16:11] havenwood: potatoes_: http://nadarei.co/mina/
[20:16:46] havenwood: Or fanciest name goes to Vlad the Deployer: https://github.com/seattlerb/vlad
[20:18:33] XiaomengChen91: has joined #RubyOnRails
[20:18:42] XiaomengChen91: has left #RubyOnRails: ()
[20:19:16] potatoes_: that made me laugh so reakin hard :)
[20:23:31] alfiemax: has joined #RubyOnRails
[20:25:36] weaksauce: has joined #RubyOnRails
[20:40:33] work_: has joined #RubyOnRails
[20:44:54] jottr: has joined #RubyOnRails
[20:49:16] weird_error: has joined #RubyOnRails
[20:50:18] cajone: has joined #RubyOnRails
[20:58:26] Puffball: has joined #RubyOnRails
[21:05:27] Xiti: has joined #RubyOnRails
[21:10:38] blackmesa: has joined #RubyOnRails
[21:26:58] gambl0re: has joined #RubyOnRails
[21:34:19] cnsvc: has joined #RubyOnRails
[21:54:48] alfiemax: has joined #RubyOnRails
[22:00:14] gavit: has joined #RubyOnRails
[22:40:21] lucasb: has joined #RubyOnRails
[22:43:13] lord4163: has left #RubyOnRails: ("Leaving")
[22:52:28] gavit: Can I write a default scope of a class in raw SQL?
[22:54:23] kapil____: has joined #RubyOnRails
[22:56:12] gavit: I'd like a group_by for my query
[22:59:59] orbyt_: has joined #RubyOnRails
[23:14:56] cnsvc: has joined #RubyOnRails
[23:36:49] Jervis_: has joined #RubyOnRails
[23:45:44] lucasb: has left #RubyOnRails: ()
[23:47:46] Wixy: has joined #RubyOnRails
[23:48:26] Wixy: Hey all. Where am I suppose to put a file with config such as possible values for languages (en_US en_UK es_ES etc)?
[23:48:35] Wixy: supposed*