Activity Graph

Page 1 of 7 | Next »


[00:56:25] Andr3as: *.net *.split
[01:13:37] Andr3as: has joined #RubyOnRails


[06:34:46] Andr3as: has joined #RubyOnRails


[13:39:34] Andr3as: has joined #RubyOnRails
[17:18:24] Andr3as: Quit: No Ping reply in 180 seconds.


[20:24:58] Andr3as: Ping timeout: 252 seconds


[07:59:33] Andr3as: has joined #RubyOnRails


[15:13:31] Andr3as: Remote host closed the connection


[00:14:56] Andr3as: Ping timeout: 252 seconds
[05:36:21] Andr3as: has joined #RubyOnRails


[08:25:38] Andr3as: has joined #RubyOnRails


[09:53:16] Andr3as: has joined #RubyOnRails
[14:49:19] Andr3as: Ping timeout: 250 seconds


[18:01:03] Andr3as: Quit: whats this plug for?


[12:50:51] Andr3as: has joined #RubyOnRails


[21:52:52] Andr3as: Ping timeout: 264 seconds


[12:59:39] Andr3as: TurtleTony: why not DIY? it doesnt semms that complex?


[08:00:26] Andr3as: has joined #RubyOnRails


[15:59:28] Andr3as: Ping timeout: 264 seconds


[14:46:04] Andr3as: cca4: you could go for <%= "#{t('offers.box_informations.delivery_on')} #{l(@offer.delivery_on)}" %>
[14:46:36] Andr3as: cca4: see


[13:46:57] Andr3as: has joined #RubyOnRails


[16:42:52] Andr3as: Quit: whats this plug for?


[14:35:14] Andr3as: hi all.. i have an Analysis model with a "dynamic longterm_trend score". that score should be set via a different model and i realized that with a "belongs_to" association.. however, what i am trying to achieve is when i for some reason delete an entry which is being referenced, i want to remove its id out of the longterm_trend column, i cant use any of the dependent options, obviously..
[14:35:27] Andr3as: anyone an idea?
[14:39:47] Andr3as: NL3limin4t0r: i have, though they only have a destroy or delete.. i cant delete my record, i jsut want to clear the column
[14:41:15] Andr3as: NL3limin4t0r: oh! i totally missed that one, thank you so much!
[14:44:37] Andr3as: NL3limin4t0r: i see.. i proly have to go the db route as its a bit of a "complicated" setup.. that referenced table is set up as STI
[14:44:52] Andr3as: and being referenced by different columns out of the analysis model
[14:45:33] Andr3as: she is throwing an error kinda like "PG::UndefinedColumn - ERROR: column analyses.trend_score_id does not exist"
[14:46:10] Andr3as: which is correct as the column in this case is "trend_longterm" and might be "trend_shortterm" in a different case
[14:46:38] Andr3as: i would need to set the different column names somewhere, if thats even possible
[14:46:49] Andr3as: and i am running postgres, as a side note..
[14:52:50] Andr3as: i then have an Analysis model where i want to references those 4 TrendScore Elements from 3 different columns: trend_longterm, trend_medterm, trend_shortterm
[14:52:50] Andr3as: i have an STI model ScoreSystemVariables and several "sub models" like TrendScore.. so i create (as an example) four TrendScore Elements with scores from 1 to 4.
[14:52:50] Andr3as: i dont know if i screwed up on this one or if this was a good idea but the idea behind was this:
[14:53:53] Andr3as: that way i could change the score for those trendscore elements "on the fly" and always calculate the "correct" scores as i could just call "Analysis.trend_longterm.score"
[14:53:59] Andr3as: (for example)
[15:02:54] Andr3as: NL3limin4t0r: is the db schema sufficient for you?
[15:06:23] Andr3as: NL3limin4t0r: here's the relevant tables
[15:08:23] Andr3as: at the end of the day it should just deliver a score number to calc an overall score (over a whole bunch of different attributes) for an analysis
[15:10:59] Andr3as: NL3limin4t0r: i've updated the gist with the models being used in this case.. pls reload if needewd
[15:13:06] Andr3as: i do not.. i wouldnt need those and i am not sure if this can even be possible due to the fact that it coould be referenced from quite a few different columns out of the Analysis model
[15:13:45] Andr3as: e.g. in our example it could be referenced from the trend_longterm, trend_medterm or trend_shortterm column
[15:14:48] Andr3as: use case was, i delete one TrendScore instance
[15:15:06] Andr3as: and it was being referenced from trend_longterm and trend_shortterm
[15:17:52] Andr3as: i see.. thank you NL3limin4t0r, appreciating your help with this.
[15:18:46] Andr3as: ah, that sounds slick.. so i could just add that in a migration and thats it.. nice
[15:19:49] Andr3as: we'll see.. i just google a bit.. will let you know NL3limin4t0r
[15:21:06] Andr3as: there ya go.. i already had this in a migration
[15:21:07] Andr3as: add_reference :analyses, :trend_shortterm, foreign_key: {to_table: :score_system_variables}
[15:21:25] Andr3as: so, on_delete: :nullify should do the trick
[15:22:00] Andr3as: thanks a lot
[15:34:54] Andr3as: NL3limin4t0r: just an fyi, that did exactly what we expected and works like a charme


