« Back to channel list

#RubyOnRails - 23 May 2019

« Back 1 day Forward 1 day »
[00:11:03] skryking: has joined #RubyOnRails
[00:11:30] tf2ftw: has joined #RubyOnRails
[00:27:00] octos: has joined #RubyOnRails
[00:32:20] mjacob: has joined #RubyOnRails
[00:33:40] mjacob: is the release procedure documented somewhere? a bug fix (https://github.com/rails/rails/pull/34656) was just merged and i wonder what's the first possible rails release which could include this fix.
[00:46:21] brool: has joined #RubyOnRails
[01:10:34] orbyt_: has joined #RubyOnRails
[01:13:58] weteamsteve: has joined #RubyOnRails
[01:35:13] deepredsky: has joined #RubyOnRails
[01:36:09] Technodrome: has joined #RubyOnRails
[01:38:57] IGnorAND: doesn't master become in the next stable release? so in your case 6.1?
[01:57:16] skryking: has joined #RubyOnRails
[02:02:34] octos: has joined #RubyOnRails
[02:09:10] beholders_eye: has joined #RubyOnRails
[02:23:41] duderonomy: has joined #RubyOnRails
[02:24:55] gambl0re: has joined #RubyOnRails
[02:42:44] s00pcan: has joined #RubyOnRails
[02:44:56] pd09041999: has joined #RubyOnRails
[03:10:55] braincrash: has joined #RubyOnRails
[03:44:25] bambanx: has joined #RubyOnRails
[04:00:12] sung: has joined #RubyOnRails
[04:07:43] srinidhi: has joined #RubyOnRails
[04:29:35] molly: has joined #RubyOnRails
[04:48:12] sameerynho: has joined #RubyOnRails
[05:20:41] conta: has joined #RubyOnRails
[05:56:35] conta: has joined #RubyOnRails
[06:00:22] schne1der: has joined #RubyOnRails
[06:13:45] xco: has joined #RubyOnRails
[06:48:00] kapilp: has joined #RubyOnRails
[06:49:49] JanMrlth: has left #RubyOnRails: ("http://quassel-irc.org - Chat comfortably. Anywhere.")
[07:21:05] schne1der: has joined #RubyOnRails
[07:22:53] lxsameer: has joined #RubyOnRails
[07:26:36] dionysus69: has joined #RubyOnRails
[07:28:41] hive-mind: has joined #RubyOnRails
[07:30:59] michael_mbp: has joined #RubyOnRails
[07:46:39] deepredsky: has joined #RubyOnRails
[07:48:58] blackmesa: has joined #RubyOnRails
[08:01:56] mikecmpbll: has joined #RubyOnRails
[08:02:08] beholders_eye: has joined #RubyOnRails
[08:07:22] Sylario: has joined #RubyOnRails
[08:08:45] jefffrails35: has joined #RubyOnRails
[08:12:11] lupine: has joined #RubyOnRails
[08:14:08] duderonomy: has joined #RubyOnRails
[08:33:02] srinidhi: has joined #RubyOnRails
[08:34:18] Technodrome: has joined #RubyOnRails
[08:37:55] sevenseacat: has joined #RubyOnRails
[08:38:17] dionysus69: Couldn't really find a straightforward answer online, does AR has method like this? Model has_relationship? would be better if it looked for through relationships too
[08:50:40] Linuus: dionysus69: Check out reflections: https://api.rubyonrails.org/classes/ActiveRecord/Reflection/ClassMethods.html
[08:52:05] Ergo: has joined #RubyOnRails
[08:53:13] dionysus69: Model.reflect_on_all_associations.find { |a| a.name.to_s.include?("the model name I am looking for") }
[08:53:37] dionysus69: if you have better idea on this, lemme know ^.^
[08:53:44] dionysus69: also this method doesnt look for through associations
[08:56:06] sevenseacat: dionysus69: what are you trying to do?
[08:57:48] Linuus: How would you test this code in a nice way?
[08:57:50] Linuus: https://gist.github.com/Linuus/f13248caab72718cc7b6818cdfde873b
[08:58:08] Linuus: The `sync_with_remote` method makes a call to an external API. The method has been tested in isolation by passing in an API client mock.
[08:58:37] Linuus: Now I want to test that this perform method which instantiates a thing and then calls the sync method. I could pass an API client mock to the perform method which passes it along to the sync method, but that seems messy...
[08:58:56] dionysus69: ok to make it short, as we already discussed earlier, I am making my custom admin more modular, so I am trying to build one universal partial that will allow me to filter all admin index pages with scopes, but there are models like user and couple others, i would check conditionally if they exist, I would let the admin filter based on them too, only if the model on current page has belongs to or has_many
[08:58:58] dionysus69: relationships to it
[09:00:54] dionysus69: so ? :D that's it? :D
[09:02:38] sevenseacat: I remembered why I didn't like asking people questions. what does that have to do with Model.has_relationship?, what does that mean
[09:03:05] dionysus69: I am using metaprogramming approach, I know there's a second approach, if I save relationships in db and then generate based on them, but it would require manual maintenance
[09:04:04] dionysus69: Model.where().present?; well this Model.has_relationship? is similar, would be great if such helper existed :P if not I will make my custom one
[09:04:48] dionysus69: one check is AR collection exists, other checks if model has relationship/s
[09:06:39] sevenseacat: model names have no direct correlation with association names
[09:06:50] sevenseacat: so I think your concept is doomed to be incomplete
[09:07:12] dionysus69: I understand it will require recursive search
[09:07:26] dionysus69: but it may accept param like, go only 3 level deep
[09:07:28] sevenseacat: that's not what I said
[09:07:30] dionysus69: won't kill the admin side
[09:08:18] dionysus69: ok but reflections do show first level relationships
[09:08:46] sevenseacat: sure, but those relationships could be named anything
[09:09:08] sevenseacat: unrelated to your model names
[09:09:44] dionysus69: that usually is not the case for me :\
[09:10:42] dionysus69: I pay huge attention to naming :S
[09:21:30] blackmesa1: has joined #RubyOnRails
[09:26:49] blackmesa: has joined #RubyOnRails
[09:35:54] alexeev: has joined #RubyOnRails
[09:38:56] srinidhi: has joined #RubyOnRails
[10:20:04] tf2ftw: has joined #RubyOnRails
[10:26:15] conta: has joined #RubyOnRails
[10:26:55] kapilp: has joined #RubyOnRails
[10:28:56] mikecmpbll: has joined #RubyOnRails
[10:41:18] algun: has joined #RubyOnRails
[10:47:29] Caerus: has joined #RubyOnRails
[10:56:21] lankanmon: has joined #RubyOnRails
[11:33:23] tf2ftw: has joined #RubyOnRails
[11:35:22] alexeev: has joined #RubyOnRails
[11:44:06] gb_away: has joined #RubyOnRails
[12:01:11] conta2: has joined #RubyOnRails
[12:17:14] conta: has joined #RubyOnRails
[12:26:43] conta: has joined #RubyOnRails
[12:31:12] Dbugger: has joined #RubyOnRails
[12:39:49] blackmesa: has joined #RubyOnRails
[12:46:12] Dbugger: has joined #RubyOnRails
[12:46:52] Technodrome: has joined #RubyOnRails
[13:11:56] beholders_eye: has joined #RubyOnRails
[13:12:38] bryanculver: has joined #RubyOnRails
[13:14:41] hmaronon: has joined #RubyOnRails
[13:31:46] w0rd-driven: has joined #RubyOnRails
[13:48:21] hightower2: has joined #RubyOnRails
[14:08:05] skryking: anyone have a prefered way to get mails from a gmail account into action mailbox? I was thinking maybe fetchmail to procmail since there is an ingress for it already but was wondering if there was an easier way.
[14:38:12] deepredsky: has joined #RubyOnRails
[14:41:58] srinidhi: has joined #RubyOnRails
[14:44:49] octos: has joined #RubyOnRails
[14:51:33] hmaronon: has joined #RubyOnRails
[15:04:51] jstrong: has joined #RubyOnRails
[15:05:08] jstrong: Hi all! I’m stumped on a pretty elementary issue. See this gist: https://gist.github.com/laspluviosillas/390c0b722994a5f6bc19af07998e4f69
[15:05:30] jstrong: If I mass assign an association ID (the ID is valid, and the account *does* exist), it fails the “account” presence validation because the relationship is not hydrated
[15:05:32] jstrong: any suggestions?
[15:05:55] jstrong: @subscription_change.account_id => returns value. @subscription_change.account => nil.
[15:11:22] haxx0r: has joined #RubyOnRails
[15:12:44] FastJack: has joined #RubyOnRails
[15:18:07] NL3limin4t0r: jstrong: I'd change `belongs_to :account` to `belongs_to :account, optional: false`. Make sure the SQL column is NOT NULL and remove the presence validation.
[15:20:39] NL3limin4t0r: You should also have a foreign key from account_id to account.id
[15:21:27] s00pcan: has joined #RubyOnRails
[15:21:28] NL3limin4t0r: account.id => accounts.id*
[15:22:12] jstrong: NL3limin4t0r: it was some other nonsense, but thanks for the suggestion
[15:33:31] orbyt_: has joined #RubyOnRails
[15:55:12] hays: has joined #RubyOnRails
[16:07:49] octos: has joined #RubyOnRails
[16:13:45] IGnorAND: Is there an environment variable available in the database.yml which I can use to name a db?
[16:19:05] Caerus: you can change the database name for each of the enviroments there. You just need to declare for instance in development. Instead of database: yourappname_development you could do database: any_db_name.
[16:21:49] Technodrome: has joined #RubyOnRails
[16:29:11] tdy: has joined #RubyOnRails
[16:32:59] Dbugger: has joined #RubyOnRails
[16:34:00] Dbugger: has joined #RubyOnRails
[16:37:49] IGnorAND: I found Rails.env Caerus, thanks anyway
[16:56:00] blackmesa: has joined #RubyOnRails
[16:56:38] conta: has joined #RubyOnRails
[16:57:37] duderonomy: has joined #RubyOnRails
[17:14:28] beholders_eye: has joined #RubyOnRails
[17:17:27] zacts: has joined #RubyOnRails
[17:21:04] timdotrb: has joined #RubyOnRails
[17:38:14] MrCrackPotBuilde: with polymorphic models like an address do you also need to create a migration and add the addressable_type/id to the user model ??
[17:49:14] ravenous_: has joined #RubyOnRails
[17:52:47] octos: has joined #RubyOnRails
[17:55:52] molly: has joined #RubyOnRails
[18:04:46] schne1der: has joined #RubyOnRails
[18:07:17] octos: has joined #RubyOnRails
[18:20:50] octos: has joined #RubyOnRails
[18:27:04] trobrock: has joined #RubyOnRails
[18:27:56] trobrock: is there any way to pre-process variants with activestorage? I have some very large image uploads that I would like to generate a few variants for in the background post-upload. I haven't been able to find anything like this yet, everything seems to focus on lazy-generation. Is this possible?
[18:32:32] octos: has joined #RubyOnRails
[18:42:47] molly: has joined #RubyOnRails
[18:44:21] jstrong: has joined #RubyOnRails
[18:55:05] octos: has joined #RubyOnRails
[18:59:42] octos: has joined #RubyOnRails
[19:02:58] jstrong: has joined #RubyOnRails
[19:03:15] octos: has joined #RubyOnRails
[19:05:08] octos: has joined #RubyOnRails
[19:08:25] w0rd-driven: has joined #RubyOnRails
[19:26:59] jstrong: has joined #RubyOnRails
[19:34:58] samort7: has joined #RubyOnRails
[19:48:44] jstrong: has joined #RubyOnRails
[20:00:05] octos: has joined #RubyOnRails
[20:02:06] blackmesa: has joined #RubyOnRails
[20:12:29] defsdoor: has joined #RubyOnRails
[20:19:11] octos: has joined #RubyOnRails
[20:26:40] dviola: has joined #RubyOnRails
[20:30:01] jstrong: has joined #RubyOnRails
[20:30:11] weteamsteve: has joined #RubyOnRails
[20:57:27] hays: has joined #RubyOnRails
[21:02:37] hays: has joined #RubyOnRails
[21:18:47] hays: has joined #RubyOnRails
[21:24:22] hays: has joined #RubyOnRails
[21:28:55] blackmesa: has joined #RubyOnRails
[21:58:44] Exuma: has joined #RubyOnRails
[22:33:34] xco: has joined #RubyOnRails
[22:38:10] mikecmpbll: has joined #RubyOnRails
[22:57:50] IGnorAND: MrCrackPotBuilde: you only have an address migration, there is no actual 'addressable table'
[22:59:29] IGnorAND: MrCrackPotBuilde: also the address table has a addressable_type and addresseable_id (indicating if its a person/company etc and its id)
[23:00:50] uks: has joined #RubyOnRails
[23:31:43] ChangaC: has joined #RubyOnRails
[23:31:52] mlt-: has joined #RubyOnRails