LyndsySimon

Activity Graph

Page 1 of 2 | Next »

2018-05-14

[17:40:11] LyndsySimon: has left #RubyOnRails: ()

2018-05-06

[16:00:42] LyndsySimon: has joined #RubyOnRails

2018-04-25

[12:25:54] LyndsySimon: *.net *.split
[12:27:33] LyndsySimon: has joined #RubyOnRails
[15:01:25] LyndsySimon: *.net *.split
[15:03:05] LyndsySimon: has joined #RubyOnRails

2018-04-16

[18:55:12] LyndsySimon: has joined #RubyOnRails

2018-04-11

[05:32:25] LyndsySimon: Quit: Connection closed for inactivity

2018-04-10

[13:51:37] LyndsySimon: has joined #RubyOnRails

2018-03-20

[08:30:49] LyndsySimon: Ping timeout: 256 seconds
[08:32:03] LyndsySimon: has joined #RubyOnRails

2018-03-09

[22:28:25] LyndsySimon: Ping timeout: 256 seconds
[22:30:29] LyndsySimon: has joined #RubyOnRails

2018-03-02

[04:16:10] LyndsySimon: has joined #RubyOnRails

2018-02-28

[23:15:26] LyndsySimon: Ping timeout: 276 seconds
[23:15:52] LyndsySimon: has joined #RubyOnRails

2018-02-22

[12:50:50] LyndsySimon: Ping timeout: 255 seconds
[12:56:38] LyndsySimon: has joined #RubyOnRails

2018-02-09

[12:52:26] LyndsySimon: has joined #RubyOnRails

2018-01-11

[12:24:26] LyndsySimon: Read error: Connection reset by peer
[12:24:47] LyndsySimon: has joined #RubyOnRails

2018-01-03

[18:15:06] LyndsySimon: has joined #RubyOnRails
[18:15:48] LyndsySimon: I'm building a docker image for a Rails app I'm working with, and was a little stunned by something - the source for the app is 178kB, but the gem dependencies are 103MB.
[18:21:11] LyndsySimon: fschuindt: I totally expected the dependencies to be many times larger than the source - that's the point of a higher-level language, after all. I guess it shocked me a bit that they're ~500x larger.

2017-11-20

[14:20:45] LyndsySimon: has left #ruby: ()

2017-11-08

[14:13:12] LyndsySimon: Bish: I've not touched it, other than to read the docs. I don't write Ruby outside of work, as a rule.
[14:13:49] LyndsySimon: I did make some significant progress on my CSV gem, thouhg.
[15:19:10] LyndsySimon: Bish: because I'm honestly not a huge fan of Ruby, like I said. I am a fan of writing stuff I like, though, and this CSV gem is one of those things. Hence, I'm writing Ruby in my personal time even though it's not my preferred language and not something I would normally work in without a financial reason.
[15:40:57] LyndsySimon: Bish: Nothing is *wrong* with Ruby
[15:41:00] LyndsySimon: At least, not that I know of.
[15:41:17] LyndsySimon: It just doesn't fit the way I think about problems as well as many other languages. Personal preference is all.
[15:42:06] LyndsySimon: If I had to wrap my complaints into a single statement, I'd say: Ruby encourages developers to create things that behave in unexpected and difficult-to-debug ways.
[15:43:13] LyndsySimon: Metaprogramming, for instance. It's a pain in the ass in Python, and as a result while it's available it's something that isn't done much unless it's really the best solution. It's super-easy in Clojure, and as a result at least when you run in to it, it's more obvious what's happening and easier to debug.
[15:44:13] LyndsySimon: Ruby takes a more middle path. It's approachable for less-experienced developers, but it has a much steeper learning curve and it's not always obvious when you're dealing with something you don't fully understand.
[15:45:49] LyndsySimon: ... because it doesn't conform to the class syntax used elsewhere, and because classes in Ruby don't have metaclasses in the same way that other languages do ...
[15:53:41] LyndsySimon: havenwood: I don't think it's a bad idea, and I don't think Ruby is a bad language. I just prefer a different way of dealing with it :)
[15:53:50] LyndsySimon: Bish: "Correct", in this case, is subjective.
[15:54:29] LyndsySimon: Bish: It's more flexible without question. I just see the point of this sort of language to be to reduce the depth at which I have to think about things when I'm writing code. For me, Python does that much more effectively than Ruby
[15:54:48] LyndsySimon: I really miss Python decorators when I'm working in Ruby, much more than I miss blocks in Python.
[16:00:09] LyndsySimon: havenwood: Right - that's exactly my complaint with Ruby. It's not that it's lacking features, it's that it has too many features.
[16:00:42] LyndsySimon: Python decided on a pattern, made is easy to use, and eschewed others.
[16:00:49] LyndsySimon: AFK - going into a meeting.

