« Back to channel list

#RubyOnRails - 10 November 2017

« Back 1 day Forward 1 day »
[00:00:58] jphase: has joined #RubyOnRails
[00:01:49] apeiros: baweaver: how about Hadschi Halef Omar Ben Hadschi Abul Abbas Ibn Hadschi Dawuhd al Gossarah?
[00:02:43] apeiros: but I grant you, yours is longer
[00:02:47] apeiros: lets see…
[00:04:11] apeiros: Lwaxana Troi of the Fifth House of Betazed, Holder of the Sacred Chalice of Rixx, and Heir to the Holy Rings of Betazed
[00:04:16] apeiros: still shorter it seems
[00:04:34] user121212: I'm trying to deploy an app using Capistrano. But I'm getting some errors like this - https://pastebin.com/BcmXMsFA. The server was configured using this tutorial - gorails.com/deploy/ubuntu/16.04. How can I deploy successfully?
[00:06:22] kies: has joined #RubyOnRails
[00:08:55] millz: has joined #RubyOnRails
[00:11:36] baweaver: user121212: "Please make sure you have the correct access rights and the repository exists."
[00:11:46] baweaver: Run back through it and make sure permissions are set up
[00:12:09] baweaver: https://stackoverflow.com/questions/25927914/git-error-please-make-sure-you-have-the-correct-access-rights-and-the-reposito
[00:12:30] jphase: has joined #RubyOnRails
[00:12:54] GodFather: has joined #RubyOnRails
[00:13:04] zave: has joined #RubyOnRails
[00:13:47] jphase_: has joined #RubyOnRails
[00:17:07] user121212: baweaver: I just checked git remote -v on local and seems like perfect. I'm committing to the same repo.
[00:29:15] user121212: Seems like the issue is related to public key. I added my keys to bitbucket and seems like it is working
[00:41:00] irishfromua: has joined #RubyOnRails
[00:46:34] Jameser: has joined #RubyOnRails
[00:51:48] Technodrome: has joined #RubyOnRails
[00:53:14] uks: has joined #RubyOnRails
[00:53:52] atrius: has joined #RubyOnRails
[01:07:40] mtkd: has joined #RubyOnRails
[01:10:38] jphase: has joined #RubyOnRails
[01:13:43] nertzy: has joined #RubyOnRails
[01:14:13] jphase: has joined #RubyOnRails
[01:17:20] cagomez: has joined #RubyOnRails
[01:31:46] EXCHGR: has joined #RubyOnRails
[01:34:17] waveprop: has joined #RubyOnRails
[01:35:11] waveprop: Is it legal in Rack to Rack::Response.set_headers('X-Some-Header', 'some value here') from within more than one middleware?
[01:36:23] waveprop: when i use @request = Rack::Response.new in a second middleware, my application returns #<Rack::BodyProxy000000...> within the body of the response, why is that happening
[01:44:08] ur5us: has joined #RubyOnRails
[01:47:24] juggler: has joined #RubyOnRails
[01:54:53] quazimodo: has joined #RubyOnRails
[02:11:57] ur5us: has joined #RubyOnRails
[02:32:18] cagomez: has joined #RubyOnRails
[02:39:55] jphase_: has joined #RubyOnRails
[02:53:38] Wirehead_Wannabe: has joined #RubyOnRails
[02:58:40] Wirehead_Wannabe: Does anyone know how the various schedulers that you can use with Heroku work?
[02:59:10] Wirehead_Wannabe: Like, do they have a process continually running in the background and checking whether it's time to carry out any tasks?
[03:12:11] guacamole: has joined #RubyOnRails
[03:15:25] orbyt_: has joined #RubyOnRails
[03:22:08] orbyt_: has joined #RubyOnRails
[03:25:37] alfiemax: has joined #RubyOnRails
[03:37:15] srinidhi: has joined #RubyOnRails
[03:43:43] MrCrackPotBuilde: has joined #RubyOnRails
[03:56:32] Saukk: has joined #RubyOnRails
[04:24:54] srinidhi: has joined #RubyOnRails
[04:41:32] kitallis: has joined #RubyOnRails
[04:55:44] quazimodo: has joined #RubyOnRails
[04:58:40] Technodrome: has joined #RubyOnRails
[04:59:05] gamut: has joined #RubyOnRails
[05:00:02] gamut: Hi all, can someone please help me a little with cancancan? It's late, and I'm at one of those places where I can't even get basic functionality to work that i've got running on dozens of other projects.
[05:00:39] gamut: If this is the right venue to talk about that gem...
[05:02:06] gamut: Anyway, so, this is my line in ability.rb: can :read, Auction, aasm_state: "live"
[05:02:33] gamut: And on calling :index, i get <CanCan::AccessDenied: You are not authorized to access this page.
[05:04:19] gamut: and in the controller, after loading the resource: authorize! :read, @auctions
[05:09:05] bga57: has joined #RubyOnRails
[05:11:27] ahrs: has joined #RubyOnRails
[05:18:59] dionysus69: has joined #RubyOnRails
[05:27:28] iamarun: has joined #RubyOnRails
[06:11:50] Exhiled: has joined #RubyOnRails
[06:28:07] Technodrome: has joined #RubyOnRails
[06:34:52] Exhiled: has joined #RubyOnRails
[06:35:04] alfiemax: has joined #RubyOnRails
[06:52:24] dionysus69: has joined #RubyOnRails
[07:03:39] mtkd: has joined #RubyOnRails
[07:05:47] alfiemax: has joined #RubyOnRails
[07:17:38] srinidhi: has joined #RubyOnRails
[07:27:23] iamarun: has joined #RubyOnRails
[07:28:38] conta: has joined #RubyOnRails
[07:28:58] h7br1x: has joined #RubyOnRails
[07:29:42] h7br1x: has joined #RubyOnRails
[07:36:52] h7br1x: Good day everyone, I'm trying to create a field for a hash and I'm not sure the best way to go about it. Here is all the details: https://gist.github.com/ktdmedia/04acd0e5ba64057ea9c4e11dffe03095
[07:36:59] h7br1x: Any suggestions?
[07:39:07] dminuoso: H7br1x: Yes, please use file extensions in gist filenames to enable syntax highlighting.
[07:40:04] h7br1x: dminuoso: My bad! Updated.
[07:40:35] dminuoso: H7br1x: Also that hash at the end seems YAML encoded ;p
[07:40:59] dminuoso: But that aside, Im not sure I understand what kind of UI element you are asking for.
[07:41:35] dminuoso: A multiselect input?
[07:41:44] dminuoso: Or just checkboxews?
[07:42:43] h7br1x: So I'm trying to create field for hour_of_day for each of the days- probably a multiselect. Or checkboxes. Honestly, either one.
[07:42:51] Exhiled: has joined #RubyOnRails
[07:43:10] dminuoso: H7br1x: What does ....hour_of_day give you?
[07:43:24] h7br1x: [9,11,13,14,17]
[07:43:26] dminuoso: An array? An enumerator?
[07:43:32] dminuoso: Or something special?
[07:43:48] h7br1x: Each of the hours in an array.
[07:44:06] dminuoso: H7br1x: In that case you can trivially just generate a tag for each hour.
[07:45:44] h7br1x: I'm not sure how to go about that...
[07:47:18] dminuoso: H7br1x: You can just generate raw <label><input type="checkbox" name="schedule[<%= hour %>]" > ... </label> labels if you want
[07:47:21] dminuoso: Or those weird magic tag builders.
[07:49:25] h7br1x: So the schedule is a field of @calendar so I'm trying to set the schedule inside of a simple_form_for @calendar currently. If the schedule was it's own record, I think I could accomplish that, but I'm getting stuck on how to do it with it being a field on the @calendar record.
[07:50:04] dminuoso: H7br1x: I dont understand.
[07:51:46] dminuoso: H7br1x: If things get special in form construction (i.e. when you stop just collecting input fields for model attributes), just generate input tags from hand. It lets you trivially control how params get passed back on submit.
[07:51:51] h7br1x: I added an example of my form to the gist... but I don't understand how to create the fields for the schedule because the schedule isn't a model it's just a field of @calendar.
[07:52:08] dminuoso: H7br1x: Oh I see.
[07:52:26] dminuoso: H7br1x: What you can do for ease, is hack an attr_accessor :schedule into your calendar model.
[07:52:56] dminuoso: That allows simple_form to play nice.
[07:53:10] dminuoso: Or just dont pass a model instance in the first place and take control over your application.
[07:53:38] h7br1x: I haven't worked with attr_accessor before, I'll give it a google.
[07:59:00] h7br1x: Alright, so I think I get it.. essentially it takes @calendar.schedule and turns the schedule into it's own instance variable, right?
[08:12:30] h7br1x: dminuoso: Okay, so I tried to use attr_accessor on :schedule and it returns @schedule as nil. Would you please be able to explain how I should proceed?
[08:17:43] alfiemax_: has joined #RubyOnRails
[08:23:53] shantanoo: has joined #RubyOnRails
[08:25:35] Dimik: has joined #RubyOnRails
[08:26:09] dionysus69: I have this in paypal.rb https://gist.github.com/anonymous/958c2f9d690c6110d9a2bd0da8847746
[08:26:23] dionysus69: but I still get these messages in paypal.log file in production
[08:26:36] dionysus69: WARN -- : DEBUG log level not allowed in sandbox mode for security of confidential information. Changing log level to INFO
[08:26:51] dionysus69: I get 3 of those messages every minute
[08:27:19] dionysus69: I have a 3 cron jobs running every minute running rake tasks, do the rake tasks not pick up the correct env?
[08:28:10] shantanoo: hi, is it possible to read routes from DB?
[08:28:47] iamarun: has joined #RubyOnRails
[08:29:04] dionysus69: routes arent saved in db though shantanoo
[08:29:47] iamarun: has joined #RubyOnRails
[08:31:42] shantanoo: dionysus69: i was thinking of something like --- table with column type, url, to. rows ("get", "mycontroller/show", "mycontroller#show")
[08:32:44] shantanoo: rather i would like to have function/class/lambda for 'to:' in routes.rb.
[08:32:52] dionysus69: anyways, why would you want that, do you generate new routes in the application, and they arent depended on a model/:id?
[08:33:30] shantanoo: dionysus69: yes.
[08:33:51] dionysus69: ye, don't know, never did it myself
[08:35:38] shantanoo: name "mycontroller#show" itself is dynamic. another way to look at it would be if user1 is logged in, "mycontroller/show" should point to "user1_mycontroller#show" and for user2, "user2_mycontroller#show"
[08:36:24] shantanoo: is it possible?
[08:38:46] shantanoo: get "mycontroller", to: lambda {|x| "mycontroller#show"} <--- tried this, but it didn't work
[08:41:06] shantanoo: https://www.evernote.com/l/AAjxQc-QMDZOOqIMQ5ZKc1WqeJsYsqCpJxo
[08:41:37] ur5us: has joined #RubyOnRails
[08:55:52] defsdoor: has joined #RubyOnRails
[09:21:54] simmerz: has joined #RubyOnRails
[09:30:08] ams__: has joined #RubyOnRails
[09:36:20] dionysus69: why was Page Caching removed from Rails?
[09:49:51] ShalokShalom: has joined #RubyOnRails
[09:56:46] phansch: has joined #RubyOnRails
[10:00:41] phansch: hi, on Rails 5.0, is there any way to stop the request logger from logging the IP? Other than replacing the entire middleware or monkeypatching the Rack::Logger?
[10:06:20] MrCrackPotBuilde: has joined #RubyOnRails
[10:11:02] dminuoso: phansch: Nope. That's it basically
[10:13:40] phansch: dminuoso: alright, just wanted to confirm. thanks!
[10:19:56] sevenseacat: has joined #RubyOnRails
[10:20:58] dminuoso: phansch: You could insert an additional middleware.
[10:21:05] dminuoso: phansch: One that fiddles with request.ip
[10:21:23] dminuoso: That would at least allow you to leave it alone, but at that moment its much saner if you just create your own logger middleware.
[10:21:29] dminuoso: (Because you seem to have a need to need custom logging anyway)
[10:23:16] ShalokShalom_: has joined #RubyOnRails
[10:24:59] apofis: has joined #RubyOnRails
[10:25:01] phansch: adding an extra middleware that filters the IP seems nice! all I want to do is filter out the IP, similar to how passwords are filtered in the logs. Replacing the middleware seems a bit overkill.
[10:25:47] dminuoso: phansch: Its a really small middleware.
[10:25:52] dminuoso: phansch: https://github.com/rails/rails/blob/master/railties/lib/rails/rack/logger.rb
[10:26:02] dminuoso: You could just copy + paste it, modify, and then replace the middleware.
[10:27:33] dminuoso: But yeah, just filtering the ip from the env hash is definitely an option.
[10:37:34] Ergo: has joined #RubyOnRails
[10:38:03] Kutakizukari: has joined #RubyOnRails
[10:42:36] phansch: dminuoso: I went with the extra middleware, thanks :) It's as simple as 'env['REMOTE_ADDR'].gsub!(/\d/, '*'); @app.call(env)'
[10:43:00] gregf_: has joined #RubyOnRails
[10:43:37] dminuoso: phansch: based on your name, your intent, I'd say you are trying to adhere to the legal situation in Germany, which disallows logging of IP addresses. Would I be correct with this shot in the dark?
[10:43:56] phansch: yes, you're right :)
[11:05:27] drale2k_: has joined #RubyOnRails
[11:07:29] simmerz: has joined #RubyOnRails
[11:24:41] Kutakizukari: has joined #RubyOnRails
[11:27:31] jottr: has joined #RubyOnRails
[11:43:03] Technodrome: has joined #RubyOnRails
[11:46:38] ferr: has joined #RubyOnRails
[11:47:27] ferr: has left #RubyOnRails: ()
[12:10:40] dionysus69: render :status => 404 or raise ActionController::RoutingError.new('Not Found')?
[12:15:31] shantanoo: dionysus69: finalised using redirect_to for now.
[12:25:17] tcopeland: has joined #RubyOnRails
[12:32:46] mostlybadfly: has joined #RubyOnRails
[12:35:39] truenito: has joined #RubyOnRails
[12:45:22] gamut: has joined #RubyOnRails
[12:50:57] gamut: has joined #RubyOnRails
[12:57:44] gamut: has joined #RubyOnRails
[13:01:44] gamut: Hi all, can someone please help me a little with cancancan?  I'm at one of those places where I can't even get basic functionality to work that i've got running on dozens of other projects.
[13:01:59] gamut: If so, this is my line in ability.rb: can :read, Auction, aasm_state: "live"
[13:02:37] gamut: On calling auctions#index I get: <CanCan::AccessDenied: You are not authorized to access this page.
[13:02:51] gamut: In the controller, after loading the resource: authorize! :read, @auctions
[13:02:59] gamut: If I just use load_resource, then i get the right scope.
[13:03:42] gamut: But if i use load_and_authorize_resource, then i get that accessdenied error
[13:09:23] jottr: has joined #RubyOnRails
[13:09:52] dionysus69: I'd switch to pundit, less magic more control
[13:27:19] keegnotrub: has joined #RubyOnRails
[13:32:57] marr: has joined #RubyOnRails
[13:39:28] marr: has joined #RubyOnRails
[13:48:10] Technodrome: has joined #RubyOnRails
[13:49:10] jphase: has joined #RubyOnRails
[13:50:09] jphase: has joined #RubyOnRails
[14:09:37] tcopeland: has joined #RubyOnRails
[14:31:18] gamut: has joined #RubyOnRails
[14:31:34] jottr: has joined #RubyOnRails
[14:34:47] gamut: @dionysus69 Thank you. I'll look into it
[14:45:19] iamarun: has joined #RubyOnRails
[14:51:01] petto: has joined #RubyOnRails
[14:58:33] one_zero: has joined #RubyOnRails
[15:00:43] apparition: has joined #RubyOnRails
[15:01:31] LateralOctober: has joined #RubyOnRails
[15:08:03] ccooke: has joined #RubyOnRails
[15:09:40] aScottishBoat: has joined #RubyOnRails
[15:10:49] jottr: has joined #RubyOnRails
[15:14:00] aScottishBoat: Hey guys. I'm trying to figure out how to connect to a running rails app from a GCE VM.
[15:15:33] orbyt_: has joined #RubyOnRails
[15:15:42] aScottishBoat: I think I'd want `rails server -b 0.0.0.0 -p 80` but it gives me `sudo: rails: command not found`
[15:16:04] iamarun: has joined #RubyOnRails
[15:29:00] dionysus69: has joined #RubyOnRails
[15:30:09] Technodrome: has joined #RubyOnRails
[15:31:22] gamut: has joined #RubyOnRails
[15:34:57] moei: has joined #RubyOnRails
[15:35:29] aScottishBoat: https://gist.github.com/naltun/116ffaf8aa4c18ff42fc95d55429035a Puma -> binding gives me Permission Denied
[15:36:57] aScottishBoat: nvm got it. Can't run it on port 80
[15:56:10] fryguy: aScottishBoat: you can't run on ports <= 1024 without special permissions (usually root)
[15:57:00] srkska: has joined #RubyOnRails
[15:58:17] aScottishBoat: fryguy: Yeah, I just learned about privileged ports. Didn't fully understand the concept. Now I do.
[15:58:34] aScottishBoat: Works like a charm when port > 1024
[16:02:21] nogic: has joined #RubyOnRails
[16:02:46] solars: has joined #RubyOnRails
[16:03:27] solars: hi, quick question: I'm not getting any types (integer, etc), only strings with ActiveRecord::Base.connection.exec_query(query.to_sql) - how can I change it so types are automatically inferred?
[16:08:06] truenito: has joined #RubyOnRails
[16:16:56] gregf_: has joined #RubyOnRails
[16:19:50] cagomez: has joined #RubyOnRails
[16:36:47] marr: has joined #RubyOnRails
[16:41:23] truenito: has joined #RubyOnRails
[16:43:03] ccooke: has left #RubyOnRails: ()
[16:44:40] tycoon177: are routes always matched to the first match in the routes.rb file? we are wanting to move the ability to have our custom cms pages from /pages/:name to just /:name but worry about route conflicts
[16:55:24] mustmodify: has joined #RubyOnRails
[16:56:05] mustmodify: I need to know how long a certain worker typically takes. I'd like a chart. I have newrelic free and rails 3.2.x. Should I ...
[16:56:19] mustmodify: I could log the results, I could ship them to newrelic...
[16:56:28] mustmodify: I have google analytics, maybe I could do something with that.
[16:56:51] mustmodify: or I could just spit the numbers into a logfile and do the analysis myself.
[16:58:38] DylanJ: newrelic free should be good enough so long as you dont need the history past 30 days or whatever their limit is.
[16:58:42] DylanJ: been a while since i used newrelic.
[17:00:14] mustmodify: ok, well then I need to figure out if NewRelic will ... like ... do anything with that data, and what it'll do.
[17:03:20] troys: has joined #RubyOnRails
[17:03:57] DylanJ: if your worker is sidekiq or delayed jobs it's automagic with newrelic.
[17:04:13] DylanJ: if its something else, you can add custom instrumentation around the worker.
[17:04:35] DylanJ: custom intrumentation being a "thing" in new relic if you haven't come across it before.
[17:07:08] mustmodify: Oh... I hadn't thought about NewRelic having pre-built tools for resque.
[17:07:14] mustmodify: good thought, thanks.
[17:08:08] DylanJ: mustmodify: i'm not sure about redis specifically, maybe. but "sidekiq" https://docs.newrelic.com/docs/agents/ruby-agent/background-jobs/sidekiq-instrumentation
[17:14:00] truenito: has joined #RubyOnRails
[17:14:18] jottr: has joined #RubyOnRails
[17:30:48] DrYockel: has joined #RubyOnRails
[17:33:24] Exhiled: has joined #RubyOnRails
[17:48:27] ule: Hey guys.. I'm trying to create some procedures via rake tasks.
[17:48:42] ule: When I use: ActiveRecord::Base.connection.execute(query) it complains about my .sql having bad syntax
[17:49:16] ule: so running via: sh "mysql -u .. < myfile.sql" works but of course I need to pass the password via "command line" so it complains as well
[17:49:21] ule: how would you do this?
[17:49:43] ule: I have the latest mysql2 gem by the way
[17:53:14] ule: zZzZz :/
[17:56:38] dblessing: has joined #RubyOnRails
[18:11:23] mustmodify: has left #RubyOnRails: ()
[18:16:31] orbyt_: has joined #RubyOnRails
[18:21:39] simmerz: has joined #RubyOnRails
[18:26:33] Exhiled: has joined #RubyOnRails
[18:34:23] Dimik: has joined #RubyOnRails
[18:41:09] uksio: has joined #RubyOnRails
[18:43:01] Exhiled: has joined #RubyOnRails
[18:50:22] kies: has joined #RubyOnRails
[18:53:17] xco: has joined #RubyOnRails
[18:53:38] xco: hi, can someone help with this? https://gist.github.com/xcobar/b21dd97ea652ea884a0c08b1887f803c
[18:53:55] andrew91841: has joined #RubyOnRails
[18:55:04] xco: i thought of defining a method in the User model like say def self.atts; [“name”, “surname”]; end but im’ thinking there might be a better way. So with this method i’d do csv << User.atts
[18:55:37] dviola: has joined #RubyOnRails
[18:58:05] gamut: has joined #RubyOnRails
[19:01:20] guacamole: has joined #RubyOnRails
[19:02:07] alfiemax: has joined #RubyOnRails
[19:06:47] dminuoso: Curious. When you folks write integration tests, how much of your UI do you test? If you have a search mask, do you test every input field for correctness?
[19:07:47] dminuoso: xco: In my opinion the problem lies in the lack of view models.
[19:09:10] dminuoso: xco: You can do: User.attribute_names - [:country]
[19:09:32] dminuoso: Or be explicit..
[19:09:39] dminuoso: csv << [:name, :surname]
[19:09:49] xco: dminuoso: yeah, but if there are 400 attribute names i don’t want?
[19:09:56] dminuoso: dminuoso | xco: You can do: User.attribute_names - [:country]
[19:10:08] xco: maybe this will be best csv << [:name, :surname]
[19:10:26] dminuoso: xco: Anything else will just randomly break whenever you change your model.
[19:10:31] dminuoso: (Unless you cover this in a test)
[19:20:05] baweaver: dminuoso: Unit - Test in isolation; Integration: Test how a component works as a whole; Acceptance - Test user workflows
[19:20:10] baweaver: that's typically my definition of it
[19:20:29] ur5us: has joined #RubyOnRails
[19:20:33] baweaver: So you may test one of the inputs as an individual component
[19:20:47] baweaver: and the acceptance criteria is that it searches something
[19:21:33] baweaver: Header should only be those attributes (name, surname, etc)
[19:22:06] baweaver: Then User.pluck(:name, :surname, :etc).map { |row| row.join(',') }
[19:22:16] baweaver: ah, CSV lib
[19:22:25] baweaver: still use pluck and just each the thing
[19:24:43] kies: has joined #RubyOnRails
[19:31:39] xco: has joined #RubyOnRails
[19:42:51] fourcolors: has joined #RubyOnRails
[19:42:54] dminuoso: baweaver: So what about search forms then?
[19:43:13] dminuoso: How can you test a search form as a whole, without testing each input field separately?
[19:43:32] fourcolors: Hey, so I keep getting this `net::ERR_ABORTED` error when trying to load my fonts
[19:43:44] fourcolors: I'm using scss and have something like this to import my fonts
[19:43:56] baweaver: Integration - Test one field for behavior; Acceptance - Test the high level interaction a user may have
[19:43:57] dminuoso: fourcolors: Have you checked https://github.com/GoogleChrome/lighthouse/issues/2784 ?
[19:44:14] dminuoso: baweaver: Oh fine. Then assume we are talking about acceptance tests.
[19:44:44] baweaver: As a User I put text in the search, click go, and get results
[19:44:45] baweaver: pretty much that
[19:44:55] baweaver: no point in testing the individual fields except to give them input
[19:44:55] dminuoso: baweaver: So you test every single input?
[19:45:02] fourcolors: @dminuoso I haven't yet
[19:45:07] dminuoso: baweaver: mmm. k
[19:45:24] baweaver: Acceptance cares as much about the implementation as your user might
[19:45:30] dminuoso: baweaver: I just have a lot of search masks that filter based on various attributes since we have a very CRUD heavy scenario
[19:45:57] dminuoso: Im gonna make higher oder tests, so I dont have to stupidly test for every input field manually..
[19:46:09] baweaver: Might make a few scenarios
[19:46:12] dminuoso: Dibs on the name: HOTs.
[19:46:44] baweaver: but as long as you can prove one input works you can extrapolate from there
[19:46:48] dminuoso: baweaver: Well the user cares about each "filter" working as expected.
[19:47:05] baweaver: dminuoso: Screenshot me later on that and I'll make sure what I said makes sense given the context
[19:47:09] baweaver: about to head for lunch
[19:47:12] dminuoso: baweaver: Considering that Im lazy and use ransack, its reasonable to assume that at some point Im gonna change/modify things so that the ransacker names dont match anymor
[19:48:03] baweaver: welcome to acceptance testing hell
[19:48:15] mikecmpbll: has joined #RubyOnRails
[19:49:12] baweaver: the best hack I have is to use data attributes or specialty class names like x-name-input
[19:49:57] dminuoso: baweaver: What do you mean?
[19:50:17] baweaver: class="... x-name-input"
[19:50:25] dminuoso: baweaver: Right now Im thinking about something along those lines: https://gist.github.com/dminuoso/92297bbe8d7db7f042f35e7d44437a2b
[19:50:45] baweaver: fillIn('.x-name-input')
[19:50:46] baweaver: be back in a bit
[19:55:31] weaksauce: has joined #RubyOnRails
[19:58:06] ur5us: has joined #RubyOnRails
[20:26:16] guacamole: has joined #RubyOnRails
[20:33:14] DTZUZO: has joined #RubyOnRails
[20:44:16] xco_: has joined #RubyOnRails
[20:50:13] Cache_Money: has joined #RubyOnRails
[20:52:42] orbyt_: has joined #RubyOnRails
[20:59:42] Papierkorb: has left #RubyOnRails: ("Konversation terminated!")
[21:01:23] tycoon177: dminuoso: do you compile your assets in your alpine container or before you build the docker image?
[21:06:20] bga57: has joined #RubyOnRails
[21:09:18] xco_: i’m readoing rails guides on ActinoMailer and i saw this https://gist.github.com/xcobar/916e5a885927c609bfef2bf2bff312ae#file-why-rb-L3
[21:09:35] xco_: why is he using Proc? couldn’t he just have done Admin.pluck(:email)?
[21:11:13] tycoon177: xco_: i believe that procs will be rerun when used
[21:12:02] xco_: what does “rerun” mean here. what will be the case for a “rerun”?
[21:12:33] tycoon177: hold on, i'm testing my thought process to make sure i'm not misleading you
[21:12:44] xco_: ok no worries
[21:13:54] dminuoso: tycoon177: So lets say you start up the rails application. It loads the constant, when doing that it fetches all admins. Great.
[21:14:29] dminuoso: tycoon177: Now you add another admin through the web interface. That admin will not be in that default list, because it was set when the constant was loaded.
[21:14:50] tycoon177: dminuoso: i was trying to get to that with an example using DateTime as a reference :)
[21:14:59] dminuoso: tycoon177: By wrapping it in a proc (they should have used proc{} by the way, or a stabby lambda), it ensures that its executed whenever the default is requested.
[21:15:24] dminuoso: tycoon177: pardon me.
[21:15:56] tycoon177: no, you're perfectly fine! I was just going to setup an example where xco_ could go into a rails console and see it working
[21:17:05] tycoon177: but your example was much more relevant and straight forward
[21:17:49] tycoon177: dminuoso: one more question and i'll be out of your hair about docker, permanently! :) do you run nginx or apache for static files or do you just run puma in your container and let rails serve the static assets?
[21:18:13] xco_: oooooooo so the job of the Proc there is to rerun Admin.pluck(..) in case we have new admins?
[21:18:36] tycoon177: dminuoso: i rebuilt the container with alpine and without cleaning up my apk installs, it's already under half of the original size! ty for the suggestion
[21:18:45] dminuoso: tycoon177: And it wasnt a problem, was it?
[21:18:56] tycoon177: not as bad as i initially thought it would be
[21:18:58] dminuoso: Apart from just installing dev dependencies (figuring out just takes a little work), it should work out of the box,.
[21:18:59] xco_: sweet! all clear. thanks tycoon and dminuoso
[21:19:11] dminuoso: tycoon177: That's great to hear. :)
[21:19:21] tycoon177: ty for the motivation :P
[21:19:59] dminuoso: tycoon177: In reality our setup is a bit more complicated though. We have multiple docker containers, one runs nginx and acts as a reverse proxies for multiple other docker containers.
[21:20:26] tycoon177: we are using apache on bare metal acting as a reverse proxy for 1 docker container so far
[21:20:43] atrius: has joined #RubyOnRails
[21:20:51] dminuoso: Bare metal?
[21:21:08] dminuoso: I do not think you mean that.
[21:21:24] dminuoso: Unless there's a bare metal build of apache that Im not aware of.
[21:22:19] dminuoso: tycoon177: Bare metal means running directly on hardware without a kernel.
[21:23:29] cagomez: has joined #RubyOnRails
[21:25:05] tycoon177: i meant directly on a server software lol
[21:25:13] tycoon177: i have apache on ubuntu on bare metal :p
[21:29:24] mostlybadfly: has joined #RubyOnRails
[21:32:57] simmerz: has joined #RubyOnRails
[21:33:34] lupine: Since VMs, bare metal has meant without VMs
[21:33:43] lupine: And that's been a while
[21:34:50] lupine: Yo simmerz
[21:35:39] dminuoso: lupine: I've written some kernels, so I've been around people doing low level development - that's what Im used to. :)
[21:36:00] lupine: Strokes and folks
[21:38:18] lupine: Certainly on today's world, it's more likely to refer to not-vm-or-container than the wonders of ring0
[21:39:02] dminuoso: lupine: You are scaring me right now.
[21:39:34] lupine: I didn't make this world. I just report on it
[21:39:48] dminuoso: If this is my perspective already, I might be one of those completely from the past "Use a real programming language like LISP" kind of people.
[21:39:57] lupine: Yeah, me too :-D
[21:39:58] dminuoso: In 30 years.
[21:40:20] lupine: Although the last time I wrote a kernel I was still using gasm
[21:40:51] dminuoso: Mine was written almost entirely in C++. :)
[21:41:01] dminuoso: My last one anyway.
[21:41:13] lupine: TBH that's worse
[21:41:58] dminuoso: lupine: It offers the right abstractions, in retrospect I should have written it in something even more fancy like Rust or perhaps OCaml.
[21:42:11] dminuoso: It's metric tons better than C.
[21:42:16] dminuoso: For the job.
[21:42:27] lupine: They've gotten to you, I see :-/
[21:45:37] dminuoso: lupine: If I keep on track, Ill write one in Haskell in a few years perhaps.
[21:46:40] orbyt_: has joined #RubyOnRails
[21:52:13] tycoon177: i'd like to eventually learn about low level programming like writing a kernel and stuff
[21:54:29] tycoon177: dminuoso: after removing build dependencies, my image was ~41% the size of my initial attempt with a ubuntu base image :o (i still have yet to install nginx for asset serving, however)
[22:00:18] dminuoso: tycoon177: Its useful if only to gain intuition about how programs work. A lot of the ideas about how CPUs operate are incorporated in MRI too by the way. :)
[22:00:45] dminuoso: Ruby itself uses a virtual machine that is quite similar to how CPUs operate.
[22:01:02] tycoon177: i might take a look at the code when i get a chance :)
[22:01:31] dminuoso: tycoon177: If you do, get `Ruby under a microscope` (the book is slightly dated, but still very good)
[22:01:51] tycoon177: ty for the suggestion :D
[22:13:41] xco: has joined #RubyOnRails
[22:24:03] FrostCandy: has joined #RubyOnRails
[22:37:38] weaksauce: has joined #RubyOnRails
[22:46:09] xco: has joined #RubyOnRails
[22:46:29] mr-spoon: has joined #RubyOnRails
[23:37:53] cagomez: has joined #RubyOnRails
[23:40:18] blackmesa: has joined #RubyOnRails
[23:49:23] bronson_: has joined #RubyOnRails
[23:59:28] ur5us: has joined #RubyOnRails