« Back to channel list

#RubyOnRails - 23 October 2017

« Back 1 day Forward 1 day »
[00:00:38] jrabe: has joined #RubyOnRails
[00:06:15] Ropeney: has joined #RubyOnRails
[00:06:24] harryk_: has joined #RubyOnRails
[00:07:14] one_zero: has joined #RubyOnRails
[00:15:02] quazimodo: has joined #RubyOnRails
[00:15:37] Technodrome: has joined #RubyOnRails
[00:16:37] idefine: has joined #RubyOnRails
[00:21:11] harryv: has joined #RubyOnRails
[00:25:35] jphase: has joined #RubyOnRails
[00:28:21] jphase_: has joined #RubyOnRails
[00:29:52] jphase__: has joined #RubyOnRails
[00:31:26] jphase: has joined #RubyOnRails
[00:32:53] jphase___: has joined #RubyOnRails
[00:34:26] jphase_: has joined #RubyOnRails
[00:35:50] jphase: has joined #RubyOnRails
[00:47:11] harryv: has joined #RubyOnRails
[00:55:42] cam27: has joined #RubyOnRails
[01:22:30] jphase: has joined #RubyOnRails
[01:26:01] jphase_: has joined #RubyOnRails
[01:27:30] jphase: has joined #RubyOnRails
[01:29:02] jphase__: has joined #RubyOnRails
[01:35:22] apparition: has joined #RubyOnRails
[01:57:03] workmad3: has joined #RubyOnRails
[02:03:47] sevenseacat: has joined #RubyOnRails
[03:09:37] jphase: has joined #RubyOnRails
[03:11:39] dionysus69: has joined #RubyOnRails
[03:24:41] Saukk: has joined #RubyOnRails
[03:42:32] alfiemax: has joined #RubyOnRails
[03:45:52] Ropeney: has joined #RubyOnRails
[03:47:58] Technodrome: has joined #RubyOnRails
[03:52:50] Cache_Money: has joined #RubyOnRails
[04:00:37] Rodya_: has joined #RubyOnRails
[04:03:03] cam27: has joined #RubyOnRails
[04:06:04] srinidhi: has joined #RubyOnRails
[04:39:05] DTZUZO: has joined #RubyOnRails
[04:57:09] workmad3: has joined #RubyOnRails
[05:05:48] bruno-: has joined #RubyOnRails
[05:07:45] uksio: has joined #RubyOnRails
[05:29:57] alfiemax: has joined #RubyOnRails
[05:31:06] Technodrome: has joined #RubyOnRails
[05:32:09] alfiemax: has joined #RubyOnRails
[06:03:14] dminuoso: !goodmorning
[06:03:14] helpa: おはよう ございます
[06:07:13] snickers: has joined #RubyOnRails
[06:08:35] aperkins81: afternoon :)
[06:19:09] Rodya_: has joined #RubyOnRails
[06:23:12] mikeyhew: has joined #RubyOnRails
[06:23:49] conta: has joined #RubyOnRails
[06:24:52] mikeyhew: How can I run a specific test method with `rake test`? Assuming `ActiveSupport::TestCase`
[06:25:29] dionysus69: has joined #RubyOnRails
[06:28:04] matthewd: mikeyhew: `rake test TEST=test/some_test.rb TESTOPT="-n test_foo"` should work, I think?
[06:28:54] matthewd: On newer Rails, it's `rails test test/some_test.rb:123` or (maybe?) `rails test test/some_test.rb -n test_foo`
[06:28:55] hammer065: has joined #RubyOnRails
[06:30:07] dminuoso: matthewd: Thank you for your input the other day regarding those inexplicable delays in TTFB if you recall. Helped me a bunch.
[06:31:32] matthewd: dminuoso: No worries! I recall the problem, but not a conclusion.. what did it turn out to be?
[06:32:13] dminuoso: matthewd: Webpacker. Turns out the middleware transparently would try to detect if the webpack dev server was running on each request, with a timeout of 1000ms.
[06:32:45] dminuoso: Something that was already addressed (by making it both configurable and default to 100ms rather).
[06:32:45] matthewd: Ohh, right. Yeah. :/
[06:33:44] dminuoso: matthewd: Would I be correct in assuming, that all the actioncable magic does not through rack?
[06:34:20] dminuoso: I mean the rack middlewares seem to work, it looks like streaming would be impossible if there's a single middleware that does not behave.
[06:34:47] dminuoso: ACTION a verb there
[06:34:55] matthewd: The initial request passes through rack, but then the connection gets hijacked instead of sending a normal response
[06:35:36] mikeyhew: matthewd: I'm not in a rails app, so a `rake` command will have to do. With `-n test_foo` it says it can't find a file with the name "test_foo"...
[06:36:59] dminuoso: matthewd: Yeah that's a shame. At times I wish I could trivially stream from regular controllers. :(
[06:36:59] matthewd: ACTION checks the sign on the front door
[06:37:18] matthewd: dminuoso: ActionController::Live ?
[06:37:21] sevenseacat: yep, it still says #rubyonrails
[06:37:46] dminuoso: matthewd: amazing, thank you.
[06:38:54] matthewd: mikeyhew: Do you actually need rake involved? The real way to do it is `ruby -Itest test/some_test.rb -n test_foo`
[06:39:42] Hexafox[I]: has joined #RubyOnRails
[06:40:28] mikeyhew: matthewd: that did it, thanks!
[06:55:32] srinidhi: has joined #RubyOnRails
[06:57:53] workmad3: has joined #RubyOnRails
[07:01:50] Rodya_: has joined #RubyOnRails
[07:02:26] rgr: has joined #RubyOnRails
[07:09:59] Rodya_: has joined #RubyOnRails
[07:14:23] one_zero: has joined #RubyOnRails
[07:26:16] Jameser: has joined #RubyOnRails
[07:36:27] kapil___: has joined #RubyOnRails
[07:56:52] mikecmpbll: has joined #RubyOnRails
[08:01:37] blackmesa1: has joined #RubyOnRails
[08:06:13] Ergo: has joined #RubyOnRails
[08:18:19] quazimodo: has joined #RubyOnRails
[08:28:40] Ropeney: has joined #RubyOnRails
[08:31:41] dionysus69: has joined #RubyOnRails
[08:53:52] apparition: has joined #RubyOnRails
[08:55:15] lxsameer: has joined #RubyOnRails
[08:58:27] workmad3: has joined #RubyOnRails
[09:04:00] workmad3: has joined #RubyOnRails
[09:25:30] Hexafox[I]: has joined #RubyOnRails
[09:29:58] migg: has joined #RubyOnRails
[09:33:21] DrYockel: has joined #RubyOnRails
[09:38:15] blackmesa1: has joined #RubyOnRails
[09:40:06] marr: has joined #RubyOnRails
[09:44:25] srinidhi: has joined #RubyOnRails
[10:17:10] alfiemax: has joined #RubyOnRails
[10:40:09] lubekpl: has joined #RubyOnRails
[10:40:40] lubekpl: has left #RubyOnRails: ()
[10:40:59] lubekpl: has joined #RubyOnRails
[10:42:54] lxsameer: hey folks, I have two exactly the same controller spec but the second one return 404 , how can i debug this ?
[10:44:06] dminuoso: lxsameer: It implies that either you have tests running concurrently with mutable state, or you don't properly clean up after tests.
[10:44:46] lxsameer: dminuoso: hmm, but why 404 ? the endpoint is there and I don't have any logic to return 404 manually
[10:46:02] blackmesa1: has joined #RubyOnRails
[10:46:24] Fernando-Basso: has joined #RubyOnRails
[10:54:28] apparition: has joined #RubyOnRails
[10:55:38] one_zero: has joined #RubyOnRails
[11:04:18] S007: has joined #RubyOnRails
[11:11:43] alfiemax: has joined #RubyOnRails
[11:37:03] fmcgeough: has joined #RubyOnRails
[11:45:25] dminuoso: lxsameer: Show us your tests.
[11:46:12] lxsameer: dminuoso: found the problem buddy, thanks a lot
[11:46:25] dminuoso: lxsameer: Mind telling what the issue was?
[11:48:11] lxsameer: dminuoso: yeah, I'm using a gem ( which authored in the company ), that gem rescue from an specific exception in controllers to 404
[11:48:13] tcopeland: has joined #RubyOnRails
[11:48:17] lubekpl: has joined #RubyOnRails
[11:51:24] dminuoso: lxsameer: Ah yeah. Rails has this behavior out of the box for the ActiveRecord::RecordNotFound exception for example.
[11:51:42] dminuoso: Or at least is used for.
[11:52:18] Hexafox[I]: has joined #RubyOnRails
[11:52:19] lxsameer: dminuoso: I never liked implicit stuff like this in big projects, It usually cause headache for the next dev
[11:52:32] dminuoso: lxsameer: Fully agreed.
[11:58:06] drale2k_: has joined #RubyOnRails
[11:59:36] srinidhi: has joined #RubyOnRails
[12:00:58] drale2k_: Not sure how to structure this. I am creating a feature called "Jobs" where i can start some jobs. Now i will have like 10 different kinds of jobs but they all have in common that they are jobs. They will all use the same model. Now i am not sure how to structure the controller and routes for this
[12:01:29] drale2k_: Should i have 1 "Jobs" controller and then have if statements to distinguish between the different kinds of jobs and show the propper UI or should i have 1 controller per job
[12:01:44] mikecmpbll: that depends on a lot of things which aren't apparent your description.
[12:02:25] drale2k_: i will start the jobs by having a dropdown and then clicking on the job i want to create, That will redirect to the job's controller
[12:02:34] mikecmpbll: how different is the UI? how different is the behaviour? (pretty much same question)
[12:03:00] drale2k_: it can be very different. That's why i would like to have different controllers
[12:03:22] drale2k_: but i would like to nest them in a sub-folder "jobs", not sure how to do that and have the proper routes
[12:04:04] drale2k_: currently i have the following routes nested https://gist.github.com/drale2k/35568250afc4f510eb19f125e2f86cb6
[12:04:21] drale2k_: so Jobs is nested under Agents, because an Agent has many jobs
[12:07:10] mello: has joined #RubyOnRails
[12:07:12] mikecmpbll: will you have separate models for the different job types?
[12:08:36] drale2k_: mikecmpbll: no same model
[12:08:43] drale2k_: the custom data i am storing as jsonb
[12:09:58] frojnd: How can I catch `Errno::ECONNREFUSED - Connection refused - connect(2) for "localhost" port 3000:` server down error when calling get requests? Right now I just see 500 error in javascript console and `Completed 500 Internal Server Error in 13ms (ActiveRecord: 0.5ms)` in rails log... but in this case I would like to return some sortf or string because right now I get nul
[12:10:00] jphase: has joined #RubyOnRails
[12:10:00] drale2k_: if i wanted to have a subfolder like controllers/jobs/somejob_controller.rb, how would i go about the routes ?
[12:11:05] frojnd: Problem is that the moment I call HTTParty.get(...) And I get that error I can't catch response.code since response is nul
[12:11:06] drale2k_: frojnd: i guess "rescue Errno::ECONNREFUSED" ..
[12:11:08] mikecmpbll: you'd use `namespace :jobs`
[12:11:38] drale2k_: mikecmpbll: nested under agent ?
[12:11:51] mikecmpbll: drale2k_ : yep can do
[12:12:01] drale2k_: k cool will check that out thanks
[12:12:26] frojnd: drale2k_: do I have to wrap HTTParty call within rescue? \
[12:16:54] quazimodo: has joined #RubyOnRails
[12:21:15] jphase: has joined #RubyOnRails
[12:29:24] workmad3: has joined #RubyOnRails
[12:31:32] cousine: has joined #RubyOnRails
[12:37:35] drale2k_: has joined #RubyOnRails
[12:43:16] nikivi: has joined #RubyOnRails
[12:48:08] keegnotrub: has joined #RubyOnRails
[12:48:31] Andr3as: hi guys.. i've a bit of a designing question.. lets say i have a user model which has_many subscriptions and each of that subscription cannot overlap.. so for a given day there is max 1 active subscription... - lets also say there is a model tradeplan which has a date..
[12:48:42] Andr3as: so the user comes and wants to see tradeplans
[12:48:57] Andr3as: but he is only allowed to see those dateplans during he was a subscriber
[12:49:14] ahrs: has joined #RubyOnRails
[12:49:45] Andr3as: aybe he had a subscription from june 1st until 30th and from aug 10th until aug 31st
[12:50:19] Andr3as: so he should get all those tradeplans but not those from aug 1st until aug 9th
[12:50:32] Andr3as: how would you guys approach that?
[12:51:12] drale2k_: has joined #RubyOnRails
[13:11:18] jphase: has joined #RubyOnRails
[13:11:31] pmunt: has joined #RubyOnRails
[13:11:54] GodFather: has joined #RubyOnRails
[13:13:56] lxsameer: has joined #RubyOnRails
[13:14:46] pmunt: has joined #RubyOnRails
[13:16:27] pmunt: has joined #RubyOnRails
[13:25:25] workmad3: has joined #RubyOnRails
[13:29:03] Sigyn: has joined #RubyOnRails
[13:29:58] rgr_: has joined #RubyOnRails
[13:39:51] DTZUZO: has joined #RubyOnRails
[13:41:21] bruno-: has joined #RubyOnRails
[13:43:26] blackmesa1: has joined #RubyOnRails
[13:48:42] alfiemax: has joined #RubyOnRails
[14:02:54] chouhoulis: has joined #RubyOnRails
[14:09:25] dviola: has joined #RubyOnRails
[14:10:46] ResidentBiscuit: has joined #RubyOnRails
[14:13:10] blackmesa1: has joined #RubyOnRails
[14:16:38] roshanavand: has joined #RubyOnRails
[14:22:50] harrycs: has joined #RubyOnRails
[14:24:54] harryv: has joined #RubyOnRails
[14:26:34] drale2k_: has joined #RubyOnRails
[14:34:47] roshanavand: has joined #RubyOnRails
[14:40:58] quazimodo: has joined #RubyOnRails
[14:43:03] snickers: has joined #RubyOnRails
[14:46:59] justrying: has joined #RubyOnRails
[14:51:11] cabotto: has joined #RubyOnRails
[15:01:20] hahuang65: has joined #RubyOnRails
[15:03:47] Skull0Inc: has joined #RubyOnRails
[15:04:13] drale2k_: due to lot of nesting / namepsacing, i have now very long helpers for paths, like operation_agent_jobs_meterpreter
[15:04:28] drale2k_: i would like to just have "meterpreter_jobs_path". Anyway to do this ?
[15:04:53] mikecmpbll: drale2k_ : http://edgeguides.rubyonrails.org/routing.html#naming-routes
[15:06:13] gusrub: has joined #RubyOnRails
[15:07:02] drale2k_: mikecmpbll: thanks, i have set now "resources :meterpreter, as: :meterpreter_jobs" but hwen i run "rails routes" i still only see the long path
[15:07:21] chouhoulis: has joined #RubyOnRails
[15:08:07] conta: has joined #RubyOnRails
[15:09:18] sameerynho: has joined #RubyOnRails
[15:09:48] guacamole: has joined #RubyOnRails
[15:10:46] mikecmpbll: drale2k_ : won't be.
[15:11:06] drale2k_: and walso when i add "as: :meterpreter_jobs" it required my model to be like "Jobs::MeterpreterJob < Jobs" instead of "MeterprterJob < Job"
[15:11:09] mikecmpbll: ah well yeh, it'll contain the nested parts
[15:11:11] mikecmpbll: i see what you mean.
[15:11:32] drale2k_: feels like i am trying to bend rails
[15:11:59] mikecmpbll: and i'm pretty sure `as` has no other affect than changing the helper path so it won't cause your model stuff.
[15:12:06] drale2k_: iam fine with the long urls but i can't get the form to work with "form_with @job"
[15:12:19] mikecmpbll: you need to include the nested resources
[15:12:22] drale2k_: it complains that there is no "meterpreter_jobs_path"
[15:12:46] drale2k_: i checked the doc, is that the "scope" ?
[15:12:47] mikecmpbll: form_with [@operation, @agent, @job]
[15:14:46] drale2k_: "<%= form_with [@operation, @agent, @job] do |form| %>" ... gives "wrong number of arguments (given 1, expected 0)"
[15:15:41] drale2k_: this is my route.rb https://gist.github.com/drale2k/08b7b2e73cf7d729c9f6ae02a232e11d
[15:16:58] jphase: has joined #RubyOnRails
[15:18:40] Saukk: has joined #RubyOnRails
[15:22:26] mikecmpbll: trace would be useful
[15:24:57] drale2k_: https://gist.github.com/drale2k/fba6df5406fa7c5cced285e9ca2d3a8f
[15:25:13] drale2k_: not sure if form_with works like this
[15:26:20] troys: has joined #RubyOnRails
[15:26:45] mikecmpbll: aye, i've not used form_with yet. from docs though looks like it wants `form_with model: @job` or `form_with model: [@operation, @agent, @job]`
[15:27:51] drale2k_: now it is back to complaining about "undefined method `meterpreter_jobs_path' "
[15:28:04] mikecmpbll: which of the above did you use.
[15:28:12] drale2k_: <%= form_with model: [@operation, @agent, @job] do |form| %>
[15:28:19] harryv: has joined #RubyOnRails
[15:30:32] mikecmpbll: docs seem to suggest it should work, idk why it's not.
[15:32:13] drale2k_: when i give it what it wants with "as: :meterpreter_jobs"
[15:32:27] mikecmpbll: nah, don't do that.
[15:32:29] Technodrome: has joined #RubyOnRails
[15:32:30] drale2k_: i get "Unable to autoload constant Jobs::MeterpreterJob, expected /Users/drale2k/Dropbox/htdocs/work/dsirf/subzero/subzero_rails/app/models/jobs/meterpreter_job.rb to define it" in "@job = MeterpreterJob.new"
[15:32:45] cagomez: has joined #RubyOnRails
[15:33:16] mikecmpbll: i can't see that that's got anything to do with your routes
[15:35:35] mikecmpbll: docs examples show this usage http://api.rubyonrails.org/v5.1/classes/ActionView/Helpers/FormHelper.html#method-i-form_with-label-Examples
[15:35:50] mikecmpbll: <%= form_with(model: [ @document, Comment.new ]) do |form| %>
[15:36:37] alfiemax: has joined #RubyOnRails
[15:37:27] drale2k_: i wonder if it has issues because my model is in models/jobs/meterpreter_job.rb which inherits from models/job.rb using STI
[15:38:11] jottr: has joined #RubyOnRails
[15:39:09] matthewd: drale2k_: Sounds like you may have several overlapping problems in play. Find something that's behaving itself, and work slowly forward from there.
[15:40:20] Papierkorb: has left #RubyOnRails: ("Konversation terminated!")
[15:41:51] mikecmpbll: indeed. too many moving parts.
[15:43:09] orbyt_: has joined #RubyOnRails
[15:50:50] gusrub: has joined #RubyOnRails
[15:51:34] drale2k_: think i am just gonna make a break
[15:54:47] quazimodo: has joined #RubyOnRails
[15:55:05] bruno-: has joined #RubyOnRails
[15:55:32] DTZUZO: has joined #RubyOnRails
[15:59:58] gusrub: has joined #RubyOnRails
[16:05:15] harryv: has joined #RubyOnRails
[16:06:14] Technodrome: has joined #RubyOnRails
[16:11:27] bruno-: has joined #RubyOnRails
[16:21:00] guacamole: has joined #RubyOnRails
[16:22:34] orbyt_: has joined #RubyOnRails
[16:23:32] chouhoulis: has joined #RubyOnRails
[16:23:43] gusrub: has joined #RubyOnRails
[16:28:54] guacamole: has joined #RubyOnRails
[16:31:40] guacamole: has joined #RubyOnRails
[16:38:14] someish: has joined #RubyOnRails
[16:38:28] alfiemax: has joined #RubyOnRails
[16:39:58] chouhoulis: has joined #RubyOnRails
[16:45:36] chouhoulis: has joined #RubyOnRails
[16:50:06] chouhoulis: has joined #RubyOnRails
[16:55:41] chouhoulis: has joined #RubyOnRails
[17:00:45] zer0python: has joined #RubyOnRails
[17:02:53] netzfisch: has joined #RubyOnRails
[17:04:55] hahuang65: has joined #RubyOnRails
[17:12:30] ^mtkd: has joined #RubyOnRails
[17:12:52] dionysus69: has joined #RubyOnRails
[17:25:32] cagomez: it it bad practice to create a scope with an ORDER specified inside of it?
[17:25:55] cagomez: that is, besides delivering Foo's where bar = x, you also specify a default Order (like created_at)
[17:32:25] workmad3: cagomez: I'd generally avoid it, because it can cause a bunch of difficulty when trying to compose the scope with joins, etc. included
[17:33:28] blackmesa1: has joined #RubyOnRails
[17:33:37] cagomez: workmad3: ah true, thanks
[17:34:18] jottr: has joined #RubyOnRails
[17:43:33] mikecmpbll: has joined #RubyOnRails
[17:44:39] cagomez: does ORDER BY timestamp imply asc or desc? what's a proper name for a collection sorted by desc timestamps?
[17:57:16] guacamole: has joined #RubyOnRails
[17:57:50] orbyt_: has joined #RubyOnRails
[18:00:02] blackmesa1: has joined #RubyOnRails
[18:04:49] srinidhi: has joined #RubyOnRails
[18:06:04] mtkd: has joined #RubyOnRails
[18:10:11] NL3limin4t0r: has joined #RubyOnRails
[18:11:10] Andr3as: is there a better way to check if a value is within an array than "include?" - or do i need to workaround include if that given value might be NIL?
[18:13:06] nickjj: are you checking for 1 or more nils?
[18:13:37] Andr3as: one nil.. but i just found out include can handle that
[18:13:40] Andr3as: its another issue
[18:13:41] nickjj: because then you can just use .any? , and it'll return true if it finds 1 or more nils
[18:13:44] NL3limin4t0r: Do you mean the Array might be `nil`, or the value you pass to the `#include?` method?
[18:13:47] Andr3as: *different
[18:14:11] Andr3as: i meant that the value i pass into include could be nil, but include is fine with nil
[18:16:49] NL3limin4t0r: As far as I know `#include?` is the best option. It is natively supported by Ruby.
[18:17:18] Andr3as: i see.. thx NL3limin4t0r
[18:20:53] NL3limin4t0r: If you want to check muliple values, you should have a look at the Set class.
[18:21:37] NL3limin4t0r: You can `Set[array_var1].subset?(Set[array_var2])`.
[18:23:56] Technodrome: say I am using devise with an omniauth provider, what is the best way for that omni auth authenticated user to have a local user profile class with additional user information, not on the (service side) ?
[18:28:39] NL3limin4t0r: I can't answer that one for you. Generaly it's never a good idea to store info on the client side, since it can be manipulated. You can do it for conviniance, but still have to validate it on the server to check if no ominous things happend.
[18:39:42] Technodrome: client side would be the rails app in this case
[18:45:55] nogic: has joined #RubyOnRails
[18:48:43] HashNuke: has joined #RubyOnRails
[18:50:06] cagomez: has joined #RubyOnRails
[18:58:05] cagomez: has joined #RubyOnRails
[18:59:57] someish: has joined #RubyOnRails
[19:00:32] harrycs: probably a dumb question, but I'm very new to TDD. Do you create tests for every single controller action?
[19:01:07] frojnd: I have a tile that I've created it with multiple divs and styles... now I would like to make it a link. Can I do it with link_to or in this case a href?
[19:04:19] harrycs: frojnd: i'm not 100% on this, but can't you pass the divs and styles to link_to in the options hash?
[19:05:56] hahuang65: has joined #RubyOnRails
[19:06:35] frojnd: harrycs: I think I found a solution: `<%= link_to path do %> <div class="my-class"> ... </div> <% end %>` seems to wrap my divs with a href
[19:07:59] harrycs: frojnd: oh wow that's awesome, i never would have thought of that
[19:08:36] conta2: has joined #RubyOnRails
[19:15:56] rcdvl: has joined #RubyOnRails
[19:18:48] rcdvl: Hey guys, I'm returning to rails after some years and I'm with some issues while coding my models... It's this the right place to make this kind of questions?
[19:20:55] havenwood: rcdvl: You've come to the right place.
[19:24:04] rcdvl: Nice :) I have a user table and a business table. Users can own many business and belong to many businesses. On the other hand, a business can have many users but belong to only one owner
[19:25:13] rcdvl: How would you do such relation in rails? I thought about using habtm but then a business could also have many owners
[19:26:17] gambl0re: has joined #RubyOnRails
[19:29:57] havenwood: rcdvl: So you might say a business belongs to a user as owner? And then a business has and belongs to many users?
[19:32:31] lupine: Add a separate owners table
[19:32:38] lupine: You'll thank me later
[19:32:46] orbyt_: has joined #RubyOnRails
[19:32:54] rcdvl: Hmm I don't think so... A business has only one owner but has many users. A user has many businesses and belongs to many businesses
[19:33:12] chouhoulis: has joined #RubyOnRails
[19:33:15] sagax: has joined #RubyOnRails
[19:33:45] dionysus69: has joined #RubyOnRails
[19:34:47] kies: has joined #RubyOnRails
[19:35:23] marr: has joined #RubyOnRails
[19:36:31] hahuang65: has joined #RubyOnRails
[19:40:53] cagomez: has joined #RubyOnRails
[19:41:00] rcdvl: has joined #RubyOnRails
[19:41:11] rcdvl: Sorry, got connected
[19:41:21] rcdvl: Disconnected
[19:41:25] rcdvl: Like in the business class has_one :owner, :through User? Is this what you mean?
[19:42:50] Technodrome: has joined #RubyOnRails
[19:45:08] guacamole: has joined #RubyOnRails
[19:45:19] cagomez: has joined #RubyOnRails
[19:48:58] cabotto: has joined #RubyOnRails
[19:53:17] harrycs: has joined #RubyOnRails
[19:58:16] cagomez: has joined #RubyOnRails
[20:05:18] mtkd: has joined #RubyOnRails
[20:14:15] harryv: has joined #RubyOnRails
[20:24:55] harryk_: has joined #RubyOnRails
[20:30:21] bnjmnwl: has joined #RubyOnRails
[20:30:29] blackmesa1: has joined #RubyOnRails
[20:31:25] jfelchner: has joined #RubyOnRails
[20:31:37] BloodyMer: has joined #RubyOnRails
[20:48:49] srinidhi: has joined #RubyOnRails
[20:54:50] rcdvl: has joined #RubyOnRails
[20:58:20] cagomez: has joined #RubyOnRails
[21:07:40] cagomez: has joined #RubyOnRails
[21:11:47] cagomez: has joined #RubyOnRails
[21:13:04] piratepete: has joined #RubyOnRails
[21:14:12] cjohnson: You can make an association which has a scope rcdvl
[21:14:22] piratepete: I’ve created a blog from the getting started guide, converted to Slim, added Bootstrap and checked into my Gitlab. Can I generate a new app and not wipe or destroy the main database in sqllite3?
[21:14:44] cjohnson: So the Business would have many Users, and also Business would have one Owner
[21:14:50] cagomez: has joined #RubyOnRails
[21:14:54] cjohnson: which is a User with a different name
[21:14:59] cjohnson: I guess no scope is even needed
[21:15:20] rcdvl: Hmm how can I do this?
[21:15:39] rcdvl: Do you what I should Google for? Haha
[21:16:10] baweaver: piratepete: databases are normally namespaced
[21:16:20] baweaver: so unless you choose the exact same name for it you should be fine
[21:16:54] cjohnson: rcdvl: has_one :owner, class_name: 'User', foreign_key: 'owner_id'
[21:17:01] piratepete: baweaver: I guess I didn’t remember choosing main but I think it’s the default
[21:17:04] cjohnson: has_many :users
[21:17:14] cjohnson: rcdvl: something like that
[21:17:28] cagomez: has joined #RubyOnRails
[21:17:54] baweaver: rcdvl: pretty much that. You could also make an Owners table which has user_id and business_id which may simplify things a bit.
[21:17:56] piratepete: baweaver: and if I wipe it, I’ll learn what not to do lol
[21:18:02] cagomez: has joined #RubyOnRails
[21:18:05] baweaver: That's what backups are for ;)
[21:18:43] baweaver: Though if I have any particularly risky migrations I write it as a rake task and test the heck out of it
[21:19:22] lupine: Get there in the end? :-D
[21:20:55] baweaver: I'd agree with lupine though on the separate table. It'll be a lot easier to maintain and change later if you need to
[21:21:26] baweaver: Inheritance style table design is a journey of nightmares when your app gets larger
[21:21:39] rcdvl: Thank you cjohnson baweaver and lupine
[21:21:52] rcdvl: Will try your suggestions later
[21:22:04] baweaver: though it's not often you run into those problems either, but if you do....
[21:25:23] cjohnson: My approach is start off this way, then if it grows and needs to get metadata of its own, it's not a hard migration to write
[21:25:40] cjohnson: I try not to overengineer everything, a db migration and a code refactor aren't overly difficult
[21:29:11] dminuoso: baweaver: you need to sleep.
[21:30:30] piratepete: has joined #RubyOnRails
[21:32:04] piratepete: has left #RubyOnRails: ()
[21:33:37] cagomez: has joined #RubyOnRails
[21:49:12] cagomez: has joined #RubyOnRails
[21:50:36] Rodya_: has joined #RubyOnRails
[21:58:52] moei: has joined #RubyOnRails
[22:05:01] Radar: GOOD MORNING
[22:08:06] quazimodo: has joined #RubyOnRails
[22:12:01] dviola: has joined #RubyOnRails
[22:23:02] workmad3: has joined #RubyOnRails
[22:25:41] cagomez: has joined #RubyOnRails
[22:41:25] dminuoso: Radar: !goodmorning
[22:41:25] helpa: Radar: おはよう ございます
[22:48:29] wethu: has joined #RubyOnRails
[22:55:59] orbyt_: has joined #RubyOnRails
[22:58:21] jphase: has joined #RubyOnRails
[23:00:29] tcopeland: has joined #RubyOnRails
[23:01:32] jphase_: has joined #RubyOnRails
[23:02:33] jphase__: has joined #RubyOnRails
[23:03:31] jphase: has joined #RubyOnRails
[23:08:31] jphase: has joined #RubyOnRails
[23:09:33] jphase_: has joined #RubyOnRails
[23:11:04] jphase__: has joined #RubyOnRails
[23:14:32] jphase: has joined #RubyOnRails
[23:15:34] jphase_: has joined #RubyOnRails
[23:23:26] irishfromua: has joined #RubyOnRails
[23:24:13] platzhirsch: has joined #RubyOnRails
[23:24:22] platzhirsch: Is there a good guide/list of examples for migration names?
[23:24:37] platzhirsch: like a naming scheme, i.e. table_column_action
[23:24:50] platzhirsch: or should it more read like a sentence etc
[23:28:34] baweaver: Typically I use table-action-column(s)
[23:29:03] baweaver: though I don't think it's a huge point of contention
[23:32:30] platzhirsch: ah I think I used action_table_column in the past
[23:32:38] platzhirsch: even things like add_index_to_table_name
[23:34:04] Radar: wait people don't name migrations after pirates
[23:39:28] platzhirsch: I know, right?
[23:39:40] platzhirsch: well, I am a bit sad that searching for a naming scheme didn't yield any results
[23:39:54] platzhirsch: but then I again, I guess I am nowadays used to more comformity using Go
[23:44:29] baweaver: Are Rails Engines still a thing or did that get canned?
[23:44:34] Radar: Still a thing.
[23:46:56] mikecmpbll: has joined #RubyOnRails
[23:50:14] Radar: or maybe you should just split your app up into M I C R O S E R V I C E S and communicate betwixt them with CQRS
[23:52:50] Radar: Make sure to include blockchain and machine learning to get that $$$$$ VC funding
[23:56:36] baweaver: Has to be running Docker in the Cloud as well