« Back to channel list

#RubyOnRails - 06 June 2018

« Back 1 day Forward 1 day »
[00:17:18] jrm: has joined #RubyOnRails
[00:51:32] tdy: has joined #RubyOnRails
[01:14:38] johndunn: has left #RubyOnRails: ()
[01:47:01] lxsameer: has joined #RubyOnRails
[01:54:11] SteenJobs: has joined #RubyOnRails
[01:59:31] lord4163: has joined #RubyOnRails
[02:18:53] alfiemax: has joined #RubyOnRails
[02:25:24] orbyt_: has joined #RubyOnRails
[02:26:58] fragamus: has joined #RubyOnRails
[02:27:12] lxsameer: has joined #RubyOnRails
[02:27:45] sevenseacat: has joined #RubyOnRails
[02:33:09] safetypin: has joined #RubyOnRails
[02:49:17] Saukk: has joined #RubyOnRails
[03:03:53] darkhanb: has joined #RubyOnRails
[03:07:02] lxsameer: has joined #RubyOnRails
[03:10:20] braincrash: has joined #RubyOnRails
[03:17:02] lxsameer: has joined #RubyOnRails
[03:27:15] lxsameer: has joined #RubyOnRails
[03:51:58] vedu_: has joined #RubyOnRails
[04:04:24] reber: has joined #RubyOnRails
[04:07:06] lxsameer: has joined #RubyOnRails
[04:46:37] srinidhi: has joined #RubyOnRails
[04:51:15] apeiros: has joined #RubyOnRails
[04:52:03] lxsameer: has joined #RubyOnRails
[04:56:09] regedit: has joined #RubyOnRails
[05:10:24] vedu_: has joined #RubyOnRails
[05:36:36] apeiros: has joined #RubyOnRails
[05:47:05] lxsameer: has joined #RubyOnRails
[06:03:50] markh: has joined #RubyOnRails
[06:07:03] lxsameer: has joined #RubyOnRails
[06:17:15] lxsameer: has joined #RubyOnRails
[06:17:43] fragamus: has joined #RubyOnRails
[06:19:53] sandstrom: has joined #RubyOnRails
[06:21:21] roshanavand: has joined #RubyOnRails
[06:21:31] srinidhi: has joined #RubyOnRails
[06:34:07] akaiiro: has joined #RubyOnRails
[06:36:42] KeyJoo: has joined #RubyOnRails
[06:42:38] conta: has joined #RubyOnRails
[06:46:27] s2013: has joined #RubyOnRails
[06:48:32] yadnesh: has joined #RubyOnRails
[06:55:31] mtkd: has joined #RubyOnRails
[06:57:01] lxsameer: has joined #RubyOnRails
[07:07:09] za1b1tsu: has joined #RubyOnRails
[07:12:21] lxsameer: has joined #RubyOnRails
[07:21:47] srinidhi: has joined #RubyOnRails
[07:27:02] macxim: has joined #RubyOnRails
[07:42:02] lxsameer: has joined #RubyOnRails
[07:43:44] psychoslave: has joined #RubyOnRails
[07:44:42] reber__: has joined #RubyOnRails
[07:51:05] reber: has joined #RubyOnRails
[07:52:00] lxsameer: has joined #RubyOnRails
[07:56:15] apeiros: has joined #RubyOnRails
[07:57:30] apeiros: has joined #RubyOnRails
[07:57:58] sandstrom: has joined #RubyOnRails
[07:58:16] reber__: has joined #RubyOnRails
[07:59:44] dionysus69: has joined #RubyOnRails
[08:06:45] srinidhi: has joined #RubyOnRails
[08:20:37] armyriad: has joined #RubyOnRails
[08:33:01] lxsameer: has joined #RubyOnRails
[08:35:51] uksio: has joined #RubyOnRails
[08:36:19] dionysus69: has joined #RubyOnRails
[08:37:50] conta: has joined #RubyOnRails
[08:52:51] mtkd: has joined #RubyOnRails
[08:54:44] dionysus69: where.not(code: "object_code") sends n+1 queries
[08:54:50] dionysus69: is that expected?
[08:55:29] sevenseacat: and it would not. real code? :)
[08:55:42] dionysus69: Currency.where.not(code: "usd")
[08:55:48] dionysus69: so there are 5 currencies
[08:55:55] dionysus69: and I want to select all except usd
[08:55:56] sevenseacat: and the generated queries are?
[08:56:16] dionysus69: http://paste.debian.net/1028162/
[08:56:38] sevenseacat: its the same query, so youre running it multiple times
[08:56:58] dionysus69: ok thanks :D
[08:57:16] dionysus69: I didnt expect them to run in sequence so I didn't think about that
[08:57:26] dionysus69: I assumed they came from single AR call
[09:00:53] dionysus69: Rails.cache.fetch should work great in this case right? since number of currencies change really really rarely
[09:01:24] sevenseacat: savings would be pretty little
[09:01:39] sevenseacat: and now youve got the overhead of managing a cache
[09:03:01] trautwein: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[09:03:08] dionysus69: but it's ok to use scopes and cache fetch at the same time right? not too much headache I would just set expiration date at like 12 hours or so
[09:03:37] sevenseacat: I don't see the benefit in doing so
[09:03:55] dionysus69: I just want to minimize db hits, that's all :)
[09:04:08] sevenseacat: I think you have bigger problems
[09:04:14] dionysus69: these queries run every time I reload console too
[09:04:19] dionysus69: I don't know if it's normal
[09:04:47] sevenseacat: hahahahahahahahahaha
[09:05:11] sevenseacat: oh I thought we were laughing at you.
[09:05:32] dionysus69: lol no why, little confused :P
[09:09:08] KeyJoo: has joined #RubyOnRails
[09:09:33] FernandoBasso: has joined #RubyOnRails
[09:10:04] KeyJoo: has joined #RubyOnRails
[09:15:15] za1b1tsu: has joined #RubyOnRails
[09:17:03] drale2k_: has joined #RubyOnRails
[09:24:45] Charliebr73: has joined #RubyOnRails
[09:28:03] dionysus69: sevenseacat: ok it turns out it's fault of activeadmin, it for some reason runs queries on app load
[09:29:00] dminuoso: magical rails engines doing magical things?
[09:29:03] dminuoso: Who would have thought.
[09:31:18] crst: has joined #RubyOnRails
[09:31:49] dionysus69: as I have mentioned before, it's not due to my decision that this app has active admin :S :D
[09:32:40] crst: Hi, can you recommend me anything where you can manage permission and roles via checkboxes in a webinterface or do I need to build my own?
[09:48:05] sandstrom: has joined #RubyOnRails
[09:50:22] Tempesta: has joined #RubyOnRails
[10:10:26] dionysus69: crst: you need gem like pundit
[10:11:00] dionysus69: but it needs setting up
[10:17:01] crst: dionysus69: ok, thank you
[10:39:36] crst: dionysus69: In that context the same could be achieved with cancancan (which is already implemented), right?
[10:40:02] dionysus69: yes they serve the same purpose: authorization
[10:40:24] dionysus69: but it's harder to customize cancan
[10:40:56] DTZUZO: has joined #RubyOnRails
[10:41:27] fragamus: has joined #RubyOnRails
[10:46:02] apparition: has joined #RubyOnRails
[11:07:40] dionysus69: has anyone here used rails settings cached gem?
[11:10:22] wethu: has joined #RubyOnRails
[11:13:52] cschneid: has joined #RubyOnRails
[11:15:07] fourcolors: has joined #RubyOnRails
[11:16:29] mtkd: has joined #RubyOnRails
[11:21:01] Terens: has joined #RubyOnRails
[11:21:52] Terens: I want to broadacast notifications about a model when it is updated/created.
[11:22:35] Terens: the problem is that some receivers might not have permission
[11:22:50] Terens: to get the update
[11:29:37] apeiros: has joined #RubyOnRails
[11:36:06] Tolnaiz: has joined #RubyOnRails
[11:37:14] vedu_: has joined #RubyOnRails
[11:37:45] vedu_: has joined #RubyOnRails
[11:40:57] jgpawletko: has joined #RubyOnRails
[11:47:14] sandstrom: has joined #RubyOnRails
[11:49:58] wethu: has joined #RubyOnRails
[11:55:08] eelster_: has joined #RubyOnRails
[12:09:49] roshanavand: has joined #RubyOnRails
[12:19:30] CuriousMind: has joined #RubyOnRails
[12:21:08] CuriousMind: Hi. My heroku app won't work after deployment. Here are my heroku log. https://gist.github.com/Osagiede/52427b77664cd14ca1a635c02e5d7710
[12:21:19] CuriousMind: I tried heroku restart but that didn't do anything
[12:21:50] tbuehlmann: have you read the log? it says undefined method `has_one_attached'
[12:21:50] syndikate: How can I change the redis url for my rails app? I was trying to deploy it in kubernetes but rails is unable to connect to redis
[12:22:00] syndikate: The redis service is available as 'redis'
[12:22:21] CuriousMind: Yesterday, someone helped me spot a syntax error in my application controller. After I fixed it, the app still doesn't work
[12:22:43] CuriousMind: tbuehlmann: Yes, but I don't understand
[12:23:48] CuriousMind: tbuehlmann: Does that have to do with my models or something?
[12:24:36] ellcs: has joined #RubyOnRails
[12:24:37] Sylario: has joined #RubyOnRails
[12:25:36] tbuehlmann: does it work locally in development?
[12:26:20] dminuoso: ACTION loves how rails default setting promotes "breaks in production but not in development" with production-only-eager-loading
[12:26:45] hammer065: has joined #RubyOnRails
[12:26:49] syndikate: Not sure if that was for me
[12:27:41] tbuehlmann: it was meant for CuriousMind
[12:29:10] CuriousMind: tbuehlmann: Yes, but there are a bunch of warnings
[12:30:53] dminuoso: CuriousMind: Its triggered by one of your initializers.
[12:31:09] dminuoso: Or actually the eager loading rather
[12:31:12] conta: has joined #RubyOnRails
[12:31:12] CuriousMind: dminuoso: Initializers? What is that
[12:31:48] dminuoso: CuriousMind: Any chance you can upload the project to github?
[12:32:09] CuriousMind: dminuoso: https://github.com/Osagiede/sample_app
[12:34:17] CuriousMind: Question. I am trying to learn rails well. Any tips/advice? The only idea I have is to do as many tutorials as I can until I understand everything. Will that do?
[12:35:40] dminuoso: CuriousMind: If you remove bootsnap, does it still trigger?
[12:36:13] CuriousMind: dminuoso: You know, I was thinking of removing bootsnap but I didn't because I thought it was something necessary. Will try now
[12:38:16] CuriousMind: dminuoso: Ok so to do that, I'm going to go to config/boot.rb and comment out `require 'bootsnap/setup'`. If I remove the gem, but keep that then it will cause an error
[12:39:04] dminuoso: CuriousMind: You can just comment out that line as long as you have `require: false` in the Gemfile as well
[12:42:43] CuriousMind: dminuoso: I commented out the gem too in the gemfile
[12:42:56] dminuoso: CuriousMind: I *think* you may be victim to this: https://github.com/Shopify/bootsnap/pull/136
[12:42:57] CuriousMind: Even after that, the app still doesn't work
[12:43:38] conta: has joined #RubyOnRails
[12:43:39] dminuoso: CuriousMind: Same error?
[12:43:50] dminuoso: Well it cant be. Gist the current error then
[12:45:08] CuriousMind: The first line of my heroku logs says "Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? sqlite3 is not part of the bundle. Add it to your Gemfile. (Gem::LoadError)"
[12:45:16] CuriousMind: I'm going to try to do that then
[12:46:01] CuriousMind: But I already have sqlite3 in my gemfile. It is in my development, test group
[12:46:30] dminuoso: CuriousMind: test group means it will only be loaded when you run tests.
[12:46:45] dminuoso: CuriousMind: You probably misconfigured your database.yml
[12:48:43] CuriousMind: dminuoso: I see
[12:49:05] CuriousMind: I'm following a tutorial. I'm on chapter 3, https://www.railstutorial.org/book/static_pages
[12:57:12] spohnz_: has joined #RubyOnRails
[13:02:29] regedit: has joined #RubyOnRails
[13:04:05] CuriousMind: dminuoso: In my gemfile, I'm using pg for production. So would I have to change the adapter from sqlite3 to pg in the database.yml file? Is that how it works?
[13:06:30] dminuoso: CuriousMind: Yes.
[13:21:46] conta1: has joined #RubyOnRails
[13:28:23] sandstrom: has joined #RubyOnRails
[13:59:18] Ergo: has joined #RubyOnRails
[14:05:38] mtkd: has joined #RubyOnRails
[14:06:28] hpfmn: has joined #RubyOnRails
[14:06:45] vedu_: has joined #RubyOnRails
[14:13:51] Terens: Assuming you had some kind of ACL. Also you had a model named Issue that had some attributes and some associations.
[14:14:29] GioVdK: has joined #RubyOnRails
[14:14:58] Terens: If there is a need to broadcast that something about that model record changed how could I tell if subscribers are permitted to view
[14:15:04] Terens: to receive it?
[14:15:28] conta1: has joined #RubyOnRails
[14:15:29] witchofiza: has joined #RubyOnRails
[14:16:51] witchofiza: quick syntax question about {selected: :column_1} being ignored
[14:17:34] GioVdK: hello, when using dynamic routes constraints (http://api.rubyonrails.org/classes/ActionDispatch/Routing/Mapper/Scoping.html#method-i-constraints) is there a way to have a constrain that allow parameter values with dots?
[14:17:57] witchofiza: for my erb I'm using <%= f.select( :column_1, {selected: :column_1}, {required: false, include_blank: false}, {class: 'option-select-fixed-status' }) %> and it works great but seems it ignore passing in the existing value
[14:18:03] GioVdK: basically with Dynamic request matching I end up having the last part of the parameter (after the dot) being seen as the format
[14:18:21] SteenJobs: has joined #RubyOnRails
[14:28:39] drale2k_: has joined #RubyOnRails
[14:31:13] witchofiza: has joined #RubyOnRails
[14:33:18] witchofiza: I'm not sure if I have to pass an option to the js and if that's causing the issue
[14:36:49] BloopMonster: has joined #RubyOnRails
[14:58:33] spohnz_: <%= f.select(:server_type,[['ssh-oob'],['Puppet Server'],['Puppet Database'],['GitLab Server'],['DNS']]) %> I am suppose to move this line to the controller? I am sorry but how do I do this?
[14:59:26] spohnz_: is it like in python where I just create a list like servers = ["puppet', 'cisco', 'etc']
[15:01:53] fragamus: has joined #RubyOnRails
[15:05:17] sagax: has joined #RubyOnRails
[15:09:06] MksN: has joined #RubyOnRails
[15:16:41] cagomez: has joined #RubyOnRails
[15:18:37] za1b1tsu: has joined #RubyOnRails
[15:21:33] cagomez: has joined #RubyOnRails
[15:25:06] cschneid: has joined #RubyOnRails
[15:28:45] jane_booty_doe: has joined #RubyOnRails
[15:43:23] jottr: has joined #RubyOnRails
[16:01:23] jcarl43: has joined #RubyOnRails
[16:06:10] akaiiro: has joined #RubyOnRails
[16:13:12] mostlybadfly: has joined #RubyOnRails
[16:24:38] darkhanb: has joined #RubyOnRails
[16:28:07] apeiros: has joined #RubyOnRails
[16:44:18] elsurudo: has joined #RubyOnRails
[16:44:46] fragamus: has joined #RubyOnRails
[16:47:59] mtkd: has joined #RubyOnRails
[16:54:30] Cavallari: has joined #RubyOnRails
[16:55:55] roshanavand: has joined #RubyOnRails
[16:57:55] Saukk: has joined #RubyOnRails
[17:04:50] srinidhi: has joined #RubyOnRails
[17:14:14] istrasci: has joined #RubyOnRails
[17:14:24] istrasci: has left #RubyOnRails: ()
[17:16:49] spohnz_: pthbb, I figured it out. Thanks to everyone who could help
[17:23:12] dionysus69: has joined #RubyOnRails
[17:31:39] hahuang65: has joined #RubyOnRails
[17:32:49] mtkd: has joined #RubyOnRails
[17:55:06] vedu_: has joined #RubyOnRails
[17:55:11] eckhardt_: has joined #RubyOnRails
[17:58:41] ellcs: has joined #RubyOnRails
[18:09:15] elsurudo: has joined #RubyOnRails
[18:09:56] elsurudo: has joined #RubyOnRails
[18:10:48] elsurudo: has joined #RubyOnRails
[18:11:34] elsurudo: has joined #RubyOnRails
[18:12:21] elsurudo: has joined #RubyOnRails
[18:13:06] elsurudo: has joined #RubyOnRails
[18:13:51] elsurudo: has joined #RubyOnRails
[18:14:36] elsurudo: has joined #RubyOnRails
[18:15:06] NoGodDamnIdea: has joined #RubyOnRails
[18:26:19] elsurudo: has joined #RubyOnRails
[18:31:44] johndunn: has joined #RubyOnRails
[18:36:36] mtkd: has joined #RubyOnRails
[18:38:26] glassresistor: has joined #RubyOnRails
[18:39:53] akaiiro: has joined #RubyOnRails
[18:40:06] glassresistor: im using belongs_to and shoulda mathchers with a model class FooBAR and it works fine expect when I do this belongs_to :foo_bar because it looks for constant FooBar
[18:40:20] glassresistor: is there a way to do this or do i have to rename?
[18:41:11] dionysus69: has joined #RubyOnRails
[18:55:08] vedu_: has joined #RubyOnRails
[18:58:49] vedu_: has joined #RubyOnRails
[19:08:09] mcr1: there is a way to turn BAR into a word.
[19:08:31] mcr1: I'd have to poke around some old code to remember what it was.
[19:08:45] ellcs: has left #RubyOnRails: ()
[19:14:30] havenwood: mcr1: BAR into a word? I don't understand. Give an example of what that would look like?
[19:16:17] havenwood: mcr1: User.name #=> "User" # dunno if this is what you mean?
[19:20:48] cagomez: has joined #RubyOnRails
[19:23:15] mcr1: glassresistor, you can add class_name => 'FooBar' to the belongs_to.
[19:24:08] mcr1: If you want things like "FooBAR" to be mapped to "foo_bar", then you can add stuff to inflections:
[19:24:27] mcr1: http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html
[19:24:29] mcr1: stuff like:
[19:24:37] mcr1: ActiveSupport::Inflector.inflections(:en) do |inflect|
[19:24:38] mcr1: inflect.acronym 'DID'
[19:25:06] havenwood: oh, did i just miss backlog - seems i did...
[19:25:50] glassresistor: mcr1: thanks thats helpful
[19:26:13] spohnz_: has joined #RubyOnRails
[19:26:54] spohnz_: has joined #RubyOnRails
[19:27:33] spohnz_: has joined #RubyOnRails
[19:28:10] spohnz_: has joined #RubyOnRails
[19:28:48] spohnz_: has joined #RubyOnRails
[19:31:47] macxim: has joined #RubyOnRails
[19:35:22] macxim: has joined #RubyOnRails
[19:38:04] tdy: has joined #RubyOnRails
[19:52:16] cagomez: has joined #RubyOnRails
[19:52:55] quarters: has joined #RubyOnRails
[19:53:14] quarters: hello. I was wondering if I can ask about jekyll here
[19:54:15] dionysus69: has joined #RubyOnRails
[19:56:42] akaiiro: quarters Why not use #jekyll instead?
[19:56:59] quarters: akaiiro: oh. didn't know it existed!
[19:57:24] quarters: akaiiro: thanks
[20:05:37] weaksauce: has joined #RubyOnRails
[20:07:37] cagomez: has joined #RubyOnRails
[20:08:49] roshanavand: has joined #RubyOnRails
[20:17:02] _aeris_: has joined #RubyOnRails
[20:17:58] Inside: has joined #RubyOnRails
[20:23:46] hahuang65: what would be the best way to define a set of callbacks that I want shared between multiple models?
[20:24:18] hahuang65: in this case, I'm trying to define a set of callbacks that publishes a message with information about the object in question when it's created, updated, and destroyed.
[20:26:15] lupine: hahuang65: you can use a concern to do so, and just include the concern in each model. Alternatively, you can use a superclass, which amounts to more or less the same thing
[20:27:10] DylanJ: has joined #RubyOnRails
[20:28:38] hahuang65: lupine: great, thanks for the tip
[20:43:28] Dimik: has joined #RubyOnRails
[20:57:27] ur5us: has joined #RubyOnRails
[21:07:43] za1b1tsu: has joined #RubyOnRails
[21:12:48] cagomez: has joined #RubyOnRails
[21:13:24] markh: has joined #RubyOnRails
[21:34:53] jawatio: has joined #RubyOnRails
[21:34:59] dblessing: has joined #RubyOnRails
[21:35:13] acovrig: has joined #RubyOnRails
[21:36:54] jawatio: I've built a JSON API with Rails 5.2, all my POST requests require the body to be "{ entity: { ... } }", and I want to actually have it just be "{ ... }", but I am not sure how to do so, or what to search to find out how
[21:37:49] cagomez: has joined #RubyOnRails
[21:40:03] SteenJobs: has joined #RubyOnRails
[21:44:56] hahuang65: jawatio: do you have a link to the project/
[21:46:21] markh: has joined #RubyOnRails
[21:46:53] jawatio: hahuang65: not, but its all pretty standard/basic
[21:47:44] hahuang65: can you paste your `routes.rb` file as well as one of the controllers?
[21:48:31] jawatio: Here is the create method sample https://hastebin.com/iwijegaruj.rb
[21:49:15] jawatio: Routes would just be "resources :articles" for that one
[21:50:42] jawatio: I feel like what needs changed is the "params.require(:article)" for "article_params", but I am not sure to what
[21:51:43] Yzguy: has joined #RubyOnRails
[21:54:28] jane_booty_doe: has joined #RubyOnRails
[21:56:33] jawatio: Ah, I think with strong_parameters I can just remove the require part, and just use the permit section
[21:56:54] jawatio: Which would remove the need of a top property, and still ensure only what I want comes in
[21:56:56] hahuang65: wait, you're not saying it's requiring specifically 'entity'
[21:57:23] hahuang65: you're saying, that it is requiring an 'entity', which for this controller, would be 'article'... am I correct?
[21:57:29] jawatio: Entity was vague, as in each POST ... ie :articles :comments :etc
[21:57:38] hahuang65: yeah, so you are right
[21:57:54] hahuang65: you would remove the `require` part for strong params.
[21:58:15] jawatio: Dang, hope doing the same for Devise is easy lol
[21:58:51] hahuang65: jawatio: make sure you understand the implications of not using strong params.
[21:59:12] jawatio: Should still be using it, just not requiring a top param
[22:00:25] jawatio: Since, what it is saying .. "params.require(:article).permit(...)" is that the Body must have a key/hash "article", and return just that key/hash allowing only the sub keys/hashes defined in permit
[22:02:58] jawatio: Awesome it works :D no more "annoying" sub property, its all at the root JSON like I want
[22:03:16] Yzguy: has joined #RubyOnRails
[22:04:05] hahuang65: jawatio: just a note from experience... sometimes it's nice to have to be more explicit when having to deal with an API :)
[22:05:04] jawatio: To me, the URL is the explicit part, you wouldn't post a comment to POST /articles
[22:06:11] hahuang65: jawatio: yup, but sometimes, you'll want to add on extra params that have nothing to do with articles
[22:07:15] jawatio: That sounds less RESTful, and most likely should be done at different paths, /articles/do-something-fancy
[22:08:06] hahuang65: what about globally scoped things like, API/session IDs, analytics tracking IDs, requestIDs for progress look-up etc.
[22:09:49] hahuang65: or, maybe a more reasonable situation... if you allow `accepts_nested_attributes_for`
[22:15:41] fourcolors: has joined #RubyOnRails
[22:16:58] eckhardt_: has joined #RubyOnRails
[22:19:19] ur5us: has joined #RubyOnRails
[22:19:20] conceivably: has joined #RubyOnRails
[22:20:39] conceivably: Hi. I'm running into a weird issue w/r/t ActiveRecord scopes. I have a scope with a lambda that when invoked returns one result and when I run the same query directly returns another. I'm at a complete loss as to what might be going on. Any ideas?
[22:26:41] Yzguy: has joined #RubyOnRails
[22:26:58] psychoslave: has joined #RubyOnRails
[22:29:43] urkle: has joined #RubyOnRails
[22:32:40] conceivably: Ah it seems that 'scope' returns an all scope when the lambda returns nil or false. Hm. It seems a bit odd that no error is thrown, no? Or is this perhaps somehow useful?
[22:33:15] orbyt_: has joined #RubyOnRails
[22:34:06] fragamus: has joined #RubyOnRails
[22:45:19] Ericx2x: has joined #RubyOnRails
[22:48:15] baweaver: conceivably: It allows you to no-op or empty operation a builder of queries
[22:48:41] baweaver: Imagine you have a conditional scope: with_people(if: condition)
[22:49:07] baweaver: you could chain as many of those on as you want, and they may return: conds ? where(conds) : all
[22:49:25] dblessing: has joined #RubyOnRails
[22:49:47] baweaver: can be anywhere in a chain and does nothing: where(A).all.where(B) == where(A).where(B)
[22:50:13] baweaver: and since ActiveRecord is lazy that means you can stack scopes as much as you want, combine them, reorder them, or whatever else you want
[22:51:12] baweaver: put in another way, #all is effectively an identity function: where(A).all == all.where(A) == where(A)
[22:52:06] baweaver: They're also associative, in that you can apply then in whatever order: a + b + c == a + (b + c)
[22:53:13] baweaver: Though granted things like joins / includes will be very much order dependent in some cases
[22:53:36] conceivably: Ah that makes a lot of sense! Thank you so much baweaver. I often times wish documentation was more theoretical and concise rather than just a series of simple cases :)
[22:53:57] baweaver: I've considered writing a guide like that at some point
[22:54:26] baweaver: Note though that usecases are exceptionally effective for teaching some types of people
[22:54:52] baweaver: I think you need both. In order to understand the base properties of an abstraction, you must first see how it's applied.
[22:55:46] baweaver: Some can skip that step and understand a higher-order abstraction without it. I don't think that's the best idea as it may skip concerns or oversimplify the nature of it.
[22:56:24] conceivably: Agreed, both are useful in different ways.
[22:56:37] baweaver: Me, I like teaching with cartoon lemurs
[22:56:50] lemur: for I too am lemur
[22:57:10] baweaver: but that's a story for another day and a book to be released sometime within the next year
[22:58:01] wethu: has joined #RubyOnRails
[23:02:23] istrasci: has joined #RubyOnRails
[23:08:47] Radar: GOOD MORNING
[23:09:32] Radar: Guess who had a cheeky Thursday morning sleep-in?
[23:14:55] apeiros: has joined #RubyOnRails
[23:23:12] johndunn: has left #RubyOnRails: ()
[23:39:06] armyriad: has joined #RubyOnRails
[23:52:47] fourcolors: has joined #RubyOnRails