Page 1 of 3 | Next »
[18:21:13] sloggerkhan: I'm having an issue where I lose sessions running a capybara-selenium-based test, but only when running my whole test suite, not when running just that single test. My other tests don't use selenium.
[21:23:01] sloggerkhan: Pro777: Yeah, it doesn't make a difference. I'm convinced there must be some kind of accidental side effect in another test, I just have no idea what/how.
[18:01:48] sloggerkhan: I'm having trouble with capybara not being able to select an option in a select dropdown about 6/7ths of the time.
[18:02:16] sloggerkhan: Sometimes I get a stale element reference error, other times it just times out, once in a while it works.
[18:03:44] sloggerkhan: Have been using page.all('#modal_fluency option').select_option, and yeah, the modal's presence is asserted, and in fact an immediately preceding fill_in(...) of a text input in the same modal works every time.
[18:06:18] sloggerkhan: Well, they don't change and are rendered/displayed the same way the text input is. They both get created as part of the modal display.
[18:38:12] sloggerkhan: I use a mixture of fixtures and factory girl usually. Depends a lot on what's being tested and how which I use more.
[18:39:58] sloggerkhan: It's more a question of what your tests are doing than what kind test framework you use.
[19:33:25] sloggerkhan: What's the proper way of accessing the test helper from a console opened with the test env in rails 5?
[18:01:53] sloggerkhan: I doubt my approach is the best, but essentially I cache a series of redis structures that feel a tad overly complicated and use Structs that extend ActiveModel::Naming and include some other AR bits and pieces as needed. If there's nothing found in the redis cache, the remote call happens, cache is refreshed, and "Model" structs come out.
[18:05:42] sloggerkhan: Skull0inc: The cache-ingest logic converts things to ruby/rails like names/conventions, etc.
[18:05:43] sloggerkhan: My biggest gripe with the approach is that Redis really feels like the wrong back end because it's potentially really complicated to maintain caches. (It would love something more SQL-like with expiring rows if such a thing existed.)
[18:06:45] sloggerkhan: I'd say I'm in the "designed as went along camp," mainly because the external API I'm working with was not designed according to any normal design patterns.
[18:07:13] sloggerkhan: I think there are some tools that make it easier if the API you're working with follows standardized REST type patterns.
[18:24:21] sloggerkhan: tuelz: I mean I don't really like persisting relatively ephemeral/turbulent largish volume data to DB because then you end up needing a whole system to just maintain DB state that's constantly churning and that you don't want to store forever anyway.
[18:31:52] sloggerkhan: Yeah, if that's the kind of thing you have going on I encourage you to do what tuelz is suggesting.
[18:47:20] sloggerkhan: Like is it a problem if you get back 50k items and have to individually check update or create for each?
[15:59:42] sloggerkhan: Is there any meaningful difference between redis-store vs redis-session-store at this point? As in are there any gotchas with one vs another?
[19:56:49] sloggerkhan: What's the term for something that has too many different meanings depending on context?
[20:51:32] sloggerkhan: Radar: not really. I agree with "confusing," as a general descriptor, but I think there's a term for it. Maybe a bad example is the way the word "hash" is sometimes used in reference to the output of a cryptographic hash function and other times in reference to a hash table, or a data structure that uses keys, so if someone says "so I have a hash" pretty much you immediately ask for clarification unless you already know the context (which to be
[20:52:31] sloggerkhan: *... (which to be fair, is frequently known). But I'm looking for a word that describes something similar in non-technical situations and with regular words for situations where it's almost always a given that the meaning will be unclear without clarification.
[20:55:11] sloggerkhan: I was considering "overly overloaded terminology," but feel kind of "meh" about it. I more or less finished having the conversation that inspired the question anyway, so it's not particularly important at this point.
[20:57:41] sloggerkhan: Yeah, I don't think the hash example is that perfect of an example. It's just the first thing I can think of where there are quite a few different meanings. (Including the # symbol as you mention :p)
[23:00:53] sloggerkhan: If I need to sort by UTF-8 case insensitive on an array of non-DB-generated data will casecmp work as expected? Or is there some library I have to use to set a collation?
[18:22:45] sloggerkhan: If I define a struct in a module, and then include that module in a class, what's the correct way to reference said struct from a method call in another included module of said class? Should structs be defined in the base class itself instead of a module? Is it just bad practice to have dependent modules? (This is all at least partially originating from Rubocop suggesting modules/classes be limited to 100 lines.)
[18:39:52] sloggerkhan: I'm trying to make a form for a model that belongs_to and accepts_nested_attributes_for another model using fields_for. I keep getting an error that the model it belongs_to must exist. Is it required that overarching form must be for the has_one model instead of for the belongs_to model?
[20:47:22] sloggerkhan: Yeah, is there a way to have 0.0.0.0 be part of your config instead of a CLI arg?
[21:00:24] sloggerkhan: Basically I don't want it accidentally be running on an address that random other people on the network can hit.
[21:00:47] sloggerkhan: If people need to remember a different command to use args, sometime somebody will forget.
[21:06:25] sloggerkhan: mordof: For a variety of reasons that's not simple. There are firewalls, but there are also an awful lot of users on our side of them.
[21:07:43] sloggerkhan: Also, killing the port conf option in puma.rb and just putting bind seems to solve the double listen.
[21:51:23] sloggerkhan: When working with binary in ruby is there an easy way of making the result of an op like ~0x0040 give 0xffbf instead of 0xfbf?
[21:56:49] sloggerkhan: When working with binary in Ruby is there an easy way of making the result of an op like ~0x0040 give 0xFFBF instead of 0xFBF? (Related, why does it give 0xFBF over 0xBF, even for ~0x40?)
[22:45:32] sloggerkhan: Is it expected that ruby or rails require open-uri behind the scenes somewhere?
[23:11:37] sloggerkhan: havenwood: I was mostly wondering about what I considered to be a minor case of "unexpected behavior" in my test environment/console.
[21:54:48] sloggerkhan: Pundit users, what do you do about PolicyScopingNotPerformedError for index pages that don't use a model? (IE what goes in Scope resolve if there's nothing for it to do?)
[18:05:24] sloggerkhan: If I have to make a raw sql query prepared statement from `ActiveRecord::Base.connection.raw_connection.prepare` and I want to avoid creating a delegation of responsibility to call close on the connection (which I'm assuming needs to be done manually), do I pretty much have to process the query result in method instead of returning a Mysql2::Result ?
[18:00:05] sloggerkhan: Is there a way to use active record order to specify ordering by columns on a joined table without having to resort to manually creating the order string by hand?
[23:32:24] sloggerkhan: Is there some kind of bulk find_or_create_by or is looping to make a transaction the best bet?
[15:37:38] sloggerkhan: A wrapper is something you put around an object or interface to change how you interact with it. An interface is a specification for how an object behaves.
[15:40:16] sloggerkhan: In ruby interfaces aren't Java style/IE don't exist formally, so it's more based around whether any given object can do what you expect.
[15:47:06] sloggerkhan: Well, a simple example would be a test case that gets passed arbitrary objects and checks if they `can_bark?`by trying to call the `bark` method on said object and verifying a reasonable return value. Potentially any object could bark. But all could be said to implement some kind of "interface" that defines the method `bark`. Only it's the test defining the interface in this circumstance.
[15:47:56] sloggerkhan: As deur- said in languages with formal interfaces they're a collection of method signatures that are left to be implemented by the implementing classes.
[15:49:46] sloggerkhan: Not really. Interfaces are mostly a way of making sure method signatures that need to be compatible with each other are. It doesn't really have anything to do with the role or kind of objects involved.
[15:52:05] sloggerkhan: It's a form a polymorphism that doesn't bind as tightly as inheritance is maybe another way to put it.
[15:56:04] sloggerkhan: potatochipz: They mostly aren't involved in ruby because ruby prefers duck typing.
[22:50:55] sloggerkhan: So dumb question, but when you have a form for updating/creating a collection, like maybe a person can have cars or something that you choose via multi-select of some sort, and there's a M2M sort of thing going on, how is the form/endpoint normally dealt with?
[22:06:22] sloggerkhan: If being able to assign a string column with something like model_instance.some_string_column = 'a', 'b', 'c' and have "[\"a\", \"b\", \"c\"]" come back out expected behavior?
[22:08:23] sloggerkhan: (I had a bug caused by an accidental/erroneous comma and the behavior surprised me.)
[22:08:59] sloggerkhan: And if it were, I think the thing should deserialize when accessed, which it doesn't.
[19:27:09] sloggerkhan: Is redis-rails maintained? Its homepage listed on rubygems seems to be down.
[21:58:40] sloggerkhan: Does Rails have anything similar in style to Django's multi table inheritance?
[22:00:43] sloggerkhan: class Person, class KindOfPerson < Person, leads to tables for Person, KindOfPerson, where KindOfPerson's extra table basically 1:1's to Person transparently and holds some extra columns.
[22:02:58] sloggerkhan: For the project I'm working on the organizational benefit significantly outweighs any performance concerns.
[22:06:56] sloggerkhan: CNK: it's actually correct DB-wise in this case as the table wouldn't be decomposed to any reasonable NF if it included each of the "variant" models I'd like to have.
[22:08:06] sloggerkhan: cnk: Yeah, if I don't find anything particularly helpful my fallback is just creating a a bunch of 1:1s.
[17:29:30] sloggerkhan: I'm trying to figure out how to extend/wrap the default/built in logger. Pretty much I'd like to keep using the default/built in one, but write a subset of messages to Redis. Is this something I could do with a custom formatter, or is there a better approach? Most of the things I've found in Google have to do with using entirely different log systems.
[17:31:15] sloggerkhan: I don't think I know what you mean. Can I have multiple loggers? If I have multiple loggers what controls when each one logs?
[17:31:59] sloggerkhan: Or do you mean having ones that have to be manually called rather than triggered by logger.info or whatnot.
[17:34:56] sloggerkhan: I'd like to avoid the complexity of keeping track of multiple calls that are sometimes redundant. I think I can make a gist that outlines the behavior I'd like, it's not that complicated.
[17:44:51] sloggerkhan: tubbo: I'm envisioning something like this: https://gist.github.com/anonymous/7c5fb5462fb883801c47
[17:50:25] sloggerkhan: Looks like something along the lines of what I'd like to do is pretty straightforward, then. Though I think I explained myself slightly badly as the "redis_log" isn't a separate log, it's just a subset of entries I'd like in a Redis data structure in addition to the log file.
[18:38:55] sloggerkhan: Does removing Rack::Lock middleware lead to a lot of unexpected side effects?
[18:43:45] sloggerkhan: Great! Thanks! I realized it was enabled and causing issues with some tests on a site I'm working to upgrade. It used to call config.threadsafe!, but that got depricated I didn't realize until now it was controlling whether Rock::Lock was used.
[22:04:57] sloggerkhan: I'm having trouble getting the flash to work in a controller that uses ActionController::API
[20:11:29] sloggerkhan: Is there any reason not to patch TrueClass and FalseClass so that they have to_i methods?
[20:15:59] sloggerkhan: It drives me crazy because one of my projects involves a lot of (simple) math based on whether various flags are T/F and I always want to just write them as one liners and the lack of boolean to_i means they end up being giant multi-line things.
[17:34:28] sloggerkhan: It sounds like they want a Angular/Backbone/Ember type app that lets them scale static resources separately from the application layer more than a microservice.
[17:43:47] sloggerkhan: diegoviola: well random ultimatums sound ridiculous. That said, rich front end client style apps aren't that hard. Just use something like pundit + active model serializers and the back end can come together pretty quick. Which will leave the front end. Which probably won't take a day since you haven't built something like it before.
[17:47:50] sloggerkhan: Backbone + something like Backbone Stickit could be quickish to learn if you drop backbone routes and just use views/collections/models. Or at least much less to learn than angular/react/ember.
[22:54:40] sloggerkhan: I don't know what I think about how it's written, but in terms of how it functions I think actioncable is fairly clean.
[22:59:23] sloggerkhan: I particularly like that I can just run my main rails app like normal and use the regular redis pub command to push stuff so the ActionCable parts are more or less isolated from the regular App parts. Though I'm sure it can't compete with Erlang, it's been great for my narrow use case.
[23:45:40] sloggerkhan: I like not having the layout/appearance/html stuff coupled to the business parts of my apps. Main reason I tend to shy away from traditional style rails is I feel like you get more room to change and redesign the front end when it's mostly static since front and back end aren't as tightly coupled with the API style.
[21:43:27] sloggerkhan: Came across this in a legacy application I have to support but didn't write today: https://gist.github.com/anonymous/4df29be9a2afc53d5a0d
[21:48:05] sloggerkhan: Radar: Sadly the project isn't in ruby, but yeah, how I wish they'd used something like that.