« Back to channel list

#RubyOnRails - 26 May 2017

« Back 1 day Forward 1 day »
[00:03:30] gambl0re: has joined #RubyOnRails
[00:09:49] rakm: has joined #RubyOnRails
[00:38:42] _moep_: has joined #RubyOnRails
[00:42:26] duderonomy: has joined #RubyOnRails
[00:43:41] _moep_: Hi, I have a problem to run my unicorn for my Redmine. I have a simple wrapper script for running it, but I get this error: https://gist.github.com/anonymous/f06a1a5ec43ca479ab7cee2e436f994b
[00:44:08] _moep_: I want to find the solution
[00:51:09] havenwood: _moep_: segfault eh?
[00:51:22] havenwood: _moep_: does it segfault with just: bundle exec unicorn
[00:51:40] havenwood: what's on unicorn_wrapper line 35?
[00:52:21] _moep_: a case switch
[00:52:21] _moep_: case $1 in
[00:52:22] _moep_: "$0" pidfile-remove-if-not-unicorn
[00:52:22] _moep_: ${unicorn} --daemonize --config ~/.unicorn-config
[00:53:48] havenwood: _moep_: what are you running? are you running?: unicorn_wrapper start
[00:54:14] _moep_: havenwood: no debug
[00:54:15] havenwood: _moep_: You should see if `bundle exec unicorn` works and then debug your wrapper script if it does.
[00:54:44] _moep_: havenwood: yes it does:
[00:54:45] _moep_: unicorn="bundle exec unicorn"
[00:54:45] _moep_: unicorn_process="unicorn master.*"
[00:55:45] apparition: has joined #RubyOnRails
[00:55:46] havenwood: _moep_: Was the "yes it does" a response to "You should see if `bundle exec unicorn` works"?
[00:56:26] havenwood: Did you run `bundle exec unicorn` from the command line and check that it works?
[00:56:28] _moep_: it was a reply that it runs bundle…
[00:57:36] havenwood: I trying to ask what happens if you run: bundle exec unicorn
[00:57:42] havenwood: bundle exec unicorn
[00:58:12] _moep_: a lot of output and an error: ERROR -- : reaped #<Process::Status: pid 28240 SIGSEGV (signal 11)> worker=0
[00:58:44] havenwood: Do you have enough memory?
[00:59:20] havenwood: _moep_: You need enough memory to run the app. If you have less that required it will fail.
[01:00:14] havenwood: I suspect if you provision adequate memory it will work.
[01:01:14] _moep_: 300 M free is not enough?
[01:08:28] hndk: has joined #RubyOnRails
[01:11:51] hndk: has joined #RubyOnRails
[01:20:56] Emily: has joined #RubyOnRails
[01:30:32] irishfromua: has joined #RubyOnRails
[01:31:59] urkle: has joined #RubyOnRails
[01:39:50] brent__: has joined #RubyOnRails
[01:44:00] urkle: has joined #RubyOnRails
[01:54:33] sevenseacat: has joined #RubyOnRails
[01:55:31] roamingdog: has joined #RubyOnRails
[02:11:55] Technodrome: has joined #RubyOnRails
[02:15:15] xx00__: has joined #RubyOnRails
[02:20:24] xx00___: has joined #RubyOnRails
[02:43:00] Tempesta: has joined #RubyOnRails
[02:47:08] hndk: has joined #RubyOnRails
[02:48:04] xx00__: has joined #RubyOnRails
[02:56:37] roamingdog: has joined #RubyOnRails
[03:06:12] roamingdog: has joined #RubyOnRails
[03:27:24] quazimodo: has joined #RubyOnRails
[03:30:20] desnudopenguino: anyone have a quick example for rails 5 for a multi-model form? I am having some trouble figuring it out
[03:30:47] sevenseacat: what part are you having problem with? got a code sample?
[03:32:37] desnudopenguino: It is pretty junked right now, what do you guys prefer for code snippets in here? gist?
[03:35:48] Jameser: has joined #RubyOnRails
[04:00:29] Technodrome: has joined #RubyOnRails
[04:02:33] desnudopenguino: https://gist.github.com/desnudopenguino/d886f2851805fc392532706c80ba30e7 here you are
[04:03:07] desnudopenguino: I guess I need the model in there as well.
[04:03:25] sevenseacat: and whats the problem with this code?
[04:04:09] desnudopenguino: it's not saving the address
[04:04:58] desnudopenguino: I probably have stuff all kinds of mixed up in there at this point haha
[04:05:36] sevenseacat: ok its a bit weird to do this in a two-step process - normally with a form, you'd use accepts_nested_attributes for to let the Contact record be responsible for building and saving the relevant Address records
[04:06:07] sevenseacat: but one problem you have here is that the address form isn't part of the parent contact form
[04:06:53] sevenseacat: typically for a nested model form you'd have form.text_field, blah blah... then form.fields_for :addresses
[04:07:30] sevenseacat: like so http://guides.rubyonrails.org/form_helpers.html#nested-forms
[04:08:48] desnudopenguino: ah, that's what I was looking for, just not knowing how to describe it.
[04:09:18] desnudopenguino: that looks like it covers pretty much exactly what I'm doing.
[04:09:47] desnudopenguino: sevenseacat: you are the man! thank you!
[04:09:58] sevenseacat: I hope I'm not a man, but you're welcome
[04:10:24] desnudopenguino: well, you're the woman (or however you identify yourself, not trying to be sexist or anything :p)
[04:16:27] desnudopenguino: the complexity of my project just got about 5x easier nowyay
[04:22:29] CGibsonmm: has joined #RubyOnRails
[04:22:40] CGibsonmm: I need to set AWS region for US East (Ohio), is this us_east_2?
[04:49:45] patarr: has joined #RubyOnRails
[04:55:30] tfitts: Anyone know of a rails 5 compatible alternative to draper? I'm using api mode but I still need to generate some PDFs and don't want all that code in my models.
[04:55:53] sevenseacat: draper is compatible with rails 5
[04:56:59] tfitts: oh, I was reading a bunch of stuff that it wasn't and I get some errors when I tried it.
[04:58:20] tfitts: Draper::UninferrableDecoratorError: Could not infer a decorator for ActiveRecord::Base
[04:58:50] sevenseacat: if you've upgraded to a new major version, you might need to fix some things in your code to make it compatible
[05:00:21] tfitts: this is a new-ish app that started on version 5. I just have previously used draper in a rails 4 project and thought it would work fine for this pdf stuff. I saw some other recommendations about a gem called cells but that one seemed more for generating views, though I suppose it may be able to do both.
[05:00:57] tfitts: is app/decorators/* not loaded be default in rails 5? if I do OrderDecorator.new I get NameError: uninitialized constant OrderDecorator
[05:01:13] sevenseacat: its loaded. do you have an OrderDecorator class?
[05:01:20] sevenseacat: everything in app is autoloaded by default
[05:01:53] sevenseacat: what file is it in?
[05:01:57] tfitts: that's what I thought, but I'm looking at the OrderDecorator class which is defined in app/decorators/order_decorator.rb
[05:02:11] tfitts: OrderDecorator inherits from Draper::Decorator
[05:02:13] sevenseacat: have you restarted your server/console/spring/etc. since making that decorators folder?
[05:02:23] tfitts: ah, maybe not spring
[05:03:12] tfitts: I've never manually restarted spring before, just my console
[05:04:44] tfitts: that was it, thanks.
[05:17:52] cjhowe: has joined #RubyOnRails
[05:18:37] cjhowe: has joined #RubyOnRails
[05:19:27] cjhowe: has joined #RubyOnRails
[05:20:16] cjhowe: has joined #RubyOnRails
[05:21:01] cjhowe: has joined #RubyOnRails
[05:21:51] cjhowe: has joined #RubyOnRails
[05:22:36] cjhowe: has joined #RubyOnRails
[05:23:10] roamingdog: has joined #RubyOnRails
[05:36:23] cjhowe: has joined #RubyOnRails
[05:39:19] cjhowe: has joined #RubyOnRails
[05:40:05] cjhowe: has joined #RubyOnRails
[05:41:06] cjhowe: has joined #RubyOnRails
[05:46:01] Technodrome: has joined #RubyOnRails
[06:27:33] conta: has joined #RubyOnRails
[06:34:36] irishfromua: has joined #RubyOnRails
[06:34:37] cam27: has joined #RubyOnRails
[06:38:47] arup_r: has joined #RubyOnRails
[06:46:06] Technodrome: has joined #RubyOnRails
[06:50:47] patarr: has joined #RubyOnRails
[06:57:36] mtkd: has joined #RubyOnRails
[07:09:02] dionysus69: has joined #RubyOnRails
[07:39:22] quazimodo: has joined #RubyOnRails
[07:40:18] roamingdog: has joined #RubyOnRails
[07:41:05] roamingdog: has joined #RubyOnRails
[07:41:53] roamingdog: has joined #RubyOnRails
[07:42:39] roamingdog: has joined #RubyOnRails
[07:43:25] arBmind: has joined #RubyOnRails
[07:43:30] roamingdog: has joined #RubyOnRails
[07:44:14] roamingdog: has joined #RubyOnRails
[07:44:20] defsdoor: has joined #RubyOnRails
[07:48:19] agent_white: has joined #RubyOnRails
[08:06:20] mitt3ns: has joined #RubyOnRails
[08:12:03] mikecmpbll: has joined #RubyOnRails
[08:13:59] defsdoor: has joined #RubyOnRails
[08:15:19] defsdoor: has joined #RubyOnRails
[08:24:08] defsdoor: has joined #RubyOnRails
[08:27:32] mikecmpbll: has joined #RubyOnRails
[08:34:03] Technodrome: has joined #RubyOnRails
[08:40:19] DoubleMalt: has joined #RubyOnRails
[08:45:24] roamingdog: has joined #RubyOnRails
[08:51:16] halogenandtoast: has joined #RubyOnRails
[08:51:30] patarr: has joined #RubyOnRails
[08:51:52] halogenandtoast: Is there a ruby on rails irc channel specific to people looking for jobs?
[08:52:36] sonOfRa: has joined #RubyOnRails
[08:52:38] mikecmpbll: halogenandtoast : i don't believe so.
[08:54:26] halogenandtoast: mikecmpbll: oh well, thanks
[08:55:25] mikecmpbll: halogenandtoast : nothing against job discussion in room rules here though.
[08:56:03] halogenandtoast: Fair enough, I'll keep it short and sweet then. If anyone is good at rails and looking for a job in Tokyo or Bristol, UK feel free to DM me.
[08:56:22] halogenandtoast: I'm not a recruiter, I promise
[08:56:47] mikecmpbll: tokyo or bristol :D
[08:56:50] halogenandtoast: Just a dev at Cookpad
[08:57:20] halogenandtoast: I haven't been yet.
[08:57:25] lxsameer: has joined #RubyOnRails
[08:57:28] halogenandtoast: We recently opened an office there.
[08:57:48] mikecmpbll: awesome, i didn't know.
[08:57:58] mikecmpbll: ACTION files that away for a 18 months time
[08:58:49] halogenandtoast: I can remind you in 18 months if you'd like
[09:00:46] marr: has joined #RubyOnRails
[09:05:05] tbuehlmann: halogenandtoast: oh, do you work with miles? had the pleasure to meet him last year in braga
[09:05:22] halogenandtoast: tbuehlmann: I do, he moved to Bristol right when I joined
[09:05:25] halogenandtoast: but he hired me.
[09:06:24] halogenandtoast: He's great, I was sad that he moved right when I joined
[09:11:00] srinidhi: has joined #RubyOnRails
[09:13:06] snickers: has joined #RubyOnRails
[09:16:59] snickers: Hi, I have that code https://gist.github.com/pwojcieszonek/b922f274ce4a2d2588233526abea685d when I invoke method user_signed_in? without headers['Authorization'] i get stack level too deep. Method current_user invoke http_auth_header and render_error wich invoke current_user and so on.
[09:18:45] shilon: has joined #RubyOnRails
[09:19:32] halogenandtoast: Snickers: how does render_error call current_user?
[09:21:10] snickers: this is part I can't understood https://gist.github.com/pwojcieszonek/562df8e82198695532162de9ea6eb74c
[09:21:40] halogenandtoast: Snickers: Can you post the full controller?
[09:22:34] halogenandtoast: That way I can line up the stack trace and make sure nothing else is interfering.
[09:23:38] snickers: https://gist.github.com/pwojcieszonek/f87504f6a7b508b9d1f9eaf7f637a629
[09:27:01] halogenandtoast: So the line in question is this: render json: {status: code, error: resource.to_s}, status: code according to your stack trace and I can't see how that would trigger current_user
[09:27:10] halogenandtoast: unless you have something registered for rendering json
[09:28:18] halogenandtoast: I might be missing something obvious. But in case it's this crazy, do you have anything inside of config/initializers/mime_types.rb regarding JSON?
[09:28:24] halogenandtoast: Or anywhere else for that fact?
[09:29:54] halogenandtoast: I do wonder if it was working, if you'd have a double render error
[09:30:49] halogenandtoast: Also... are all your files saved.
[09:31:03] halogenandtoast: that's always a fun problem.
[09:31:38] snickers: config/initializers/mime_types.rb is empty
[09:32:04] snickers: yes, i saved file ;)
[09:32:05] arBmind: has joined #RubyOnRails
[09:33:09] halogenandtoast: Snickers: What happens if you change line 34 to render text: "All your base"
[09:35:11] workmad3: has joined #RubyOnRails
[09:35:19] snickers: now is information about multiple render in action but no recurency
[09:35:35] halogenandtoast: huh so let's start elimnating things
[09:35:42] halogenandtoast: render text: resource.to_s
[09:36:01] halogenandtoast: should be a double render still.
[09:36:39] halogenandtoast: and what about render text: resource.to_s, status: code
[09:36:58] snickers: ActiveModel::Serializer overwrite to_sjon method?
[09:37:18] halogenandtoast: Snickers: it does inject itself yes.
[09:37:34] halogenandtoast: Should only trigger for AR object (at least if I implemented it)
[09:37:41] snickers: so maybe this is a problem
[09:37:56] halogenandtoast: It sounds likel
[09:38:17] snickers: with :text it render correctly
[09:38:22] halogenandtoast: In applicationcontroller do you have something like serialization_scope :current_user
[09:40:21] sonOfRa: has joined #RubyOnRails
[09:43:24] halogenandtoast: Ah the default scope is current_user
[09:43:50] halogenandtoast: My suggestion is to architect your application such that calling current_user doesn't result in an error.
[09:44:05] halogenandtoast: Also you're going to have a double render issue if you do that :p
[09:44:23] halogenandtoast: No problem, good luck.
[09:46:50] roamingdog: has joined #RubyOnRails
[10:06:41] simmerz: has joined #RubyOnRails
[10:07:47] simmerz: hi. I need to create a Rails 4.2 app and I have 5.x installed as well as the 4.2 version I want to use locally. AIUI, I can use `rails _4.2.8_ new my_app_name` to create a 4.2.8 rails app. but it keeps trying to create a 5.x app, and the Gemfile specifies 5.x. Any ideas?
[10:18:55] netzfisch: has joined #RubyOnRails
[10:19:56] patarr: has joined #RubyOnRails
[10:29:34] shotbug: has joined #RubyOnRails
[10:33:08] gregf_: has joined #RubyOnRails
[10:35:10] shotbug: has joined #RubyOnRails
[10:38:47] ferr: has joined #RubyOnRails
[10:43:44] ur5us: has joined #RubyOnRails
[10:47:36] roamingdog: has joined #RubyOnRails
[10:56:07] DylanJ: has joined #RubyOnRails
[10:56:22] sevenseacat: what version of rubygems are you using? it might need to be updated
[10:56:43] sevenseacat: http://sevenseacat.net/posts/2017/rubygems-gem-versioning-bugs/
[10:56:51] DylanJ: How can I execute an arbitrary SQL statement *with* sanitization of params. Ex: `ActiveRecord::What.execute('select somefunc(?)', args)`
[11:00:53] tbuehlmann: DylanJ: you might find something for that in here: https://github.com/rails/rails/blob/d15527800fbc199b969019c665226f836d8fedce/activerecord/lib/active_record/sanitization.rb
[11:10:32] simmerz: sevenseacat: oh, thanks for that. just updating rubygems now
[11:12:36] simmerz: sevenseacat: yep, that’s done it :)
[11:12:45] sevenseacat: simmerz: oh, glad to hear it!
[11:13:34] Ergo: has joined #RubyOnRails
[11:33:57] aljmo: has joined #RubyOnRails
[11:34:18] kthibodeaux: has joined #RubyOnRails
[11:45:42] shilon: has joined #RubyOnRails
[12:00:00] xhoy: has joined #RubyOnRails
[12:00:25] xhoy: hi there!
[12:00:30] xhoy: is there a nonzero? for nil?
[12:00:36] xhoy: doens't seem to work
[12:00:46] sevenseacat: then I think you just answered your own question
[12:00:58] Pumukel: has joined #RubyOnRails
[12:01:19] xhoy: it doens't work for nil
[12:01:36] xhoy: NoMethodError: undefined method `nonzero?' for nil:NilClass <<
[12:01:45] xhoy: so i tought maby its a different namin
[12:14:40] hashrocket: has joined #RubyOnRails
[12:19:30] roamingdog: has joined #RubyOnRails
[12:19:40] nertzy: has joined #RubyOnRails
[12:21:39] pupsicle: has joined #RubyOnRails
[12:31:59] _moep_: has left #RubyOnRails: ()
[12:41:05] AzaToth: has joined #RubyOnRails
[12:46:50] xx00__: has joined #RubyOnRails
[12:48:31] bruce_lee: has joined #RubyOnRails
[12:51:01] centrx: has joined #RubyOnRails
[13:01:14] xhoy: presence!
[13:02:11] centrx: I can feel it
[13:05:28] Technodrome: has joined #RubyOnRails
[13:20:14] roamingdog: has joined #RubyOnRails
[13:22:35] uks: has joined #RubyOnRails
[13:24:10] xx00__: has joined #RubyOnRails
[13:25:29] ghormoon: has joined #RubyOnRails
[13:32:57] mikecmpbll: is it possible to see why certain gems get upgraded when i do `bundle update some_gem` and a whole bunch of other gems get updated?
[13:33:00] mikecmpbll: really confusing.
[13:33:46] mikecmpbll: some_gem has a dependency on rails ~> 4.2.6, yep when i update some_gem rails gets upgraded to 4.2.8
[13:34:31] sevenseacat: 4.2.8 matches ~> 4.2.6
[13:34:46] sevenseacat: so why wouldn't it upgrade when you run an upgrade?
[13:35:09] mikecmpbll: because i've not specified rails
[13:35:23] mikecmpbll: and in my Gemfile.lock it has 4.2.6
[13:35:29] sevenseacat: so you want to upgrade one gem but none of its dependencies?
[13:35:48] mikecmpbll: http://bundler.io/man/bundle-update.1.html#UPDATING-A-LIST-OF-GEMS
[13:35:52] sevenseacat: if you want to use 4.2.6, pin 4.2.6
[13:36:06] sevenseacat: that doesnt seem like a valid use case to me
[13:36:36] mikecmpbll: upgrading one gem isn't a valid use case? hmpf
[13:36:51] sevenseacat: one gem but nothing that gem relies on
[13:37:12] mikecmpbll: so one gem, yeah
[13:37:48] sevenseacat: like i said, if you want to force 4.2.6, lock 4.2.6 in your Gemfile
[13:39:46] mikecmpbll: excellent, cheers.
[13:39:51] mikecmpbll: just don't really understand the rationale that bundle update operates
[13:39:51] DLSteve: has joined #RubyOnRails
[13:40:01] cam27: has joined #RubyOnRails
[13:44:54] tbuehlmann: mikecmpbll: you are not talking about --conservative, right?
[13:45:05] mikecmpbll: tbuehlmann : correct, i'm not.
[13:45:16] mikecmpbll: ah, that would be the answer, would it?
[13:45:37] tbuehlmann: I don't know, is it? :)
[13:45:47] mikecmpbll: > In short, by default, when you update a gem using bundle update, bundler will update all dependencies of that gem, including those that are also dependencies of another gem. To prevent updating shared dependencies, prior to version 1.14 the only option was the CONSERVATIVE UPDATING behavior in bundle install(1):
[13:45:49] mikecmpbll: ah bollocks it's on that same page.
[13:45:54] sevenseacat: interesting. i havent seen that option but I don't think I'd ever use it
[13:46:53] sevenseacat: I think you should be locking appropriately in your Gemfile so you can run `bundle update` at any time
[13:47:12] mikecmpbll: sevenseacat : that's not what the gemfile is for :/ that's what the lock is for
[13:47:24] mikecmpbll: --conservative had the behaviour i expected 👍🏼
[13:47:40] sevenseacat: no, the lock lists known valid tested versions of all the dependencies
[13:47:46] mikecmpbll: and that says nothing about how i shall be voting in the general election, js
[13:48:07] mikecmpbll: then i don't know what you mean by "so you can run `bundle update` at any time"
[13:48:47] sevenseacat: if you check in a lock file that says 4.2.6, then you're saying hey my app works with 4.2.8
[13:48:52] mikecmpbll: anyone can run bundle update at anytime, but it will most likely break everything and that's expected. being able to run `bundle update` and be sure not to break everything you'd need to lock every version in your Gemfile
[13:49:03] sevenseacat: thats what your test suite is for
[13:49:08] sevenseacat: to make sure things arent broken
[13:49:13] mikecmpbll: yes, obviously.
[13:49:17] sevenseacat: bundle update, if everything works, check in the changes
[13:50:03] mikecmpbll: i don't need to work out, of all the versions of gems, which my app works with
[13:50:07] mikecmpbll: that's why i have a lock.
[13:50:21] sevenseacat: who said anything about working it out manually
[13:50:34] mikecmpbll: then i haven't got a clue what we're disagreeing about anymore
[13:50:45] mikecmpbll: you went way off-piste with the testing stuff.
[13:50:45] sevenseacat: I'm not surprised
[13:51:09] sevenseacat: you mentioned updates breaking things. tests prevent breakages.
[13:51:20] mikecmpbll: no they don't, they detect them
[13:51:28] sevenseacat: exactly, then you roll the updates back
[13:51:46] mikecmpbll: yes. this has nothing to do with anything we were talking about though
[13:51:48] sevenseacat: and you get more granular
[13:51:48] mikecmpbll: [14:46:54] <sevenseacat> I think you should be locking appropriately in your Gemfile so you can run `bundle update` at any time
[13:51:54] mikecmpbll: anyone can run bundle update at any time. no idea what this means
[13:52:04] mikecmpbll: that's the source of the confusion.
[13:52:16] sevenseacat: maybe I should have specified 'run bundle update without being petrified of breakages'
[13:52:32] mikecmpbll: well yeah, that's what tests are for we've established that's common ground :)
[13:52:33] sevenseacat: updating Rails from 4.2.6 to 4.2.8 is literally no big deal, and you've been arguing for ages not to do it
[13:52:42] mikecmpbll: it is a big deal, because all my tests failed
[13:52:55] sevenseacat: then you have some dodgy code in your app
[13:53:01] sevenseacat: that you should fix
[13:53:10] mikecmpbll: there's dodgy code in rails, that they should fix
[13:53:12] mikecmpbll: and probably have
[13:53:46] mikecmpbll: they fucked up the way .includes and .preloads works with association scopes.
[13:53:56] mikecmpbll: but i don't have time to sort it now :) i was just curious why rails was being updated when it didn't need to be
[13:54:31] Technodrome: has joined #RubyOnRails
[13:58:05] spheric: has joined #RubyOnRails
[14:01:38] Jameser: has joined #RubyOnRails
[14:05:42] chouhoulis: has joined #RubyOnRails
[14:12:24] quazimodo: has joined #RubyOnRails
[14:13:43] ar1a: So I'm writing a restaurant manager with Ingredients, Menu items, and orders (what i'm currently working on). When someone finishes an order, I want to log and delete/move it somewhere. How do I do this, is that the right course of action? Also, how would I do the associations? Many-Many?
[14:14:17] patarr: has joined #RubyOnRails
[14:20:21] apparition: has joined #RubyOnRails
[14:21:00] mahloun: has joined #RubyOnRails
[14:21:05] apeiros: ar1a: can an ingredient appear in more than one menu item?
[14:21:12] ar1a: they are many-many
[14:21:24] apeiros: and can a menu item have more than one ingredient?
[14:21:32] ar1a: yes, they are many-many
[14:21:36] ar1a: but those arent what im working on
[14:21:39] ar1a: im working on the orders :p
[14:21:44] apeiros: same set of questions
[14:22:05] ar1a: yes an item can have many orders and an order can have many items
[14:22:24] ar1a: so what about the other things
[14:22:27] apeiros: it's always "can A be associated with multiple B's and B with multiple A's?" if both are "yes", then it's many-many.
[14:22:36] ar1a: arhiving, etc :p
[14:22:45] apeiros: look into state machines
[14:22:50] apeiros: things like aasm
[14:23:16] ar1a: what are you saying to do
[14:23:35] ar1a: lots of confusing docs here
[14:23:59] apeiros: that the topic of "I have a thing, which has a state, which can transition" is covered by a "pattern" called "state machine" and there are libraries implementing that for you
[14:24:20] ar1a: so my two states are finished and unfinished?
[14:24:20] apeiros: https://github.com/aasm/aasm
[14:24:41] apeiros: you probably have more than 2 states
[14:24:54] ar1a: like what? the order is either being made or its done :p
[14:25:28] apeiros: interesting restaruant if those are the only two states :-p
[14:25:38] ar1a: what other states would there be :p
[14:26:56] apeiros: presumably somebody orders then (ordered), then somebody is assigned to prepare them (being_prepared), then it is ready to be served (ready_for_serving), then somebody actually serves them (served) and before the guest leaves it probably should be payed too (payed)
[14:28:01] ar1a: its supposed to be for mom and pop restaurants, i don't think they'll have more than 2 or 3 staff. Also, that means every time something's started cooking or finished cooking the chef has to press on the screen
[14:28:13] ar1a: and chefs multitask meals
[14:29:15] apeiros: *shrug* it's your software. in the end, you have to know which states you want to track.
[14:45:03] Jameser: has joined #RubyOnRails
[14:47:17] netzfisch: has joined #RubyOnRails
[14:57:01] theunraveler: has joined #RubyOnRails
[14:59:08] Technodrome: has joined #RubyOnRails
[15:00:45] killerbunny: has joined #RubyOnRails
[15:07:50] greengriminal: has joined #RubyOnRails
[15:08:12] greengriminal: Hey all quick question, has anyone independently been able to render a HAML files from within the rails console ?
[15:08:49] francuz: has joined #RubyOnRails
[15:12:34] xx00__: has joined #RubyOnRails
[15:14:13] Jameser: has joined #RubyOnRails
[15:20:56] roamingdog: has joined #RubyOnRails
[15:23:51] mdw: has joined #RubyOnRails
[15:25:08] cjhowe: has joined #RubyOnRails
[15:35:24] tercenya: has joined #RubyOnRails
[15:46:38] tercenya: has joined #RubyOnRails
[15:48:56] tercenya: has joined #RubyOnRails
[15:49:04] tomasm-: has joined #RubyOnRails
[15:50:59] tomasm-: hey, what are some of the best gems/tools for rails development to help save time, especially as an entrepreneur and rapid prototyping? for example, I see there's ActiveAdmin for admin dashboards, best_in_place for inline editing, etc... lets say I'm coming up with a CMS or social media platform
[15:53:09] tomasm-: can I mix erb and haml together in my project, assuming they're separate files?
[15:53:35] ar1a: it just looks if its .haml or .erb
[16:01:12] dblessing: has joined #RubyOnRails
[16:10:38] rakm: has joined #RubyOnRails
[16:14:27] HoierM_: has joined #RubyOnRails
[16:14:57] tomasm-: it's just the haml gem? or haml-rails?
[16:15:31] gusrub: has joined #RubyOnRails
[16:15:38] konsolebox: has joined #RubyOnRails
[16:15:48] hobodave: has joined #RubyOnRails
[16:19:32] dionysus69: has joined #RubyOnRails
[16:22:10] danman: has joined #RubyOnRails
[16:22:34] xx00__: has joined #RubyOnRails
[16:23:23] arup_r: has joined #RubyOnRails
[16:28:30] rromanchuk: has joined #RubyOnRails
[16:28:46] killerbunny: has joined #RubyOnRails
[16:33:15] rgr: has joined #RubyOnRails
[16:33:55] HoierM: has joined #RubyOnRails
[16:35:50] b0mbnet: has joined #RubyOnRails
[16:36:08] roamingdog: has joined #RubyOnRails
[16:37:00] b0mbnet: i'm using grape 0.19.2, i can access parameter using @params and request.params, but i can not access it through params keyword, very wired?
[16:38:15] b0mbnet: it is inside post block
[16:38:34] rromanchuk: Let's say you have json serializer to display a collection of Posts that has_many Likes, and in that collection for each post we must pass down the attributed is_liked that is a boolean on if the current_user has liked that object. Nothing too tricky here, but is eager loading likes off the post and checking for inclusion the most performant solution, given no arch changes.
[16:39:20] b0mbnet: i have looked grape source code, it seems that class endpoint already have attr_reader for params, but it not working
[16:39:51] tomasm-: any other good gems/tools for saving dev time on prototyping? maybe higher level patterns, widgets, tasks etc?
[16:40:05] rromanchuk: would an n+1 with Like.where be faster? I guess i need to just profile
[16:40:13] xx00__: has joined #RubyOnRails
[16:40:56] workmad3: rromanchuk: you'd need to profile with a realistic production setup and a realistically populated DB
[16:42:17] rromanchuk: workmad3 figured, in production i'm just getting crushed by this eager load, i need to rethink strategy
[16:50:32] adgtl: has joined #RubyOnRails
[16:53:31] xx00__: has joined #RubyOnRails
[16:57:57] aseibert: has joined #RubyOnRails
[16:59:48] pLaTo0n: has joined #RubyOnRails
[17:07:26] defsdoor: has joined #RubyOnRails
[17:13:52] arBmind: has joined #RubyOnRails
[17:14:39] chouhoulis: has joined #RubyOnRails
[17:35:13] duderonomy: has joined #RubyOnRails
[17:36:47] roamingdog: has joined #RubyOnRails
[17:38:33] brent__: has joined #RubyOnRails
[17:39:10] mikecmpbll: has joined #RubyOnRails
[17:44:09] mordof: has joined #RubyOnRails
[17:44:19] mordof: this is such an annoying problem to resolve....
[17:44:40] mordof: Trying to run an rspec unit test for what we call "staging" - and in that process, a postgres table gets renamed
[17:45:24] mordof: so I basically do TableName.count == 0, postgres_conn.exec("ALTER TABLE table_names RENAME TO foo"); and because i've done a count initially, the alter table gets denied an exclusive lock by postgres, so it just hangs
[17:45:46] mordof: if i comment out the .count == 0, everything works fine
[17:45:57] borodin: has joined #RubyOnRails
[17:49:00] hobodave: has joined #RubyOnRails
[17:49:05] Aytan72: has joined #RubyOnRails
[17:54:56] mdw: has joined #RubyOnRails
[17:58:25] killerbunny: has joined #RubyOnRails
[17:59:08] mikecmpbll: has joined #RubyOnRails
[18:03:37] ghormoon: has joined #RubyOnRails
[18:07:55] ErhardtMundt: has joined #RubyOnRails
[18:14:43] centrx: has joined #RubyOnRails
[18:16:31] gusrub: has joined #RubyOnRails
[18:18:55] ravster: has joined #RubyOnRails
[18:20:50] centrx: hello you
[18:32:59] gusrub: has joined #RubyOnRails
[18:38:16] |PiP|: has joined #RubyOnRails
[18:38:20] dblessing: has joined #RubyOnRails
[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?
[18:41:26] brent__: has joined #RubyOnRails
[18:43:09] lxsameer: has joined #RubyOnRails
[19:01:55] mdw: has joined #RubyOnRails
[19:04:05] xx00__: has joined #RubyOnRails
[19:10:37] centrx: has joined #RubyOnRails
[19:17:07] kies: has joined #RubyOnRails
[19:20:01] borodin: has joined #RubyOnRails
[19:30:29] srinidhi: has joined #RubyOnRails
[19:39:30] tfitts: anyone use Bourbon Neat or know how to inspect elements in scss? My breakpoints aren't changing the number of columns and I'm trying to figure out why.
[19:44:44] aseibert: has joined #RubyOnRails
[19:49:25] gusrub_: has joined #RubyOnRails
[19:50:18] rfoust: has joined #RubyOnRails
[19:52:24] quazimodo: has joined #RubyOnRails
[19:56:06] agent_white: has joined #RubyOnRails
[20:06:55] jdqx: has joined #RubyOnRails
[20:17:14] gusrub: has joined #RubyOnRails
[20:32:06] simmerz: has joined #RubyOnRails
[20:33:21] workmad3: has joined #RubyOnRails
[20:33:55] Synthead: has joined #RubyOnRails
[20:41:24] Synthbread: has joined #RubyOnRails
[20:47:27] Synthmead: has joined #RubyOnRails
[20:58:09] blackmesa: has joined #RubyOnRails
[21:04:57] Synthbread: has joined #RubyOnRails
[21:07:38] urkle: has joined #RubyOnRails
[21:16:57] Synthmead: has joined #RubyOnRails
[21:18:53] mikecmpbll: has joined #RubyOnRails
[21:20:26] futilegames: has joined #RubyOnRails
[21:23:53] Synthmead: has joined #RubyOnRails
[21:31:57] roamingdog: has joined #RubyOnRails
[21:32:57] roamingdog: has joined #RubyOnRails
[21:41:27] gusrub: has joined #RubyOnRails
[22:00:51] tenderlove: has joined #RubyOnRails
[22:25:19] bpmedley: has joined #RubyOnRails
[22:28:54] rfoust: has joined #RubyOnRails
[22:30:27] starfox_sf: has joined #RubyOnRails
[22:31:18] starfox_sf: Hey guys - I need to insert around 300M rows into a postgreSQL database. The data is in the form of gzipped JSON lines files on s3. Each file has 50k JSON lines and each JSON line is between 35kb.
[22:31:22] starfox_sf: Right now I’m creating a job on sidekiq for each of the JSON lines files on S3. Then I have workers on Heroku processing these files. Workers download the JSON lines file, parse the lines and start persisting them via ActiveRecord to the database (doing transactions of 1000 at a time). Right now I’m finding that each worker can persist around 2500 rows per minute. I was hoping I could make
[22:31:28] starfox_sf: this faster. Any pointers for improving performance?
[22:31:40] websterlake: has joined #RubyOnRails
[22:56:30] HoierM: has joined #RubyOnRails
[23:07:39] Synthmead: has joined #RubyOnRails
[23:27:26] roamingdog: has joined #RubyOnRails
[23:44:21] ur5us: has joined #RubyOnRails