2017-11-07

[15:56:33] LyndsySimon: I'm considering writing a gem to ease CSV parsing in Ruby - if you have a sec, I'd appreciate a quick review of the short README. I'm looking for community input before I decide whether or not writing it is worth my time: https://gitlab.com/lyndsysimon/ideas/blob/master/csv_parser.md
[15:59:58] LyndsySimon: Bish: Oh? I've honestly never used it. I came up with this idea after discussing options to reduce code duplication for CSV import scripts in a web app at work.
[16:00:34] LyndsySimon: I'm kind of on a kick writing DSLs right now, and it seemed like a natural fit. Too much work to justify it for work, but not if others find it useful.
[16:00:56] LyndsySimon: Bish: Yes, fields are defined by default in the order they are presented in the file.
[16:01:26] LyndsySimon: Bish: I've not yet thought much about title rows. I may just exclude them, or I may allow you to define fields based upon the titles in the title row.
[16:02:03] LyndsySimon: Bish: My favorite DSL I've written so far is for defining datatables. It's written on top of ajax-datatables-rails.
[16:04:33] LyndsySimon: Bish: It's still rough :) I planned to support using it as an object or a keyword, and to allow you to register new types as keywords.
[16:05:07] LyndsySimon: The "from: last_name" part, I was thinking that the field was named "last_name" in the CSV. Like I said, not fully formed, just trying to illustrate the overall idea.
[16:05:38] LyndsySimon: `object.class < Integer` :)
[16:06:02] LyndsySimon: >> 1.class < Numeric
[16:07:00] LyndsySimon: Bish: What about the idea of splitting out the process into several steps? i.e., schema definition, row validation, excluding rows, processing rows, etc.
[16:08:09] LyndsySimon: Bish: My general approach is to handle the 80% use case first, and by default. Only schema definition and per-row processing would actually be required.
[16:08:55] LyndsySimon: Ideally, I'd like most uses of my code to be only a few short, clear, concise lines. Only if things deviate from the norm should there be additional complexity exposed to the dev.
[16:10:08] LyndsySimon: Anyhow, thanks for letting me bounce the idea off you :) I have an inkling I may write the gem this week for fun.
[16:11:20] LyndsySimon: FWIW I'm not a huge fan of Ruby as a language. I come from a Python background mostly and have branching out into more functional languages, specifically those centered on immutable types. I've discovered that I really like Ruby for writing DSLs though.
[16:11:56] LyndsySimon: Yeah, I can see that.
[16:12:19] LyndsySimon: My problem is time. This gem seems like something I can whip up fairly quickly, and something that won't require a ton of ongoing maintenance.
[16:13:26] LyndsySimon: I've dabbled in Haskell. It fits the way I think, but I'm not yet fluent in the syntax. Every time I go back to it, I get to the point where I'm overwhelmed by the terminology that's used - monads, functors, et. al.
[16:14:01] LyndsySimon: Clojure fits me pretty well too, but I find that every time I get in the flow I have to reach back into Java for something and it breaks my flow.
[16:14:30] LyndsySimon: Plus, Clojure's tooling is *slow*.
[16:15:04] LyndsySimon: Nim is very, very interesting to me. The only real issue I have with it is that the standard library uses mutable types by default.
[16:16:04] LyndsySimon: Oh hey - here's an example of a previous DSL I've written, in use:
[16:16:09] LyndsySimon: https://usercontent.irccloud-cdn.com/file/MRsUnoK2/image.png
[16:16:41] LyndsySimon: `get_raw_records` was named by the library the DSL sits atop, not me.
[16:16:49] LyndsySimon: ACTION looks up sequel
[16:17:52] LyndsySimon: Hell yeah, that's awesome.
[16:18:09] LyndsySimon: Sequel looks a lot like my style.
[16:19:25] LyndsySimon: I'm skimming the docs now. I love it. It's both simpler and more powerful that ActiveRecord.
[16:19:45] LyndsySimon: composite key support! :P
[16:22:58] LyndsySimon: Nah, that's a good thing.
[16:23:16] LyndsySimon: I will point out that you were just making fun of me for seeing this kind of thing as fun, though :)
[16:24:24] LyndsySimon: CSV is only a convenient hook I'm using to get to do the nerdy stuff
[16:27:11] LyndsySimon: CSV is actually quite sane - it's the implementations that make you want to shoot yourself.
[16:28:10] LyndsySimon: Bish: I got a commit into the Nim core repo a while back! https://github.com/nim-lang/Nim/commit/8ea78b1bc9dc0b4d883b4f0750ee84e93605b82a#diff-172294a35ce6ecdb390ca1d591297682
[16:28:15] LyndsySimon: ACTION iz proud.
[16:29:08] LyndsySimon: IIRC, Excel's CSV exports are bad, too.
[16:29:54] LyndsySimon: I want to say there's a problem where it only allows escaping quotes with `""`, instead of `\"`, or vice versa. It's been a while.
[19:18:24] LyndsySimon: Can anyone tell me why this fails?
[19:18:31] LyndsySimon: >> x = Integer; x('1')
[19:19:27] LyndsySimon: dminuoso: OK... I'm not following.
[19:20:26] LyndsySimon: ^ That doesn't work either.
[19:20:52] LyndsySimon: I have a glimmer of understanding, though.
[19:21:03] LyndsySimon: There's a lookup table for methods, and another for variables in scope. Right?
[19:21:36] LyndsySimon: I think it's pretty advanced, honestly.
[19:22:46] LyndsySimon: I haven't thought about it like that, but that makes sense.
[19:22:59] LyndsySimon: Yeah, I'm digesting it.
[19:25:14] LyndsySimon: OK, I think I understand the eval.in - the existence of an in-scope variable `x` means that it shadows the method `x`, which is a method. Adding parens skips the lookup in the variable table(s), so it gets the actual object.
[19:25:53] LyndsySimon: My problem is that I need to assign the Integer - the callable - to a variable, then call it on another object later.
[19:26:29] LyndsySimon: `x` does in fact contain the object I want to call, but neither method allows me to actually call it. Is there another way to call it?
[19:26:49] LyndsySimon: Ahhhh. That makes sense.
[19:27:28] LyndsySimon: ACTION laughs
[19:27:39] LyndsySimon: >> x = Integer; x.('1')
[19:28:27] LyndsySimon: Yep. Yay, that makes sense.
[19:30:00] LyndsySimon: dminuoso: ... but `Integer '`'` works. I assume there is something special in `Integer` that tells it to call `Integer()` if it's being called and not assigned to a variable?
[19:30:25] LyndsySimon: apeiros: Thank you, that part was missing for me
[19:37:42] LyndsySimon: The DSL stuff I'm working on where I needed that piece of functionality is now working - thanks dminuoso and apeiros

