« Back to channel list

#RubyOnRails - 14 March 2018

« Back 1 day Forward 1 day »
[00:02:51] roca: has joined #RubyOnRails
[00:03:19] rikkipitt: has joined #RubyOnRails
[00:08:35] orbyt_: has joined #RubyOnRails
[00:10:58] ramfjord: has joined #RubyOnRails
[00:14:16] jottr: has joined #RubyOnRails
[00:25:27] hahuang61: has joined #RubyOnRails
[00:26:12] jottr: has joined #RubyOnRails
[00:41:46] jottr: has joined #RubyOnRails
[00:52:11] workmad3: has joined #RubyOnRails
[01:00:42] ramfjord: has joined #RubyOnRails
[01:01:48] cstls: has joined #RubyOnRails
[01:09:36] cawel: has joined #RubyOnRails
[01:10:18] jottr: has joined #RubyOnRails
[01:21:26] jottr: has joined #RubyOnRails
[01:31:34] hahuang61: has joined #RubyOnRails
[01:34:56] jottr: has joined #RubyOnRails
[01:38:57] xuyuheng: has joined #RubyOnRails
[01:44:46] jottr: has joined #RubyOnRails
[01:52:51] cstls: has joined #RubyOnRails
[01:53:28] darkhanb: has joined #RubyOnRails
[01:54:59] hahuang65: has joined #RubyOnRails
[01:55:41] alfiemax: has joined #RubyOnRails
[01:55:57] jottr: has joined #RubyOnRails
[02:11:09] jottr: has joined #RubyOnRails
[02:25:44] jottr: has joined #RubyOnRails
[02:29:36] quazimodo: has joined #RubyOnRails
[02:34:42] jottr: has joined #RubyOnRails
[02:38:18] mtkd: has joined #RubyOnRails
[02:43:41] jottr: has joined #RubyOnRails
[02:52:31] workmad3: has joined #RubyOnRails
[02:52:49] Jameser: has joined #RubyOnRails
[02:58:47] jottr: has joined #RubyOnRails
[03:05:11] jottr: has joined #RubyOnRails
[03:14:12] jottr: has joined #RubyOnRails
[03:20:36] jottr: has joined #RubyOnRails
[03:35:06] jottr: has joined #RubyOnRails
[03:42:28] jottr: has joined #RubyOnRails
[03:48:24] kn-928: has joined #RubyOnRails
[03:50:23] jottr: has joined #RubyOnRails
[03:55:15] cagomez: has joined #RubyOnRails
[03:59:30] jottr: has joined #RubyOnRails
[04:01:26] nachoman: has joined #RubyOnRails
[04:07:15] jottr: has joined #RubyOnRails
[04:13:34] kn-928: has joined #RubyOnRails
[04:14:26] gil_: has joined #RubyOnRails
[04:19:24] jottr: has joined #RubyOnRails
[04:25:15] trautwein: has joined #RubyOnRails
[04:29:10] Puffball: has joined #RubyOnRails
[04:30:15] jottr: has joined #RubyOnRails
[04:38:00] jottr: has joined #RubyOnRails
[04:38:29] Hosh: has joined #RubyOnRails
[04:43:30] mtkd: has joined #RubyOnRails
[04:52:00] jottr: has joined #RubyOnRails
[04:52:56] workmad3: has joined #RubyOnRails
[04:59:10] cagomez: has joined #RubyOnRails
[05:07:08] jottr: has joined #RubyOnRails
[05:12:47] mjolnird: has joined #RubyOnRails
[05:20:16] advorak: has joined #RubyOnRails
[05:21:36] jottr: has joined #RubyOnRails
[05:32:14] sidx64: has joined #RubyOnRails
[05:36:04] jottr: has joined #RubyOnRails
[05:51:07] jottr: has joined #RubyOnRails
[05:51:25] sidx64: has joined #RubyOnRails
[05:57:05] Ryzokuken: has joined #RubyOnRails
[05:59:43] jcarl43: has joined #RubyOnRails
[06:00:39] sidx64: has joined #RubyOnRails
[06:06:33] jottr: has joined #RubyOnRails
[06:20:01] jottr: has joined #RubyOnRails
[06:29:58] jottr: has joined #RubyOnRails
[06:38:38] sidx64_: has joined #RubyOnRails
[06:42:38] KeyJoo: has joined #RubyOnRails
[06:43:41] helpa-bot: has joined #RubyOnRails
[06:43:50] jottr: has joined #RubyOnRails
[06:44:35] apeiros__: has joined #RubyOnRails
[06:44:51] roshanavand: has joined #RubyOnRails
[06:45:39] helpa: has joined #RubyOnRails
[06:48:14] mtkd: has joined #RubyOnRails
[06:48:46] sevenseacat: has joined #RubyOnRails
[06:53:06] timdotrb: has joined #RubyOnRails
[06:53:20] workmad3: has joined #RubyOnRails
[06:57:17] timdotrb: Evening, all. I’m having an issue with solr reindexing where it gets to the same spot every time before failing due to a timeout error. Any help would be greatly appreciated:
[06:57:18] timdotrb: https://gist.github.com/willc0de4food/c217c1544bff55298c94634a3d97e431
[06:59:21] jottr: has joined #RubyOnRails
[07:11:55] sidx64_: has joined #RubyOnRails
[07:13:16] jottr: has joined #RubyOnRails
[07:17:52] sidx64: has joined #RubyOnRails
[07:20:21] reber: has joined #RubyOnRails
[07:27:02] jottr: has joined #RubyOnRails
[07:28:12] armyriad: has joined #RubyOnRails
[07:28:40] morfin60: has joined #RubyOnRails
[07:29:53] morfin60: i created browser.rb under lib subdirectory and added config.autoload_paths += %W(#{config.root}/lib) but Browser class declared in lib/browser.rb do not load
[07:30:04] morfin60: any clue why this can happen?
[07:30:59] sevenseacat: what do you mean, 'do not load'?
[07:31:53] morfin60: when i run "rails c" and then Browser.new(driver: :firefox) saying that this class not exists
[07:32:17] morfin60: but when i do require 'browser' and then do same thing everything is ok
[07:32:28] sevenseacat: do you need to restart spring?
[07:33:33] sevenseacat: yes - it autoloads and caches application config and data
[07:33:37] sevenseacat: try bin/spring stop
[07:33:43] sevenseacat: and try again
[07:33:43] conta: has joined #RubyOnRails
[07:34:20] morfin60: hmm nothing changed
[07:35:31] sevenseacat: what output did you get?
[07:36:15] jottr: has joined #RubyOnRails
[07:36:17] morfin60: NameError: uninitialized constant Browser
[07:36:25] sevenseacat: no, when stopping spring
[07:37:12] morfin60: and my application is working in development environment
[07:37:27] sevenseacat: well either you're using spring and got told that it was stopped, or not using spring and would have gotten an error
[07:38:28] morfin60: i do not know what happens with this class
[07:42:42] morfin60: config.autoload_paths += Dir["#{config.root}/lib/**/", "#{config.root}/app/models/ckeditor"] in application.rb worked
[07:49:54] jottr: has joined #RubyOnRails
[07:50:34] riotjones: has joined #RubyOnRails
[08:03:16] jottr: has joined #RubyOnRails
[08:05:18] dionysus69: has joined #RubyOnRails
[08:08:04] dionysus69: has joined #RubyOnRails
[08:11:10] jottr: has joined #RubyOnRails
[08:16:16] ramfjord: has joined #RubyOnRails
[08:21:38] cschneid: has joined #RubyOnRails
[08:26:04] srinidhi: has joined #RubyOnRails
[08:26:19] jottr: has joined #RubyOnRails
[08:29:08] elcms: has joined #RubyOnRails
[08:32:50] ephemer0l: has joined #RubyOnRails
[08:35:10] Sylario: has joined #RubyOnRails
[08:35:57] elcms: has joined #RubyOnRails
[08:37:35] srinidhi: has joined #RubyOnRails
[08:40:46] jottr: has joined #RubyOnRails
[08:43:31] Jameser: has joined #RubyOnRails
[08:47:11] jottr: has joined #RubyOnRails
[08:50:50] dionysus69: is there a downside to using inverse of? why not make every relationship inverse_of? or even more, why not make it default in a relationship ?
[08:51:31] moei: has joined #RubyOnRails
[08:53:40] jottr: has joined #RubyOnRails
[08:53:43] workmad3: has joined #RubyOnRails
[08:55:10] Sylario: @dionysus69 invese_of will change the way the relation is retrieved
[08:55:35] dionysus69: so if it changes in DB it wont change in memory?
[08:55:50] dionysus69: if that's the case I guess it shouldn't that hard to change it in memory too
[08:57:28] Sylario: From what I remember, you can have use case where you want it, and some where you do not want it
[08:58:52] Sylario: Ok, i checked, it changed in 4.1, rails try inverse_of
[09:00:20] Sylario: @dionysus69 https://www.viget.com/articles/exploring-the-inverse-of-option-on-rails-model-associations/
[09:03:24] mikecmpbll: has joined #RubyOnRails
[09:04:45] dionysus69: thanks sylario
[09:08:04] jottr: has joined #RubyOnRails
[09:12:14] schneider: has joined #RubyOnRails
[09:14:14] jottr: has joined #RubyOnRails
[09:19:05] ule: has joined #RubyOnRails
[09:23:08] jimmylu2333: has joined #RubyOnRails
[09:25:27] jottr: has joined #RubyOnRails
[09:30:52] marr: has joined #RubyOnRails
[09:33:32] Jameser: has joined #RubyOnRails
[09:37:12] jottr: has joined #RubyOnRails
[09:38:32] Jameser: has joined #RubyOnRails
[09:40:05] NL3limin4t0r: has joined #RubyOnRails
[09:40:18] timdotrb: has joined #RubyOnRails
[09:44:26] syndikate: has joined #RubyOnRails
[09:44:37] srinidhi: has joined #RubyOnRails
[09:44:41] mtkd: has joined #RubyOnRails
[09:46:57] timdotrb: has joined #RubyOnRails
[09:47:14] jottr: has joined #RubyOnRails
[09:48:54] timdotrb_: has joined #RubyOnRails
[09:49:03] jimmylu2333: has joined #RubyOnRails
[09:57:15] jottr: has joined #RubyOnRails
[10:11:23] jottr: has joined #RubyOnRails
[10:14:26] syndikate: I have eager loaded some records. I want to manipulate the array of eager loaded records and assign it back to the original record. How can I do that? How can I re-assign the updated associated array?
[10:15:55] DrYockel: has joined #RubyOnRails
[10:16:00] ramfjord: has joined #RubyOnRails
[10:17:20] tbuehlmann: syndikate: can't you just update the loaded records directly?
[10:17:29] sidx64: has joined #RubyOnRails
[10:18:01] dminuoso: ACTION .oO( AbstractEagerLoadingProxyWriterFactoryImplImplementorPattern )
[10:18:52] syndikate: No, I am not updating the records, but altering the array. Say I have eagerloaded 3 records [A,B,C]. I want to filter out B from it based on a condition and leave out the eager loaded records with only A and C
[10:23:38] tbuehlmann: so you only really want to eager load some of the associated records and not all, is that it?
[10:23:58] syndikate: Yes, I want to filter teh eager loaded records
[10:24:08] syndikate: But the condition is dynamic
[10:26:15] tbuehlmann: you could preload the association manually: https://gist.github.com/tbuehlmann/30fed1716c921586d3ff803a88c8aa5c
[10:26:37] tbuehlmann: this will preload the post's comments with an id > 42
[10:26:59] jottr: has joined #RubyOnRails
[10:32:34] tbuehlmann: isn't this even easier? like Post.includes(:comments).where(comments: {foo: 'bar'})
[10:32:59] tbuehlmann: or is thig filtering posts as well? let's see..
[10:33:09] sevenseacat: that will filter posts
[10:33:44] tbuehlmann: I'm sure it will when using .joins, wasn't sure about .includes
[10:35:51] jottr: has joined #RubyOnRails
[10:40:43] am55: has joined #RubyOnRails
[10:43:04] tbuehlmann: right, so it will filter posts _and_ comments. whereas when using joins, it will only filter posts
[10:44:35] sidx64: has joined #RubyOnRails
[10:49:43] Jameser: has joined #RubyOnRails
[10:49:53] boshhead: has joined #RubyOnRails
[10:50:24] jottr: has joined #RubyOnRails
[10:53:13] schneider: has joined #RubyOnRails
[10:54:05] workmad3: has joined #RubyOnRails
[10:55:33] sidx64: has joined #RubyOnRails
[10:56:31] jottr: has joined #RubyOnRails
[10:57:53] cstls: has joined #RubyOnRails
[11:00:24] syndikate: That's the thing here I don't want to filter posts, but the comments associated
[11:01:54] sidx64: has joined #RubyOnRails
[11:03:41] tbuehlmann: use https://gist.github.com/tbuehlmann/30fed1716c921586d3ff803a88c8aa5c then
[11:06:03] workmad3: has joined #RubyOnRails
[11:07:07] jottr: has joined #RubyOnRails
[11:07:09] syndikate: Okay tbuehlmann, thanks! I will try that
[11:07:20] syndikate: Aside from this, regarding active record
[11:07:42] syndikate: What if I want to re-assign the association how do I do it? Example: employee.leaves = filtered_leaves
[11:07:53] syndikate: This will break the active record collection
[11:08:07] centos_: has joined #RubyOnRails
[11:08:18] schneider: has joined #RubyOnRails
[11:09:57] tbuehlmann: I don't think think there's an interface for just replacing records in a loaded relation
[11:11:20] sidx64: has joined #RubyOnRails
[11:19:27] jottr: has joined #RubyOnRails
[11:19:45] NL3limin4t0r: has joined #RubyOnRails
[11:26:12] dminuoso: This stupid rspec.
[11:26:33] dminuoso: This thing needs a beating.
[11:27:35] jottr: has joined #RubyOnRails
[11:31:10] KeyJoo: has joined #RubyOnRails
[11:40:48] jottr: has joined #RubyOnRails
[11:47:00] Cavallari: has joined #RubyOnRails
[11:47:22] Cavallari1: has joined #RubyOnRails
[11:48:14] am55: has joined #RubyOnRails
[11:49:44] cstls: has joined #RubyOnRails
[11:53:29] jottr: has joined #RubyOnRails
[11:57:25] centos_: has joined #RubyOnRails
[12:00:03] roshanavand: has joined #RubyOnRails
[12:00:33] roshanavand: has joined #RubyOnRails
[12:00:55] centos_: has joined #RubyOnRails
[12:01:35] jottr: has joined #RubyOnRails
[12:06:30] mikecmpb_: has joined #RubyOnRails
[12:14:20] sonOfRa: has joined #RubyOnRails
[12:15:39] ramfjord: has joined #RubyOnRails
[12:19:53] bryanculver: has joined #RubyOnRails
[12:20:10] nickjj: has joined #RubyOnRails
[12:29:31] keyjoo_: has joined #RubyOnRails
[12:37:41] cawel: has joined #RubyOnRails
[12:40:59] Ergo: has joined #RubyOnRails
[12:41:08] _aeris_: has joined #RubyOnRails
[12:44:14] chouhoulis: has joined #RubyOnRails
[12:47:16] mikecmpbll: has joined #RubyOnRails
[12:49:05] tcopeland: has joined #RubyOnRails
[12:53:28] cawel: has joined #RubyOnRails
[12:54:56] ramfjord: has joined #RubyOnRails
[12:55:11] toomus: has joined #RubyOnRails
[12:55:55] toomus: Can someone help me with active model serializer?
[12:56:34] toomus: I have e.g. model like this {"key"=>"header.title", "value"=>"Logout"}
[12:57:25] toomus: How to make serializer that will produce {"header.title" => "Logout"}?
[12:57:47] chouhoulis: has joined #RubyOnRails
[12:58:21] mtkd: has joined #RubyOnRails
[12:59:50] TomyWork: has joined #RubyOnRails
[13:00:05] dminuoso: toomus: Do it yourself.
[13:00:48] toomus: dminuoso How? :)
[13:00:56] TomyWork: a rails application starts in development mode if nothing else is specified, right?
[13:01:14] dviola: has joined #RubyOnRails
[13:02:08] dminuoso: toomus: Well strictly speaking you can beat AMS into submission, but you can simply make that hash yourself, and use to_json.
[13:02:46] dminuoso: TomyWork: Depends on the environment variable RAILS_ENV
[13:06:41] TomyWork: ah, let me check that :)
[13:08:12] dminuoso: TomyWork: Its better to state your problem, rather than playing the xy game.
[13:08:20] helpa: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[13:14:05] cstls: has joined #RubyOnRails
[13:15:46] mtkd: has joined #RubyOnRails
[13:20:42] gregf_: has joined #RubyOnRails
[13:21:16] desperek: has joined #RubyOnRails
[13:22:27] desperek: has joined #RubyOnRails
[13:22:53] DrYockel: has joined #RubyOnRails
[13:25:11] Jameser: has joined #RubyOnRails
[13:26:41] arBmind: has joined #RubyOnRails
[13:29:16] Axsuul: has joined #RubyOnRails
[13:32:41] sidx64: has joined #RubyOnRails
[13:36:59] TomyWork: dminuoso alright, i'm trying to figure out why stopping puppet-dashboard creates a development.log in /usr/share/puppet-dashboard/log
[13:37:20] TomyWork: ...even when it wasn't started before stopping it
[13:37:43] TomyWork: and why that logfile grew to 300 MB, even though that thing is supposed to be in production mode
[13:38:01] TomyWork: and why the production log file also grew to 300 MB
[13:38:29] TomyWork: and why there's a delayed_job.log that grew to 20 GB
[13:39:00] TomyWork: first step for me is figuring out whether that thing runs in development mode or production mode
[13:39:26] TomyWork: and whether putting it into production mode fixes the excessive logging
[13:46:36] TomyWork: assets are compiled every time it starts, which kinda tells me that it's in development mode
[13:46:53] jottr: has joined #RubyOnRails
[13:48:29] TomyWork: on the other hand, the process command line is "/usr/local/rvm/rubies/ruby-2.0.0-p247/bin/ruby script/rails server -e production -p 3000 -b 0.0.0.0 -d", so it's supposedly in production mode
[13:49:25] TomyWork: (i know that 2.0.0 has long been EOL, but i guess so has rails 3.2 and puppet-dashboard)
[13:50:47] fox_mulder_cp: hi, folks. can somebody helps me with parse xml file to json or some easy to use structure in plain ruby? i try to use Nokogiri.xml.parse, but it returns large structure which must be parsed to object via xpaths etc
[13:53:17] TomyWork: fox_mulder_cp xpath is pretty easy to use. you just have to learn it. the basics are simple:
[13:54:51] TomyWork: if you have A nested in B nested in C, the xpath to get A is either "//A" (meaning look for an A tag anywhere in the document) if you dont care about structure, or "/C/B/A" (meaning look for an A tag in a B tag in a C tag) if you do care about structure
[13:55:30] TomyWork: i can't imagine a case where converting it to json would simplify dealing with it
[13:55:31] dminuoso: fox_mulder_cp: You dont "parse" it with xpath.
[13:55:46] fox_mulder_cp: TomyWork: i think, that some like xml schema can help to load doc at json, or hash
[13:55:51] dminuoso: fox_mulder_cp: The #parse method returns a tree basically. xpath is just a method for finding things inside that tree.
[13:56:14] dminuoso: TomyWork: XML is a complete pita to work with for starters.
[13:56:17] fox_mulder_cp: so how i can parse a xml tree to hash/json?
[13:56:25] dminuoso: fox_mulder_cp: You dont "parse" it to hash/json.
[13:57:05] dminuoso: fox_mulder_cp: Strictly speaking you cant generally convert xml to json because XML is vastly more complex.
[13:57:10] fox_mulder_cp: dminuoso: i must create object from xml. so how i can do this?
[13:57:48] dminuoso: fox_mulder_cp: You traverse down the tree to find the information necessary for building your object (either manually or you use css/xpath selectors)
[13:58:12] fox_mulder_cp: dminuoso: so no way to compose object with xml + schema?
[13:59:40] TomyWork: fox_mulder_cp what is an "object" and do you mean that kind of schema? https://www.w3.org/standards/xml/schema
[13:59:44] TomyWork: do you have one?
[13:59:51] TomyWork: do you know how to write them?
[14:00:00] TomyWork: if not, that's harder than learning xpath :)
[14:00:10] dminuoso: If possible use css selectors over xpath.
[14:00:11] TomyWork: orders of magnitude
[14:00:18] dminuoso: css selectors are way simpler than xpath.
[14:01:08] tbuehlmann: fox_mulder_cp: if you're lucky, you call Hash.from_xml(your_xml_string) and you're done
[14:01:13] TomyWork: dminuoso is there any environment beyond ruby that allows you to use css selectors for xml (rather than html)?
[14:01:22] fox_mulder_cp: so we have methods to get object from json, but can't parse xml with it schems..
[14:01:37] TomyWork: or will using css with xml create a vendor lock-in?
[14:01:53] fox_mulder_cp: tbuehlmann: Hash.from_xml requires rails :)
[14:02:09] tbuehlmann: I'm sorry, I thought this was a #RubyOnRails channel
[14:02:33] TomyWork: fox_mulder_cp json is just a nested hierarchy of objects/hashes and arrays
[14:02:38] fox_mulder_cp: tbuehlmann: i try to use plain ruby ) hm
[14:03:56] TomyWork: whereas xml is multi-tiered standard where each element can not only contain other elements, but also attributes
[14:04:13] TomyWork: and good luck with xml if you care about whitespace :)
[14:05:40] tbuehlmann: https://github.com/rails/rails/blob/v5.1.5/activesupport/lib/active_support/core_ext/hash/conversions.rb#L139 ¯\_(ツ)_/¯
[14:07:01] TomyWork: tbuehlmann that looks like it's some specific xml scheme on top of regular xml
[14:07:10] TomyWork: so it probably won't work for him anyway
[14:07:33] fox_mulder_cp: ahah. i try to create gem which parse xml before send it to rails.
[14:07:54] TomyWork: fox_mulder_cp but why
[14:08:46] fox_mulder_cp: TomyWork: becouse it's a partial small app, and i don't want rails on it
[14:09:13] TomyWork: fox_mulder_cp no, why do you want to parse xml to something else?
[14:09:20] TomyWork: that is just gonna confuse everyone
[14:10:35] tbuehlmann: I quite often had to build small apps, the rails stack with all its gems and the ecosystem was just too convenient to not using it, but well
[14:10:49] fox_mulder_cp: TomyWork: becouse EPP protocol use it
[14:11:38] TomyWork: fox_mulder_cp Extensible Provisioning Protocol, an Internet protocol for domain registration - that?
[14:11:47] fox_mulder_cp: TomyWork: yes.
[14:12:04] TomyWork: looks like i'm above average at guessing
[14:12:36] TomyWork: so, why don't you write a gem to deal with EPP instead of writing a gem to convert xml to some arbitrary JSON representation of XML?
[14:12:50] TomyWork: that would be a whole lot more useful
[14:14:06] fox_mulder_cp: TomyWork: and i try to do this shit via easy way, not ton's of xpath calling
[14:14:51] sidx64: has joined #RubyOnRails
[14:15:38] chouhoulis: has joined #RubyOnRails
[14:16:07] TomyWork: fox_mulder_cp ok, say you have your json representation of xml. what next?
[14:16:18] jottr: has joined #RubyOnRails
[14:16:19] TomyWork: a ton of jsonpath calling?
[14:16:36] TomyWork: i don't really see the advantage here
[14:17:17] TomyWork: and you have the disadvantage of not being able to reuse other people's work
[14:17:20] fox_mulder_cp: TomyWork: i try to ask a question for easy parsing. thats all
[14:17:34] TomyWork: fox_mulder_cp easy parsing = xpath
[14:18:09] fox_mulder_cp: TomyWork: because i try to use existing projects and seems that all of it use hardcoded schemas, which is not applicable for me
[14:18:33] fox_mulder_cp: all ISP which i connect via epp use custom realizations
[14:19:27] TomyWork: https://github.com/m247/epp-client
[14:19:41] TomyWork: https://github.com/ultraspeed/epp
[14:20:23] tbuehlmann: your guessing is far above average!
[14:22:31] fox_mulder_cp: TomyWork: i try to ask a question. epp is a example of task where my ask is relevant
[14:33:23] chouhoulis: has joined #RubyOnRails
[14:36:37] kn-928: has joined #RubyOnRails
[14:39:34] kn-928_: has joined #RubyOnRails
[14:51:09] wacko: has joined #RubyOnRails
[14:52:15] NL3limin4t0r: has joined #RubyOnRails
[14:59:24] tycoon177: in our app, we currently upload photos with dragonfly and i recently set up client-side resizing of the images to reduce load on the server. What other things can i do to optimize the image format on the server side? we strip metadata as well
[15:02:44] kn-928: has joined #RubyOnRails
[15:05:45] fox_mulder_cp: imagemagic is do it automatically :)
[15:06:29] fox_mulder_cp: you can setup allowed file extensions on your mounted file uploader gem and html input field on form
[15:16:35] SteenJobs: has joined #RubyOnRails
[15:16:38] mroutis: has joined #RubyOnRails
[15:19:22] tycoon177: fox_mulder_cp: i'm not sure that i follow. is imagemagic different from imagemagick? and we already limit to just png, jpg, and gif on the client side
[15:19:39] tycoon177: but that doesn't help with image optimization :)
[15:23:42] jottr: has joined #RubyOnRails
[15:59:32] troys: has joined #RubyOnRails
[16:00:02] cagomez: has joined #RubyOnRails
[16:02:32] srinidhi: has joined #RubyOnRails
[16:03:20] brycesenz: has joined #RubyOnRails
[16:07:04] beingjohnm: tycoon177: I think that question might be outside the intended scope of the channel :)
[16:07:28] tycoon177: beingjohnm: alright :) just thought there might be some gems that i overlooked that may do this for me
[16:07:37] tycoon177: no worries, i'll take it elsewhere though :D
[16:08:20] beingjohnm: you could probably send them striaight to s3 and process them with lambda
[16:08:28] beingjohnm: but I don't know how to set that up
[16:11:03] one_zero: has joined #RubyOnRails
[16:15:47] kapil___: has joined #RubyOnRails
[16:16:29] kapil___: how to get all the constrains on the table?
[16:18:27] conta: has joined #RubyOnRails
[16:19:47] cstls: has joined #RubyOnRails
[16:20:19] mikecmpbll: has joined #RubyOnRails
[16:20:48] roca: has joined #RubyOnRails
[16:21:51] KeyJoo: has joined #RubyOnRails
[16:22:17] uks: has joined #RubyOnRails
[16:24:21] rafik: has joined #RubyOnRails
[16:24:23] andrewray: has joined #RubyOnRails
[16:29:03] chouhoulis: has joined #RubyOnRails
[16:38:24] bluelf: has joined #RubyOnRails
[16:40:37] jcarl43: has joined #RubyOnRails
[16:43:41] darkhanb: has joined #RubyOnRails
[16:45:24] NL3limin4t0r: kapil___: It depends what you mean by **all** constraints. For foreign keys you can do `ActiveRecord::Base.connection.foreign_keys(<table name>)`, for primary keys you do `ActiveRecord::Base.connection.primary_keys(<table name>)` and for indexes you'll need `ActiveRecord::Base.connection.indexes(<table name>)`.
[16:46:08] [Butch]: has joined #RubyOnRails
[16:46:31] NL3limin4t0r: Keep in mind that you can replace `ActiveRecord::Base` with any model you have, as long as it inherits from `ActiveRecord::Base`.
[16:47:22] NL3limin4t0r: With Rails 5.0 this is normaly through `ApplicationRecord`.
[16:48:33] arBmind: has joined #RubyOnRails
[16:51:02] nachoman: has joined #RubyOnRails
[16:52:15] mikecmpbll: i'm 99% sure i'm being thick but i can't find any decent explanations of it online: with rails 5's ar_internal_metadata table, do i have to create that in production database?
[16:55:10] NL3limin4t0r: https://stackoverflow.com/questions/40314552/is-ar-internal-metadata-table-created-in-production
[16:56:19] kapil___: @NL3limin4t0r: I not get all foreign keys still.
[17:00:03] TomyWork: tycoon177 if you hadnt said "photos", i would have suggested pngcrush
[17:00:18] TomyWork: pngcrush can help reduce png size
[17:02:46] mikecmpbll: NL3limin4t0r : doesn't answer my question :/
[17:05:49] NL3limin4t0r: mikecmpbll: I can't help you any further. If I where you I would just run my development environment in production mode and just check. Maybe someone else can help you further, but I don't know much about the internal metadatabase tables.
[17:10:50] kapil___: nachoman: when i run \d ee_guru12.materials in psql prompt i get: Referenced by: .. fields. i want that fields.
[17:11:56] nachoman: psql? I don't using postgres @kapil___
[17:12:09] rafik: has joined #RubyOnRails
[17:13:27] kapil___: sorry name wrong
[17:24:26] timdotrb: has joined #RubyOnRails
[17:25:29] brycesenz: has joined #RubyOnRails
[17:25:59] mtkd: has joined #RubyOnRails
[17:26:24] brycesenz: has joined #RubyOnRails
[17:26:25] kn-928: has joined #RubyOnRails
[17:28:18] ramfjord: has joined #RubyOnRails
[17:45:52] jottr: has joined #RubyOnRails
[17:45:56] cstls: has joined #RubyOnRails
[17:46:52] newton: is it possible to have ActionCable broadcasts be different depending on the subscriber it's sending to? eg anonymize input for only some subscribers
[17:55:39] brycesenz: has joined #RubyOnRails
[18:02:23] orbyt_: has joined #RubyOnRails
[18:06:45] workmad3_: has joined #RubyOnRails
[18:07:32] mroutis: has joined #RubyOnRails
[18:09:10] conta: has joined #RubyOnRails
[18:14:13] mikecmpbll: has joined #RubyOnRails
[18:15:34] fox_mulder_cp: what method i must realize for change some like @client=#<W3dns::Client:0x0000559d17c442d0>,
[18:15:45] fox_mulder_cp: to human readable text?
[18:23:03] apeiros: fox_mulder_cp: not sure I understand your question correctly, but either .inspect (irb/pry/rails console uses that) or .to_s (puts uses that)
[18:24:16] ramfjord: has joined #RubyOnRails
[18:27:59] fox_mulder_cp: that is, in the console output, this should not worry me?
[18:53:01] schneider: has joined #RubyOnRails
[18:56:18] glassresistor: has joined #RubyOnRails
[18:57:11] glassresistor: in rspec how do i get the database into a specific migration state like Rails.migrate_to(path_to_migration)
[19:08:07] Dimik: has joined #RubyOnRails
[19:08:32] fox_mulder_cp: glassresistor: why? you create database, complete all migrations and seeding it with sample data.
[19:09:01] fox_mulder_cp: if database not in last migration it raise exeption
[19:09:19] glassresistor: fox_mulder_cp: ? im wanting to test a migration with rspec
[19:10:19] fox_mulder_cp: it must be executed on application all. no 'special state level'
[19:10:27] glassresistor: fox_mulder_cp: so in other frameworks I can be like run this specific portion of the test at this migration and another at this. typically this is used to verify a data migration works a expected
[19:10:56] glassresistor: fox_mulder_cp: usually it uses db transactions to make this fast and clean
[19:15:54] Yzguy: has joined #RubyOnRails
[19:16:44] cagomez: has joined #RubyOnRails
[19:17:09] dionysus69: has joined #RubyOnRails
[19:18:18] glassresistor: whats a reversable way to do change_column_null?
[19:19:38] desperek: apeiros, eh, how do i redirect to with an object? ;-;
[19:23:03] syndikate: tbuehlmann, I was trying this out ActiveRecord::Associations::Preloader.new.preload(posts, :comments, Comment.where('id > 42')), but have no clue how to make use of the returned class :D
[19:23:20] syndikate: Tried going through the source but couldn
[19:25:14] sameerynho: has joined #RubyOnRails
[19:26:25] kn-928: has joined #RubyOnRails
[19:32:11] Axsuul: has joined #RubyOnRails
[19:35:46] cstls: has joined #RubyOnRails
[19:36:44] desperek: hey syndikate, i have a question about redirecting
[19:36:59] desperek: how do i redirect devise resource correctly
[19:40:25] schneider: has joined #RubyOnRails
[19:45:16] am55: has joined #RubyOnRails
[19:47:09] Omnilord: has joined #RubyOnRails
[19:47:14] cagomez: has joined #RubyOnRails
[19:50:30] cstls: has joined #RubyOnRails
[19:51:50] orbyt_: has joined #RubyOnRails
[20:10:35] sidx64: has joined #RubyOnRails
[20:11:39] jammanbo: has joined #RubyOnRails
[20:14:36] jammanbo: Suppose a class Child < Parent. Then you (for reasons best known to yourself) say thingy = Parent.new(type: 'Child'). Now thing.is_a?(Child) is false, as is instance_of? Without manually checking the type attribute, is there a way to test if `thingy` is a Child?
[20:16:47] sidx64: has joined #RubyOnRails
[20:18:40] dminuoso: jammanbo: Interrogate .type ?
[20:18:49] cagomez: has joined #RubyOnRails
[20:18:53] dminuoso: jammanbo: Also, you can use `Child.new` directly
[20:21:53] jammanbo: Cool, just checking, thanks dminuoso
[20:24:14] weaksauce: has joined #RubyOnRails
[20:25:18] orbyt_: has joined #RubyOnRails
[20:26:56] schneider: has joined #RubyOnRails
[20:30:30] Inside: has joined #RubyOnRails
[20:31:31] Inside: Do you guys recommend using activestorage? I'd need to update one of my old apps from 4.1.4 to 5.2 (I need to update it anyway due to some security issues /anyway/...) or should I continue using carrierwave?
[20:34:04] Inside: The only thing I really need is to store files on disk and show their thumbnials
[20:36:02] schneider: has joined #RubyOnRails
[20:42:06] Tempesta: has joined #RubyOnRails
[20:45:08] schneider: has joined #RubyOnRails
[20:51:13] spohnz: has joined #RubyOnRails
[20:54:18] schneider: has joined #RubyOnRails
[20:54:30] fox_mulder_cp: i try to prepare my Module and classes to use enumerable. How i can prepare it to sort, filter and etc?
[20:59:06] apeiros: fox_mulder_cp: all you need is to implement #each, then include Enumerable
[20:59:25] apeiros: some methods will profit if you also provide #size
[21:00:05] schneider: has joined #RubyOnRails
[21:01:29] jottr: has joined #RubyOnRails
[21:02:47] workmad3: has joined #RubyOnRails
[21:05:36] arBmind: has joined #RubyOnRails
[21:06:02] fox_mulder_cp: and when i have a some instance variables, and want filter for @year and @status?
[21:07:09] cawel: has joined #RubyOnRails
[21:12:26] mroutis: has joined #RubyOnRails
[21:17:07] atrerus: has joined #RubyOnRails
[21:22:57] atrerus: I’m trying to run a test in Rails 5 and POST /users/sign_in is returning a 200 and rendering the login page… I don’t see a flash message or any other explanation. The user I’m trying to log in as was created by a test fixture. In the test I verify that @user.email = ‘foo@bar.com’ and @user.valid_password? ‘password’. Any thoughts as to other explanations why sign_in wouldn’t be working? We have divise_scope :user,
[21:22:57] atrerus: believe it’s an unmodified devise controller I’m dealing with.
[21:26:25] kn-928: has joined #RubyOnRails
[21:30:47] mtkd: has joined #RubyOnRails
[21:31:11] gil_: has joined #RubyOnRails
[21:36:19] maxvaillancourt1: has joined #RubyOnRails
[21:52:08] quazimodo: has joined #RubyOnRails
[22:04:31] schneider: has joined #RubyOnRails
[22:13:47] schneider: has joined #RubyOnRails
[22:15:06] gambl0re: has joined #RubyOnRails
[22:15:33] remix2000: has joined #RubyOnRails
[22:22:53] schneider: has joined #RubyOnRails
[22:25:33] timdotrb: has joined #RubyOnRails
[22:26:10] mjolnird: has joined #RubyOnRails
[22:26:46] kn-928: has joined #RubyOnRails
[22:31:42] Radar: atrerus: I've seen this once before.
[22:31:50] Radar: But it was with an older version of Devise.
[22:32:04] rubemlrm: has joined #RubyOnRails
[22:32:32] elcms: has joined #RubyOnRails
[22:33:23] Radar: atrerus: Can you reproduce this issue in a new Rails application?
[22:33:47] atrerus: yeah I have no idea… this is an app I inherited, I’m just trying to get the tests working
[22:38:24] fox_mulder_cp: How i can implement #each for my class with some instance variables?
[22:40:56] atrerus: I’m putting debug statements inside devise… it looks like warden.authenticate! is throwing
[22:41:43] fox_mulder_cp: atrerus: it's a last devise version?
[22:42:08] atrerus: warden 1.2.6
[22:42:29] atrerus: it’s probably something stupid, like wrong user/password
[22:43:02] atrerus: I just find it hard to tell without any info to go off of
[22:43:38] Radar: atrerus: what is it throwing?
[22:44:27] atrerus: well I have a log statement before and after warden.authenticate! …execution enters but doesn’t leave, so I assume it’s throwing?
[22:54:08] atrerus: is there something simple I’m missing that I could check?
[22:54:30] atrerus: I really don’t want to be debugging warden right now…
[22:55:20] p8m: has joined #RubyOnRails
[22:56:06] atrerus: @Radar I don’t know… if there’s a throw it’s also being caught and swallowed. I’m not getting any info from this, I just get a 200 response and I was expecting a 302.
[22:56:22] atrerus: maybe it’s working, and I just didn’t supply a redirect parameter?
[22:56:49] tcopeland: has joined #RubyOnRails
[22:58:24] atrerus: but if I give it a bogus password I get the same result
[23:03:01] Ergo: has joined #RubyOnRails
[23:03:14] workmad3: has joined #RubyOnRails
[23:04:47] Yzguy: has joined #RubyOnRails
[23:07:07] desperek: hm, how can i get all depth of relations?
[23:07:17] desperek: is there a go-to solution?
[23:11:54] jottr: has joined #RubyOnRails
[23:15:33] atrerus: I figured it out… this was stupid. I needed to group my email/password params under a user object
[23:16:34] bambanx: has joined #RubyOnRails
[23:16:49] bambanx: has joined #RubyOnRails
[23:17:20] atrerus: how can I tell that devise failed authenticating so I can deliver a message to the user?
[23:17:29] KeyJoo: has joined #RubyOnRails
[23:18:17] bambanx: has joined #RubyOnRails
[23:19:15] fox_mulder_cp: atrerus: edit route method )
[23:19:39] fox_mulder_cp: Mailer.some(blah); super, end
[23:21:06] kapil___: has joined #RubyOnRails
[23:21:13] atrerus: couldn’t I add an after hook?
[23:21:56] atrerus: after SessionsController::create?
[23:22:05] fox_mulder_cp: as you wish :_
[23:27:03] kn-928: has joined #RubyOnRails
[23:27:20] gravity_pope: has joined #RubyOnRails
[23:30:51] bambanx: has joined #RubyOnRails
[23:38:32] cstls: has joined #RubyOnRails
[23:40:32] gravity_pope: Anyone know how to get a reference to a belongs to associated object when both objects are still unsaved? something like this: https://gist.github.com/jessewmc/d8aa7bdc17b08a1f0036a5c3c8706bf5#file-gistfile1-txt I'd like to have a reference to delivery in the item model before saving. I can work around it if not possible but seems like a simple thing that should be doable (rails 5.0.6)
[23:40:46] am55: has joined #RubyOnRails
[23:45:07] atrerus: I got it… devise was already populating the flash messages, I just needed to render them in the view