« Back to channel list

#RubyOnRails - 17 April 2017

« Back 1 day Forward 1 day »
[00:05:24] Pumukel: has joined #RubyOnRails
[00:11:32] Technodrome: has joined #RubyOnRails
[00:18:21] hotpancakes: has joined #RubyOnRails
[00:19:15] neohunter: has joined #RubyOnRails
[00:21:18] neohunter: Hi there, I'm using the Telegram-bot gem that have a module Telegram. I want to extend it to add one method, so i can to Telegram.send_message with my default configuration. I added a telegram.rb file on app/models.rb that extend there original module. if on console i run Telegram.send_message it says undefined method, If I do require 'telegram' the send_message method now works, (i guess its not autoloaded as there is module called Telegram
[00:21:18] neohunter: already. Now i want to require it on app initialization, I added the require on my application.rb but it sasys cannot load such file, Where i can add the require?
[00:42:50] cerulean: the true version number of ruby on rails is this: 396.55
[00:48:06] mwlang: has joined #RubyOnRails
[01:01:08] hotpancakes: has joined #RubyOnRails
[01:14:40] Pumukel: has joined #RubyOnRails
[01:16:58] drale2k_: has joined #RubyOnRails
[01:18:50] Radar: cerulean: what
[01:19:03] Radar: cerulean: that makes no sense
[01:19:25] drale2k_: has joined #RubyOnRails
[01:20:27] Pumukel: has joined #RubyOnRails
[01:27:43] hotpancakes: has joined #RubyOnRails
[01:40:09] cerulean: Radar: https://github.com/mixflame/ceruversion
[01:40:20] cerulean: find out the real version of your app !!!
[01:40:25] cerulean: requirements: crystal-lang
[01:40:47] cerulean: https://crystal-lang.org (im sure you're away of crystal-lang right Radar?)
[01:43:59] cerulean: is it Chrystal?
[01:46:14] hotpancakes: has joined #RubyOnRails
[01:47:04] Radar: man those must be some good drugs.
[01:50:35] cerulean: do you disagree with the algorithm?
[01:50:36] Jameser: has joined #RubyOnRails
[01:56:03] MasterAsia: has joined #RubyOnRails
[01:56:04] irishfromua: has joined #RubyOnRails
[01:56:16] MasterAsia: Ideal action to merge 2 resources?
[02:05:22] libastral: has joined #RubyOnRails
[02:08:25] grymok: has joined #RubyOnRails
[02:12:14] Jameser: has joined #RubyOnRails
[02:24:44] grymok: has joined #RubyOnRails
[02:44:09] creature: has joined #RubyOnRails
[03:12:59] Jameser: has joined #RubyOnRails
[03:16:32] harfangk: has joined #RubyOnRails
[03:22:01] webdestroya: has joined #RubyOnRails
[03:24:56] Tempesta: has joined #RubyOnRails
[03:33:09] armyriad: has joined #RubyOnRails
[03:41:06] sevenseacat: has joined #RubyOnRails
[03:47:55] r3vDev: has joined #RubyOnRails
[03:48:17] grymok: has joined #RubyOnRails
[03:49:30] srinidhi: has joined #RubyOnRails
[03:58:22] hndk: has joined #RubyOnRails
[03:59:36] spicerack: has joined #RubyOnRails
[04:01:25] targaf: has joined #RubyOnRails
[04:01:34] rakm: has joined #RubyOnRails
[04:09:44] Jameser: has joined #RubyOnRails
[04:10:58] pwnd_nsfw: has joined #RubyOnRails
[04:12:52] jdm: has left #RubyOnRails: ("Leaving")
[04:31:39] srinidhi: has joined #RubyOnRails
[04:33:35] webdestroya: has joined #RubyOnRails
[04:37:14] webdestroya: has joined #RubyOnRails
[05:09:03] jane_booty_doe: has joined #RubyOnRails
[06:07:31] Jameser: has joined #RubyOnRails
[06:13:36] nahtnam: has joined #RubyOnRails
[06:28:42] drale2k_: has joined #RubyOnRails
[06:33:12] drale2k_: has joined #RubyOnRails
[06:40:07] Jameser: has joined #RubyOnRails
[06:44:04] mcfiredrill: has joined #RubyOnRails
[06:55:19] mcfiredrill: i'm trying to monkeypatch javascript_include_tag using Module#prepend, not sure what i'm doing wrong https://gist.github.com/mcfiredrill/0d074b70db414b2358af702eae7fc881
[07:00:47] dminuoso: mcfiredrill: Why would you have to monkey patch that method? It's dumb.
[07:01:02] dminuoso: It's user API. You dont monkey patch user APIs.
[07:01:28] dminuoso: Either re-implement it and name it "my_javascript_include_tag", or wrap it and name it, guess what, "my_javascript_include_tag"
[07:05:00] webdestroya: has joined #RubyOnRails
[07:08:55] pavelz: hey guys im using activerecord outside rails and can't seem to get to do expect(subject.valid?).to be true. I get 'superClass must be a Class(Module given)" error...
[07:09:30] pavelz: that is a spec to check for validity of the object naturally
[07:09:55] sevenseacat: pavelz: please show us your code and the error
[07:11:10] pavelz: https://gist.github.com/pavelz/1d083f51594e3b0362605745858cb7a6
[07:11:20] dminuoso: pavelz: https://gist.github.com/pavelz/1d083f51594e3b0362605745858cb7a6#file-gistfile1-txt-L7
[07:11:30] dminuoso: pavelz: That error happens when you try to derive a class from a module instead of a class.
[07:11:35] dminuoso: It is code error. A ruby error.
[07:11:45] sevenseacat: and the code?
[07:11:57] dminuoso: class C < B; end; if B is a module, you get that error. The code simply wont even compile in Ruby.
[07:12:17] pavelz: but it does its an activerecord model )
[07:12:28] sevenseacat: pavelz: please show us your code.
[07:12:45] dminuoso: pavelz: No it does not. The spec just showed you it doesn't.
[07:13:13] sevenseacat: dminuoso: you're not being helpful.
[07:14:06] pavelz: added to gist its simple, maybe b/c i am doing this outside of rails ?
[07:14:20] sevenseacat: pavelz: we need to see the test.
[07:14:46] sevenseacat: the full test. like, what are you defining `subject` as?
[07:14:58] mcfiredrill: sometimes monkey patching is easier than doing a search and replace across a huge codebase, its a trade off :) dminuoso
[07:15:56] pavelz: added. its a build(:user) from factory girl.
[07:16:27] dminuoso: mcfiredrill: If you want to modify *all* files sed will do that for you. And if you start using so many javascript include tags all over your place I consider that to be a smell.
[07:16:42] sevenseacat: pavelz: do you have a User module in your application?
[07:17:54] pavelz: not it is a class
[07:18:21] pavelz: maybe somewhere in rspec it does something ...
[07:18:28] sevenseacat: I didn't ask if you had a class, I asked if you have a module
[07:18:54] dminuoso: pavelz: Let's have the factory.
[07:19:07] dminuoso: pavelz: Also did you cut any parts off your User model?
[07:19:36] sevenseacat: does the other test also fail? or just the valid? one?
[07:20:12] pavelz: no if I call it in a test its fine returns false obviously.
[07:21:09] pavelz: dminuoso: its all boiler plate. maybe this is more of an rspec question. what does expect really expect
[07:21:51] dminuoso: pavelz: No. Some code along the way for whatever bizarre reason is trying to derive a class from a module. The code does not even pass through the Ruby compiler.
[07:22:08] dminuoso: Its not a simple "rspec problem"
[07:25:03] dminuoso: pavelz: Fastest way to find the source is to quickly monkey patch /Users/pavel/.rvm/gems/ruby-2.2.6@ruby-find/gems/activesupport-5.0.2/lib/active_support/dependencies.rb
[07:25:08] dminuoso: and have it print out the file name
[07:25:45] dminuoso: pavelz: Like, wrap the load_dependency code in an exception handler, and have that exception handler print "file" and re-throw.
[07:26:23] dminuoso: Otherwise you are left to guesstimate where the problem is with that kind of stacktrace.
[07:30:21] dminuoso: pavelz: It's possible that rspec can generate a more useful stacktrace with -b too, so you might want to try that first.
[07:33:41] pavelz: hah added more elaborate stacktrace. ends up prettyprint module for some reason
[07:38:02] GriffinHeart: has joined #RubyOnRails
[07:39:21] dminuoso: pavelz: foo.to be true is not the same as foo.to be(true)
[07:40:01] dminuoso: pavelz: compare https://eval.in/777475 with https://eval.in/777476
[07:40:47] dminuoso: pavelz: The error is still a bit surprising, it could be a bug inside rspec.
[07:41:53] pavelz: well fact i ripped activerecord right out and expect fancy things like validatation to work all fine in rspec with factory_girl building the object might be a bit much and need some massaging...
[07:42:11] dminuoso: Though Im not entirely sure.
[07:42:30] dminuoso: 09:41:53 pavelz | well fact i ripped activerecord right out
[07:42:33] dminuoso: What does that mean exactly?
[07:42:54] dminuoso: Or actually they are the same btw, weird still.
[07:43:14] pavelz: yeah same result
[07:44:14] pavelz: i don't use rails just the active record.
[07:44:49] pavelz: anyway thanks for headsup i'll try to wind my way to the solution
[07:45:27] dminuoso: pavelz: Well the issue is related to rspec trying to print out its failure message. That's where it chokes.
[07:45:58] dminuoso: Validations should work just fine with AR pulled out by the way.
[07:51:00] lxsameer: has joined #RubyOnRails
[07:53:52] dminuoso: pavelz: It's really confusing. https://gist.github.com/pavelz/1d083f51594e3b0362605745858cb7a6#file-gistfile1-txt-L13 is where I would probably pry-byebug into to see what the heck was happening.
[08:01:07] pavelz: dminuoso: thanks! i'll try the pry now
[08:06:51] arBmind: has joined #RubyOnRails
[08:13:20] Qchmqs: has joined #RubyOnRails
[08:15:33] srinidhi: has joined #RubyOnRails
[08:20:00] pavelz: this is weird. i replaced prettyprint with awesomeprint and now it works right.
[08:23:39] dminuoso: pavelz: Have you debugged into the LoC I mentioned?
[08:23:49] dminuoso: pavelz: Because I feel like you should debug this into a bug report. ;-P
[08:24:29] irishfromua: has joined #RubyOnRails
[08:24:38] pavelz: yeah i'll do it later doing assingment for an interview
[08:25:15] dminuoso: pavelz: Perfect. Show them your debugging skills!
[08:30:30] irishfromua: has joined #RubyOnRails
[08:33:45] yaw: has joined #RubyOnRails
[08:38:10] arBmind: has left #RubyOnRails: ()
[08:53:23] AzaToth: has joined #RubyOnRails
[08:56:10] arBmind: has joined #RubyOnRails
[09:04:05] irishfromua: has joined #RubyOnRails
[09:13:45] mikecmpbll: has joined #RubyOnRails
[09:37:33] irishfromua: has joined #RubyOnRails
[09:49:20] r3vDev: has joined #RubyOnRails
[09:56:56] tedwing: has joined #RubyOnRails
[10:06:14] xco: has joined #RubyOnRails
[10:07:24] GodFather: has joined #RubyOnRails
[10:28:33] pLaTo0n: has joined #RubyOnRails
[10:28:54] jane_booty_doe: has joined #RubyOnRails
[10:30:15] Fernando-Basso: has joined #RubyOnRails
[10:33:43] nebiros: has joined #RubyOnRails
[10:41:04] t_p: has joined #RubyOnRails
[11:05:22] arup_r: has joined #RubyOnRails
[11:07:53] arup_r: Hi All. I am having the same problem as u see in this question description http://stackoverflow.com/questions/15821560/using-a-deleted-scope-with-devise-authentication .. I am using paranoia gem to soft delete my users. But now problem is I would like to unscope the default scope added by this gem inside warden while it searches inside the DB. I tried the solutions given in the SO answers, and it is not working. Because when I try to sign, I
[11:07:54] arup_r: see the methods mentioned the SO answer was not being called. Any idea how to solve it?
[11:10:14] justAllgood: has joined #RubyOnRails
[11:13:12] Doldge: has joined #RubyOnRails
[11:42:39] wethu: has joined #RubyOnRails
[11:46:03] netzfisch: has joined #RubyOnRails
[11:47:21] Jameser: has joined #RubyOnRails
[11:48:02] centrx: has joined #RubyOnRails
[11:54:43] Pumukel: has joined #RubyOnRails
[11:55:30] Pumukel: has joined #RubyOnRails
[11:56:18] Pumukel: has joined #RubyOnRails
[11:56:24] arup_r: figured out.
[11:57:06] Pumukel: has joined #RubyOnRails
[11:57:54] Pumukel: has joined #RubyOnRails
[12:14:34] drale2k_: has joined #RubyOnRails
[12:19:19] AntiSpamMeta: has joined #RubyOnRails
[12:20:36] epochwolf: has joined #RubyOnRails
[12:22:39] pupsicle: has joined #RubyOnRails
[12:25:12] DoubleMalt: has joined #RubyOnRails
[12:27:17] v|sh: has joined #RubyOnRails
[12:29:07] darrik: has joined #RubyOnRails
[12:33:05] darrik: has joined #RubyOnRails
[12:48:36] irishfromua: has joined #RubyOnRails
[12:50:53] handicraftsman: has joined #RubyOnRails
[12:56:58] irishfromua: has joined #RubyOnRails
[13:03:45] Derperperd: has joined #RubyOnRails
[13:07:55] mrbubbles: has joined #RubyOnRails
[13:17:43] Jameser: has joined #RubyOnRails
[13:19:22] Technodrome: has joined #RubyOnRails
[13:19:57] FastJack: has joined #RubyOnRails
[13:27:09] cpruitt: has joined #RubyOnRails
[13:31:41] cpruitt: has joined #RubyOnRails
[13:36:56] patarr: has joined #RubyOnRails
[13:44:26] DLSteve: has joined #RubyOnRails
[13:50:13] irishfromua: has joined #RubyOnRails
[14:00:34] DLSteve: has joined #RubyOnRails
[14:02:30] dblessing: has joined #RubyOnRails
[14:04:06] netzfisch: has joined #RubyOnRails
[14:09:10] DLSteve: has joined #RubyOnRails
[14:12:35] tjvc_: has left #RubyOnRails: ("Leaving")
[14:12:49] r3vDev: has joined #RubyOnRails
[14:15:54] w0rd-driven: has joined #RubyOnRails
[14:19:32] ResidentBiscuit: has joined #RubyOnRails
[14:21:01] Aherin: has joined #RubyOnRails
[14:31:07] tjvc: has joined #RubyOnRails
[14:32:47] tjvc: has left #RubyOnRails: ("Quit: Leaving")
[14:32:58] xco: has joined #RubyOnRails
[14:43:46] hotpancakes: has joined #RubyOnRails
[14:44:04] justAllgood1: has joined #RubyOnRails
[14:46:28] mrbubbles: has joined #RubyOnRails
[14:57:13] irishfromua: has joined #RubyOnRails
[15:01:57] irishfromua: has joined #RubyOnRails
[15:04:02] irishfromua: has joined #RubyOnRails
[15:11:01] centrx: Why is +r mode on this channel? No traffic
[15:11:22] sevenseacat: because we were having a problem with spammers and abusers.
[15:14:03] doublemalt_: has joined #RubyOnRails
[15:20:05] polishdub: has joined #RubyOnRails
[15:23:07] RubyRonin: has joined #RubyOnRails
[15:26:05] hotpancakes: has joined #RubyOnRails
[15:27:11] Technodrome: has joined #RubyOnRails
[15:27:30] ableto: has joined #RubyOnRails
[15:27:45] ForeignBiscuit: has joined #RubyOnRails
[15:28:14] ForeignBiscuit: has joined #RubyOnRails
[15:29:28] netzfisch: has joined #RubyOnRails
[15:32:12] drale2k_: has joined #RubyOnRails
[15:33:20] hotpancakes: has joined #RubyOnRails
[15:44:20] Technodrome: has joined #RubyOnRails
[15:56:39] mikecmpbll: has joined #RubyOnRails
[15:58:14] s2013: has joined #RubyOnRails
[16:06:48] spicerack: has joined #RubyOnRails
[16:13:37] w0rd-driven: has joined #RubyOnRails
[16:14:40] frankarine: has joined #RubyOnRails
[16:15:04] frankarine: hi guys, what is the path i should use in my templates to link a css file?
[16:18:29] webdestroya: has joined #RubyOnRails
[16:24:35] RubyRonin: frankarine: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
[16:24:36] RubyRonin: <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
[16:28:16] MasterAsia: has joined #RubyOnRails
[16:28:42] MasterAsia: For enums that are multi word("Credit Card"), is it advisable to use string keys for them?
[16:29:13] MasterAsia: enum payment_option: { "Credit Card" => 1 } vs enum payment_option: { credit_card: 1 }
[16:35:37] Aherin: has joined #RubyOnRails
[16:35:53] frankarine: RubyRonin: where is the name of the actual css/js file in that line ?
[16:43:20] RubyRonin: frankarine: http://guides.rubyonrails.org/asset_pipeline.html
[16:43:27] agent_white: has joined #RubyOnRails
[16:46:57] agent_white: Mornin' folks
[16:49:06] normie1: has joined #RubyOnRails
[16:49:34] normie1: using devise, should i create a sessions controller
[16:55:20] DrYockel: has joined #RubyOnRails
[16:57:41] patarr: Anyone here recommend a feature-toggle gem?
[17:00:46] patarr1: has joined #RubyOnRails
[17:02:57] rakm: has joined #RubyOnRails
[17:03:22] morfin: has joined #RubyOnRails
[17:05:58] Technodrome: has joined #RubyOnRails
[17:06:30] pwnd_nsfw: has joined #RubyOnRails
[17:06:57] chouhoulis: has joined #RubyOnRails
[17:11:54] tbuehlmann: patarr_: if you don't need something very elaborated, I'd roll my own. see http://blog.arkency.com/2015/11/simple-feature-toggle-for-rails-app/
[17:15:07] patarr: has joined #RubyOnRails
[17:15:19] Leepoff: has joined #RubyOnRails
[17:15:30] morfin: if you want to save cart how you'd implement that?
[17:15:43] tbuehlmann: patarr: if you don't need something very elaborated, I'd roll my own. see http://blog.arkency.com/2015/11/simple-feature-toggle-for-rails-app/
[17:17:12] morfin: i guess writing AR entities to session is a bad idea?
[17:17:51] baweaver: Why would you need to?
[17:18:02] baweaver: Cart is constant across sessions, no?
[17:18:14] baweaver: if you log out and log back in you probably still want it there
[17:20:58] defsdoor: has joined #RubyOnRails
[17:21:18] morfin: but how save it for user if he logs out?
[17:22:24] havenwood: patarr: Flipper is nice.
[17:22:34] havenwood: patarr: https://github.com/jnunemaker/flipper
[17:23:17] morfin: save into database for user_id?
[17:24:18] baweaver: morfin: what do you think?
[17:25:19] havenwood: morfin: Do you have a Cart model? Should you?
[17:27:08] patarr: has joined #RubyOnRails
[17:28:59] morfin: i think i can have it and maybe polymorphic relation
[17:29:24] morfin: because there is Product and ProductVariant(Product has many ProductVariants)
[17:29:54] duderonomy: has joined #RubyOnRails
[17:35:09] mmun: has joined #RubyOnRails
[17:36:35] FoX_77: has joined #RubyOnRails
[17:36:53] mmun: how could you dynamically set the cookie expiration time? (e.g. regular users last a month, admin users are session). using devise/warden if that matters.
[17:37:08] FoX_77: It was more beautiful then i ever imagined!!!!
[17:38:15] FoX_77: Disc Battles and Racing on Ribbons of Light!!
[17:40:42] Technodrome: has joined #RubyOnRails
[17:45:03] morfin: would you store that in database or somewhere else?
[17:45:31] baweaver: as opposed to what other sourse?
[17:45:32] morfin: i think it's a good idea allow use cart after relog
[17:45:41] morfin: maybe Redis?
[17:46:02] baweaver: What operations does a Cart have?
[17:46:34] ableto: hold things
[17:47:37] morfin: calculate whole thing price
[17:47:47] baweaver: get a sheet of paper
[17:47:51] baweaver: write all of it down
[17:48:03] baweaver: and think about it
[17:48:44] morfin: ah i forgot i don't save Product to Cart any more
[17:49:28] morfin: i have at least 1 ProductVariant for every Product to avoid unnesessary complication
[17:50:01] baweaver: that sounds unnecessarily complicated
[17:51:42] morfin: well, when i had Product and ProductVariant and product without variants was just Product and with several variants was Product + N ProductVariants it was more complicated
[17:52:10] ableto: that sounds ridiculous
[17:53:40] ableto: even if you have products with different variations you should list them each as an item not an item with sub-items/variants
[17:53:55] ableto: from an inventory control perspective it will be far easier to track
[17:54:14] ableto: not to mention, it would simplify the design in your current situation
[17:55:34] ableto: alternatively if someone needs data of that sort for some reason you can pull that from the DB and create it for them
[17:55:52] morfin: but descriptions/images/some other stuff is shared for that "variants"
[17:56:27] morfin: create separate model ProductDetail and link?
[17:57:33] ableto: say you sell tshirts and you have sizes s-xl and colors red, green, and blue. I would create a tshirt item catagory so 100 lets say, a size sub catagory so small would be 1, med 2, large 3, xl 4, then a color subcat red 1, green 2, etc
[17:57:56] ableto: so your product number would be 10012 for a green tshirt size small
[17:58:16] ableto: that's pretty basic but the general idea
[17:58:22] morfin: ah i forgot
[17:58:25] ableto: usually the dev is not the person who makes that system
[17:58:38] morfin: basically source data is plain
[17:59:01] morfin: i import it from external system where they store it almost as you said)
[17:59:20] ableto: yeah then if manufacturing needs to know "product variants" you can write a script to pull from your DB and map the data into "variants"
[17:59:41] justAllgood: has joined #RubyOnRails
[17:59:53] morfin: basically i had a bit different idea
[18:00:18] ableto: well that's your choice but in my experience KISS
[18:00:37] morfin: have Product model, every variant stored separately, it have linked ProductType, ProductAttributes
[18:01:12] planigan: has joined #RubyOnRails
[18:01:20] morfin: ProductAttributes used for filters(there is different filters in every category depending on products
[18:02:38] morfin: and maybe ProductInformation which is shared for all variants
[18:02:50] ableto: if you do it correctly, the item number should be reversible even if you have multiple brands/vendors so if that Tshirt is Nike and you buy nike from 3 vendors you assign each vendor a code, and nike a code then tag that info on the front of your item number
[18:03:02] ableto: so 10010010012
[18:03:24] ableto: Nike from Sports world Tshirt small green
[18:04:00] kies: has joined #RubyOnRails
[18:04:17] morfin: it would be harder to collect all attributes/types for filters i think
[18:05:23] ableto: yes if you plan to not grow you are right
[18:05:35] ableto: if, however, you plan for growth your system would have the flaws
[18:06:15] ableto: even if you end up having to change it down the line, you have a really simple method of any human understanding the item number with the naked eye
[18:07:04] ableto: you will hit a ceiling where your item numbers will get to a point where they've grown too large
[18:07:57] ableto: usually, at that point, you have grown and made a pile of money. It's then time to redesign the system; walmart style. You could do that now but something tells me you don't want to put the time in
[18:08:35] morfin: how huge amounts you're talking about?
[18:08:36] ableto: implementing a simple system will allow for a future system to easily absorb the data in an ultra fast, conditional fashion
[18:09:08] ableto: as it relates to brands and vendors you are buying from
[18:09:44] morfin: i have >100000 products right now
[18:09:48] ableto: when you hit 10,000 vendors and as many brands you'll find conflicts in inventory solutions; but like I said, that's a good thing
[18:09:52] ableto: it means you've grown
[18:10:35] ableto: even with that number, I'd expect a product team, inventory control, and a dev group to be brainstorming this
[18:10:46] ableto: which begs the question why you're in a chan asking for input
[18:11:34] morfin: i want to think how redesign system which is using legacy crappy code right now
[18:11:40] morfin: and Yii 1.1 :(
[18:12:25] ableto: there are worse things than yii but I understand your point
[18:12:30] netzfisch: has joined #RubyOnRails
[18:12:34] ableto: is the company ready to invest in such a venture?
[18:12:48] ableto: or is this your own personal quest to show the boss what you can do?
[18:12:52] morfin: well, there is funniest part
[18:13:03] morfin: i want to do that to learn
[18:13:52] Omnilord: has joined #RubyOnRails
[18:14:09] ableto: well, I'd first try to understand their current inventory system and how it compares to others in the world
[18:14:50] ableto: secondly, I'd ask yourself if it's the system they use to categorize their products or the legacy nature of the system
[18:15:23] ableto: when you answer those, you may find you need to redo the inventory systems in which case there are millions of ways to do it
[18:16:20] ableto: a desire to rebuild is great when you know what plagues the original first; why is it slow is the #1 question at the moment
[18:18:20] morfin: well, after supporting that pile of crap > 1 year i really should think how to redesign that and don;t break whole thing
[18:18:53] ableto: are you a developer or a sys admin?
[18:19:26] Jack347: has joined #RubyOnRails
[18:19:36] morfin: developer
[18:21:16] ableto: any PHP experience?
[18:22:28] morfin: i saw many things
[18:22:33] Jack347: Hello, I'm not sure if this is the proper channel. I am having some odd issues with my ActiveRecord::Base.decendants not representing my models as I'd expect. I've written a migration dropping a HABTM from a model and moving that relationship to another model. The impact for me is ActiveJob::QueueAdapters is using old models and failing. If I've dropped an old HABTM table and created a new one,
[18:22:34] Jack347: should I expect errors such as 'User::HABTM_Portfolios(Table doesn't exist)’ when running ActiveRecord::Base.descendants?
[18:22:56] ravster: has joined #RubyOnRails
[18:22:57] ableto: If so, ask permission, get a copy of the source, update it to Yii 2.0 and PHP 7, latest sql version (shouldn't be too much work) and put it on a modern server
[18:23:10] ableto: hey ravster
[18:23:20] morfin: i'd prefer rewrite using RoR =)
[18:23:33] morfin: Yii 1.1/2/Kohana/Symfony 1.4/2, Laravel, some rare crap but i don't like PHP pretty much
[18:24:02] ableto: morfin: I understand but here's the thing; if it's a flawed inventory design then you'll run into the same problems
[18:24:05] ableto: just saying
[18:24:26] ravster: I'm trying to get fixtures working with a fresh rails 5 project, but the 'fixtures :all' in the test_helper.rb doesn't seem to be working. I don't see any fixtures in the test db.
[18:27:15] ravster: oh, nvm, didn't think about the default scope
[18:29:00] Aherin: has joined #RubyOnRails
[18:32:23] normie1: has joined #RubyOnRails
[18:32:58] dsimon: has joined #RubyOnRails
[18:33:24] dsimon: hey all, trying to figure out an associations technique, not having much luck googling it but maybe i just don't have the right term
[18:35:05] ravster: dsimon: the rails guides didn't help? What are you trying to do?
[18:35:15] dsimon: what i'm wondering is: is there a way to follow an association through an activerecord relation? e.g. User.where(admin: true).comments to get a flat relation of all comments by admin users
[18:35:30] chouhoulis: has joined #RubyOnRails
[18:35:45] dsimon: i'm trying to avoid instantiating the comments at that point, otherwise i could do User.where(admin: true).include(:comments).map(&:comments).flatten(1)
[18:36:17] dsimon: but instead, i want to keep it a relation so that i can call further AR methods on it to refine it before i actually hit the database
[18:36:36] KnownSyntax: has joined #RubyOnRails
[18:36:57] ravster: dsimon: What is 'User.where(..).comments.class' ?
[18:37:24] dsimon: i'd like it to be Comment::ActiveRecord_Relation
[18:37:58] dsimon: i can get to this by doing Comment.joins(:user).where(user: {id: User.where(admin: true)})
[18:38:21] dsimon: but that's kinda cumbersome, so basically i'm just hoping there's a convenience for it
[18:39:08] ravster: Comment.joins(:user).where(users: {admin: true})
[18:39:18] ravster: What is 'User.where(..).comments.class' ?
[18:39:47] dsimon: ravster, Comment::ActiveRecord_Relation
[18:39:53] dsimon: or it would be if such a method were there :-)
[18:40:27] ravster: dsimon: there you go. I'm guessing that you might be doing this in the REPL, and that is why it instantiates all the Comment objects.
[18:41:02] ravster: When you do this in your actual code, it wouldn't run the DB-query till it needs to.
[18:41:12] dsimon: ravster, the thing is, there is no method 'comments' on User::ActiveRecord_Relation
[18:41:36] dsimon: i was expecting there to be, and wondering if there's something similar
[18:41:56] dsimon: your idea to just put the user condition directly into the query works well though
[18:42:25] dsimon: but is there a way to make it generic? like, i've got a method that gets an arbitrary User relation and returns the corresponding Comment relation
[18:42:54] ravster: Yeah, thats the best I can think of. I'm sure there is a gem out there that does what you want with that kind of construct, but I don't know it.
[18:44:10] dsimon: i'm pretty sure i could monkey patch it in myself without that much trouble, but yeah, i was hoping for a gem
[18:44:19] dsimon: i just don't know what the gem would be called or how to google for the feature it would provide :-\
[18:44:31] dsimon: something like "en-masse association lookup"?
[18:44:55] dsimon: or "association on scope", but neither of those gave me back any gems that were for this purpose
[18:46:57] jmarchello: has joined #RubyOnRails
[18:51:57] drale2k_: has joined #RubyOnRails
[18:54:41] Andr3as: hello everyone.. has someone ever used foundation7 with rails?
[18:57:24] bheesham: has joined #RubyOnRails
[18:57:59] yawboakye: has joined #RubyOnRails
[19:04:28] xMopxShell: has joined #RubyOnRails
[19:08:11] Rodya_: has joined #RubyOnRails
[19:22:23] ferr: has joined #RubyOnRails
[19:22:33] chouhoulis: has joined #RubyOnRails
[19:24:24] jmarchello: has left #RubyOnRails: ()
[19:24:50] arBmind: has joined #RubyOnRails
[19:31:47] srinidhi: has joined #RubyOnRails
[19:44:08] tasaif: has joined #RubyOnRails
[19:45:09] justAllgood: has joined #RubyOnRails
[19:45:17] tasaif: how do I halt a "rails s" if my application fails a check?
[19:45:36] tasaif: do I return a value or raise an exception or some third thing?
[19:50:38] ravster: tasaif: use 'exit' ?
[19:51:48] ravster: When using minitest/unit, how do I do things like 'context', which is something we can do with rspec?
[19:52:01] ahrs: has joined #RubyOnRails
[19:53:10] tasaif: ravster, thank you that works
[19:53:41] havenwood: ravster: Minitest supports `describe do` (context is an alias for describe).
[19:54:25] ravster: havenwood: is that only with minitest/spec?
[19:54:56] havenwood: ravster: Yes, but you can mix and match the two Minitest styles, using describe with test assertions.
[19:55:19] ravster: havenwood: huh, ok. I'll fiddle around with that. Thank you.
[19:56:20] ravster: Am I correct in guessing there isn't a native way to do that with minitest/unit? Someone would just have to have a different test class at that point?
[19:57:07] Technodrome: has joined #RubyOnRails
[19:57:49] havenwood: ravster: you can do basically the same with: begin # context description; #... end
[19:58:30] havenwood: ravster: But usually folk use `describe '...' do` since Minitest supports it.
[20:14:34] justAllgood: has joined #RubyOnRails
[20:24:20] Puck6633: has joined #RubyOnRails
[20:26:37] Puck6633: Hey, I'm working with a large existing rails application, and there's no existing model for the table I need to access. I'm trying to work around that by using connect.execute() but I have user input and it doesn't seem to support prepared statements. Any advice?
[20:27:13] Puck6633: I meant ActiveRecord::Base.connection.execute()
[20:38:45] ResidentBiscuit: has joined #RubyOnRails
[21:01:06] Rodya_: has joined #RubyOnRails
[21:04:32] chouhoulis: has joined #RubyOnRails
[21:06:47] Rodya_: has joined #RubyOnRails
[21:12:18] netzfisch: has joined #RubyOnRails
[21:16:43] DLSteve: has joined #RubyOnRails
[21:25:03] agent_white: has joined #RubyOnRails
[21:29:26] mr-spoon: has joined #RubyOnRails
[21:34:57] mr-spoon: has joined #RubyOnRails
[21:37:48] tomasm-: has joined #RubyOnRails
[21:38:28] tomasm-: hey are there any popular CMS's built on rails that are good for saving time as a freelance developer? i'm hoping to save time not reinventing the wheel of a core cms/dashboard/admin and hopefully find some pre-built (free) themes....
[21:47:21] marr: has joined #RubyOnRails
[21:53:25] mrbubbles: has joined #RubyOnRails
[21:55:35] andywww: has joined #RubyOnRails
[21:58:06] Technodrome: has joined #RubyOnRails
[21:58:26] havenwood: ACTION tomasm-: The most recent one I've seen making the rounds is Fae: https://www.faecms.com/
[22:00:07] baweaver: ACTION wants to slap their designer
[22:03:32] br0d1n: has joined #RubyOnRails
[22:09:06] HoierM: has joined #RubyOnRails
[22:11:05] HoierM: has joined #RubyOnRails
[22:13:50] sloggerkhan: has joined #RubyOnRails
[22:22:10] Technodrome: has joined #RubyOnRails
[22:25:20] cerulean: slap that ho !!!!
[22:25:26] cerulean: take away the cocaine
[22:25:30] ChanServ: +q *!*@174-29-46-3.hlrn.qwest.net
[22:25:46] Radar: GOOD MORNING
[22:31:30] ChanServ: -q *!*@174-29-46-3.hlrn.qwest.net
[22:31:38] cerulean: ACTION gaspa for air
[22:31:49] cerulean: thank you thank you
[22:49:30] rakm: has joined #RubyOnRails
[23:06:00] AntiSpamMeta: has joined #RubyOnRails
[23:06:42] username1: has joined #RubyOnRails
[23:06:56] wethu: has joined #RubyOnRails
[23:31:26] TinkerTyper: has joined #RubyOnRails
[23:35:53] Jameser: has joined #RubyOnRails
[23:46:37] mrbubbles: has joined #RubyOnRails
[23:58:01] uks: has joined #RubyOnRails