2017-09-28

[14:29:30] LyndsySimon: has joined #ruby
[14:30:24] LyndsySimon: I'm working on a project where we have substantial manual QA testing, in addition to our automated tests that use Capybara. Does anyone have experience using Capybara to automate the setup to particular states for the purposes of manual testing?
[14:31:05] LyndsySimon: Basically, I'd like to run the user's browser for as long as it takes to do environment setup tasks - logging in, creating some stuff, then dropping them on a page and giving them back control.
[14:44:58] LyndsySimon: MrBusiness: Yes, it's a web app. The "state" would be a combination of client state (i.e., session, including cookies and LocalStorage) and server state (including database contents).
[14:46:06] LyndsySimon: Basically, I want to be able to run a test that's already using Capybara, but instead of executing the test I want to stop there and let a user take over.
[14:46:33] LyndsySimon: Hmm. Yeah, I could.
[14:47:42] LyndsySimon: I'd like to wrap this in a GUI of some type - either a desktop app, a web interface or a browser extension. That would require that I split the test setup and teardown from the test suite and put it in a structure that's readable and usable for this as well. That should be possible.
[14:47:47] LyndsySimon: It's getting more clear in my mind :)
[14:47:52] LyndsySimon: Just talking about it helps.
[14:53:06] LyndsySimon: matthewd: Ideally, yeah. We're not going to be able to get away from manual testing completely, no matter what. The software is for the healthcare industry, so it's very important that we be as confident as possible that things in the UI in particular not break.
[14:53:36] LyndsySimon: In my experience, automated testing is awesome for making sure things don't break in the same way they have in the past. It's not as great for making sure they don't break in new and exciting ways.
[14:58:07] LyndsySimon: teatime: I'm aware :)
[14:58:50] LyndsySimon: teatime: Actually, I was trying to be a bit more precise. Codifying the "happy path" of expected user interaction isn't technically regression testing, and that's the primary stuff I meant.
[14:59:05] LyndsySimon: matthewd: Yes, a visual diffing tool is on my list of things to incorporate.
[15:00:21] LyndsySimon: That's not *quite* what I'm looking for. I don't want to tell them what to do, that's sorta their job description.
[15:00:51] LyndsySimon: I just want to automate what they're already having to do by hand, and since I'm already having to do it for automated testing, I'd rather just put an additional interface over that existing code than do it twice.
[15:06:09] LyndsySimon: matthewd: The data are too big for a DB restore to be a viable solution, and a big part of this is going to be navigating them through the app to the right spot. There's also the part where they're testing against a deployed instance of the application with anonymized PHI data pre-loaded. Acting against the DB directly is not out of the question, but is a fairly high barrier.
[15:06:25] LyndsySimon: I've got some ideas how to do it now - it's just a matter of making it happen.