[15:46:38] Andr3as: has joined #RubyOnRails
[15:47:44] Andr3as: hi all... is someone aware of an "opposite" of time in words? if i enter like "5 years" or "3 months" it should come up with the number of days


[18:15:29] Andr3as: Quit: whats this plug for?


[07:55:49] Andr3as: Remote host closed the connection


[17:55:25] Andr3as: has joined #RubyOnRails
[18:07:17] Andr3as: hi all.. i've got an issue with running the command: rake webpacker:compile RAILS_ENV=staging which results in a
[18:07:25] Andr3as: TypeError: no implicit conversion of nil into String
[18:08:01] Andr3as: i did quite an extensive google search but i havent been able to come up with a hint on how to track that down.. anyone an idea how to find out where it dies?
[18:08:22] Andr3as: dev env compiles just fine
[18:11:43] Andr3as: i am on
[18:12:24] Andr3as: havent touched the app in a while, it worked great before.. went from linux to windows, pulled it out of my gitlab, did some updates and now boom
[18:12:51] Andr3as: updates as in "bundle update" and some minor bug fixes in the code.. totally unrelated to that error
[18:13:28] Andr3as: will give that a try, havenwood.. thank you
[18:14:26] Andr3as: ha, that "fixes" it
[18:14:39] Andr3as: thanks a lot!! i googled for like hours


[23:46:47] Andr3as: *.net *.split


[18:27:27] Andr3as: hi all.. i am having an API and it works as expected.. however, a third party wants to request a json reply of my "identity".. that req in the browser works fine, though wen the 3rd party app asks for it, i get an ActionController::UnknownFormat error
[18:27:52] Andr3as: as the req format seems to be html (request.formats: ["text/html"])
[18:28:14] Andr3as: is there a way to tell rails to serve json no matter what? kinda like ignore that the req asks for html?
[18:29:43] Andr3as: fwiw, that's my controlelr which serves the json
[18:30:33] Andr3as: its a bit of a test right now, so dont focus on the missing auth and what not..
[18:31:17] Andr3as: thing is, it already defaults on json
[18:31:25] Andr3as: lemme post the error
[18:31:45] Andr3as: trade added
[18:33:06] Andr3as: so, that 3rd party seems to specifically requests html (for whatever reason)
[18:34:17] Andr3as: so you still think that "format: :json" might fix that?
[18:35:48] Andr3as: will try.. its a bit of an open heart surgery on the staging env.. have that 3rd party app nowhere else..
[18:35:53] Andr3as: thank god for capistrano
[18:40:30] Andr3as: i dont get that far.. throws the error right away.. probably even before it executes the method
[18:47:30] Andr3as: yes, as this is an api.. i just try to disguise html as json now.. lets see what happens
[19:07:02] Andr3as: i put the default format into the routes.. the error is gone but it doesnt serve what its supposed to do
[19:07:06] Andr3as:
[19:07:26] Andr3as: first req is made be the 3rd party app.. it serves :no_content
[19:07:49] Andr3as: 2nd req is made by me in the browser, it serves what i expect it to
[19:11:09] Andr3as: sh*t .. i gotta go..


