#RubyOnRails - 07 July 2019
« Back 1 day Forward 1 day »
[02:29:57] arooni: anyone ever have the issue where you generate a new controller and cannot access any regular activerecord models that you would normally be able to access? things like User.find_by_email don't work ?
[05:59:22] tfreedman1: so I have a rails project that's got a bunch of plugins, such that you can kinda turn on and off a bunch of features
[06:00:13] tfreedman1: I can dump the entire DB schema with rake, but then that restores every plugin
[06:00:58] tfreedman1: and migrations aren't super useful, just because they would also restore things assuming every plugin is used
[06:02:25] tfreedman1: is there a good way to automatically break it up and put the relevant DB stuff into the model or controller
[09:59:22] Norrin: kurly that's fine but there's very little rails discussion happening. maybe you haven't seen how IRC has been in the past before
[16:55:54] xco: Hi I need help. I have this https://gist.github.com/xcobar/422daadfb65f4c1add7df6890cd77653. This is what I want to achieve: To be able to access `current_user` in the twitter intializer file so I can grab some tokens to create a Twitter client. I’m assuming the initializer files loads before everything else and current_user will be nil at the point it loads, I have tried doing it through a service and including ApplicationHelper in the
[16:55:54] xco: service (which is bad i guess). Question is how can i access current_user from my current setup or from a service?
[17:25:44] xco: actually no, ActionDispatch::Request.new(ENV) is not what i’m looking for. question still holds! :D
[17:55:11] IGnorAND: anyone try lambda @ aws? I get Ignoring nokogiri-1.10.3 because its extensions are not built. Try: gem pristine nokogiri --version 1.10.3
[19:38:26] havenwood: IGnorAND: https://aws.amazon.com/blogs/developer/announcing-ruby-build-support-for-aws-sam-cli/
[19:39:59] havenwood: I've been confused by articles showing Sinatra or Rails on Lambda. Why have a serverless function be a server?
[19:54:16] havenwood: IGnorAND: Or try `bundle install --deployment` and ship the vendor/ dir. I think you'd want to do that from Amazon Linux
[19:54:52] IGnorAND: I did bundle install --path vendor/bundle && zip -r $1.zip $1.rb vendor && aws-v3.rb lambda update-function-code --function-name $1 --zip-file fileb://$1.zip
[20:43:19] havenwood: IGnorAND: No, I didn't since the lambda functions I've used so far haven't actually used native extensions.
[21:37:53] IGnorAND: havenwood: removed python2, 3 and installed pyenv, installed the aws bundle. so much change
[22:49:09] dgs: I've got a rails 4.2 app and am having issues with caching. We use dalli/memcached, and it's working fine for stuff we cache explicitly (ie Rails.cache.set/fetch etc), but request specific query_cache isn't working. This is configured in production.rb (config.action_controller.perform_caching = true), but the rails log shows no sign of it caching (looking for CACHE keyword in log), and enabling database auditing shows dozens of identica
[22:49:49] dgs: rake middleware task indicates that QueryCache is enabled: use ActiveRecord::QueryCache
[22:50:49] dgs: or am I misunderstanding what QueryCache is meant to do (I thought it should automatically cache identical selects within the same request)
[22:51:39] dgs: running memcached in verbose mode shows all the manual caching fetching/getting/missing exactly as expected - so I'm fairly sure the app is connecting to memcached fine