2017-09-12

[12:46:41] LyndsySimon: I've been asked to move all of the models of a fairly mature Rails app into a gem so they can be used in other contexts. I've not been able to find where others have done this in the past - does anyone here know where I could start?
[14:15:12] LyndsySimon: tcopeland: Thanks :) I'll read that to file it away mentally, but I have found some stuff that will keep us from doing it and convinced the people who matter in this case that it's a bad idea.
[14:15:55] LyndsySimon: I mean it's a bad idea for us because it doesn't get us closer to accomplishing what we're trying to do, not because there is anything inherent wrong with the concept.
[16:51:40] LyndsySimon: has left #ruby: ()
[16:51:44] LyndsySimon: has left #ruby-offtopic: ()
[16:51:48] LyndsySimon: has left #RubyOnRails: ()

2017-09-06

[14:01:59] LyndsySimon: I'm looking for a generic way to convert an objects externally accessible instance variables into a hash. Is there some way to introspect Object that I'm not seeing?
[14:07:29] LyndsySimon: matthewd: Maybe this will help - https://gist.github.com/lyndsysimon/dfa513f92d6711f6b55056763ba94f44
[14:08:01] LyndsySimon: matthewd: I'm well aware of the ability to "reach in to" objects and access instance variables directly. :)
[14:11:21] LyndsySimon: I get that, I'm just surprised that there isn't an Array kept somewhere of calls to attr_reader/attr_accessor
[14:14:10] LyndsySimon: Fair enough. I can write a concern that implements this
[14:21:28] LyndsySimon: dminuoso: I don't see how would help in this particular case... but yes, I would prefer static typing for this project.
[14:21:47] LyndsySimon: konsolebox: Yes. If there isn't a built-in method to do this, I can write one easily enough.
[14:27:43] LyndsySimon: dminuoso: Awesome, I'll grok that when I get a sec. It looks useful.
[14:30:06] LyndsySimon: Here's the solution I ended up with, for this one-off use case: https://gist.github.com/lyndsysimon/3ff4e6df02702ef4b4565bf1012e4962

2017-08-03

[10:24:14] LyndsySimon: Ping timeout: 246 seconds
[10:25:58] LyndsySimon: has joined #ruby-offtopic
[10:26:02] LyndsySimon: has joined #ruby
[10:26:02] LyndsySimon: has joined #RubyOnRails

2017-07-19

[13:23:22] LyndsySimon: TIL: camelize and underscore are not compliments of each other.
[13:23:41] LyndsySimon: Example: `'create_90_day'.camelize != 'create_90_day'.camelize.underscore`