[15:35:59] Andr3as: hi all.. i have a text field where users should set a timecode in the format of MM:SS.. that timecode should be converted into seconds before i save it to the database as there is an integer field to hold it..
[15:36:30] Andr3as: in order to set that field correct i had to write a setter message timecode= with write_attribute :timecode, time.split(':').inject(0){|m, s| m = m * 60 + s.to_i}
[15:37:02] Andr3as: so far so good, i am now stuck with a validation coz i wnat that the user input will be validated if the format is correct..
[15:37:29] Andr3as: but as it gets converted when set, i cant validate, can i?
[15:38:06] Andr3as: if i dont do that setter method, user inputs of like "01:08" will be set to 1 when i do the thing..
[15:38:13] Andr3as: any hint is highly welcome


[11:35:35] Andr3as: morning all.. pretty noob question but i have this youtube api playlist item.. all i want is to put that content of @data into another hash.. but i dont seem to get @data out of the item.. anyone a hint how to get it?
[11:36:54] Andr3as: argh.. sometimes it needs a question somewhere.. i totally missed @snippet
[11:37:04] Andr3as: so does the trick


[11:34:12] Andr3as: has joined #RubyOnRails


[07:52:30] Andr3as: Remote host closed the connection


[17:04:32] Andr3as: hello all.. i wonder what i do wrong here.. i cannot seem to have a fontwaesome icon in a button_to call..? it ends up rendering as text
[17:04:37] Andr3as: anyone an idea whats going on?
[17:07:18] Andr3as: the left one is using link_to, the right one uses the button_to
[17:10:00] Andr3as: tbuehlmann: <%= button_to icon('far', 'eye'), new_signal_read_path, remote: true, class: 'read-link' %>
[17:10:43] Andr3as: no, passt..
[17:14:27] Andr3as: tbuehlmann: just to clearify.. i meant i am using the button_to method as above.. and it aint working.. i cant find my mistake..
[17:15:33] Andr3as: same thing.. doesnt work.. i even tried raw(icon('foo', 'bar'))
[17:15:46] Andr3as: i give this one a shot
[17:16:37] Andr3as: the block systax does the trick
[17:17:35] Andr3as: that method is part of the fontawesome gem
[17:18:37] Andr3as:
[17:29:49] Andr3as: ah, and thanks, as walways, tbuehlmann
[17:42:25] Andr3as: yeah, but they stopped at 4.7'ish or something.. i thought, i new project deserves the newest icons ;)
[17:42:35] Andr3as: *a new project


