« Back to channel list

#RubyOnRails - 11 April 2017

« Back 1 day Forward 1 day »
[00:03:35] ahrs: has joined #RubyOnRails
[00:07:41] Pumukel: has joined #RubyOnRails
[00:11:37] PickleMan100: has joined #RubyOnRails
[00:13:56] spicerack: has joined #RubyOnRails
[00:15:41] PickleMan100: Can anyone here help me with bcrypt?
[00:18:51] PickleMan100: /msg NickServ VERIFY REGISTER PickleMan100 jphzwkjhyrsm
[00:23:32] codezomb: has joined #RubyOnRails
[00:31:56] quazimodo: has joined #RubyOnRails
[00:34:39] rakm: has joined #RubyOnRails
[00:40:25] rubyonrailed: has joined #RubyOnRails
[00:43:04] jenrzzz: has joined #RubyOnRails
[00:43:05] cschneid_: has joined #RubyOnRails
[00:43:10] jhack: has joined #RubyOnRails
[00:43:20] workmad3: has joined #RubyOnRails
[00:48:58] sevenseacat: has joined #RubyOnRails
[00:49:56] irishfromua: has joined #RubyOnRails
[00:53:18] rubyonrailed: has joined #RubyOnRails
[00:53:49] irishfromua: has joined #RubyOnRails
[00:55:39] duderonomy: has joined #RubyOnRails
[01:08:27] fernandomm: has joined #RubyOnRails
[01:26:06] romeoh: has joined #RubyOnRails
[01:26:45] Trynemjoel: has joined #RubyOnRails
[01:27:00] byteflam1: has joined #RubyOnRails
[01:27:00] byteflame: has joined #RubyOnRails
[01:29:35] daydream: has joined #RubyOnRails
[01:32:38] Technodrome: has joined #RubyOnRails
[01:34:16] cschneid_: has joined #RubyOnRails
[01:39:38] Trynemjoel: has joined #RubyOnRails
[01:41:09] fox_mulder_cp: has joined #RubyOnRails
[01:41:26] claudevandort: has joined #RubyOnRails
[01:45:50] alexggordon: has joined #RubyOnRails
[01:59:43] icharlie: has joined #RubyOnRails
[02:06:28] libastral: has joined #RubyOnRails
[02:17:39] treefrob: has joined #RubyOnRails
[02:17:56] naprimer_2: has joined #RubyOnRails
[02:26:26] Jameser: has joined #RubyOnRails
[02:29:18] nahtnam: has joined #RubyOnRails
[02:31:11] Trynemjoel: has joined #RubyOnRails
[02:33:14] hakash: has joined #RubyOnRails
[02:37:39] Trynemjoel: has joined #RubyOnRails
[02:44:29] Suslov: has joined #RubyOnRails
[02:51:26] jenrzzz: has joined #RubyOnRails
[02:53:28] cschneid_: has joined #RubyOnRails
[02:54:18] treefrob: has joined #RubyOnRails
[03:00:24] keerthana: has joined #RubyOnRails
[03:19:13] Suslo: has joined #RubyOnRails
[03:19:30] Suslo: has joined #RubyOnRails
[03:20:56] rakm: has joined #RubyOnRails
[03:21:45] xall: has joined #RubyOnRails
[03:21:48] tomasm-: has joined #RubyOnRails
[03:22:24] tomasm-: hi, is there anything I can do about speeding up my initial page load from being TERRIBLY slow? it's not even taking up a lot of CPU or memory.
[03:23:01] tomasm-: there's nothing special to my app, it's just a basic CRUD page I'm trying to load
[03:25:03] SteenJobs: has joined #RubyOnRails
[03:33:08] pwnd_nsfw: tomasm-, production? development?
[03:34:49] sunrunner20: unless somebody here has done it
[03:34:58] sunrunner20: i'm giving up getting rails running on iis8
[03:36:15] sunrunner20: I still get the feeling
[03:36:22] sunrunner20: RoR on windows is going to be a pain
[03:36:32] xrcode: has joined #RubyOnRails
[03:36:35] romeoh_: has joined #RubyOnRails
[03:37:37] sunrunner20: but thats what work wants
[03:37:41] sunrunner20: I think it stupid
[03:38:07] sunrunner20: redmine running in IIS with MSSQL as the backend
[03:38:24] sunrunner20: I want redmine, work wants windows
[03:47:01] alexggordon: has joined #RubyOnRails
[03:50:24] patarr: has joined #RubyOnRails
[03:52:31] irishfromua: has joined #RubyOnRails
[03:53:29] Technodrome: has joined #RubyOnRails
[03:54:35] spyder55: has joined #RubyOnRails
[03:54:49] JDeen: sevenseacat: thanks for the advice (y'day). Adding `inverse_of: :membership` still has that probelm. it works if i add an `optional: true` - https://gist.github.com/ziyan-junaideen/d3d62221e9d24530aa304ca5fa99de17
[03:55:16] sceem: has left #RubyOnRails: ()
[04:00:18] sunrunner20: i'm not wasting any more time on this
[04:00:43] cam27: has joined #RubyOnRails
[04:08:22] pwnd_nsfw: sunrunner20, why are you personally tied to Windows?
[04:08:46] pwnd_nsfw: Well, ok I understand.
[04:08:49] sunrunner20: the business is
[04:09:23] pwnd_nsfw: Yesyes. You should run it in a vm on the windows machine
[04:09:43] pwnd_nsfw: sunrunner20, do you think they'd notice?
[04:09:54] pwnd_nsfw: I don't know how big your team is or whatever you have going on
[04:10:14] sunrunner20: I can run whaterver I damn well want on my desktop pretty much
[04:10:35] pwnd_nsfw: would anyone notice in production..
[04:12:26] pwnd_nsfw: Are you having any specific problems currently? I ran RoR on a Windows machine for like.. 6 months lol
[04:12:29] quazimodo: has joined #RubyOnRails
[04:12:30] pwnd_nsfw: before rails 4
[04:13:04] sunrunner20: I'm using the HTTPplatformHandler method
[04:13:18] sunrunner20: the site just never loads
[04:13:28] pwnd_nsfw: Do you see any action in the console?
[04:16:54] quazimod1: has joined #RubyOnRails
[04:18:00] webdestroya: has joined #RubyOnRails
[04:19:29] srinidhi: has joined #RubyOnRails
[04:20:00] pickle_: has joined #RubyOnRails
[04:24:31] sunrunner20: error code -21477023829
[04:24:35] Wobni: has joined #RubyOnRails
[04:24:37] sunrunner20: but now its time to sleep
[04:28:41] Wobni_: has joined #RubyOnRails
[04:30:53] itsgokul: has joined #RubyOnRails
[04:34:22] rubyonrailed: has joined #RubyOnRails
[04:37:39] Depili: has joined #RubyOnRails
[04:46:32] cschneid_: has joined #RubyOnRails
[04:57:00] mt_: has joined #RubyOnRails
[04:59:06] jenrzzz: has joined #RubyOnRails
[05:09:29] jusa: has joined #RubyOnRails
[05:11:02] jeyraof^mbpr: has joined #RubyOnRails
[05:15:11] _djbkd: has joined #RubyOnRails
[05:18:04] SteenJobs: has joined #RubyOnRails
[05:18:18] byteflame: has joined #RubyOnRails
[05:18:37] armando: has joined #RubyOnRails
[05:26:34] jgt2: has joined #RubyOnRails
[05:30:29] mazeinmaze_: has joined #RubyOnRails
[05:30:35] xall: has joined #RubyOnRails
[05:31:36] armando: has joined #RubyOnRails
[05:33:09] rubyonrailed: has joined #RubyOnRails
[05:33:15] srinidhi: has joined #RubyOnRails
[05:44:45] User458764: has joined #RubyOnRails
[05:50:05] Guest96: has joined #RubyOnRails
[05:51:14] patarr: has joined #RubyOnRails
[05:51:31] jeffaustin81: has joined #RubyOnRails
[05:55:41] rubyonrailed: has joined #RubyOnRails
[06:04:20] rogerrogerpls: has joined #RubyOnRails
[06:05:39] rogerrogerpls: I define my enum in User model, ( enum gender: [:Male, :Female] ) I call it in the View with : = f.select(:gender, User.user_status.keys) but I get the following error - undefined method `gender' for #<Class:0x007fbcd5be6fb0>
[06:07:34] dminuoso: rogerrogerpls: !rule3
[06:07:34] helpa: rogerrogerpls: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[06:07:47] dminuoso: And no, you may not leave out the (full) stack trace.
[06:08:33] chouhoul_: has joined #RubyOnRails
[06:08:46] atrius: has joined #RubyOnRails
[06:11:13] rogerrogerpls: https://gist.github.com/BryanSingh/a06f9f89d35dda2012d1422641d1e9e8
[06:11:44] dminuoso: rogerrogerpls: Didn't I say something about not leaving out (full) stack traces?
[06:11:47] dminuoso: I swear my log says I did.
[06:12:10] sevenseacat: rogerrogerpls: http://api.rubyonrails.org/classes/ActiveRecord/Enum.html the method t oget all of the different options is plural
[06:12:30] sevenseacat: eg. enum :status -> Conversation.statuses, from the example
[06:13:13] dminuoso: ACTION hands sevenseacat some stati
[06:13:34] sevenseacat: and some octopi?
[06:13:48] dminuoso: Is that like a pie with some octopus in it? If so I'll have it.
[06:14:02] sevenseacat: its all yours
[06:17:35] pwnd_nsfw`: has joined #RubyOnRails
[06:21:45] jenrzzz: has joined #RubyOnRails
[06:31:04] epochwolf: has joined #RubyOnRails
[06:31:05] DarkBushido: has joined #RubyOnRails
[06:31:06] DarkBushido: has joined #RubyOnRails
[06:31:07] pLaTo0n: has joined #RubyOnRails
[06:34:33] dionysus69: has joined #RubyOnRails
[06:41:07] conta: has joined #RubyOnRails
[06:41:21] User458764: has joined #RubyOnRails
[07:01:12] DrYockel: has joined #RubyOnRails
[07:01:52] xrcode: has joined #RubyOnRails
[07:02:24] tbuehlmann: ACTION hands dminuoso some status, since that's the plural form, at least in german
[07:03:24] arBmind: has joined #RubyOnRails
[07:05:26] universa1: tbuehlmann: ‘In English usage status has both an anglicized plural statuses and the (zero) plural status. The second results from its being a Latin fourth declension noun … but also correlates with English use of the word as a mass noun, as in considering their relative status.’ *chuckle*
[07:05:29] helpa: good morning IRCers, I hope that this day finds you hale and hearty
[07:08:13] tbuehlmann: universa1: I can't help myself, when my german colleagues say "stati" or "statuses" in a german manner, that's just wrong. like mixing up frankenstein and frankenstein's monster. yep, I'm that kind of person :p
[07:08:54] jenrzzz: has joined #RubyOnRails
[07:08:54] jenrzzz: has joined #RubyOnRails
[07:11:22] User458764: has joined #RubyOnRails
[07:14:30] dminuoso: tbuehlmann: Triggered!
[07:14:32] dminuoso: Goal reached.
[07:14:47] universa1: tbuehlmann: :D
[07:18:27] pulkit4tech: has joined #RubyOnRails
[07:18:30] byteflam1: has joined #RubyOnRails
[07:18:30] byteflame: has joined #RubyOnRails
[07:18:50] pulkit4tech: has left #RubyOnRails: ()
[07:19:46] Jameser`: has joined #RubyOnRails
[07:20:12] pulkit4tech: has joined #RubyOnRails
[07:25:17] Andr3as: good morning - i have a uniqueness-validation in a join model und want to localize it (read, make it user readable).. how can i find the correct "key"?
[07:25:31] Andr3as: fwiw, here's the model and the validation error https://gist.github.com/awunder/7ac9667a1ac1641858dda344f15373a1
[07:26:42] universa1: do not set a division which is already in the user's divisions
[07:27:07] dionysus69: has joined #RubyOnRails
[07:27:31] Andr3as: hey universa1 - well, i'm more looking into the "key" like "activerecords.errors.bla"
[07:27:42] Andr3as: in the localization yml files
[07:27:48] mark_66: has joined #RubyOnRails
[07:27:51] universa1: you mean i18n.
[07:28:16] Andr3as: i found this: http://guides.rubyonrails.org/i18n.html#translations-for-active-record-models
[07:28:31] Andr3as: but here are 2 attributes involved.. (?)
[07:28:44] Andr3as: chapter 4.5.1 in that link
[07:29:31] srinidhi: has joined #RubyOnRails
[07:30:42] universa1: https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/de.yml#L129
[07:31:17] Andr3as: let me rephrase... ;)
[07:31:22] rubyonrailed: has joined #RubyOnRails
[07:31:41] universa1: https://github.com/rails/rails/blob/a772518d047b230642d011a71459dc2b67869dbb/activerecord/lib/active_record/validations/uniqueness.rb#L33
[07:32:17] Andr3as: the error is missleading.. what i want is to give access to certain domain infos to a user.. but that access should be given by a "director".. so i have a join model "RolloutRead"
[07:32:30] Andr3as: which has 2 references.. user and division
[07:32:55] Andr3as: and the error message should be something like "user already has access to..."
[07:33:07] universa1: Andr3as: so replace the error message.
[07:33:13] universa1: this is what the i18n is for
[07:33:14] Andr3as: or so.. so i wanna avoid them attribute names
[07:33:25] universa1: you can change it for all models, or just the one.
[07:33:34] Andr3as: but how can i find out the key / path
[07:33:40] universa1: uhm look at the links?!
[07:35:19] artto: has joined #RubyOnRails
[07:35:24] Andr3as: i did.. but maybe i dont understand it? if i "override" format, it am screwed for the other error messages, no?
[07:36:02] Andr3as: i thought i could somehow alter the message just for that particular model and that particular combination of attributes...
[07:36:32] universa1: Andr3as: https://github.com/rails/rails/blob/a772518d047b230642d011a71459dc2b67869dbb/activerecord/lib/active_record/validations/uniqueness.rb#L33
[07:37:09] universa1: http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#method-i-validates_uniqueness_of
[07:37:19] universa1: it has a message option.
[07:37:30] universa1: you can set attribute specific errors.
[07:37:34] Radar: universa1: right, but what is the i18n key for that?
[07:37:52] Andr3as: exactly thats my point, Radar
[07:38:06] Andr3as: thanks, i thought i am dumber than i thought i'd be
[07:38:18] Andr3as: and i already am quite a bit...
[07:38:38] universa1: activerecord.attributes.modelname.attribute.errors.taken probably
[07:38:43] Radar: Getting warmer.
[07:38:45] universa1: guessing here ;)
[07:39:11] universa1: activerecord.errors.models.user.attributes.name.blank
[07:39:19] universa1: ohh it's even in the guide ;)
[07:39:20] Andr3as: Radar: so its not a "combo"? as the uniqueness is for a combination of 2 attributes..
[07:39:41] Andr3as: sort of, universa1 - my issue is that there are 2 attributes involved
[07:39:42] Radar: Andr3as: I am not sure.
[07:40:02] universa1: Andr3as: you have a uniqueness validation on one attribute.
[07:40:14] universa1: it has a configuration option scope, like min or max for numericality.
[07:40:43] User458764: has joined #RubyOnRails
[07:40:48] universa1: activerecord.attributes.blub.division_id.errors.taken ...
[07:43:00] Guest96: has joined #RubyOnRails
[07:44:03] Arkentias: has joined #RubyOnRails
[07:46:31] Andr3as: hmm.. that changed it like this: "Rollout reads division blablablabla"
[07:47:46] Andr3as: fwiw, it's: lang.activerecord.errors.models.rollout_read.attributes.division_id.taken
[07:48:19] Radar: I thought it would show you the key if there was no translation available?
[07:48:38] Radar: Or perhaps not if it's configured to fallback and you've got something like rails-i18n installed?
[07:48:38] Radar: Dunno. End of the day. Brain is mush.
[07:48:38] Radar: Oh look it's my train station. :wave:
[07:48:46] Andr3as: Radar: it would, but as this is an error, a translation is available..
[07:48:54] Andr3as: built in, somewhat
[07:49:08] Andr3as: ah and yeah, i18n installed..
[07:49:17] Andr3as: good night Radar
[07:49:43] rubyonrailed: has joined #RubyOnRails
[07:51:05] alexggordon: has joined #RubyOnRails
[07:52:06] patarr: has joined #RubyOnRails
[07:52:21] fernandomm: has joined #RubyOnRails
[07:52:47] JDeen: Hi... this is about controller naming... i am making a simple multi tenancy app... it has accounts... for controllers that are account specific what is the name space best to use? ex: `Accounts::DashboardsController` `Account::DashboardsController`?
[07:54:09] sevenseacat: you'll run into problems with Account::DashboardController if you also want to have an Account model
[07:54:20] dminuoso: jdeen: Up to you really. It's common to keep namespaces in singular.
[07:54:46] dminuoso: jdeen: Whatever you do, the main important thing is to define your own convention and _stick_ to it.
[07:54:59] jenrzzz: has joined #RubyOnRails
[07:55:11] sevenseacat: though my current app doesnt have those problems... hmm
[07:55:51] JDeen: dminuoso: ack, thanks, singular makes sense
[07:56:04] jdm: has joined #RubyOnRails
[07:57:28] xrcode: has joined #RubyOnRails
[07:58:05] JDeen: sevenseacat: yes i see, i am also curious to find out if it makes an issue, lets give it a try :D
[07:59:50] jaequery: has joined #RubyOnRails
[08:01:48] mikecmpbll: has joined #RubyOnRails
[08:02:06] artto: has joined #RubyOnRails
[08:03:18] artto: has joined #RubyOnRails
[08:05:49] elsurudo: has joined #RubyOnRails
[08:05:59] Jameser: has joined #RubyOnRails
[08:10:03] zpe: has joined #RubyOnRails
[08:11:01] darutoko: has joined #RubyOnRails
[08:14:05] agit0: has joined #RubyOnRails
[08:15:53] kassav_: has joined #RubyOnRails
[08:17:00] jsrn_: has joined #RubyOnRails
[08:17:17] Guest96: has joined #RubyOnRails
[08:17:29] Qchmqs: has joined #RubyOnRails
[08:24:48] marr: has joined #RubyOnRails
[08:30:22] artto: has joined #RubyOnRails
[08:31:31] gloscombe: has joined #RubyOnRails
[08:35:37] nya: has joined #RubyOnRails
[08:37:15] Andr3as: fwiw, i was not able to properly change the error message accordingly.. however, i found this little gem ( https://github.com/thethanghn/custom-err-msg ), which lets you set fully custom messages.. and if you start your message with a "^" it omits the field names completely, which is exactly what i'd need
[08:38:51] xall: has joined #RubyOnRails
[08:50:09] lxsameer: has joined #RubyOnRails
[08:52:13] artto_: has joined #RubyOnRails
[08:59:15] ketan: has joined #RubyOnRails
[09:02:52] cschneid_: has joined #RubyOnRails
[09:03:14] artto: has joined #RubyOnRails
[09:04:32] jenrzzz: has joined #RubyOnRails
[09:06:03] snickers: has joined #RubyOnRails
[09:07:22] cschneid_: has joined #RubyOnRails
[09:17:52] Guest96: has joined #RubyOnRails
[09:29:41] arBmind: has joined #RubyOnRails
[09:33:11] artto_: has joined #RubyOnRails
[09:36:37] ferr1: has joined #RubyOnRails
[09:37:41] nya: has joined #RubyOnRails
[09:38:21] nya: has joined #RubyOnRails
[09:44:31] Sylario: has joined #RubyOnRails
[09:46:15] rubyonrailed: has joined #RubyOnRails
[09:51:51] xixi_: has joined #RubyOnRails
[09:52:11] alexggordon: has joined #RubyOnRails
[09:52:59] patarr: has joined #RubyOnRails
[10:01:46] bga57: has joined #RubyOnRails
[10:09:47] Qchmqs: has joined #RubyOnRails
[10:18:08] artto: has joined #RubyOnRails
[10:21:09] artto: has joined #RubyOnRails
[10:24:38] xixi: has joined #RubyOnRails
[10:24:39] artto: has joined #RubyOnRails
[10:27:29] tvw: has joined #RubyOnRails
[10:28:11] kristofferR: has joined #RubyOnRails
[10:30:12] kristofferR: has joined #RubyOnRails
[10:34:18] xixi: has joined #RubyOnRails
[10:37:09] kristofferR: has joined #RubyOnRails
[10:39:29] DrYockel: has joined #RubyOnRails
[10:40:15] artto: has joined #RubyOnRails
[10:47:45] artto: has joined #RubyOnRails
[10:49:27] shinnya: has joined #RubyOnRails
[10:50:41] patarr: has joined #RubyOnRails
[10:50:42] greengriminal: has joined #RubyOnRails
[10:54:01] xpl0iter: has joined #RubyOnRails
[10:57:12] xpl0iter: I am getting this error saying undefined method for active record relations. I have given attr_accessor :modified_by and yet it saying modified by is an undefined method
[10:57:20] xpl0iter: Can someone please tell me why this could be happeing?
[11:00:19] dminuoso: xpl0iter: !rule3
[11:00:19] helpa: xpl0iter: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[11:00:21] dminuoso: You should know this.
[11:00:27] quazimodo: has joined #RubyOnRails
[11:00:27] quazimod1: has joined #RubyOnRails
[11:03:25] artto: has joined #RubyOnRails
[11:03:37] Guest96: has joined #RubyOnRails
[11:08:21] ahrs: has joined #RubyOnRails
[11:16:28] aajjbb: has joined #RubyOnRails
[11:18:12] cschneid_: has joined #RubyOnRails
[11:19:08] nya: has joined #RubyOnRails
[11:19:52] tvw: has joined #RubyOnRails
[11:21:59] Guest96: has joined #RubyOnRails
[11:26:25] claudevandort: has joined #RubyOnRails
[11:27:18] jusa: has joined #RubyOnRails
[11:37:07] King_Rex: has joined #RubyOnRails
[11:37:55] am55: has joined #RubyOnRails
[11:38:03] ldnunes: has joined #RubyOnRails
[11:38:05] adlerdias__: has joined #RubyOnRails
[11:41:15] artto_: has joined #RubyOnRails
[11:42:35] keerthana: has joined #RubyOnRails
[11:44:08] tomasm-: has joined #RubyOnRails
[11:48:50] tomasm-: anyone know of a _flexible_ metadata-based table gem where I can have arbitrarily fields not part of a rigid sql schema, but in a meta table, and still in mysql? I don't want to resort to NoSQL for one table when I need relations to other data.... i want dynamic fields because I'm creating a very large form that is flexible and changing often and don't want to run an migration. there was one meta-based table that I could use b
[11:48:51] tomasm-: ut it was one meta table for all other tables, which i'd think would eventually not be efficient. i'd like a single 'meta' table for each table I need expanded, ie 'businesses' and 'businesses_meta' with key, value columns
[11:49:49] tomasm-: JSON/TEXT columns scare me because what if i only want to change one item in a larger object, i'd have to pre-load the whole thing or possibly lose all the other data
[11:53:30] alexggordon: has joined #RubyOnRails
[11:57:33] keerthana: has joined #RubyOnRails
[12:01:03] am55: has joined #RubyOnRails
[12:01:13] erlend: has joined #RubyOnRails
[12:01:29] adlerdias__: has joined #RubyOnRails
[12:04:31] ldnunes: has joined #RubyOnRails
[12:07:16] jarr0dsz: has joined #RubyOnRails
[12:07:20] handicraftsman: has joined #RubyOnRails
[12:07:20] handicraftsman: has joined #RubyOnRails
[12:07:21] jarr0dsz: hi everyone, what would be the best way to get a custom collection from several associated tables? im still trying to resolve this problem again
[12:08:13] jarr0dsz: say i want to have a collection from User, get all the first_name , then I would like to have all he users.user_rooms inside this collection for example
[12:09:22] romeoh: has joined #RubyOnRails
[12:11:26] tvw: has joined #RubyOnRails
[12:13:05] kassav_: has joined #RubyOnRails
[12:17:14] artto: has joined #RubyOnRails
[12:17:57] Guest96: has joined #RubyOnRails
[12:18:52] jusa: has joined #RubyOnRails
[12:21:31] conta: has joined #RubyOnRails
[12:22:21] keerthana: has joined #RubyOnRails
[12:25:48] ulrich: has joined #RubyOnRails
[12:27:25] jarr0dsz: im looking for a way to build a custom collection, nobody can point me in right direction?
[12:27:48] jarr0dsz: Say I have Users.all. user.first_name, user.last_name and I only want a collection with user.first.name
[12:28:05] jarr0dsz: + add some extra fields from user.user_profile.gender for example , i cannot find anything in the docs on how to approach this
[12:28:19] conta: has joined #RubyOnRails
[12:31:49] Jameser: has joined #RubyOnRails
[12:39:38] jarr0dsz: ugh finally found out how @requests = User::Request.all.select(:id, :first_name).take
[12:39:47] jarr0dsz: but now need to find out how to do associated models adding
[12:40:25] aajjbb: has joined #RubyOnRails
[12:40:27] futilegames: has joined #RubyOnRails
[12:43:44] kristofferR: has joined #RubyOnRails
[12:45:52] jarr0dsz: more rtfm User::Request.includes(:user).all
[12:46:05] jarr0dsz: now i only also need the user.user_profile :9 anyone knows how to have a double join?
[12:46:37] sevenseacat: if we wait, you might read the docs some more and figure it out :)
[12:48:35] Pumukel: has joined #RubyOnRails
[12:48:57] lele: has joined #RubyOnRails
[12:50:42] loechel: has joined #RubyOnRails
[12:51:10] loechel: has joined #RubyOnRails
[12:52:43] workmad3: has joined #RubyOnRails
[12:57:12] jarr0dsz: sevenseacat im kinda stuck now ;(
[12:57:40] jarr0dsz: i dont want to have User::Request.includes(:user, :user_profile) but instead get the user_profile from the user include, is that possible even?
[12:57:47] xpl0iter: has joined #RubyOnRails
[12:57:54] jarr0dsz: i tried already User::Request.includes(:user, :user.user_profile)
[12:58:17] sevenseacat: http://guides.rubyonrails.org/active_record_querying.html#eager-loading-multiple-associations
[12:58:53] jarr0dsz: this returns a <NoMethodError: undefined method `user_profile' for :user:Symbol, your link is what i had before
[13:01:35] ldnunes: has joined #RubyOnRails
[13:02:19] mrbubbles: has joined #RubyOnRails
[13:02:40] ramortegui: has joined #RubyOnRails
[13:05:21] jarr0dsz: thank you sevenseacat the solution was simple something like User::Request.includes(user: :user_profile ).all
[13:05:30] jarr0dsz: the syntax was a bit unclear to me made sense now
[13:10:07] chouhoulis: has joined #RubyOnRails
[13:16:07] xall: has joined #RubyOnRails
[13:17:36] tomasm-: has joined #RubyOnRails
[13:18:52] tvw: has joined #RubyOnRails
[13:19:54] helpa: has joined #RubyOnRails
[13:20:53] arBmind1: has joined #RubyOnRails
[13:21:21] User458764: has joined #RubyOnRails
[13:22:15] blergmat: has joined #RubyOnRails
[13:22:35] rgr: has joined #RubyOnRails
[13:35:40] jscheel: has joined #RubyOnRails
[13:35:55] sunya7a: good morning all
[13:37:00] pupsicle: has joined #RubyOnRails
[13:37:47] keerthana: has joined #RubyOnRails
[13:38:03] DLSteve: has joined #RubyOnRails
[13:38:50] blergmat: Hi all, I am confused about accepts_nested_attributes_for. A has many Bs, B has one C. If I do a.bs.build({b_attrib: 'b', c_attributes: {c_attrib: 'c'}}. But this never creates c. What am I doing wrong?
[13:40:04] conta1: has joined #RubyOnRails
[13:40:39] sunya7a: blergmat: are you forgetting whitelisting when using strong params?
[13:40:40] universa1: not calling build?
[13:40:46] universa1: *not calling save ?
[13:41:04] blergmat: universa1: I'm calling save, do I have to call build on c as well?
[13:41:16] blergmat: sunya7a: params are good
[13:41:52] universa1: blergmat: impossible to tell without seeing actual code.
[13:42:17] tomasm-: has joined #RubyOnRails
[13:44:06] tomasm-: hey is there a way in rails to treat a has_many relation as if it's a key=>value pair hash? I need some way to save some extra arbitrary columns that can't go into schema.... but instead of array indexing such as users[meta][0][key] = 'address'; users[meta][0]['value'] = '123 baker st'; # I'd rather have users[meta][address] = '123 baker st'.... something it can just understand and save fields accordingly
[13:44:50] sevenseacat: you only get the array indexing when you put a has_many association in the form
[13:45:04] pLaTo0n: has joined #RubyOnRails
[13:45:05] sevenseacat: otherwise, how can you have more than one meta?
[13:45:13] universa1: json attribute?! ;)
[13:46:03] tomasm-: honestly this is more for programming convenience than trying to fit the underlying way things work.
[13:46:39] sevenseacat: tomasm-: how can you have more than one meta in your relation without some kind of indexing?
[13:46:42] tomasm-: universa1, i'm hesitant to use serialization because that would require pre-loading the whole data structure and I don't want to chance something goes wrong and the whole set of data gets lost
[13:47:00] matthewd: tomasm-: If you have an address= method, it will get called
[13:47:45] blergmat: universa1: https://pastebin.com/0CcGwK31
[13:47:56] tomasm-: sevenseacat, maybe has_many isn't the right way, I just need a way that will map it over to what eventually is a has_many... meta is just a single row with a 'key' column and 'value' column (along with ref_id for the corresponding row)
[13:48:15] universa1: blergmat: can you put it in a gist (gist.github.com) .. so much better to read ;)
[13:49:18] blergmat: universa1: https://gist.github.com/anonymous/12e0a8f23744eca03be4f0d55b6e435f
[13:49:20] claudevandort: has joined #RubyOnRails
[13:49:50] sevenseacat: `attr_accessor :c_attributes`
[13:49:58] universa1: https://gist.github.com/anonymous/12e0a8f23744eca03be4f0d55b6e435f#file-example-rb-L8
[13:50:04] universa1: !gist-usage
[13:50:04] helpa: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[13:50:19] tomasm-: matthewd, well i need a general catch-all setter, and a way to somehow find the corresponding row in the meta table if such exists
[13:50:35] cpruitt: has joined #RubyOnRails
[13:51:12] matthewd: You could override assign_attributes ¯\_(ツ)_/¯
[13:51:36] matthewd: This does rather sound like the standard use case for a serialized column, though
[13:52:22] tomasm-: matthewd, but how do serialized columns work when I only have a single field somewhere nested inside of it I'm changing? doesn't my model have to preload the whole thing to update?
[13:53:34] rubyonrailed: has joined #RubyOnRails
[13:53:43] matthewd: Yes, models get read from the database before they're updated. But is your set of metadata really large enough for that to matter?
[13:53:46] blergmat: sevenseacat: universa1: ok, now I get ForbiddenAttributesError
[13:53:53] pwnd_nsfw`: has joined #RubyOnRails
[13:54:08] sevenseacat: now you can fix your attr_accessible/strong_parameters
[13:54:41] blergmat: oh, wait, duh
[13:54:45] tomasm-: matthewd, losing any data would be a big deal, these are large forms of information.
[13:55:18] blergmat: thanks sevenseacat and universa1
[14:05:21] hndk: has joined #RubyOnRails
[14:05:44] tomasm-: so if I have "serialize :meta, JSON" , can I just assign to user.meta.address.city = 'San Jose' ?
[14:07:16] tomasm-: and if I have an input hash (form values), how do I append to the serialized data rather than possibly wiping out the existing values, resetting the hash?
[14:09:08] arBmind: has joined #RubyOnRails
[14:14:02] workmad3: has joined #RubyOnRails
[14:22:33] ldnunes: has joined #RubyOnRails
[14:31:34] chouhoul_: has joined #RubyOnRails
[14:31:47] xixi_: has joined #RubyOnRails
[14:32:17] narval: has joined #RubyOnRails
[14:38:52] Suslov: has joined #RubyOnRails
[14:43:04] chouhoulis: has joined #RubyOnRails
[14:43:27] mooser: has joined #RubyOnRails
[14:44:11] patarr: has joined #RubyOnRails
[14:44:12] war_pigs: has joined #RubyOnRails
[14:45:32] jpterry: has joined #RubyOnRails
[14:47:05] glmglmglm: has joined #RubyOnRails
[14:48:20] mrbubbles: Are there any good Rails CMS' around yet?
[14:49:38] sevenseacat: that depends on your needs
[14:50:11] dminuoso: Also on your definition of "good"
[14:51:06] glmglmglm: hey guys, good morning. i have a before_filter :set_menu_variables with a protected set_menu_variables in application controller. this is not being inherited by other controllers. it's supposed to behave this way?
[14:51:23] sevenseacat: glmglmglm: !debug
[14:51:23] helpa: glmglmglm: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[14:52:12] glmglmglm: sevenseacat: i believe i provide all info needed, i mean
[14:52:31] glmglmglm: before_filter in application controller is inherited by the other controllers?
[14:52:42] sevenseacat: if those controllers inherit from application controller, then yes.
[14:52:54] glmglmglm: yes, for me its not working :P
[14:53:00] sevenseacat: if thats not what you're seeing, provide your code as requested.
[14:53:02] glmglmglm: now i will provide more code
[14:53:12] sevenseacat: and hope that you havent annoyed people that much.
[14:53:19] rogue_koder: has joined #RubyOnRails
[14:53:42] glmglmglm: this is a channel to get help, right?
[14:54:01] cpruitt: glmglmglm: Post your code. I’m happy to take a look if I can.
[14:54:53] cpruitt: The code would certainly help but I didn’t find your first question “annoying”. :-)
[14:55:26] sevenseacat: the question wasnt annoying. the refusal to provide information was
[14:55:34] cpruitt: Just bear with me, I’ve got a pending phone call so I might have to bail on you. Apologies in advance.
[14:56:16] glmglmglm: cpruitt: https://gist.github.com/anonymous/faa80004ffdea300b2b9a3de6086fbfc
[14:56:25] glmglmglm: sevenseacat: relax dude
[14:56:40] glmglmglm: cpruitt: dont worry man, take your time!
[14:56:42] sevenseacat: your controllers don't inherit from applicationcontroller.
[14:56:56] glmglmglm: it's the ::Base?
[14:57:06] glmglmglm: shit now i see
[14:57:11] cpruitt: You need class DocumentsController < ApplicationController
[14:57:21] sevenseacat: funny what showing code can do
[14:57:58] artto: has joined #RubyOnRails
[14:58:27] glmglmglm: sevenseacat: you are always very helpful dude, relax a bit
[14:59:00] cpruitt: sevenseacat: My difference of opinon with you isn’t in the point you were making. My difference is in the way you pointed it out. glmglmglm asked a question & was immediately greeted with an auto response. It’s not that difficult to help someone learn why it’s important. He wasn’t being antonistic or anything.
[14:59:11] war_pigs: has joined #RubyOnRails
[14:59:14] sevenseacat: cpruitt: good to know.
[14:59:36] glmglmglm: you know, thats a behaviour very similar as a guy from the channel
[14:59:44] glmglmglm: he is very very bad moody always
[14:59:52] Jon30: in rails 5, what method can be used to bulk update model records and also trigger updated_at update?
[15:00:29] glmglmglm: i believe he might have a condition called low testosterone
[15:00:40] dminuoso: Jon30: update_all
[15:00:41] sevenseacat: glmglmglm: watch it.
[15:01:23] sevenseacat: that was completely uncalled for.
[15:01:25] cpruitt: glmglmglm: I’m here to try & help where I can and maybe get some help now & then. Not here to point fingers in any direction. Radar always seems fine to me. (I just don’t want to feel like I’m in a grumpy PHP chanel)
[15:01:28] matthewd: Oh, helpa doesn't like me :/ sevenseacat?
[15:01:39] sevenseacat: matthewd: if they do it again, sure.
[15:01:46] Jon30: dminuoso: https://apidock.com/rails/ActiveRecord/Relation/update_all "Note that ActiveRecord will not update the timestamp fields (updated_at/updated_on) when using update_all()."
[15:01:55] glmglmglm: you guys are very very unwelcoming
[15:02:02] glmglmglm: i dont know why so much hate
[15:02:37] cpruitt: glmglmglm: I think you cought people on a bad day. This is a little unusual in my experience.
[15:02:44] matthewd: glmglmglm: If that's your ongoing experience, perhaps you'd have a better time seeking help elsewhere
[15:02:54] dminuoso: Jon30: each + update it is
[15:03:09] glmglmglm: matthewd: hehe thats what im talking about
[15:03:37] Jon30: I guess I will just include updated_at inside update_all ...if that's the best way to do. Was just making sure. thanks!
[15:04:16] fernandomm: has joined #RubyOnRails
[15:04:22] cpruitt: Sigh…. come on phone… ring… RING!
[15:04:41] workmad3: has joined #RubyOnRails
[15:05:23] glmglmglm: people here seems to always be in a bad mood, can i talk about it is it allowed? i dont have time to read the quran/bible/torah of rules of the channel
[15:05:45] sevenseacat: glmglmglm: please follow the rules of the channel.
[15:05:54] glmglmglm: so many rules
[15:06:05] sevenseacat: they're designed to get people help most efficiently.
[15:06:15] sevenseacat: there are more people asking for help than available to give it.
[15:06:21] glmglmglm: there's space for relaxed chat?
[15:06:47] glmglmglm: like old irc channels was? remember?
[15:06:48] cpruitt: glmglmglm: Wait… Is your issue really that you’re coming to a “place” for help and don’t want to be bothered with the rules of the place you came to?
[15:07:14] glmglmglm: cpruitt there's too much rules
[15:07:18] Pumukel: has joined #RubyOnRails
[15:07:37] glmglmglm: in every aspect of our lives
[15:07:53] cpruitt: glmglmglm: Cool, then go start a different rails channel with no rules. But you can’t really complain about rules in a place you voluntarily came to.
[15:07:53] glmglmglm: that's all im saying
[15:08:39] glmglmglm: cpruitt of course i can
[15:08:39] cpruitt: glmglmglm: And I’m all for relaxed chat, but remember that most of these rules stem from past experience & resolve problems. They’re not arbitrary
[15:09:20] glmglmglm: yes, i understand that, but see, im the only person talking now
[15:09:47] glmglmglm: the set of rules are very efffective in shut people
[15:10:01] glmglmglm: i have to go, thanks for the help
[15:10:04] Puffball: has joined #RubyOnRails
[15:10:21] cpruitt: glmglmglm: welcome
[15:11:45] mikecmpbll: has joined #RubyOnRails
[15:12:20] cschneid_: has joined #RubyOnRails
[15:13:16] romeoh: has joined #RubyOnRails
[15:15:35] safetypin: has joined #RubyOnRails
[15:15:53] Jon30: which CDN is the easiest to setup with rails?
[15:18:19] User458764: has joined #RubyOnRails
[15:18:28] romeoh_: has joined #RubyOnRails
[15:21:37] b3l914n: has joined #RubyOnRails
[15:22:59] sevenseacat: glmglmglm: this is your last warning to follow the channel rules.
[15:23:26] glmglmglm: man theres so much rules, im not even talking on channel
[15:23:53] mazeinmaze_: has joined #RubyOnRails
[15:23:59] matthewd: There are 14 rules. And "don't do that" is one of them.
[15:24:19] glmglmglm: what rule i broke now?
[15:24:48] helpa: Do not PM members of the channel without first asking if that is OK.
[15:24:55] glmglmglm: well, i asked
[15:25:11] glmglmglm: didn't broke any rule
[15:25:17] glmglmglm: as far as im concerned
[15:26:05] universa1: glmglmglm: no offense, but i would highly suggest you take a step back and stop doing psycho-analysis over the internet ;)
[15:27:15] glmglmglm: i was trying to be helpful, giving some health tips
[15:28:00] universa1: really, take a step a back and leave the keyboard be for a while.
[15:28:01] glmglmglm: taking sun bathes, respect cyrcadian rythm and sleep better and deeper
[15:28:09] glmglmglm: is a offense?
[15:28:56] byteflam1: has joined #RubyOnRails
[15:28:56] byteflame: has joined #RubyOnRails
[15:32:07] glmglmglm: universa1: you dont agree to PM, me no problem, we talk here
[15:32:36] roshanavand: has joined #RubyOnRails
[15:32:38] glmglmglm: universa1: explain to me why the channel is so unfriendly?
[15:33:31] patarr: has joined #RubyOnRails
[15:34:29] glmglmglm: really, this kind of cranky mood is related to a condition called low testosterone, sun bathes increases vitamin D, that increases androgens.
[15:34:30] universa1: the only person claiming it is unfriendly is you. maybe it is not the channel but you. and instead of beating a dead horse, maybe just take the hint and move on.
[15:34:38] dminuoso: glmglmglm: If you think you deserve a particular behavior, go hire a consultant.
[15:34:57] dminuoso: glmglmglm: In here people spend their free time to help other people, so it's only fair if these people get to make rules too.
[15:35:02] dminuoso: If you want to make your own rules, hire somebody.
[15:35:11] glmglmglm: ok, you're right
[15:35:59] glmglmglm: im not trying to force anybody
[15:36:07] glmglmglm: but where i live
[15:36:11] glmglmglm: people are far more friendly
[15:36:25] glmglmglm: that's only a cultural shock
[15:36:28] dminuoso: Ask the people around you then.
[15:36:38] glmglmglm: dude, don't try to give smart answers all the time
[15:37:31] glmglmglm: only one thing, what about this: let's try to be more friendly
[15:37:41] glmglmglm: this is offensive?
[15:37:43] spicerack: has joined #RubyOnRails
[15:38:00] dionysus69: has joined #RubyOnRails
[15:38:19] dminuoso: glmglmglm: Tell you what, sevenseacat is going to be more friendly if you do your homework and provide with as many prepared information the next time you come in here.
[15:38:21] baweaver: ACTION starts reading
[15:39:50] glmglmglm: can you be more friendly sevenseacat?
[15:40:07] sevenseacat: if you follow the channel rules. thats all I ask.
[15:40:13] baweaver: ACTION sighs
[15:40:53] glmglmglm: that's awesome sevenseacat, i really want you to be a fiendlier person
[15:41:04] glmglmglm: good girl :)
[15:41:05] baweaver: We're pushing it now
[15:41:14] baweaver: and now we're being condescending
[15:41:19] glmglmglm: im trying to talk relaxed
[15:41:28] glmglmglm: its agains the rules?
[15:41:29] ChanServ: +q *!*@187.38.148.89
[15:41:46] defswork: has joined #RubyOnRails
[15:42:22] cagomez: has joined #RubyOnRails
[15:43:26] [Butch]: has joined #RubyOnRails
[15:48:28] workmad3: has joined #RubyOnRails
[15:53:43] rakm: has joined #RubyOnRails
[15:55:20] snickers: has joined #RubyOnRails
[15:58:21] cagomez: has joined #RubyOnRails
[15:58:51] juggler: has joined #RubyOnRails
[16:02:42] aajjbb: has joined #RubyOnRails
[16:02:54] Pumukel: has joined #RubyOnRails
[16:06:54] Puffball: has joined #RubyOnRails
[16:11:46] Guest96: has joined #RubyOnRails
[16:13:35] mooser: has joined #RubyOnRails
[16:16:32] Technodrome: has joined #RubyOnRails
[16:16:58] rubyonrailed: has joined #RubyOnRails
[16:22:01] barnex: has joined #RubyOnRails
[16:25:13] rogue_koder: has joined #RubyOnRails
[16:27:51] safetypin: has joined #RubyOnRails
[16:35:10] dionysus69: has joined #RubyOnRails
[16:51:25] mrbubbles: I'm looking for a CMS that works similar to the Wordpress Advanced Custom Fields plugin, namely the "flexible content" aspect. I'd like to define a number of blocks - for example, a "testimonial" has a "quote" and a "citation field - and then when building a page, you can add these blocks which provides the form based on the fields you've defined. Does anyone know if this exists?
[16:53:20] TinkerTyper: has joined #RubyOnRails
[16:54:46] Guest96: has joined #RubyOnRails
[16:56:28] cagomez: has joined #RubyOnRails
[17:01:45] matthewd: mrbubbles: I imagine most CMSes have that capability in some form... but you're not going to find a better Wordpress than Wordpress, and IME any time you add a CMS to an application, it proceeds to get in the way forevermore
[17:02:32] ldnunes: has joined #RubyOnRails
[17:03:13] mrbubbles: matthewd Thanks for the heads up. The reason for my question is that I'm using Spree on a site but there a number of non-spree pages which I have built, but which are quite tightly integrated with the Spree site. The client wants to content manage these pages, and it seemed a bit dirty mixing PHP and Ruby pages together
[17:04:35] mrbubbles: Or would you suggest just building a rails dashboard for it?
[17:04:36] matthewd: mrbubbles: When I last looked at the space several years ago, Comfy seemed to do the best job of managing chunks of content without trying to take over the application/routing/etc
[17:05:24] mrbubbles: thanks matthewd I'll check it out
[17:05:51] matthewd: If it's just going to be a couple of models, yes, I'd strongly consider just building trivial models & controllers for it -- no big gem to drag in dependencies, and potentially hold you back on upgrades, etc
[17:06:53] AzaToth: has joined #RubyOnRails
[17:08:32] war_pigs: has joined #RubyOnRails
[17:09:10] war_pigs: has joined #RubyOnRails
[17:10:08] war_pigs: has joined #RubyOnRails
[17:10:54] mrbubbles: Fair point. Would you build a separate dashboard or just merge into Spree dashboard?
[17:10:56] war_pigs: has joined #RubyOnRails
[17:11:27] mclee: has joined #RubyOnRails
[17:11:54] matthewd: I don't know enough about Spree to have an opinion on that, sorry
[17:13:15] cagomez: has joined #RubyOnRails
[17:14:21] mrbubbles: No worries. Cheers
[17:18:16] rubyonrailed: has joined #RubyOnRails
[17:19:52] chouhoulis: has joined #RubyOnRails
[17:21:19] _djbkd: has joined #RubyOnRails
[17:24:09] byteflame: has joined #RubyOnRails
[17:27:50] eclecticjohny: has joined #RubyOnRails
[17:29:06] hahuang65: has joined #RubyOnRails
[17:29:25] pLaToOn: has joined #RubyOnRails
[17:30:04] rubyonrailed: has joined #RubyOnRails
[17:31:01] workmad3: has joined #RubyOnRails
[17:32:23] ketan: has joined #RubyOnRails
[17:40:28] byteflame: has joined #RubyOnRails
[17:45:49] nahtnam: has joined #RubyOnRails
[17:45:59] zero1one0: has joined #RubyOnRails
[17:46:00] antgel: has joined #RubyOnRails
[17:49:16] Technodrome: has joined #RubyOnRails
[17:52:35] jusa: has joined #RubyOnRails
[17:53:45] jaequery: has joined #RubyOnRails
[17:57:44] mrgreenfur: has joined #RubyOnRails
[17:59:09] pulkit4tech: has left #RubyOnRails: ()
[17:59:25] mrgreenfur: Anyone ever used a python library from within rails/ruby?
[17:59:49] mrgreenfur: I’m trying ot get started with the facebook API, but the SDK is only in python and php. Should I write my own wrapper or use the python one?
[17:59:57] fryguy: mrgreenfur: write your own
[18:00:19] fryguy: or find one that already exists
[18:00:23] fryguy: i'm sure it does
[18:00:27] mrgreenfur: I found a few from like 7 years ago
[18:00:38] mrgreenfur: http://rfacebook.rubyforge.org/
[18:00:49] fryguy: https://github.com/arsduo/koala
[18:00:51] mrgreenfur: and htis one https://github.com/arsduo/koala
[18:00:55] mrgreenfur: ok, i’ll try Koala
[18:00:55] fryguy: here's one i found in a few seconds on google
[18:00:59] mrgreenfur: oh i see an update 2 months ago
[18:01:03] mrgreenfur: maybe this one is fresh
[18:01:07] mrgreenfur: thanks fryguy !
[18:01:35] artto: has joined #RubyOnRails
[18:01:35] fryguy: there was a release less than a month ago
[18:01:43] fryguy: 3.0.0 - March 17, 2017 (5.26 MB)
[18:01:45] Puffball: has joined #RubyOnRails
[18:02:19] mrgreenfur: oh you’re right
[18:02:31] mrgreenfur: Somehow I missed this when I read through the libs I found
[18:04:13] xixi: has joined #RubyOnRails
[18:05:24] GodFather: has joined #RubyOnRails
[18:06:30] tentacle: has joined #RubyOnRails
[18:06:55] tentacle: has joined #RubyOnRails
[18:06:57] cagomez: has joined #RubyOnRails
[18:11:44] duderonomy: has joined #RubyOnRails
[18:16:30] mikecmpbll: has joined #RubyOnRails
[18:18:03] joelwallis: has joined #RubyOnRails
[18:18:51] mattp__: has joined #RubyOnRails
[18:20:40] war_pigs: has joined #RubyOnRails
[18:21:15] greengriminal: has joined #RubyOnRails
[18:22:06] dionysus69: has joined #RubyOnRails
[18:23:55] crystalneth: has joined #RubyOnRails
[18:31:21] romeoh: has joined #RubyOnRails
[18:32:07] zero1one0: has joined #RubyOnRails
[18:33:16] workmad3: has joined #RubyOnRails
[18:37:38] meoblast001: has joined #RubyOnRails
[18:38:53] zero1one0: has joined #RubyOnRails
[18:42:27] d5sx43: has joined #RubyOnRails
[18:42:38] marcdel: has joined #RubyOnRails
[18:42:50] Suslov: has joined #RubyOnRails
[18:43:02] gusrub: has joined #RubyOnRails
[18:43:36] User458764: has joined #RubyOnRails
[18:43:57] netzfisch: has joined #RubyOnRails
[18:51:27] jfelchner: has joined #RubyOnRails
[18:55:54] adam_: has joined #RubyOnRails
[19:02:41] gusrub: has joined #RubyOnRails
[19:12:00] gusrub: has joined #RubyOnRails
[19:13:15] zpe: has joined #RubyOnRails
[19:16:38] Leepoff: has joined #RubyOnRails
[19:18:48] adamb: has joined #RubyOnRails
[19:18:56] Leepoff: has joined #RubyOnRails
[19:19:50] cagomez: has joined #RubyOnRails
[19:21:07] username1: has joined #RubyOnRails
[19:22:03] mooser: has joined #RubyOnRails
[19:22:28] mooser: has joined #RubyOnRails
[19:26:03] cseder: has joined #RubyOnRails
[19:26:29] Sheperson: has joined #RubyOnRails
[19:27:13] NoGodDamnIdea: has joined #RubyOnRails
[19:33:35] patarr1: has joined #RubyOnRails
[19:34:38] _djbkd: has joined #RubyOnRails
[19:35:27] cagomez: has joined #RubyOnRails
[19:37:33] mlt-: has joined #RubyOnRails
[19:38:26] lxsameer: has joined #RubyOnRails
[19:52:08] war_pigs: has joined #RubyOnRails
[19:56:04] pupsicle: has joined #RubyOnRails
[19:56:51] srinidhi: has joined #RubyOnRails
[20:00:38] mooser: has joined #RubyOnRails
[20:00:43] cagomez: has joined #RubyOnRails
[20:09:05] cschneid_: has joined #RubyOnRails
[20:13:47] war_pigs: has joined #RubyOnRails
[20:14:12] username1: has joined #RubyOnRails
[20:14:54] DoctorMonocular: has joined #RubyOnRails
[20:22:52] quazimodo: has joined #RubyOnRails
[20:22:58] quazimod1: has joined #RubyOnRails
[20:25:06] cagomez: has joined #RubyOnRails
[20:35:42] byteflame: has joined #RubyOnRails
[20:41:48] jenrzzz: has joined #RubyOnRails
[20:41:48] jenrzzz: has joined #RubyOnRails
[20:45:11] b3l914n_: has joined #RubyOnRails
[20:52:59] _djbkd: has joined #RubyOnRails
[20:55:10] Puffball: has joined #RubyOnRails
[20:56:13] gusrub: has joined #RubyOnRails
[20:58:02] envint: has joined #RubyOnRails
[21:00:40] tercenya: has joined #RubyOnRails
[21:02:35] war_pigs: has joined #RubyOnRails
[21:24:52] cschneid_: has joined #RubyOnRails
[21:25:25] rakm: has joined #RubyOnRails
[21:30:51] mooser: has joined #RubyOnRails
[21:33:06] jusa: has joined #RubyOnRails
[21:34:42] cam27: has joined #RubyOnRails
[21:37:37] Leepoff: has joined #RubyOnRails
[21:37:37] mooser: has joined #RubyOnRails
[21:47:22] lmac: has joined #RubyOnRails
[21:49:36] roshanavand: has joined #RubyOnRails
[21:50:36] lmac: has joined #RubyOnRails
[21:51:01] d5sx43: has joined #RubyOnRails
[21:51:58] war_pigs: has joined #RubyOnRails
[21:52:53] tvw: has joined #RubyOnRails
[21:53:34] jake_g: has joined #RubyOnRails
[21:53:36] envint: has joined #RubyOnRails
[21:55:41] brent__: has joined #RubyOnRails
[21:57:18] jakethesnake: has joined #RubyOnRails
[22:01:50] jdm_: has joined #RubyOnRails
[22:05:33] jenrzzz: has joined #RubyOnRails
[22:05:33] jenrzzz: has joined #RubyOnRails
[22:06:10] rakm: has joined #RubyOnRails
[22:10:07] s2013: has joined #RubyOnRails
[22:12:33] hahuang65: has joined #RubyOnRails
[22:24:16] cagomez: has joined #RubyOnRails
[22:25:16] Radar: GOOD MORNING
[22:25:32] Rodya_: has joined #RubyOnRails
[22:27:07] cagomez: has joined #RubyOnRails
[22:29:44] bronson: has joined #RubyOnRails
[22:30:47] helpa: has joined #RubyOnRails
[22:31:36] cagomez: has joined #RubyOnRails
[22:36:11] mooser: has joined #RubyOnRails
[22:36:47] cam27: has joined #RubyOnRails
[22:40:04] Leepoff: has joined #RubyOnRails
[22:41:47] cseder: morning already, Radar ?
[22:41:53] Radar: cseder: true
[22:42:05] Radar: it is down here in kangaland
[22:42:21] cseder: Ayay, mate
[22:42:30] yaw: has joined #RubyOnRails
[22:43:57] cam27: has joined #RubyOnRails
[22:44:16] marcdel: has joined #RubyOnRails
[22:45:06] cagomez: has joined #RubyOnRails
[22:53:16] DoctorMonocular: let's say I have a Friend model, and a Relationship model. The relationship model just belongs_to 2 Friends, indicating that those 2 are friends with each other. What's the most sane way to run a query that returns a list of N levels of friends? So like the query for 1 level is just which friends have a direct relationship with the first one? 2 level is that plus whoever is friends with THOSE
[22:53:32] CGibsonmm: has joined #RubyOnRails
[22:54:47] war_pigs: has joined #RubyOnRails
[22:54:49] GodFather: has joined #RubyOnRails
[22:55:04] DoctorMonocular: 1 level is just a normal query. 2 levels is pretty easy with like the first query for friend_id then find anything that matches that array of ids, but I want it to be recursive. In real usage it'll only ever query 3 or possibly 4 levels deep
[23:00:14] DoctorMonocular: postgres has a `recursive with` thing, I guess that could be it
[23:00:29] gusrub: has joined #RubyOnRails
[23:02:21] cagomez: has joined #RubyOnRails
[23:02:59] pwnd_nsfw: has joined #RubyOnRails
[23:04:29] yaw: DoctorMonocular: I'm not sure ActiveRecord can do Common Table Expressions (CTEs)
[23:04:46] DoctorMonocular: yeah I might have to drop down to raw sql
[23:04:53] DoctorMonocular: also I think I'm locking myself into postgres
[23:04:57] DoctorMonocular: which is probably fine
[23:05:56] yaw: the idea that ORMs allow you to switch database easily doesn't hold
[23:06:30] matthewd: Yeah, you'll probably need a (hand-written) with recursive CTE.. but you can use it with a relation as .where("id IN (WITH RECURSIVE SELECT id FROM ...)")
[23:06:31] Technodrome: has joined #RubyOnRails
[23:06:35] lupine: well, it holds for the simplest applications. when you need it least.
[23:06:36] yaw: worst case it prevents you from using the full features of whatever database you're using. feel free to dive deep without any remorse
[23:07:55] cseder: most ORM's are from hell
[23:10:45] CGibsonmm: has joined #RubyOnRails
[23:10:59] DoctorMonocular: ok maybe I'm having a brain fart with this question
[23:11:13] DoctorMonocular: Relationship is not directed
[23:11:19] DoctorMonocular: I just have references to 2 friends
[23:11:50] DoctorMonocular: but in the structure some direction is implied because it's like friend_id and friend2_id
[23:12:00] wethu: has joined #RubyOnRails
[23:12:35] DoctorMonocular: for some reason that's doing my head in. Like, how am I supposed to say friend.friends for either friend1 or friend2?
[23:12:49] DoctorMonocular: teh default would be that friend2 looks for relationships where it is friend1
[23:13:02] DoctorMonocular: but that's not how the relationship happens to be structured
[23:13:10] jdm: has joined #RubyOnRails
[23:13:28] matthewd: DoctorMonocular: This is a solved problem. Just find an existing answer.
[23:13:50] matthewd: DoctorMonocular: You're even using exactly the standard domain language (friends & relationships)
[23:17:16] DoctorMonocular: matthewd: ok I'm googling with that term, but the closest thing I've found is having separate entries for the relationships, ie. friend1 is friends with friend2 and friend2 is friends with friend1, separate entries
[23:17:28] DoctorMonocular: that seems problematic to me for a couple reasons
[23:17:49] DoctorMonocular: first it's impossible in my scenario for the relationship not to be mutual, but the data model allows it
[23:18:10] zero1one0: has joined #RubyOnRails
[23:18:18] DoctorMonocular: second, there is data attached to the relationship, and if there are 2 entries for one relationship, it becomes unclear where to store that extra data
[23:19:23] xco: has joined #RubyOnRails
[23:19:27] DoctorMonocular: the other thing that's possible is making a query which joins on both user.id = friend.id and friend.id = user.id
[23:19:41] DoctorMonocular: which I guess could work, but but I was hoping for a cleaner way
[23:21:15] matthewd: It's not a clean thing to do ¯\_(ツ)_/¯
[23:21:30] matthewd: The other variant of the OR method is a UNION in a subquery
[23:21:46] Megamos: has joined #RubyOnRails
[23:24:18] cam27: has joined #RubyOnRails
[23:30:36] cagomez: has joined #RubyOnRails
[23:31:21] cagomez: has joined #RubyOnRails
[23:31:32] djbkd_: has joined #RubyOnRails
[23:32:58] jusa: has joined #RubyOnRails
[23:36:26] war_pigs: has joined #RubyOnRails
[23:39:10] romeoh: has joined #RubyOnRails
[23:40:05] war_pigs: has joined #RubyOnRails
[23:41:05] sevenseacat: has joined #RubyOnRails
[23:43:02] cschneid_: has joined #RubyOnRails
[23:47:00] warner_: has joined #RubyOnRails
[23:52:40] lxsameer: has joined #RubyOnRails
[23:53:42] pwnd_nsfw`: has joined #RubyOnRails
[23:55:44] Duckily: has joined #RubyOnRails
[23:56:35] cagomez: has joined #RubyOnRails
[23:57:09] rbpynet: has joined #RubyOnRails
[23:58:17] rubyonrailed: has joined #RubyOnRails
[23:59:44] rbpynet: newbie here. what version of rails should i learn first? v4 or v5? thanks