« Back to channel list

#RubyOnRails - 10 May 2017

« Back 1 day Forward 1 day »
[00:13:23] brent__: has joined #RubyOnRails
[00:15:39] northfurr: has joined #RubyOnRails
[00:23:26] northfurr: has joined #RubyOnRails
[00:24:47] Pumukel: has joined #RubyOnRails
[00:27:32] DLSteve: has joined #RubyOnRails
[00:28:46] sevenseacat: has joined #RubyOnRails
[00:30:35] rgr: has joined #RubyOnRails
[00:38:07] northfurr: has joined #RubyOnRails
[00:39:49] eljimmy: has joined #RubyOnRails
[00:40:39] eljimmy: has joined #RubyOnRails
[00:41:20] eljimmy: has joined #RubyOnRails
[00:48:08] quirkycoders: has joined #RubyOnRails
[00:59:18] aajjbb: has joined #RubyOnRails
[01:00:42] ResidentBiscuit: has joined #RubyOnRails
[01:20:03] tetraktys: has joined #RubyOnRails
[01:31:49] northfurr: has joined #RubyOnRails
[01:35:31] gremax: has joined #RubyOnRails
[01:40:34] Jameser: has joined #RubyOnRails
[02:10:33] gremax: has joined #RubyOnRails
[02:11:06] brkkyk: has joined #RubyOnRails
[02:18:58] francuz: I have 4 models, A, B, C and D, where : A has many B, B has many C and C has many D, i'd like to be able to do A.first().ds to get all the D connected to this A(through B and C),
[02:19:17] sevenseacat: set up some has_many through associations
[02:19:52] francuz: my approch would be first create with a through statement from B to D through C, and then from A to D through B
[02:20:44] francuz: but is there a way to put it all in the model A, like "has_many :ds, through: :bs, through: :cs" ?
[02:21:41] sevenseacat: you can say A has many C through B. and then A has many D through C.
[02:21:47] sevenseacat: and I really hate fake model names
[02:21:52] Jameser: has joined #RubyOnRails
[02:23:04] francuz: I don't have real model names as it's not for a real application, I'm just reading and learning all I can about as much as I can on rails, sorry :p
[02:23:16] matthewd: `def ds; D.where(c_id: C.where(b_id: B.where(a_id: self))); end` would work.. but yeah, don't do that; define the throughs in each model -- that's what they're for
[02:23:38] sevenseacat: ah, the good old fake-hypothetical
[02:23:48] matthewd: (a simple method like that is less useful than an association, too)
[02:28:58] francuz: sevenseacat : not direclty working on rails usually but a coworker would like to see something like "https://www.skipper18.com/" but for rails, so i'm thinking about making some basic utility in that direction, that's why i'm asking myself these kind of questions,
[02:30:11] francuz: @matthewd : yeah, associations are a better option
[02:31:33] patarr: has joined #RubyOnRails
[02:32:26] irishfromua: has joined #RubyOnRails
[02:45:03] northfurr: has joined #RubyOnRails
[02:51:18] irishfromua: has joined #RubyOnRails
[02:56:17] irishfromua: has joined #RubyOnRails
[02:59:15] bronson: has joined #RubyOnRails
[03:09:08] amloelxer: has joined #RubyOnRails
[03:12:39] gremax: has joined #RubyOnRails
[03:16:12] hndk: has joined #RubyOnRails
[03:21:14] amloelxer: has left #RubyOnRails: ()
[03:26:15] jphase: has joined #RubyOnRails
[03:31:31] SteenJobs: has joined #RubyOnRails
[03:35:52] Pumukel: has joined #RubyOnRails
[03:40:33] northfurr: has joined #RubyOnRails
[03:47:26] Ericx2x: has joined #RubyOnRails
[03:51:01] bronson: has joined #RubyOnRails
[04:09:22] quirkycoders: has joined #RubyOnRails
[04:16:25] jane_booty_doe: has joined #RubyOnRails
[04:19:24] duderono_: has joined #RubyOnRails
[04:31:57] patarr: has joined #RubyOnRails
[04:36:53] Pumukel: has joined #RubyOnRails
[04:38:30] uksio: has joined #RubyOnRails
[04:41:35] SteenJobs: has joined #RubyOnRails
[04:56:24] urkle: has joined #RubyOnRails
[05:06:37] armyriad: has joined #RubyOnRails
[05:16:54] sandstrom: has joined #RubyOnRails
[05:24:06] duderonomy: has joined #RubyOnRails
[05:37:50] srinidhi: has joined #RubyOnRails
[05:38:32] tetraktys: has joined #RubyOnRails
[05:38:34] Pumukel: has joined #RubyOnRails
[06:08:37] foxmask: has left #RubyOnRails: ()
[06:17:59] xall_: has joined #RubyOnRails
[06:18:35] User458764: has joined #RubyOnRails
[06:19:16] User458764: has joined #RubyOnRails
[06:32:49] patarr: has joined #RubyOnRails
[06:35:39] conta: has joined #RubyOnRails
[06:39:11] blackmesa: has joined #RubyOnRails
[06:41:04] Pumukel: has joined #RubyOnRails
[06:42:11] User458764: has joined #RubyOnRails
[07:04:26] frojnd: has joined #RubyOnRails
[07:05:34] frojnd: I'm trying to print in console associations for a singular model. Like it would print column definitions and also something like belongs_to or has_many... how can I do that? I Know Model.reflect_on_all_associations but that's not what I'm looking for
[07:06:52] sandstrom: has joined #RubyOnRails
[07:11:39] dionysus69: has joined #RubyOnRails
[07:15:28] tbuehlmann: frojnd: when using pry-rails, you could do `show-models` or `show-model <model_name>` in a rails console
[07:20:45] frojnd: tbuehlmann: exactly what I'm looking for! Thank you :)
[07:31:37] marr: has joined #RubyOnRails
[07:33:17] frojnd: I have a question regarding forms and text areas :) Let say I would like to "inject" value into current form's hidden field from another text_field_tag (outside of this form). How would I do that?
[07:33:50] frojnd: And when clicking save this hidden field tag would get value from outside text_field_tag..
[07:37:44] Jameser: has joined #RubyOnRails
[07:43:02] Pumukel: has joined #RubyOnRails
[07:53:41] lipoqil: has joined #RubyOnRails
[07:56:49] workmad3: has joined #RubyOnRails
[07:58:55] morfin: has joined #RubyOnRails
[08:03:35] mikecmpbll: has joined #RubyOnRails
[08:05:53] arBmind: has joined #RubyOnRails
[08:07:40] railsForDaiz: has joined #RubyOnRails
[08:11:03] dionysus69: has joined #RubyOnRails
[08:26:55] vedu: frojnd: you can use javascript to do that
[08:32:42] coucheron: has joined #RubyOnRails
[08:33:47] patarr: has joined #RubyOnRails
[08:37:37] coucheron: Hey, I've got a query for my project I can't get to work. The thought is that it is suppose to gather all books, with a given course_id. To get each book I have to go through articles (which share ISBN with books). I tried using .inject (as seen here http://pasted.co/3d4bc1c2) but this only gives me a AND statement where I need an OR statement. Any tips to how this can be changed would help a lot! :-)
[08:39:09] coucheron: Such as this ( Book Load (0.3ms) SELECT DISTINCT "books".* FROM "books" WHERE (isbn LIKE '9788243010550') AND (isbn LIKE '9788279008439') AND (isbn LIKE '9788243010550') LIMIT ? OFFSET ? [["LIMIT", 10], ["OFFSET", 0]] ) Here I need it to be OR instead of AND
[08:41:00] pwnd_nsfw: The isbn should be exact, right?
[08:42:08] pwnd_nsfw: Can I get schema.rb in http://gist.github.com
[08:42:12] pwnd_nsfw: Along with models please
[08:42:25] pwnd_nsfw: What you're doing might be really simple, in fact.
[08:43:57] Pumukel: has joined #RubyOnRails
[08:45:48] lupine: Book.where(isbn: [a, b, c, ...])
[08:46:15] lupine: preceded by any necessary relations
[08:46:30] coucheron: https://gist.github.com/scoucheron/b21a0610c38841767e0262b6b30485c0
[08:47:25] dionysus69: has joined #RubyOnRails
[08:48:17] coucheron: The problem is that the database is designed so each article can have 3 courses, and a book has an article. So to be able to do this I have to iterate through and find all articles under each book which has the correct course_id that I'm looking for (?)
[08:48:29] lupine: https://gist.github.com/scoucheron/b21a0610c38841767e0262b6b30485c0#file-book-rb-L14
[08:48:33] lupine: no no no no no no no no no no no no no
[08:48:53] pwnd_nsfw: very unnecessary
[08:49:00] lupine: it's how to get pwned
[08:49:36] pwnd_nsfw: AR handles relations like this very easily
[08:49:39] pwnd_nsfw: so use their methods
[08:50:41] pwnd_nsfw: has_many :through, coucheron. Look that up
[08:52:26] coucheron: Will do, thanks :-)
[08:59:09] vedu: Hello. How can I create and call custom methods in my ActiveJob class? Something like PushNotificationJob.incoming_message(message).perform_later and PushNotificationJob.welcome(user).perform_later
[08:59:27] Silox|: has joined #RubyOnRails
[08:59:45] lupine: vedu: you'd typically not
[09:00:01] lupine: you could botch something with arguments to perform_later perhaps, but I'd sooner split them out into separate classes
[09:02:16] vedu: lupine: but if I create separate classes there would be lot of common code. Or I should create a common base class?
[09:02:41] lupine: choose composition over inheritance
[09:06:40] lxsameer: has joined #RubyOnRails
[09:10:22] mrbubbles: Is there a way to disable the new Yarn/JS features in a Rails 5.1.0 app? It's breaking my deploy :(
[09:10:35] gregf_: has joined #RubyOnRails
[09:20:39] Coldblackice: has joined #RubyOnRails
[09:21:16] Jameser: has joined #RubyOnRails
[09:25:08] shotbug: has joined #RubyOnRails
[09:32:09] patarr: has joined #RubyOnRails
[09:34:04] v|sh: has joined #RubyOnRails
[09:37:47] dionysus69: which deployment solution is mostly used by rails community?
[09:37:54] dionysus69: I have heard of puppet and chef
[09:38:07] dionysus69: which one should I get started with?
[09:38:31] Radar: dionysus69: did you try heroku yet?
[09:40:19] stamina: has joined #RubyOnRails
[09:41:53] arBmind: has joined #RubyOnRails
[09:45:06] Pumukel: has joined #RubyOnRails
[09:45:06] dionysus69: Radar: I have used heroku but it is expensive compared to DO
[09:45:45] dionysus69: I can have 20$ DO dropplet and have great performance while for same price I would get half performance on heroku
[09:55:11] dps: has joined #RubyOnRails
[10:02:46] nickjj: has joined #RubyOnRails
[10:05:02] ferr: has joined #RubyOnRails
[10:10:08] morfin: if you use docker containers how do you configure packages required for apps?
[10:21:14] ur5us: has joined #RubyOnRails
[10:23:04] Thomas-0725: has joined #RubyOnRails
[10:26:11] manzo: has joined #RubyOnRails
[10:26:56] manzo: has left #RubyOnRails: ()
[10:29:44] arBmind: has joined #RubyOnRails
[10:38:16] shotbug: has joined #RubyOnRails
[10:46:46] Pumukel: has joined #RubyOnRails
[10:47:10] yaw: has joined #RubyOnRails
[10:49:11] Jameser: has joined #RubyOnRails
[10:58:28] User458764: has joined #RubyOnRails
[10:59:00] User458764: has joined #RubyOnRails
[11:02:21] arup_r: has joined #RubyOnRails
[11:03:33] arBmind: has joined #RubyOnRails
[11:16:54] HoierM: has joined #RubyOnRails
[11:18:31] waseem_: has joined #RubyOnRails
[11:19:20] elsurudo: has joined #RubyOnRails
[11:21:43] elsurudo: Hi all. So I have a form in a modal generated like so: `form_for :resource_name, url: …`. I change the `action` of this form via JS, because it may apply to a different resource, depending on how you open then containing modal. Now, the problem is that if the page has been navigated to via turbolinks, I get a `ActionController::InvalidAuthenticityToken` on POST. The form does have an authenticity_token, but it seems it is not
[11:21:43] elsurudo: correct. Any ideas?
[11:23:15] arup_r: show your form and js also pls
[11:23:20] elsurudo: I’m not usre if the authenticity token is somehow tied to a particular POST action URL
[11:23:54] elsurudo: Form: <%= form_for :layout_task, url: production_layout_task_mark_completed_path(layout_task_id: 'LAYOUT_TASK_ID'), method: :patch, data: { confirm: "Are you sure you want to approve this layout?" } do %>
[11:24:31] elsurudo: JS: const formPostPath = form.attr('action').replace('LAYOUT_TASK_ID', item.id); form.attr('action', formPostPath);
[11:24:48] elsurudo: Then it’s up to the user to submit the form, which is jsut a regular HTTP post (non-remote)
[11:25:58] shotbug: has joined #RubyOnRails
[11:26:44] elsurudo: @arup_r With a regular button
[11:27:34] arup_r: auth token comes from meta tag inside the HEAD tag
[11:28:30] arup_r: elsurudo: when u do submit, can u check in browser devtool if there is any JS errors in the console?
[11:28:33] elsurudo: I have `<%= csrf_meta_tags %>` there. All my other forms work
[11:29:15] arup_r: check what U said. Because form.attr('action').replace('LAYOUT_TASK_ID', item.id); line doesn't look right.
[11:29:54] elsurudo: Right, because I need to change the POST url. I am just replacing a placeholder with the actual resource ID. It’s a pattern I’ve used before
[11:30:31] arup_r: can u check is there error in the devtool console.. when u are submitting the form
[11:31:51] arup_r: also u can inspect the form in browser and check the hidden input values .. if it is getting cleared as a side effect of any of your JS in place.
[11:32:15] arup_r: Rails stores the token in a hidden field inside the form
[11:32:16] elsurudo: Nope, there are no errors, and the auth token isn’t getting cleared
[11:32:25] elsurudo: Yes, it is still there after my JS
[11:33:15] arup_r: can u show the rails log that comes when u submit the form?
[11:33:31] arup_r: just that part.
[11:33:54] elsurudo: Was jsut about to do that
[11:33:58] elsurudo: Parameters: {"utf8"=>"✓", "authenticity_token"=>"XvwrcYPIytG28aQedgJpdn9/ZQsOxbFSjPGPTV3FaCb0UdI5wIW75Qdt8F2eJ/ZdVGSVmU0MDxK6IC05fK4dpw==", "layout_task_id"=>"3"}
[11:33:59] elsurudo: Can't verify CSRF token authenticity.
[11:34:27] elsurudo: The ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken): and a long stack trace
[11:37:13] elsurudo: If it gets submitted with the form via the hidden field, what are the tags in the head even for, btw?
[11:39:05] arup_r: <meta name="csrf-param" content="authenticity_token"> and <meta name="csrf-token" content="+4c4pOFi8NovCIC7pIZnQ==">
[11:39:27] SteenJobs: has joined #RubyOnRails
[11:39:42] arup_r: so rails geneally put the content of meta[name="csrf-token"] inside the token of form
[11:40:16] arup_r: so when u reload the browser and match this values, Does they match ? They will be exactly same.
[11:41:09] elsurudo: So I’m look at a form in another part of my app that is working properly, and they don’t even match there
[11:41:23] elsurudo: And this form gets no error on POST
[11:41:32] elsurudo: I think those may be different somehow
[11:42:51] arup_r: checking in my app. :)
[11:44:13] webdestroya: has joined #RubyOnRails
[11:47:23] Jameser: has joined #RubyOnRails
[11:47:52] Pumukel: has joined #RubyOnRails
[11:50:10] arup_r: elsurudo: see they are same -> https://gist.github.com/aruprakshit/939bec0b5510bec8c0a5bcaa49944731 Look inside from and meta
[11:50:24] arup_r: that is rails 5.0.2
[11:51:10] elsurudo: I am on Rails 5.1.0
[11:51:24] elsurudo: So mine are different… but that form works. Hmm...
[11:51:49] arup_r: elsurudo: well instead chnaging url, why not adding a hidden field to the form and update it using JS?
[11:52:20] elsurudo: You think the token is somehow hashed with the URL or something? How can that be, if yours are identical?
[11:52:53] arup_r: no tokens are not connected with the url
[11:53:05] elsurudo: So why would me changing the URL cause any issue?
[11:54:29] arup_r: don't know yet,.. disable the JS code and see if they are matching.. It seems hard now to help in this black room without seeing the actual ground
[11:55:27] elsurudo: Fair enough, thanks for the help in any case
[11:55:31] elsurudo: It’s a puzzle
[11:56:14] AimlessRAven: has joined #RubyOnRails
[11:56:50] arup_r: or u can change the developement secret key in the yml file and restart see if they are still different or not :)
[11:58:57] arup_r: elsurudo: https://github.com/rails/rails/issues/23524
[12:03:00] arup_r: elsurudo: so this comment https://github.com/rails/rails/issues/23524#issuecomment-180899424 may be your issue
[12:04:15] arup_r: But why in my case both values are same I am now thinking.. those smart people made changes to their magic from release to release :)
[12:06:28] fmcgeough: has joined #RubyOnRails
[12:11:06] brent__: has joined #RubyOnRails
[12:16:12] elsurudo: @arup_r Thanks for the links. This is definitely on the right track. So it looks like my hunch was correct: https://github.com/rails/rails/issues/24257#issuecomment-205556315 (“The form CSRF token is per-form and contains the information of form action and the form method.”)
[12:17:01] arup_r: That screwed you.. it was a silent change.. I was not aware of too
[12:17:05] elsurudo: So me fudging the URL is JS is bad news. But what is the simplest solution, I wonder...
[12:17:20] arup_r: I think your way to go now is using hidden field inside the form elsurudo
[12:17:25] elsurudo: Yeah, like I said my solution worked fine before.
[12:17:41] elsurudo: Damn, I’d like to avoid that because it’s not the most RESTful
[12:17:52] elsurudo: Right now my routes make more sense, with the ID being the path...
[12:18:31] arup_r: ok.. so that thing is part of your path, not query param?
[12:19:38] elsurudo: that’s right
[12:19:48] elsurudo: it’s the ID of the resource to update
[12:19:54] elsurudo: so it’s ideal for it to be in the path
[12:23:33] elsurudo: anyways this is good to know. now I know I can’t upgrade my other 5.0 project without first solving this issue (I used the same pattern there)
[12:30:29] AntiSpamMeta: has joined #RubyOnRails
[12:32:20] francuz: hello everyone, i'm struggling in my search for a documentation about the include statements as in : "has_many :accounts, -> { includes :representative }"
[12:32:41] francuz: is it exactly the same thing as has_many :accounts
[12:32:41] francuz: has_many :representative, through: :accounts
[12:37:31] User458764: has joined #RubyOnRails
[12:38:03] sonOfRa: has joined #RubyOnRails
[12:38:27] quirkycoders: has joined #RubyOnRails
[12:39:54] arup_r: has joined #RubyOnRails
[12:41:56] lupine: representatives* presumably
[12:45:39] elsurudo: @francuz that pulls in the associated representatives along with the query (although in the case of `includes`, it’s up to rails whether it uses a join or a subsequent query to do this)
[12:46:01] elsurudo: See: http://api.rubyonrails.org/classes/ActiveRecord/QueryMethods.html#method-i-includes
[12:49:18] adlerdias: has joined #RubyOnRails
[12:52:15] morfin: again about Action Cable
[12:52:57] arup_r: go ahead! :p
[12:53:02] elsurudo: @francuz it eager-loads the further assoociation, so it makes sense to have that default scope in the `has_many` only if you always need the further assocation. otherwise, you waste a query
[12:53:36] morfin: ok i have common channel but when i create record if i render page containing it and send to every subscribed used that's not good idea
[12:54:12] morfin: basically there could be different combinations of page number + sort + filters for every user
[12:54:24] morfin: so i don't know which page user needs exactly
[12:54:25] francuz: @elsurudo yeah, so having a "though" is better when you need it sometimes and a includes when you need it everytime if I understood well,
[12:54:33] northfurr: has joined #RubyOnRails
[12:55:10] morfin: even if i will send JSON data to build grid page that's wrong
[12:59:13] elsurudo: @francuz different use-cases. a `through` also allows many-to-many, and storing other data along with the association
[12:59:29] elsurudo: @francuz naprawde jestes francuzem?
[12:59:56] elsurudo: `includes` just eager-loads the assocaition, it doesn’t change your model in any way
[13:01:27] francuz: @elsurudo serb, but as i live in french speaking country, people called me Francuz as a child, and I still use it
[13:03:00] peterhil: has joined #RubyOnRails
[13:10:04] xangria: has joined #RubyOnRails
[13:10:22] xangria: Hello guys
[13:11:01] xangria: I'm building a webapp and need some sort of pdf library where users can upload and download pdf from our website. where should I host these pdf's?
[13:11:23] xangria: I'm used to upload photos to Cloudinary but not sure if they handle pdf's or if it's the best solution
[13:13:41] eyal670: has joined #RubyOnRails
[13:16:48] |RicharD|: has joined #RubyOnRails
[13:18:23] |RicharD|: guys i have 3 tables User - Organization - Organisation User (has_many through association), the User has a custom attribute called image(is not in the db, is virtual)
[13:19:02] |RicharD|: then i have @organization.users.select('full_name, image') of course it doesn't work because image is not in the db but is virtual
[13:19:05] |RicharD|: how could do it ?
[13:20:51] arBmind: has joined #RubyOnRails
[13:22:28] cam27: has joined #RubyOnRails
[13:22:35] tbuehlmann: |RicharD|: if it's virtual, why select it?
[13:22:48] cam27: Do Rails developers use service layers?
[13:23:12] |RicharD|: tbuehlmann: and how could have it in the array of the attributes ?
[13:25:15] tbuehlmann: if it's a method, just call user.image
[13:25:59] |RicharD|: the problem is that I need an array that then I convert to a json
[13:26:09] |RicharD|: and in this array must be present the image field too
[13:27:05] tbuehlmann: so the actual problem is that user.as_json does not have that field, right?
[13:27:53] |RicharD|: this is what i've wrote: window.members = <%= @organization.users.select('full_name, username').to_json.html_safe %>;
[13:28:11] |RicharD|: the problem is that I want the virtual attribute image too
[13:29:31] spheric: has joined #RubyOnRails
[13:30:15] tbuehlmann: do you want as_json/to_json to always include that attribute or just for this one call?
[13:30:51] |RicharD|: for this call
[13:31:15] tbuehlmann: try .to_json(methods: [:image]) then
[13:31:16] |RicharD|: uhm maybe always is fine too
[13:32:00] DLSteve: has joined #RubyOnRails
[13:32:38] |RicharD|: if i want it for every call what you suggest ?
[13:32:40] |RicharD|: (btw this works)
[13:32:59] tbuehlmann: then I'd override User#serializable_hash
[13:34:06] northfurr: has joined #RubyOnRails
[13:34:34] |RicharD|: OK I will google it, thx
[13:37:35] chouhoulis: has joined #RubyOnRails
[13:39:13] arBmind: has joined #RubyOnRails
[13:39:19] xangria: arup_r thanks
[13:40:58] xangria: another thing. i have 3 tables Students - Teachers - Instruments. i want a student and a teacher to has_many intruments but when i do has_many students and teachers to create an object i have to assign both to the instrument
[13:42:11] jtdowney: has joined #RubyOnRails
[13:43:11] workmad3: has joined #RubyOnRails
[13:43:41] jtdowney: has joined #RubyOnRails
[13:43:52] |RicharD|: super weird
[13:44:07] |RicharD|: when I do: @organization.users.select('full_name, username') it takes anyway all fields, any idea ?
[13:46:25] laekur: has joined #RubyOnRails
[13:47:08] nebiros: has joined #RubyOnRails
[13:49:08] Pumukel: has joined #RubyOnRails
[13:49:10] romeoh: has joined #RubyOnRails
[13:54:42] jammanbo: has joined #RubyOnRails
[13:56:22] jammanbo: Suppose you'd gone and done this: post.comments.build([{...}, {...}]). Is there any way to unbuild some of those Comments? i.e. remove them so that when I call post.save, they don't get created.
[13:56:30] truenito: has joined #RubyOnRails
[13:57:16] chouhoulis: has joined #RubyOnRails
[14:01:50] laekur: has joined #RubyOnRails
[14:03:25] ovaltine: has joined #RubyOnRails
[14:03:51] xall_: has joined #RubyOnRails
[14:04:36] SteenJobs: has joined #RubyOnRails
[14:05:30] cam27: Why do people choose rails and not .NET
[14:06:41] fryguy: cam27: platform availability, cost, community size, library availability, ease of use for different sized projects are a few aspects to consider when choosing a platform for your application
[14:06:42] ovaltine: developer productivity over performance
[14:07:19] dionysus69: has joined #RubyOnRails
[14:07:34] jammanbo: Rails developers get invited to all the cool parties
[14:08:45] cam27: I was learning Rails, but no one locally uses it, so I got hired by a .NET shop and after a month they just let me go. SO Iahve to figure out what I should do. I enjoy Rails the most, but it seems like businesses are using .NET, so I after to figure out which one to take to the next level. I want to choose Rails.
[14:08:45] morfin: not sure about .NET perfomance
[14:08:45] Ergo: has joined #RubyOnRails
[14:09:38] morfin: and is actually that thing xsp ready for production
[14:10:07] morfin: (Nginx + .Net + Mono)
[14:11:16] patarr: has joined #RubyOnRails
[14:11:53] cam27: Even though I got a month of Good experience with .NET, their IRC Chatroom has 78 people in it right now and Ruby and Rails has 1200 combined
[14:12:46] ovaltine: cam27 that could be cultural difference, but imo rails is actually pretty popular in enterprise even when compared to .net
[14:12:55] cam27: The sources for what I was doing was almost non existant, unless I was asking the wrong questions
[14:13:02] morfin: with JRuby i guess?
[14:13:11] morfin: that could be faster than
[14:14:04] chouhoulis: has joined #RubyOnRails
[14:14:37] cam27: So the big thing where I was was service layers, and I was just about to get introduced to them, then they let me go. But I had never heard of Service layers before this job (I jsut graduated college) and I’m just wondering why I have never heard of it and if Rails uses them?
[14:16:41] cam27: FYI, this company only had two developers, they hired me as a junior saying in about 3 months I would be writing stuff for their software, but then after a month of training they pulled the plug on me and said we just don’t have the resources to make this work.
[14:17:32] cam27: Even though I was largely on y own adn would reach out a couple of times a day to ask a question.
[14:17:40] northfurr: has joined #RubyOnRails
[14:18:00] cam27: Sorry for my typos ^
[14:19:48] cam27: So yeah, I sucekd, but they knew that going in that I knew Java and Rails, but never wrote anything in C# or .NET and the tutorials were not like how they developed after finsihing them. So tough field.
[14:19:49] laekur: has joined #RubyOnRails
[14:21:06] mostlybadfly: has joined #RubyOnRails
[14:21:13] fernandomm: has joined #RubyOnRails
[14:23:23] lxnr: has joined #RubyOnRails
[14:24:55] cam27: They said I should have gotten through a 500 computer screen long tutorial in one day. and it took me a week. Well whatever, I know this probably isn’t a good place to mope, but this is more about career advice and what to focus on.
[14:25:38] cam27: So I ask the Rails community, what do I need to really know beyond CRUD
[14:27:38] arup_r: has joined #RubyOnRails
[14:28:11] cam27: I left off with RSpec, Jasmine, Angular, but I’m just wondering if I need to focus more on Service layers and things like that
[14:28:24] laekur: has joined #RubyOnRails
[14:29:17] cam27: fryguy, can you give me good references to take it to the next level
[14:29:26] laekur: has joined #RubyOnRails
[14:29:43] fryguy: metaprogramming ruby is probably worth a read
[14:33:15] ahrs: has joined #RubyOnRails
[14:34:05] cam27: So with .NET we used VS for debugging. One of my cahllenges with Rails was I used Vim and there was no way to know what was going wrong? THen I started using PRY. Is PRY the debugger for rails or how do Rails developers see the value of an ID during runtime?
[14:35:06] fryguy: most use pry
[14:35:25] fryguy: and unit tests
[14:37:48] cam27: Ok, then I was on the right track. Thanks for the info. I’m gonna get back into Rails, but no matter what I know it is never enough for the places around here. That was my second opportunity where I was let go after a month, and yet I wrote 20 controllers and 100 views
[14:41:01] fryguy: there's probably something else going o n
[14:41:31] northfurr: has joined #RubyOnRails
[14:49:11] arup_r: has joined #RubyOnRails
[14:50:01] Pumukel: has joined #RubyOnRails
[14:52:29] tbuehlmann: |RicharD|: what do you mean?
[14:55:37] xall_: has joined #RubyOnRails
[14:58:24] gil_: has joined #RubyOnRails
[14:59:39] patarr1: has joined #RubyOnRails
[14:59:58] |RicharD|: When I do : @organization.users.select('full_name, username').to_json
[15:00:22] |RicharD|: should returns only full name and username like fields, instead it returns all fields of user table
[15:00:54] tbuehlmann: to_json doesn't respect which fields are selected/loaded and which are not loaded, that's your job
[15:03:02] polishdub: has joined #RubyOnRails
[15:03:36] SteenJobs: has joined #RubyOnRails
[15:04:29] rodrigovlds: has joined #RubyOnRails
[15:05:44] |RicharD|: got it, done :) thx
[15:05:53] |RicharD|: (using only in the to_json options)
[15:17:38] [Butch]: has joined #RubyOnRails
[15:21:34] arup_r: Is this changed new Rails... Because 2 years back in Rails 4.2.x I remember I render such collection like render json: @collection and it does show only the fields I selected using .select('..')
[15:22:25] aajjbb: has joined #RubyOnRails
[15:22:41] arup_r: I just tested in Rails 5 console, and saw what tbuehlmann said. I am trying to remember the story of 2 years old.. :)
[15:26:05] Saukk: has joined #RubyOnRails
[15:29:38] hobodave: has joined #RubyOnRails
[15:31:46] brent__: has joined #RubyOnRails
[15:31:54] User458764: has joined #RubyOnRails
[15:40:37] ovaltine: you might have to '.to_a.to_json' to coerce it to return a collection first
[15:43:49] cpruitt: has joined #RubyOnRails
[15:44:14] cpruitt: has left #RubyOnRails: ()
[15:52:25] Pumukel: has joined #RubyOnRails
[15:52:36] sandstrom: has joined #RubyOnRails
[16:01:59] hashrocket: has joined #RubyOnRails
[16:04:31] Uranio: has joined #RubyOnRails
[16:15:52] laekur: has joined #RubyOnRails
[16:18:59] zapho: has joined #RubyOnRails
[16:27:40] gusrub: has joined #RubyOnRails
[16:30:46] laekur: has joined #RubyOnRails
[16:34:40] laekur_: has joined #RubyOnRails
[16:35:29] cam27: has joined #RubyOnRails
[16:42:38] lxnr: has left #RubyOnRails: ("WeeChat 1.7.1")
[16:46:21] laekur_: has joined #RubyOnRails
[16:51:43] laekur_: has joined #RubyOnRails
[16:52:00] northfurr: has joined #RubyOnRails
[16:53:02] Pumukel: has joined #RubyOnRails
[17:02:17] gusrub: has joined #RubyOnRails
[17:03:15] Rukeal: has joined #RubyOnRails
[17:04:14] xall_: has joined #RubyOnRails
[17:15:01] User458764: has joined #RubyOnRails
[17:15:30] defsdoor: has joined #RubyOnRails
[17:27:54] mikecmpbll: has joined #RubyOnRails
[17:29:30] chouhoulis: has joined #RubyOnRails
[17:29:35] nahtnam: has joined #RubyOnRails
[17:30:47] duderonomy: has joined #RubyOnRails
[17:40:03] cam27: has joined #RubyOnRails
[17:43:17] Thomas-0725: has joined #RubyOnRails
[17:49:44] syndikate: Hello people, I have an API only app, I want to add Google oauth to it, how do I go ahead doing that? I will probably require a frontend app to it, right? How would the flow be?
[17:54:39] Pumukel: has joined #RubyOnRails
[17:55:37] Uranio: has joined #RubyOnRails
[17:55:52] Uranio: has left #RubyOnRails: ()
[18:13:00] pupsicle: has joined #RubyOnRails
[18:15:32] gusrub: has joined #RubyOnRails
[18:16:09] sandstrom: has joined #RubyOnRails
[18:16:21] laekur_: has joined #RubyOnRails
[18:20:53] laekur: has joined #RubyOnRails
[18:21:36] laekur: has joined #RubyOnRails
[18:22:54] laekur_: has joined #RubyOnRails
[18:24:24] ur5us: has joined #RubyOnRails
[18:24:39] lxsameer: has joined #RubyOnRails
[18:25:40] laekur: has joined #RubyOnRails
[18:30:15] laekur_: has joined #RubyOnRails
[18:39:47] joeyk: I am using will_paginate for a search that's a POST. When I click on the next page I am losing the search parameter. Is there a recommended/clean way to handle that?
[18:46:30] joeyk: to n00b of a question for you guys?:(
[18:47:04] tbuehlmann: I guess you can just add the param to the will_paginate call: will_paginate(@records, params: {search: params[:search]})
[18:47:24] Diabolik: has joined #RubyOnRails
[18:47:56] User458764: has joined #RubyOnRails
[18:48:16] Diabolik: has anyone here used grape to create multiple instances of a model at a time?
[18:54:57] quirkycoders: has joined #RubyOnRails
[18:56:03] Pumukel: has joined #RubyOnRails
[18:59:23] hobodave_: has joined #RubyOnRails
[19:00:20] joeyk: tbuehlmann: That's not a bad idea.
[19:00:36] joeyk: tbuehlmann: I googled and found apparently using POST with will_paginate is not necessarily a wide supported thing
[19:03:33] salios: has joined #RubyOnRails
[19:08:02] spheric: has joined #RubyOnRails
[19:10:25] srinidhi: has joined #RubyOnRails
[19:17:48] bronson: has joined #RubyOnRails
[19:18:36] gusrub: has joined #RubyOnRails
[19:23:20] fernandomm: has joined #RubyOnRails
[19:27:19] netzfisch: has joined #RubyOnRails
[19:31:08] arup_r: has joined #RubyOnRails
[19:51:12] fernandomm: has joined #RubyOnRails
[19:51:35] marr: has joined #RubyOnRails
[19:56:58] quirkycoders: has joined #RubyOnRails
[19:57:34] Pumukel: has joined #RubyOnRails
[19:59:43] mikecmpbll: has joined #RubyOnRails
[20:02:30] patarr: has joined #RubyOnRails
[20:18:17] bronson: has joined #RubyOnRails
[20:26:09] mahloun: has joined #RubyOnRails
[20:26:23] Thomas-0725: has joined #RubyOnRails
[20:28:10] hahuang65: has joined #RubyOnRails
[20:28:12] hahuang65: hmm what is the <> operator in an AR query?
[20:29:28] v|sh: has joined #RubyOnRails
[20:34:13] Thomas-0725: has joined #RubyOnRails
[20:36:47] arup_r: it is postgres not equal operator https://www.postgresql.org/docs/9.0/static/functions-comparison.html
[20:37:29] hahuang65: arup_r: thanks
[20:43:27] francuz: has joined #RubyOnRails
[20:58:59] Pumukel: has joined #RubyOnRails
[21:03:40] dnyy: anyone use knock? having issue trying to find or create a user. https://gist.github.com/dannytatom/00f8c513d00105825974581c945fdd10 when #from_token_request is called, the logs show a SELECT query with the right stuff so it's trying to find it, but then it's halted because it can't before creating?
[21:03:46] dnyy: no idea how to get this working
[21:08:14] Thomas-0725: has joined #RubyOnRails
[21:09:16] gusrub: has joined #RubyOnRails
[21:20:01] ur5us: has joined #RubyOnRails
[21:32:29] hndk: has joined #RubyOnRails
[21:35:31] gambl0re: has joined #RubyOnRails
[21:41:32] Thomas-0725: has joined #RubyOnRails
[21:42:57] SteenJobs: has joined #RubyOnRails
[21:43:48] Thomas-0725: has joined #RubyOnRails
[21:48:46] v|sh: has joined #RubyOnRails
[21:54:35] aajjbb: has joined #RubyOnRails
[21:56:07] das3in: has joined #RubyOnRails
[22:00:50] dps: has joined #RubyOnRails
[22:01:17] tercenya: has joined #RubyOnRails
[22:05:13] railsForDaiz: has joined #RubyOnRails
[22:12:10] SteenJobs: has joined #RubyOnRails
[22:15:19] dps: has joined #RubyOnRails
[22:17:19] elcontrastador: has joined #RubyOnRails
[22:19:15] bronson: has joined #RubyOnRails
[22:20:08] mrgreenfur: has joined #RubyOnRails
[22:31:49] amperry: has left #RubyOnRails: ("ERC (IRC client for Emacs 24.5.1)")
[22:47:53] wethu: has joined #RubyOnRails
[22:59:53] Pumukel: has joined #RubyOnRails
[23:10:20] antib: has joined #RubyOnRails
[23:11:44] gusrub: has joined #RubyOnRails
[23:14:17] cam27: has joined #RubyOnRails
[23:21:38] DLSteve: has joined #RubyOnRails
[23:21:48] v|sh: has joined #RubyOnRails
[23:25:29] quirkycoders: has joined #RubyOnRails
[23:46:14] v|sh: has joined #RubyOnRails
[23:50:22] bronson: has joined #RubyOnRails