#RubyOnRails - 11 May 2017
« Back 1 day Forward 1 day »
[00:31:42] baash05: I'm trying to handle this expect_any_instance_of(MyUser).to receive(:user_event).with('posted_comment')
[00:49:50] qmr: thinking of going with Intel® Xeon® E5-2687W v4 3.0GHz,30M Cache,9.60GT/s QPI,Turbo,HT,12C/24T (2x) for our new rails servers. anyone have any other suggestions?
[02:34:25] Radar: Upgrading is all good-and-proper, but realistically you should be investigating CPU performance problems before upgrading the hardware.
[02:39:38] Radar: I would advise if that's going to be a problem to find someone in the US who can helpm you.
[02:43:03] Radar: Yeah, but it's 7:40pm there and the people who do this for a dayjob are probably offline right now.
[04:12:43] Tariq: Or even any type of serialization? Where you just type in artibrary data and store it in a database?
[04:21:14] Tariq: I’m stuck right now figuring out the best way of dealing with a huge number of data columns that a user wants to type in
[04:22:16] Tariq: My original plan is to create a column for every single possible row that a user needs to fill in
[05:09:13] helpa: Please do not use active_admin, rails_admin or any other gems to build your admin interfaces. Instead, build it yourself. This will lead you to a safe path of understanding of the code, rather than to the Hell that is those gems.
[05:11:30] Radar: What happens is this: 1) person sees rails_admin 2) thinks they have a simple idea which fits the intended use case 3) implements it... 4) but then requires customisations, which rails_admin can't handle 5) they come in here and cry about #4, 6) they end up building their own and they live happily ever after.
[05:12:18] PorcoRex: Tariq, opinions are like opinions that people have. Some people are you and you have opinions and some opinions come from other people with opinions.
[05:12:53] Tariq: Well, I think it resolves the bigger problem. As for the smaller problem, I do know how to customize rails_admin
[05:16:25] Tariq: Rails_Admin does have the ability to render partials based on certain conditions, so if I detect X, I’ll load up a partial that handles that specific condition
[05:17:15] Tariq: It’s just a horrible hacky solution. I’ll try to find an alternative after this project is done.
[05:19:38] PorcoRex: Do you think a better use of your time would be to write it from scratch? I highly doubt it.
[05:20:11] Tariq: When I’m done with this project, I’m going to start exploring alternatives so if I get another job involving an admin dashboard, I’m ready.
[12:10:03] jarr0dsz: hello everyone, does anyone know how I can do a array[index] in a each with index loop?
[12:10:21] jarr0dsz: i want to get elements from array but array[index] seems invalid where array, array works?
[12:11:46] matthewd: (also, why would you want to do that? You already get the value of array[index] in the block.)
[12:14:28] jarr0dsz: the array[index] yield no output where array works so how could I use the index instead of the integer?
[12:17:12] jarr0dsz: matthewd something like https://gist.github.com/anonymous/186825ff135c47d7b1ad67034c5cde98
[12:17:40] jarr0dsz: if there is a better way, i basically POST data from a frontend grid and then need to read it back in reading the array
[12:18:06] jarr0dsz: im building he array like so https://gist.github.com/anonymous/1b00a2d64fc542b33deea0cc64c2e114
[12:22:50] matthewd: Yes, that looks better... though you're not using index, so you could just use regular each
[12:34:02] jarr0dsz: thank you matthewd would there also be a way to generate a unique id for use in the db? normally id autoincrements
[13:02:36] dionysus69: what do I do if I want to use bootstrap without jquery? since 5.1 dropped jquery by default, I want to try rails development without jquery... any suggestions?
[13:16:48] matthewd: nir0: You can answer the first question with `method(:main_app).source_location` from somewhere that can see it
[15:22:41] cek: getting ActiveRecord::StatementInvalid: when I Model.where('attr > 123') . When attr taken into backticks, it works. WTF
[15:24:46] matthewd: cek: Your attribute name is probably a MySQL keyword. But we can't tell, because you chose not to share it.
[16:12:37] soahccc: Can someone please confirm my sanity? What am I missing here? https://gist.github.com/2called-chaos/5ecc8d796bb94a59ca18c9c2cefa964b
[16:14:56] ovaltine: 0 index instead of 1 index? i think strip only strips on the edges of a string perhaps
[16:19:17] soahccc: baweaver: I just assumed it because it returned "" but it's a 3-byte something which doesn't show in my terminal
[16:21:49] soahccc: I'm parsing a file that is so messed up with binary data that I have to find a specific thing and then back/forward seek from there... And there is garbage all over the place so yeah I would like a cookie as well ;)
[17:05:05] xco: hi my routes.rb looks like this https://gist.github.com/siaw23/a4757ed7c98533df85c99d411c7d5af5#file-admin-rb-L5 i just added line 5 but my url looks like this `index_all_admin_similar_object_stats` while other urls just start with ‘admin’, like ‘admin_something” how do i make “index_all” go to the end of the route name?
[19:00:45] das3in: I'm having trouble getting my routes together. Here's a gist https://gist.github.com/das3in/1900d27828ed1c47876cf48f03dfd3e0 there's some weird nesting stuff I wnat to do
[20:25:51] thecharacterman: I want to list all the names and not the ID's in the table groupsxconcerts
[20:26:49] dionysus69: just do groupsxconcert.all that returns an active record collection, you can treat it as an array
[20:26:50] beingjohnm: I'm using sidekiq on heroku. Does each sidekiq queue need its own worker dyno?
[20:27:41] thecharacterman: yes if i do groupsxconcert.all , obviousliy it will return only de IDS and the band names
[20:27:42] dionysus69: thecharacterman: maybe something like this http://stackoverflow.com/questions/16906922/iterate-over-array-of-objects-and-return-attributes
[20:30:39] dionysus69: groupsxconcert.concerts will return concerts groupsxconcert.groups will return groups, use map array enum in each case and you would just get names for both cases without IDs
[20:33:26] arup_r: Is there anyway to show the actual html content while using mail_to? Right now the body shows the content with HTML. :) Any help https://gist.github.com/aruprakshit/042763fe99e15866bd4c827a4726be7a ?
[20:38:47] dionysus69: ok that wont work either, you need to just trial and error around something like that
[21:18:40] thecharacterman: i want to list groupconcert table but in onw way i can read, because this table only have ID
[21:21:26] baweaver: In the first case you want to use `select` to select those columns from your two joined tables there
[21:25:18] thecharacterman: it it helps, my association is exactly like this --> http://guides.rubyonrails.org/association_basics.html#the-has-many-through-association
[21:27:23] thecharacterman: the only thing I want is to list all the concerts and groups by name or anything else which are inside GroupsConcert table
[21:28:07] thecharacterman: you understand me if I do GroupConcert.all it list the foregin keys only
[21:28:54] thecharacterman: with oracle it easy doing a join, but with active record no idea , but im sure it should be easier
[21:29:40] assembledbits: New to Rails.. looking to get values from the Enrollments table into the Order decorator.. help?
[21:32:02] assembledbits: ^^ That is what I am editing, but I believe I need to define an "enrollment_expiry_date"
[22:32:27] helpa: Do not use any service that is not Pastie or Gist to post code. Pastebin, for example has a tiny font and it has ads on it which cause the page to load slowly. Other paste services generally look like crap.
[22:33:12] Radar: AssembledBits: put another way: how does an enrollment link to orders, users, or products?
[23:13:28] thecharacterman: baweaver, dionysus69 . Actually I found some solution: Group.select('groups.name, concerts.id').joins(:GroupConcerts, :concerts)
[23:14:27] thecharacterman: the only thing if i request concert.tittle instead concerts.id it do not return antyhing, only the group name