2017-07-18

[02:13:59] LyndsySimon: *.net *.split

2017-06-20

[00:17:32] LyndsySimon: *.net *.split
[00:22:42] LyndsySimon: has joined #RubyOnRails

2017-06-15

[13:26:50] LyndsySimon: I know Ruby has the concept of "autoload", and that Rails has a similar concept and builds on it with "eager loading". I'm looking for a way to eager load all files in a directory, preferably without hooking into Rails' `config.eager_load_paths`, since I want it to happen even when Rails' eager loading is turned off (i.e., in local development).
[13:29:05] LyndsySimon: You know what? Scratch that. I was trying to strip out part of a complex problem I'm working on, and I think I just figured out a way to avoid it entirely.
[13:29:19] LyndsySimon: I'm still interested if someone has an answer, but it's not blocking me anymore :)
[14:47:50] LyndsySimon: ljarvis: Is there any easier way to "require all files in a directory" other than enumerating them and building the require statements dynamically?
[15:07:24] LyndsySimon: ljarvis: You don't happen to have that one-liner handy, do you? My head is full of other context and I'd like at least document this.
[15:08:10] LyndsySimon: Woot, thank s:)
[15:08:36] LyndsySimon: Ah, cool, it supports pattern matching then. Even better.

2017-06-02