[09:18:41] Andr3as: is it really called "file.rb"?
[09:19:28] Andr3as: and.. define "not working"..
[09:25:41] Andr3as: => "cat's are really nice sometimes, we give them good cat ."
[09:25:41] Andr3as: 2.5.3 :004 > line.gsub!(/food/, '') if line.start_with?('cat', 'dog')
[09:25:53] Andr3as: line = "cat's are really nice sometimes, we give them good cat food."
[09:26:11] Andr3as: so, your code works to me..?
[09:26:54] Andr3as: that loop though..
[09:30:17] Andr3as: you might wanna try map
[09:30:20] Andr3as: {|l| l.gsub(/food/, '') if line.start_with?('cat', 'dog')}
[09:30:43] Andr3as: or if you wanna replace the text inside the array try map! {...
[09:31:55] Andr3as: if l-start_with, obviously
[09:32:02] Andr3as: *l.start_with?


[12:07:47] Andr3as: has joined #RubyOnRails


[03:47:42] Andr3as: Ping timeout: 252 seconds


[09:36:41] Andr3as: i do that quite often
[09:37:31] Andr3as: though, for lots of data (big table rows or something) it proves to be slow using partials
[09:37:45] Andr3as: *big tables and a row partial
[09:39:58] Andr3as: ah, good tip, nevre thought abt using helpers for that


[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:30:32] Andr3as: anyone with a hint on how to achieve that?
[12:35:31] Andr3as: could someone pls take a look at that gist?
[12:35:53] Andr3as: i'm going crazy and wonder why i cant iterate through the elements..(?)
[12:37:07] Andr3as: sevenseacat: am still at that issue above..
[12:37:32] Andr3as: even a puts doesnt "work"
[12:38:24] Andr3as: see updated gist
[12:38:29] Andr3as: same output as without
[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:59] Andr3as: well.. i thought i simplify the gist
[12:47:09] Andr3as: sevenseacat: i did another update.. this time with my poor attempt to get the id
[12:48:56] Andr3as: ok.. so map... i will read a bit
[12:52:29] Andr3as: sevenseacat: you think {|bi| if trade_executions[r][2].match bi.symbol }.first sounds good?
[12:54:34] Andr3as: hmm, it gives me 1 which is the id of the BrokerInstrument i'd expect it to return
[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: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:02:45] Andr3as: sevenseacat: select might do what i need...
[13:02:50] Andr3as:
[13:03:35] Andr3as: {|bi| if trade_executions[r][2].match bi.symbol }.first.instrument


[17:26:33] Andr3as: hi all.. 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'
[17:27:02] Andr3as: anyone a tip how to approach that? i did some google research but am stuck, somewhat..
[17:53:09] Andr3as: i found the match method..
[17:53:27] Andr3as: when i change the pattern to like ES..-CME it should do the trick
[17:53:37] Andr3as: with something like BrokerInstrument.where(broker: broker).each {|bi| puts if te[1][2].match(bi.symbol) }


[08:30:11] Andr3as: i import them in my scss file and thats it
[08:30:15] Andr3as: @elcontrastador
[08:43:35] Andr3as: @import "bootstrap";
[08:43:35] Andr3as: cat alphatrade_reloaded/app/assets/stylesheets/application.scss
[08:44:17] Andr3as: i import 'em directly in application.scss (renamed it to scss from css)
[08:45:48] Andr3as: elcontrastador:
[08:46:46] Andr3as: idk.. never did it like that.. i always used the bootstrap gem
[08:47:31] Andr3as: so, you're using weback then? elcontrastador
[08:48:54] Andr3as: found this via google.. they even use bootstrap as example:
[08:49:56] Andr3as: what rails version do you use?
[08:52:20] Andr3as: maybe you can figure it out with a starter app?
[08:53:18] Andr3as: here's another.. well... guide
[12:26:51] Andr3as: gemfile.lock might get an update
[12:27:03] Andr3as: *Gemfile.lock


[08:30:16] Andr3as: i'd go with pundit
[08:30:23] Andr3as: and rolify @elcontrastador
[08:33:09] Andr3as: nothing specific, i just started with it and found it very clean and organized
[08:33:33] Andr3as: i guess i wouldnt switch in the middle of the "project" though


[08:13:50] Andr3as: good morning.. i have a simple_form inside a modal / reveal and when i submit invalid data it does not show validation errors inside the form.. the controller correctly responds with a 422 and json data with the error message.. i was under the impression that simple_form does show the errors automagically...(?) - it does do so in a non remote form but not in this case.. here's the stackoverflow q i posted a while back but no soltion in sight..
[08:13:51] Andr3as:
[08:13:59] Andr3as: any help is appreciated


[15:29:49] Andr3as: has joined #RubyOnRails
[15:31:13] Andr3as: hello all.. i have a little issue with an "after_create".. i need to create associations (has_many through) when i create a certain element.. thats working great.. now i started to implement paper_trail to have an undo function
[15:31:51] Andr3as: i was able to get it working with associations too.. though that after_create is a bit wrong in that case as the associations will be recreated by paper_trail
[15:32:23] Andr3as: how would you guys prevent the firing of that after_create in that case?
[15:33:09] Andr3as: determining the "caller"? (e.g. which controller called for the (re)creation of that element?)


[12:28:04] Andr3as: has joined #RubyOnRails


[08:01:29] Andr3as: Remote host closed the connection


[07:17:24] Andr3as: maybe dump it, change the table names in the sql file and reload it?
[07:17:37] Andr3as: if the other table is empty, obviously
[07:24:48] Andr3as: so, you basically have to skip those id's which are presnet in both tables
[07:27:13] Andr3as: what about some sql magic? like a full outer join?
[07:27:46] Andr3as: or iner join (i think)
[07:30:13] Andr3as: This variant of the full outer join (sometimes abbreviated to full join) returns all rows from both tables named in the ON condition where the join condition is not met (excluding NULL values).
[07:30:13] Andr3as: Full [Outer] Join without Intersection
[07:30:37] Andr3as: if i understood it correctly, thats the sql join you could use
[07:31:10] Andr3as: and create the records if they arent already existing
[07:31:25] Andr3as: This join is a variant on the basic right outer join, but instead, it returns all rows from the right-hand table specified in the ON condition that also meets the join condition and none of the rows from the left-hand table that match the join condition.
[07:31:25] Andr3as: or even better the Right [Outer] Join without Intersection
[07:31:48] Andr3as: that gives you only the missing records.. take those and create them
[07:33:20] Andr3as: here's a pic and stuff
[07:35:26] Andr3as: well, you get the records which are missing
[07:36:58] Andr3as: yes, and the outer join excludes those from the production table
[13:49:35] Andr3as: mices:


[06:36:26] Andr3as: anyone ever had this issue with rails and js?
[06:38:30] Andr3as: i've tried to boil it down to the minimum without losing infos..
[06:39:51] Andr3as: well, at the end of the day it sends this $('#mainModal').modal('toggle'); in the update.js.erb and chrome argues Uncaught Error: Syntax error, unrecognized expression:
[06:40:18] Andr3as: and i dont know why.. i can execute the same thing from the console and it does work just fine
[06:44:51] Andr3as: no, i say the exact same code which does not work from within update.js.erb work when i post it into the console
[06:45:37] Andr3as: i wanted to make it easier to read.. and omited the rest of the code which also works
[06:45:57] Andr3as: "from the console
[06:46:40] Andr3as: and it also works from within the update.js.erb but it still throws that error and after the error, chrome wont deal with js anymore (as expected, unfortunately)..
[06:48:51] Andr3as: i've updated the post with the complete update.js.erb
[06:49:05] Andr3as: though its not that it adds any more value, actually..(?)
[06:49:50] Andr3as: coz it does not work with that modal toggle alone as well
[06:50:35] Andr3as: well, when it doesnt work with the toggle alone..(?) how could it matter how my final js.erb looks like?
[06:53:21] Andr3as: what shall i say to this... i just want to clearify that the whole thing does not work with the toggle alone.. to keep things simple.. you guys argue its too much code but ask for more.. anyway.. its ok.. i look somewhere else
[06:53:30] Andr3as: thanks for taking a look
[06:58:25] Andr3as: $("#mainModal").modal("toggle");
[07:00:50] Andr3as: dev tools network tab looking like this
[07:02:23] Andr3as: no, i removed it
[07:02:30] Andr3as: to only have the toggle in it
[07:03:05] Andr3as: why overvcomplicate things when the easy stuff isnt working either
[07:05:47] Andr3as: i did that a thousand times... after that i took it out of the js.erb file, pasted it into the chrome console and it closes the modal without an issue
[07:06:00] Andr3as: no error message whatsoever
[07:09:49] Andr3as: see
[07:09:55] Andr3as: i made a little video
[07:12:22] Andr3as: fwiw, the error in the rubymine server console is an old one.. i scrolled up earlier and it doesnt scroll down automatically
[08:42:16] Andr3as: i tried a console.log("Hello");


[09:22:43] Andr3as: does a counter_cache always "just counts"? or could i use it for do some calculations as well? like when a trade has many executions and each execution has a size field which could be positive or negative and i wanna calculate the position size with adding up all the sizes of each execution
[09:23:42] Andr3as: i see, thx sevenseacat
[09:25:05] Andr3as: every gem installed?
[09:25:19] Andr3as: *for staging
[10:30:25] Andr3as: Quit: No Ping reply in 180 seconds.


[11:08:49] Andr3as: so an array.. that makes sense
[11:08:54] Andr3as: thanks a lot! (again)
[11:09:05] Andr3as: yes, it is
[11:09:35] Andr3as: i thought coz map already gave back an array..
[11:09:47] Andr3as: well, i dont know what i thought coz i always would need a 2d array