Page 1 of 2 | Next »
[16:13:16] machinewar: is there any way to change the join model used by a has_many through at runtime
[16:13:39] machinewar: so I want to pretty much check a column value and if its true use one join model and if its false use another join model
[16:17:22] machinewar: why would same ruby version (2.5.1) have different results for "irb" v. "rails console" Rack::Utils.escape_path(":"). rails console URL escapes the value while irb doesnt. Does rails monkey patch rack::utils?
[16:19:31] machinewar: or more likely my ruby installed version is different than my rails projects.....
[04:34:20] machinewar: if I have a JS library that is loading files with paths like /js/myfile.js the asset pipeline breaks all of this when precompiled. Is there a way to just skip asset pipeline precompilation and have those files served separately
[15:47:01] machinewar: anyone very familiar with RSpec. I have a describe SomeNamespace::SomeClass do... the weird thing is that the class is not namespaced, but this spec does not break.....
[23:47:20] machinewar: for encrypted credentials in Rails 5.2 does that mean we no longer store these values in ENV variables? Will you need to redeploy every time you want to update one?
[04:56:52] machinewar: Radar: this works response.set_header("Cache-Control", "no-store") in Rails 5.1
[05:05:51] machinewar: hmm so this is just general web dev question and prob not best channel, but anyone know how to make sure browser doesn't cache a content-url downloaded via a css :hover for example
[21:44:33] machinewar: other than regex for all words that look like constants and checking if const_defined?
[21:55:12] machinewar: bawNg: ah interesting. (I'm pretty much just wishing for a compiler here haha), but I want to make sure that before I execute a ruby file that any constant or class name exists. even if that classname or constant is referenced in a method in the file
[21:56:59] machinewar: havenwood: woah really cool idea I haven't dig into Ripper too much but seems really cool - just what I'm looking for
[13:57:44] machinewar: getting a template error when rendering an email template from within a mailer action. https://gist.github.com/AlexWheeler/1115b8f80d4a429044f6e37ef47c9855. it works in rails console, but not on server. any ideas?
[21:21:21] machinewar: Algebr`: a gem is a Ruby library, rake is a build tool - think command line scripts in Ruby, bundler is for managing Ruby libraries (gems)
[21:41:39] machinewar: most Ruby projects will use a Gemfile + bundler though because then if I want to work on your project, I just git clone it, and run bundle install
[17:18:22] machinewar: when I run bundle show rails, how can I can only see the guides and readme in that directory?
[15:04:30] machinewar: I'm writing a rake task with custom arguments via flags, but looks like some might be reserved?
[02:29:24] machinewar: I built a custom Rack Middleware that I mounted via mount: in routes.rb. Any idea why it would display the Rack::Builder object when I run rake routes
[12:27:59] machinewar: how can Rack middleware be used to modify request before your Rack app is called? I understand using Rack::Builder to modify response, but can't find docs on modifying requet
[12:45:46] machinewar: dminuoso: I mean is there a way to intercept the environment after my Rack app's call method has been executed to modify response on way back to the web server, I can only seem to modify thing before my Rack App's call method is called
[21:20:12] machinewar: how can I use ActiveRecords #joins to do a left join with a parameter for filtering
[13:58:57] machinewar: I know Rails caches queries for single requests, but will it cache first parts of queries that are then built on...... user.friends and then user.friends.some_other_query
[14:01:37] machinewar: Scient: okay thanks! and getting a bit more specific, (might be too specific), but what about using pagination with kaminari.... user.friends.page(1) and then user.friends.page(1).num_pages
[14:02:40] machinewar: Scient: or do you know if theres method to check if a query is being read from cache v. going to the db
[13:40:00] machinewar: is anyone familiar with Memcached + Rails. Trying to find a way to access the configured URL at runtime
[13:40:37] machinewar: Thinking of something like this but not sure Rails.application.config.cache_store.some_attribute or method
[20:22:35] machinewar: if I build a gem, is there a way to check if someone is using it with Rails v. in just a normal ruby script. i..e if Rails.exists?
[20:30:23] machinewar: matthewd: the exact use case is that if the gem is used in Rails I want to access the Rails.cache, otherwise the user has to specify a different configuration
[20:30:42] machinewar: or if you know if I can access memcached in Rails explicitly without Rails.cache
[20:31:17] machinewar: like get the address, port its running on (which should be known by some object
[20:32:45] machinewar: matthewd: yea I was looking through some gems and it seems pretty common, but totally get the possible issues thanks for the heads up
[20:35:43] machinewar: yea guess simplest way would just to be to check that the classes I'm looking for are defined if defined?(Rails) && Rails.respond_to?(:cache) && defined?(Rails::Cache)
[20:41:38] machinewar: I get the whole ampersand to_proc stuff except the call part, does map send #call to procs?
[20:43:34] machinewar: so upcase is calling the block? I think I'm just confused because it seems implicit
[20:44:22] machinewar: i..e why doesn't [1,2,3,4,].map(some_proc) return [Proc.new, Proc.new, Proc.new, etc.]
[20:59:11] machinewar: workmad3: definitely just meant to show its an instance of Proc, which is was some_proc would be
[14:57:43] machinewar: anyone know what version of rails minitest was added as dependency over test unit?
[01:19:04] machinewar: if i include a module in a class how can I have those methods be defined after the methods in the class its included in?
[02:45:40] machinewar: anyone used Rake::TestTask to include tests with pattern _test.rb and the test_helper.rb
[02:46:02] machinewar: hard since have different patterns and expect to give pattern of file to load with patterns
[21:52:27] machinewar: so I have a class that is expected to respond to a method and I want to run the code in that method when its called (which sets instance variables) and then run method by same name in an included module with logic that depends on those instance variables being set
[21:57:22] machinewar: but I'm wondering if there's a *smarter* way to do this somehow from within the module
[21:57:36] machinewar: having it call something on the class (i.e. some way to open up a classes method and add to it)
[22:01:40] machinewar: jhass: thanks! am currently using prepend actually and was curious if another way
[22:02:05] machinewar: jhass: that's fine I actually want the class to implement the setup and then have it run the module method which assumes some instance vars were initialized
[22:02:36] machinewar: and prepend works since it hides the super from the class which is something I liked, just looks cleaner
[18:08:45] machinewar: jhass: ah alright that's where I was confused thanks, any relatively simple way to do it with standard library
[12:10:54] machinewar: anyone know of convention for setting up mini-test in a ruby gem project? i.e. so that all of my classes are when tests run? Do I need to make a spec_helper and add to LOAD_PATH? or do you explicitly require the classes in your specs?
[12:13:14] machinewar: if you have instance of the class then you'd do obj = Class.new; obj.class.const_set("MY_CONST", "value")
[12:19:54] machinewar: raz: you need to not make an instance on first line and instead open up the class
[22:22:40] machinewar: I know the previous app does in the initialize and call returns an arrray not the env hash?
[22:24:58] machinewar: cnk: hm that's what I would think but all I see a rack app returning is the array [status, headers, body]
[22:28:54] machinewar: cnk: so you're saying that Rack Middleware call method should only return the env and the last middleware you use should return the status headers and body?
[22:33:51] machinewar: cnk: totally, what doesn't make sense to me is that middleware returns the triple, but call gets passed the env hash. Is the env hash global and you're just mutating it on the way down the middleware stack?