[14:27:14] LyndsySimon: I keep having issues with RVM. Is there a comparable tool out there I could use?
[14:29:32] LyndsySimon: rickumali: Would you recommend it?
[14:30:17] LyndsySimon: Reading their doc looks very promisign.
[14:30:29] LyndsySimon: I had no idea that RVM was overriding cd. That's insane.
[14:49:09] LyndsySimon: rickumali: I hate to be a pain, but I'm setting up rbenv and am not seeing what I need in their docs.
[14:49:29] LyndsySimon: rickumali: In particular, I'm not seeing an analogue to rvm's gemsets.
[14:51:21] LyndsySimon: ljarvis: This is slightly beyond my knowledge at the moment. My background is in Python and I fully understand how virtualenvs work there. Does Ruby have a *need* for gemsets?
[14:52:02] LyndsySimon: I'm working on projects that have Gemfiles created by bundler. I've just never used them outside of rvm
[14:52:32] LyndsySimon: havenwood: How does that reconcile with what elomatreb said? Can I have multiple versions of the same gem installed concurrently?
[14:54:02] LyndsySimon: How does Bundler do that? If I call `rails console`, for instance, is the ruby interpreter that it's calling aware of the gemfiles and able to specific the gem versions that way?
[14:54:27] LyndsySimon: havenwood: Yep, I'm familiar with the file structure :) I just need to understand what it's doing so I can troubleshoot things.
[14:56:08] LyndsySimon: Ahh, OK. So with rvm, I don't have to prefix commands because it's shimming the shell commands. With rbenv, I have to use bundle's explicit management to do things in the "environment" (which in actuality is just Bundler loading and passing the specs from the gemfiles to Ruby before executing the commands I pass in)
[14:57:19] LyndsySimon: Hmm. OK. I think I'm still missing a critical piece of information or two.
[14:58:40] LyndsySimon: My system ruby is 2.4.1 (Installed via homebrew). My project's ruby is 2.3.1. I've installed it via rbenv. How do I use bundler now to install the gems from the gemfiles?
[14:59:21] LyndsySimon: elomatreb: bundler replies that my ruby version is 2.4.1
[14:59:43] LyndsySimon: Do I need to somehow "activate" the rbenv version?
[15:00:04] LyndsySimon: Yes, my system ruby is 2.4.1. I've specified 2.3.1 in .ruby-version. rbenv installed it fine.
[15:00:15] LyndsySimon: I did rehash, but I'll do it again.
[15:02:29] LyndsySimon: Maybe this will help: I'm sharing my screen at this link: https://appear.in/how-to-ruby
[15:03:16] LyndsySimon: Oh! I think I figured it out.
[15:03:49] LyndsySimon: `ruby --version` is 2.3.1. Bundler says I'm using 2.4.1. That's because I have Bundler installed in my system ruby but not in the rbenv-controlled 2.3.1.
[15:04:06] LyndsySimon: There's a `bundle` command in my system ruby, but not one in my 2.3.1 environment, therefore it isn't shimmed.
[15:04:28] LyndsySimon: havenwood: Yeah, I'm in the process of doing just that.
[15:05:37] LyndsySimon: havenwood: I see that, and now I understand exactly what `rbenv rehash` does.
[15:06:13] LyndsySimon: You have to rehash not whenever a gem is installed, but whenever a gem is installed that includes executables you want to access from the shell.
[15:08:19] LyndsySimon: havenwood: That's a good idea, but there are other changes happening concurrently (upgrading rails). Instead, I plan to lead a project to migrate the whole team from rvm.
[15:09:16] LyndsySimon: Somewhat annoyingly, rvm requires the ruby version right now to be 'ruby-2.3.1', while rbenv wants it to be '2.3.1'. That means there's going to have to be a point where we all move over at once :(
[15:09:50] LyndsySimon: I'll look into chruby before making a recommendation.
[15:10:34] LyndsySimon: I'm comfortable doing that now. I already more fully understand rbenv than I ever did rvm. I hate magic.
[15:11:12] LyndsySimon: havenwood: Cool, thanks :)
[15:12:23] LyndsySimon: Heh. While I'm on macOS, I'll read the linux version first. I'm a Linux user using macOS, so it's easier for me to grok that way.
[15:12:36] LyndsySimon: This has all been super helpful so far.
[15:17:55] LyndsySimon: valerauko: I can't speak for Ruby, but that's the approach I've taken in the past for other projects. Just be prepared for the PR to be rejected initially, and for the people who do so to be at least a bit gruff about it :)
[15:19:28] LyndsySimon: Feel free to shoot me a message if you want a quick code review before submitting your PR, I'd be happy to.
[15:41:27] LyndsySimon: sagax, havenwood: I'll also say that when I was playing with writing a cryptocurrency exchange, my model was to use an append-only log for all transactions. That helped me maintain an audit trail and know where I could divide work between workers concurrently and when it needed to be executed in series.
[15:44:35] LyndsySimon: havenwood: I've got chruby+ruby-install working now. So far so good - except that I need an equivalent to rehash :)
[15:45:11] LyndsySimon: havenwood: For instance, which I `gem install bundler`, I had to reload my shell session for `bundle` to point to the one I just installed. Same thing for rails.
[15:46:54] LyndsySimon: havenwood: It might be a problem with my .zshrc.
[15:49:30] LyndsySimon: Doesn't seem to be. When I install bundler, it doesn't show up on my path under I reload.
[15:50:06] LyndsySimon: Whoa. Something's weird. I don't think it's a ruby issue.
[15:51:39] LyndsySimon: https://usercontent.irccloud-cdn.com/file/F8bGwD9C/Magic.%20%3A(
[15:52:05] LyndsySimon: What part? :)
[15:56:47] LyndsySimon: havenwood: I don't understand.
[15:57:10] LyndsySimon: It does pick up the new stuff when I cd out and back in:
[15:57:14] LyndsySimon: https://usercontent.irccloud-cdn.com/file/lWJkxXXL/image.png
[15:57:25] LyndsySimon: "switch to brew with: chruby system"
[15:58:29] LyndsySimon: adaedra: I like monofur because the "e" is easy to read. I wish it was easier to distinguish multiple underscores, though.
[15:59:59] LyndsySimon: https://usercontent.irccloud-cdn.com/file/nrgLrcKc/image.png
[16:00:34] LyndsySimon: It's sourced in my .zshrc.
[16:00:45] LyndsySimon: ACTION nods.
[16:04:14] LyndsySimon: Yeah - it's gotta be something in my shell. It appears that chruby is doing the right thing, because it got added to the directory that's first in my path, it just doesn't resolve to that. I wonder if zsh is caching the location of the executable from the previous call or something.
[16:04:17] LyndsySimon: https://usercontent.irccloud-cdn.com/file/fDIPKe3l/image.png
[16:06:01] LyndsySimon: Yeah, it's totally the shell. hash isn't getting updated:
[16:06:05] LyndsySimon: https://usercontent.irccloud-cdn.com/file/hqfbTvC6/image.png
[16:09:43] LyndsySimon: It's not an Apple symbol, it's just unicode.
[16:10:38] LyndsySimon: Just like the command key - it's symbol is "PLACE OF INTEREST SIGN": ⌘
[16:11:03] LyndsySimon: Well, of course. I just mean that it's like the symbol isn't available on Linux.
[16:12:29] LyndsySimon: There's also ⎇, "ALTERNATIVE KEY SYMBOL". They're handy together.
[16:14:32] LyndsySimon: AFK. I've been working from a diner, and my battery is low enough I should walk back to work. :(
[16:54:01] LyndsySimon: pupsicle: I would actually explain that differently. Foo.bar is calling "bar", a method of "Foo". Foo.new.bar is calling "bar", a method of "Foo.new", which of course is an instance of "Foo". It's not so much a matter of the order things are happening as it is becuase of the fact that an instance of a class is a discrete object, and doesn't share methods with the class from which it is derived.
[16:55:06] LyndsySimon: You know what, scratch that. I'm overcomplicating, and thought you had defined self.bar.
[16:56:01] LyndsySimon: Yeah, I should have stopped and verified my reading of it.

2017-05-09

[07:05:38] LyndsySimon: has joined #ruby-offtopic
[07:05:43] LyndsySimon: has joined #RubyOnRails
[07:05:44] LyndsySimon: has joined #ruby

2017-05-03

[15:28:42] LyndsySimon: When defining an ActiveSupport::Concern, should instance methods be defined inside the `included` block, or directly on the module?

2017-05-02

[13:38:21] LyndsySimon: Is it a stupid idea to have a concern that is included in both models and controllers?
[13:38:45] LyndsySimon: It's for configuration handling, which on the app I'm working on is quite unique.
[13:39:52] LyndsySimon: As in provide more detail, or just ask fewer questions in this channel? :)
[13:41:29] LyndsySimon: Our config is a cascade, with "tenant" and "department" being the levels. The concern resolves the correct config object based upon the tenant and department in context for a model or controller instance.
[13:42:38] LyndsySimon: The config object is my own creation, and is where the vast majority of the business logic lives. The concern is just the way the correct config object is resolved. It provides hooks to specify the department to which an instance of a model belongs (or to which a controller belongs)
[13:44:12] LyndsySimon: Where should I put it in the filesystem.
[13:44:39] LyndsySimon: OOoh good idea.
[13:46:26] LyndsySimon: Can you remind me in a couple of days? I'll refactor it into a gem.
[13:46:43] LyndsySimon: I'm under time pressure at the moment, and there's too much business logic in there to share it at the moment.

2017-04-27

[14:46:31] LyndsySimon: Pretend I've got a magical concern that tells me if the current model instance is "good", or "evil". I include that concern in my `ApplicationRecord`, so it's by extension included in all my models.
[14:47:43] LyndsySimon: In my controller, let's say I've assigned the instance variable `@foo` to an instance of a model. In my view, I can use `<%= @foo.alignment =>` and it'll return either 'good' or 'evil'.
[14:49:37] LyndsySimon: Now imagine that I want to create a view partial that is included on every page of my application that has the object's alignment as an overlay on the page. I can still call `@foo.alignment` of course, but on some pages there is no `@foo`. `FooController#show` sets `@foo`, but `BarController#show` sets `@bar`.
[14:50:25] LyndsySimon: Make sense? I'm looking for a generic way to reference the primary object for the page, be it an instance of a model or a queryset.
[14:58:35] LyndsySimon: Clear as mud, I guess :)
[15:09:31] LyndsySimon: No testing is being done, lol.
[15:09:56] LyndsySimon: I'm asking if there is a Rails convention for naming the generic object. It's looking like there isn't.
[15:10:52] LyndsySimon: Yeah, I know. It's cool.
[15:11:01] LyndsySimon: 90% of why I'm asking about it is because I want to talk it out some.
[15:15:02] LyndsySimon: ACTION points out that mordof is needed by someone, and that's more than many people can ever say about themselves :)
[15:18:21] LyndsySimon: Yep, I'm well aware of the concept :)
[22:17:10] LyndsySimon: Ping timeout: 240 seconds
[22:25:16] LyndsySimon: has joined #ruby-offtopic
[22:25:20] LyndsySimon: has joined #ruby
[22:25:20] LyndsySimon: has joined #RubyOnRails