« Back to channel list

#RubyOnRails - 15 April 2015

« Back 1 day Forward 1 day »
[00:00:03] Radar: renegadeandy: !didntwork
[00:00:03] helpa: renegadeandy: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[00:00:21] renegadeandy: Radar: it didnt challenge me for a username and password
[00:00:31] Radar: renegadeandy: Steps to reproduce in a new app please
[00:05:06] neredsenvy: My ror script needs to call a system (ubuntu) function like so encode_video = `avconv -f image2 -framerate 24 -i ./res/img_1/%d.jpg -crf 1 ./res/img_1/out.mov`
[00:05:41] neredsenvy: Now this works but it does it on the same thread as the request is there a way to run system call and not wait for it to finish but just render the template
[00:09:39] centrx: neredsenvy, system
[00:10:06] neredsenvy: centrx, I had the problem because I was using system `..`
[00:16:04] Radar: neredsenvy: Why not use a background worker like sidekiq?
[00:16:27] Radar: system won't background it
[00:16:44] neredsenvy: Radar, I had to do system "... &"
[00:16:49] neredsenvy: and it runs in background
[00:16:54] Radar: neredsenvy: But don't you care if that command succeeds?
[00:17:02] wethu: Hey, vanilla devise path for reset token, is just users/password/edit?reset_password_token=unique_secrets ? Had to generate one manually never really looked at the path it creates in the outgoing email...
[00:17:42] neredsenvy: Radar, I do I'm pretty new to Rails tho
[00:17:46] wethu: was expecting something like users/password/:id/edit?reset_password_token=foo
[00:18:01] wethu: or users/:id/password
[00:18:02] sevenseacat: wethu: check your rake routes
[00:18:08] wethu: yeah thats what it has
[00:18:17] sevenseacat: then there you go
[00:18:22] wethu: just didn't seem right, devise probably finds users just by the unique token
[00:18:28] sevenseacat: yes, it does.
[00:18:45] sevenseacat: why do you need an extra ID when you have a unique token?
[00:19:14] wethu: I'm just sending a manually generated one to a customer because our mail server is dead
[00:19:42] wethu: wanted to be 100% before i got back "THAT LINX NOT GOOD DERP DEP I CANTZ CHANGE ETTT!"
[00:21:43] wethu: most of our customers are lacking blood flow to the brain during the time they visit our site ;)
[00:22:34] Radar: neredsenvy: I don't understand how that matters. With Sidekiq, if that command were to fail the job would fail and you'd be able to see it. With using &, you will have no insight into when that job fails.
[00:23:28] neredsenvy: Radar, I went with Sidekiq I thot it was going to be more complicated but it seems pretty easy just wrapping the system call into worker method without the &
[00:24:49] neredsenvy: Radar, Just skiming the docs of the gem to see how to update the database when task is done
[00:34:01] bricker: I always wondered about what it's like to be a developer for a porn website
[00:34:11] bricker: so many questions
[00:35:43] Diabolik: bricker i know one of the guys who runs vporn
[00:35:48] sevenseacat: i've heard you get really desensitized. a friend of mine used to be one
[00:35:55] Diabolik: the amount of money they make is insane
[00:36:00] bricker: Yeah, I imagine you would
[00:36:04] Diabolik: like ??4k a day
[00:36:11] Diabolik: completely passive
[00:37:50] bricker: I also wonder what their CMS is like
[00:38:10] Diabolik: similar to youtube if i remember correctly
[00:38:21] Diabolik: they just did a massive switchover to html5 instead of flash though
[00:42:44] neredsenvy: Radar, Ok it's pretty complicated think I'm going to go with system call
[00:43:35] neredsenvy: Trying to get Sidekiq to run
[00:43:47] sevenseacat: run the `sidekiq` command?
[00:44:35] neredsenvy: Just trying to perform a task via sidekiq but it's causing problems
[00:45:10] weaksauce: Diabolik what's their main source of income?
[00:46:37] neredsenvy: When I run bundle exec sidekiq I get superclass mismatch for class Child
[00:46:45] neredsenvy: Child class is my model
[00:47:13] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[00:47:15] weaksauce: try changing the name of Child to something more descriptive
[00:47:33] weaksauce: Child is being used for something else apparently
[00:47:59] weaksauce: neredsenvy^
[00:48:11] Diabolik: weaksauce ads
[00:48:18] neredsenvy: weaksauce, I would have to change a lot of code
[00:48:44] weaksauce: well neredsenvy I don't know what to say then?
[00:49:10] weaksauce: you are probably using a gem that has a class called Child
[00:49:35] neredsenvy: Yup in Sidekiq
[00:49:41] neredsenvy: guess I have to dump the gem then
[00:50:03] weaksauce: or find and replace child in your code with something much more descripitve
[00:50:08] weaksauce: descriptive*
[01:02:21] bourbon: when is a result exceptional?
[01:02:31] bourbon: is it exceptional if a user tries to access a resource that they do not have authorization for?
[01:02:44] bourbon: it sure is an easy way to relay information about an error state to throw exceptions, at least
[01:03:07] bourbon: is the best way to return that information by wrapping everything in objects that contain pass/fail information + results?
[01:03:18] centrx: user mistakes shouldn't through program exceptions
[01:03:29] sevenseacat: what centrx said
[01:03:47] bourbon: I see that, at least
[01:03:47] centrx: Using exceptions for flow control is generally frowned upon
[01:03:52] sevenseacat: your app should handle all user input appropriately
[01:04:02] bourbon: sevenseacat: did I say that it shouldn't?
[01:04:09] bourbon: I'm asking about how it should do it
[01:04:12] bourbon: not whether it should
[01:04:22] bricker: arggg I want to argue with all of you but I don't have the energy
[01:04:25] sevenseacat: well your app throwing an uncaught exception isnt handling it appripriately
[01:04:39] bricker: ACTION gets back to work
[01:04:41] bourbon: sevenseacat: you're adding words, here
[01:04:46] bourbon: nobody said anything about uncaught exceptions
[01:05:10] centrx: bourbon, redirect to a 401 Unauthorized page or redirect to a login page
[01:05:15] sevenseacat: you're being very vague in your descriptions
[01:05:24] centrx: or just return a response with 401 header
[01:05:24] sevenseacat: so i'm adding words to make sense out of them
[01:05:27] bourbon: I have a bit of business logic
[01:05:32] bourbon: I call it from a controller
[01:05:45] bourbon: it currently does a few things - check and see if a user is allowed to edit an item, then edits the item
[01:05:55] bourbon: is it just that I need to break that out into more things?
[01:06:20] sevenseacat: well no - your controller is responsible for authorization
[01:07:00] bourbon: the controller is responsible for calling code that finds out if an action is authorized
[01:12:40] bourbon: is this guy's policy management legit looking? http://www.elabs.se/blog/52-simple-authorization-in-ruby-on-rails-apps
[01:13:16] sevenseacat: pundit is a great gem for authorization, yes.
[01:17:12] bourbon: I'll just go with their workflows, then
[01:25:25] data-cat: REPOST from #ruby: I'm having a problem writing a test for my controller. I was getting "RuntimeError: @controller is nil" but I get "NameError: uninitialized constant" when trying to initialize @controller in my setup method. Does this mean my test cannot find my controller?
[01:25:59] helpa: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[01:31:22] data-cat: https://gist.githubusercontent.com/chris--young/2729b3fd9fb0df216dc4/raw/5fc97e45ce4204fe051bd42cfc45b018dcd9087c/gistfile1.txt
[01:33:44] data-cat: Yea, I am new to Ruby and Rails still. Just trying to keep a sanity check while working on this. I can confirm that the route works using curl.
[01:33:47] Radar: data-cat: what's in test_helper?
[01:34:29] sevenseacat: do you actually have an IndependentMatcheesController ? that isnt a typo or anything?
[01:34:58] data-cat: https://gist.github.com/chris--young/ee53011173ffde85dae9
[01:36:23] data-cat: Yes, it is located at /app/controllers/api/v1/independent_matchees_controller.rb
[01:36:29] fp-: hey all
[01:36:36] fp-: ever since Rails 4.2 and Ruby 2.0, my views are taking an extra ~500ms to render
[01:36:43] fp-: Completed 200 OK in 659ms (Views: 643.8ms | ActiveRecord: 3.3ms)
[01:36:48] data-cat: I get the correct response with curl when I hit /api/v1/independent_matchees.
[01:36:51] fp-: that used to be like ~70ms
[01:37:02] fp-: is there a way I can somehow figure out what's taking so long?
[01:37:10] fp-: my partials all render under 10ms
[01:38:30] bourbon: fp-: look into profilers
[01:39:21] sevenseacat: data-cat: so thats not IndependentMatcheesController is it - thats Api::V1::IndependentMatcheesController or something
[01:41:25] data-cat: You are right, and I tried that before but had a typo (v1 instead of V1) so I went on assuming it was something else.
[01:41:30] data-cat: Thanks a lot for the help.
[01:41:32] data-cat: It is working now.
[01:42:01] sevenseacat: can often be the little things that trip us up
[01:42:52] data-cat: I am not used to the way Rails automates things using directory and file names.
[01:43:13] sevenseacat: it leans very heavily on conventions for filenames and class names
[01:43:24] sevenseacat: convention over configuration, as the saying goes
[01:44:50] sevenseacat: but most things can still be configured anyway :) like making "API" all uppercase instead of a bad pronunciation of 'happy'
[01:45:18] fp-: bourbon: it seems that profilers are for tests... is there a way to profile views?
[01:45:32] bourbon: profilers are just for code
[01:45:40] bourbon: not really familiar with ruby profiling tools, though
[01:45:49] bourbon: sevenseacat: Pundit::NotAuthorizedError is thrown when pundit says the user isn't authorized
[01:46:13] sevenseacat: thats correct.
[01:46:18] sevenseacat: then you rescue the error and handle it however you like.
[01:46:28] bourbon: wasn't that what you were just warning me off of doing?
[01:46:41] bourbon: ie: throwing exceptions for unauthorized actions?
[01:46:52] bourbon: sounds like it
[01:47:19] sevenseacat: you can't tell me off for adding extra words to your ideas, and then pretend I didn't add them
[01:47:49] sevenseacat: I said *uncaught* exceptions - if your user ever sees an exception, you have written poor code.
[01:48:07] bourbon: fine, but it's less helpful to change people's questions into questions you'd rather answer
[01:48:19] bourbon: so this pattern isn't "exception abuse"?
[01:48:29] sevenseacat: and like i said before, your question was very unclear so i added words to make it make some kind of sense.
[01:48:35] sevenseacat: no, it's not.
[01:48:51] bourbon: so authorization failure is "exceptional" enough to warrant these
[01:49:05] centrx: it's a judgement call
[01:50:08] bourbon: exceptions are a really easy way to define a different way to return data to calling code
[01:50:09] sevenseacat: i wouldnt say its an exceptional circumstance, but it's definitely a 'halt here and under no circumstance go any further, ever'
[01:50:36] sevenseacat: if you were just returning false or something, that could easily be continued and very bad things could happen
[01:51:58] sevenseacat: if you had a call in your controller `authorize! @site, :nuke_from_orbit`, and it returned false - what do you do?
[01:52:14] sevenseacat: you have to manually handle it in every single controller action
[01:52:19] bourbon: I'd hope that the only two return states were true... and false
[01:52:32] bourbon: that's really annoying
[01:52:33] sevenseacat: and it would be easy to much it up
[01:52:51] bourbon: I didn't want to have to repeat the auth ritual with copy/paste
[01:53:13] bourbon: and exceptions are attractive here for providing both an error signal and associated information
[01:53:19] sevenseacat: and if your site accidentally gets nuked from orbit because you miswrote some code, what do you say? 'oops'?
[01:53:36] bourbon: just need to check in with other coders here to see if using exceptions for this is abusive or not
[01:54:53] sevenseacat: i'm glad i spent the time explaining that so you can go 'thats cool, but i need to discuss it with other people anyway'
[01:55:01] sevenseacat: hopefully someone else learnt something from it :)
[01:55:46] Radar: The Rails Bible (aka Rails 4 in Action) says that rescuing from Pundit::NotAuthorized exceptions is acceptable.
[01:56:08] sevenseacat: i'm not sure i'd call it the bible :P
[01:56:34] Radar: Ok I will settle for "Your Favourite Rails Book" instead
[01:56:43] sevenseacat: still waiting for the freaking final meap... so glad i spent my entire easter weekend busting my ass on the book
[01:56:44] Radar: Where "your" is everyone's
[01:57:07] Radar: sevenseacat: I suspect it'll be out 1st May. Completely miss the party boat for Railsconf.
[02:01:09] Radar: If only there was some kind of foresight into when Railsconf was going to happen. Oh well.
[02:15:36] bricker: Would you accept "Favorite"?
[02:16:02] sevenseacat: no. damn americans.
[02:16:17] sevenseacat: corrupting the english language
[02:16:30] sevenseacat: though we did write 'color' in r4ia.
[02:16:32] bricker: courrupting*
[02:17:18] morenoh149: courrecktion
[02:30:58] anibara: Quick question regarding Git workflow in the project.
[02:30:58] anibara: So I create a branch for each day's challenge and then push it using git push -u origin <branchname>
[02:30:59] anibara: Followed by git checkout master and git merge <branchname>
[02:31:00] anibara: Is this the right workflow?
[02:31:57] centrx: You don't need to make a branch for everything, unless you have a lot of active developers or something, or a peer review system, non-technical reasons
[02:32:31] centrx: s/non-technical/organizational
[02:36:21] anibara: for personal projects only
[02:36:52] anibara: I am practicing getting into habit to create feature branches
[02:37:06] sevenseacat: i dont often use branches in personal projects unless I have a couple of streams of work on the go at once
[02:41:20] anibara: so if one is working on personal projects just keep it to master?
[02:41:45] sevenseacat: it depends on how you're working, and what is most comfortable for you.
[02:42:14] sevenseacat: if its just you, and you're working on one thing at a time, finishing it off before moving onto the next thing, then branches wont be much use.
[02:42:35] centrx: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[02:43:27] sevenseacat: most of the ideologies like git flow, are based around teams working on the same project
[02:44:21] anibara: gotcha. I am overdoing things it seems
[02:52:25] sevenseacat: if you ever find yourself wishing 'gee i wish i could just go back to my work from two days ago', then maybe thats a sign that you should have branched two days ago, and maybe you can incorporate that into your workflow
[02:52:32] sevenseacat: but if not, then do the simplest thing that works for you
[03:02:14] anibara: sure. Thanks for clarifying
[03:29:59] JDeen: Hi there. I haeve a multi-tenancy application where roles of a user is based on the current account he/she has chosen (app is similar in function to Trello). The point is the 'current_user' is not suficient for authorization as I also need `current_account`. In such a scenario, can we use CanCanCan for authorization? If not what is recommendable?
[03:36:54] arup_r: can I create a file like vendor/assets/javascript/shipment.js.erb ?
[03:36:55] arup_r: in vendor folder I can use erb template ?
[03:37:39] JDeen: arup_r: Yuu should be able to. I was in a project that had done that. They used ERB for some asset paths.
[03:38:14] arup_r: ok.. thanks
[03:39:12] arup_r: sevenseacat: new problem.. https://groups.google.com/forum/#!topic/spree-user/gdP5m-mgpRQ so if I can do use erb inside vendor.. then problem is solved I think.. I'll try.. this is the only part I got stuck now
[03:39:33] sevenseacat: have you tried it?
[03:39:59] arup_r: Last night.. I figured out.. Once I'll be in office I'll try it
[03:40:21] sevenseacat: so if you try it, and it doesnt work, then come for me to help. theres nothing you need me for now.
[03:40:24] arup_r: I can see the only option in Spree to "Overriding entire JavaScript files" to add a new JS content
[03:41:16] arup_r: sevenseacat: sure
[03:41:43] arup_r: thanks jdeen :
[03:44:45] JDeen: arup_r: np, spree, yah I remember that pain. The new version is coming with BS so thats some thing good and hopefully don't need to do massive view overides. Great power comes with great discomfort I would say ;)
[03:46:00] arup_r: ok bye.. catch you within 1 hour
[03:46:25] sevenseacat: i didnt have to do too much with the JS when i worked with spree, thankfully
[03:46:43] arup_r: i m unlucky then
[04:52:43] Radar: *crickets*
[05:24:15] arup_r: ship button working, but not mine one... https://gist.github.com/aruprakshit/c9debf33fb63256da312#file-shipments-js-erb-L76-L89
[05:24:36] arup_r: If I click nothing is happening..
[05:24:51] arup_r: I had overriden the file in the vendor directory (https://github.com/spree/spree/blob/080df18614ba/backend/app/assets/javascripts/spree/backend/shipments.js.erb#L53-L69)
[05:25:03] arup_r: O spree come on work!
[05:30:02] arup_r: it seems asset overriding wouldn't work for my version of Spree
[05:34:08] wethu: this scorpion statue sure is big, taking up so much room on my desk, but its so awesome !
[05:51:08] arup_r: Any hints what the `default_template` is doing here? https://github.com/spree/spree/blob/2-3-stable/api/app/controllers/spree/api/shipments_controller.rb#L42
[05:52:50] Radar: https://github.com/spree/spree/blob/2-3-stable/api/lib/spree/api/responders/rabl_template.rb#L16-L17
[05:53:19] arup_r: ok.. But the request is Ajax..
[05:53:36] arup_r: I never used .rabl extension
[05:53:38] Radar: You're not paying attention.
[05:53:46] Radar: rabl is the template language used in Spree's API.
[05:54:38] arup_r: someone clicked the `ship` button then this Ajax is getting called.. from here - https://github.com/spree/spree/blob/34395497f1aca458393a02fd35cc718fa6ebafd4/backend/app/assets/javascripts/spree/backend/shipments.js.erb#L53-L64
[05:54:57] arup_r: and then the template mentioned is rendered .. right ?
[05:56:32] Radar: arup_r: I guess so.
[05:56:46] Radar: arup_r: you're the expert here
[05:56:59] arup_r: I have added a similar feature just like `ship`,, which is `deliver`.. ... All is handled now.. except the refreshing the current page using Ajax call back,,,
[05:57:06] IFrank00: I'm trying to add a crop option for my users following this tut from rails cast http://railscasts.com/episodes/182-cropping-images but can pass the step of rendering crop action
[05:57:46] arup_r: Radar: in case of `ship`.. that is happeing which the is written by the core team.. But mine one not working..
[05:57:55] Radar: arup_r: I can't help you.
[05:58:00] arup_r: I tried everything I could do.. but no luck! :(
[05:58:08] arup_r: Radar: its ok.. :)
[05:58:39] IFrank00: https://gist.github.com/Frank004/de803fc988d31b50c2da this what I add to the controller but dont know if is the correct way
[05:59:42] IFrank00: when the form is sent get redirect to the show view
[06:00:11] IFrank00: I want it to go is photo is present on the service_comppany
[06:00:37] Radar: if @service_company.photo.present?
[06:00:48] Radar: Don't use blank? (a negative term) when using an else.
[06:00:59] Radar: Sorry, that should be do not not not use blank?, etc.
[06:01:06] Radar: See how confusing stacking multiple negative terms is :)
[06:01:08] IFrank00: I try with present or blank
[06:03:31] IFrank00: thanx radar
[06:03:52] Radar: no worries
[06:04:05] IFrank00: radar, at first I try it with present but dint work
[06:04:15] Radar: IFrank00: !didntwork
[06:04:15] helpa: IFrank00: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[06:04:20] IFrank00: but now its working
[06:04:41] IFrank00: the render part
[06:04:49] IFrank00: render of the :crop
[06:07:48] IFrank00: Work!!!!! Radar, Thank you
[06:07:53] Radar: omg magical
[06:11:15] Radar: I spy a mythical tagrudev.
[06:11:34] tagrudev: like creature or salary Radar ?
[06:11:55] sevenseacat: mythical salary? >_>
[06:12:23] tagrudev: yeah the struggle is mythical
[06:32:45] Morkel: Does anybody use materialized views with postgresql in rails?
[06:35:06] sevenseacat: only once, and it was a pain
[06:40:16] Morkel: sevenseacat: I thought that this is not the best way. I search for a way to add a field to one table. Table A has Payments, Table B Orders. I try to add an last_payment column to B. I can make this with a view/ joins but is ther a way to do it this rails?
[06:40:31] Morkel: not this, with
[06:40:37] sevenseacat: Morkel: write a migration to add the new column to the table?
[06:42:19] Morkel: Than i must update it every time. Example: New Payment in Table A after a while i remove this payment. I must also change the Table b. With an join or subselect is this no problem
[06:42:51] sevenseacat: then use a join or a subselect
[06:43:10] zvive: Wouldn't it be better to do a Payments table w/ a date, then just search for last payment or payment that matches the user and sort by date?
[06:46:23] arup_r: sevenseacat: it worked... But I put it inside the app/assets/javascripts/spree/backend/shipments.js.erb not in vendor/assets/javascripts/spree/backend/shipments.js.erb
[06:46:34] sevenseacat: arup_r: cool story.
[06:46:47] arup_r: May be Spree is not beautiful with Vendor
[06:48:11] Radar: It should work either way. Both of those paths are in Sprockets asset paths.
[06:48:33] arup_r: I don't know it didn't
[06:49:06] arup_r: I follow this post also https://groups.google.com/forum/#!topic/spree-user/yojpih37a40 as David mentioned vendor didn't work for him to.. he used some other work around..
[06:49:37] Radar: Ahh I miss the ~200 daily emails from spree stuff.
[06:50:16] arup_r: Radar: I read all emails there.. People have same issue not working asset overriding as documented..
[06:50:19] sevenseacat: i sense the immense sarcasm coming off you in waves.
[06:50:25] arup_r: Anyway I found my work around
[06:50:27] Radar: No way you read all the emails.
[06:50:32] Radar: Nobody can read ALL THE EMAILS.
[06:50:37] Radar: You probably read that whole thread
[06:50:48] arup_r: Not ALL.. only my issue related emails
[06:50:50] Radar: and the last post before you posted was ME asking for steps to reprduce
[06:50:53] sevenseacat: i visited the spree group for a while, but it was mostly people with broken english who never read documentation
[06:50:59] Radar: And the user not giving them, which is ETERRRNNAALLLYYY frustrating.
[06:51:17] Radar: sevenseacat: as opposed to english-speaking people who are reading the broken documentation? :)
[06:51:24] sevenseacat: well there's that
[06:51:50] sevenseacat: i loved the upgrade instructions for spree 2.4. 'change your gemfile, update, then click around your site and make sure it still works'
[06:52:23] arup_r: I read only http://goo.gl/tqQZLv
[06:53:13] sevenseacat: the most recent discussion is 18 months ago
[06:54:52] Radar: sevenseacat: It's hard to write upgrade guides for Spree because sites customise it so much.
[06:55:00] sevenseacat: oh i know, and we did
[06:55:46] Radar: I think a dumb API-only version of Spree would be a much better thing to provide to people.
[06:55:52] Radar: We provide the schema, they provide the logic.
[06:56:07] arup_r: Deface is good.. but it is not for Assets.. :(
[06:56:07] Radar: (yeah, I still say "we" every now and again)
[06:56:18] Radar: Rather than having Spree have all this crap for customisations.
[06:56:22] Radar: arup_r: Yes, it's not for assets.
[06:56:23] sevenseacat: Radar: that sounds like a good topic for a book, building the engine and then building the app.
[06:56:25] Radar: Deface is not good at all.
[06:56:35] Radar: sevenseacat: MY PLAN REVEALED
[06:56:36] sevenseacat: im sure the internals of deface are horrid, but it works quite well.
[06:56:59] sevenseacat: i used it a *lot*.
[06:57:20] Radar: I have no idea if such a system would work that well. Spree provides a lot of customisation and that is what makes it hard to maintain (as an OSS developer)
[06:57:28] arup_r: sevenseacat: which book ?
[06:57:41] Radar: arup_r: One from THE FUTURE
[06:57:43] sevenseacat: the problem is that the interface and the business logic are inherently tied together.
[06:57:52] Radar: ^ There we go we have a publication date.
[06:58:05] arup_r: ok.. Radar: topic of the book ?
[06:58:13] sevenseacat: if you do what arup_r is doing and add another state to the order process, then you have to change both.
[06:58:20] Radar: "How to give arup_r all the knowledge he needs to stop asking so many questions."
[06:58:30] Radar: Not sure if that should be the title or the subtitle.
[06:58:46] Radar: actually that location is a bit too cold for my liking
[06:59:02] Radar: Much better! That's where the book launch party will be held.
[07:00:10] Radar: sevenseacat: In my ideal version of Spree there would be no order state :)
[07:00:24] Radar: Sure you could have a state column.
[07:00:36] sevenseacat: truth be told i have no idea how you would split something like spree apart in that fashion.
[07:00:41] Radar: I'd like to design it to be explicit.
[07:01:07] Radar: All that callback logic is... well, it can mess with your head.
[07:01:10] sevenseacat: i still want to build my SO clone
[07:01:16] sevenseacat: for shits and giggles
[07:01:31] Radar: sevenseacat: I tried doing that kind of splitting apart before I quit. One of the reasons I quit is because I had nobody to help me on the project.
[07:01:40] Radar: I asked for help several times but was told everyone was busy.
[07:02:59] sevenseacat: i remember them feels well - every change that would make the code better was always 'next round of funding'
[07:06:54] quazimodo: sevenseacat: any idea why my nested form would make "accounts" => { "plan" => 2 } rather than "account_attributes" => { "plan_id" => 2 } ?
[07:07:08] quazimodo: all the accepts_nested, strong params etc are set up right
[07:07:11] quazimodo: even the nested form
[07:07:19] quazimodo: ACTION wonders what's missing
[07:07:20] sevenseacat: but I'm going to pretend I don't because you don't give enough information to debug the problem
[07:08:30] arup_r: ACTION having a cup of tea after playing with Spree since 3 days..
[07:08:47] quazimodo: sevenseacat: lol i'm gisting!
[07:08:52] arup_r: This project seems will never end...
[07:08:59] sevenseacat: arup_r: after three days?
[07:09:24] arup_r: Again we got too many features to add this risky project.. where I need to read Spree code first and then adding new features..
[07:09:47] sevenseacat: the spree project i was working on went for six months before i quit, and it still isnt in production.
[07:09:53] arup_r: I mean 1 day.. including my sleeping hours it is 3 days...
[07:10:11] arup_r: sevenseacat: why not in production ?
[07:10:13] sevenseacat: and it was only 'a basic e-commerce site right'
[07:10:18] sevenseacat: because its not finished
[07:10:20] arup_r: Although our is also not in prod
[07:10:43] arup_r: I am keep pushing the Staging branch
[07:11:14] arup_r: We now added printing invoice gem.. and it is breaking again.. Time to play with Spree invoice priting Gem
[07:11:32] arup_r: All currency symbol is coming as `_`..
[07:11:38] arup_r: I don't know whjy
[07:11:48] sevenseacat: thanks helpa.
[07:12:06] quazimodo: sevenseacat: it appears to have fixed itself :/
[07:12:12] arup_r: Spree is good overall.. to Understand Rails..
[07:12:13] sevenseacat: quazimodo: magic!!
[07:12:17] quazimodo: partially :/
[07:12:17] arup_r: lots of here and there..
[07:16:13] sevenseacat: arup_r: the best way to understand rails is by building apps from scratch with it, first, not by looking at existing complex engines.
[07:16:18] sevenseacat: complex, warty engines
[07:18:32] arup_r: humm.. I am doing 2 scratch app
[07:19:23] arup_r: to undersand the flow
[07:41:57] techsethi: Hi Folks, I have a requirement where I need to display records to a user from a table, if the record belongs to his team member. In other words, if the created by column for the record is in my team. the requirement for the team is that if that person is my employee or my employee's employee. This relationship I have stored in the user table. I am looking for any pointers on how to handle this efficiently and simply. Thanks in advance.
[08:11:20] dvdchr: Hi. I am setting up automated API test for my production and staging server.. However, how do you guys usually test API that cause database changes? i.e. registration APIs, insertions, deletions, and update.
[08:11:50] dvdchr: This is not specifically RoR question, though.. Just API testing practices in general.
[08:31:36] luser0: Hi guys. I am using Rails as API and angularjs on frontend and I need a gem that would work like that: on frontend I click 'generate pdf', some data is sent to rails, pdf is generated in there and sent back to front, after that download starts automatically. Is there any tool that allows it?
[08:33:19] ddv: luser_: this sounds like.... actual development
[08:33:44] sevenseacat: ddv: you mean I cant install a gem to do my job for me?
[08:33:58] ddv: sevenseacat: lol
[08:33:58] koriner: luser_: do you mean you want a gem for generating the pdf specifically?
[08:34:08] alextheger: When using sass-rails 5, how can I import/include a plain css file from a gem in my application.css.scss file?
[08:34:12] luser0: Yes, koriner.
[08:34:25] koriner: google sounds like the first place to start
[08:34:30] sevenseacat: alextheger: same way you'd include any other stylesheet
[08:34:33] koriner: there would be a lot of them
[08:34:42] ddv: luser_: send a json request to some controller action, let it generate some pdf view or whatever
[08:34:53] alextheger: sevenseacast: using "require"? Or using "@import"?
[08:35:03] luser0: I asked wrong question and it sounds like I am retarded.
[08:35:04] krz: hi guys. i am using Rails as API and Ember js. i need a gem that will give me money every day. approximately $50 would be nice
[08:35:09] ddv: luser_: do you want a gem to wipe your butt too?
[08:35:18] sevenseacat: alextheger: either.
[08:35:25] sevenseacat: alextheger: i dont use require for stylesheets.
[08:35:34] luser0: ddv: That'd be nice.
[08:36:04] alextheger: sevenseacat: well @import uses to work with with sass-rails 4, but no longer with sass-rails 5. https://github.com/rails/sass-rails/pull/280 seems to remove the support for that.
[08:36:44] sevenseacat: alextheger: that says that mixing requires and importsis bad, and i agree
[08:36:44] sevenseacat: which is why i dont use requires
[08:37:59] sevenseacat: alextheger: are you actually getting an error, or is this all just 'i dont know if it will work' hand-wavy stuff
[08:38:14] alextheger: sevenseacat: The css file of the gem does not use any require. Yet it still is not included, when using "@import my_css_file_from_gem".
[08:38:25] alextheger: I'm getting the error, that the styles are missing.
[08:38:35] sevenseacat: if the file cant be found, you'll get a big fat error message, which you can gist for us.
[08:38:40] alienaut: I got the FATAL: Peer authentication failed for user "instabase" error when i am trying to creatin database "rake db:create", i have user on my postgresql user.
[08:39:05] sevenseacat: alienaut: add `host: localhost` to your database config.
[08:40:09] rails_noob: hey all, have any of you updated to rails 4.2?
[08:40:14] sevenseacat: Rails_noob: yep.
[08:40:40] alienaut: sevenseacat: thanks!
[08:41:02] rails_noob: I am trying to update but am having issues with dependancy issues with jquery-rails as jquery requires actionpack 4.1.10 and rails 4.2 requires actionpac 4.2.0
[08:41:19] sevenseacat: Rails_noob: then you need to update jquery-rails too.
[08:41:39] rails_noob: I have tried???
[08:43:21] alextheger: sevenseacat: Thanks for your pointer. Actually my gem uses "require", so it's not possible to combine this with sass-rails 5. Thanks for your input.
[08:43:28] sevenseacat: alextheger: :)
[08:48:36] rails_noob: sevenseacat: I see where the issue is now. Ta :)
[08:49:06] PotatoChipz: Hi. Can someone point mo to the right direction. I am using Doorkeeper & Grape for my API. All's well. I just want to be able to check if the client id and client secret are valid upon SIGN UP?
[08:52:56] alienaut: is it ok to my "production: host: localhost" on my database.yml?
[08:59:13] pen: why is respond_to json rendering will still render view???
[08:59:25] pen: the majority of the request is view rendering when it is returning json
[08:59:41] pen: i'm using activemodel serializer but that shouldn't count as view rendering does it?
[09:04:08] universa1: pen: very easy to cross check, just render an empty json string instead
[09:04:16] ddv: pen: why are you not using jbuilder views?
[09:04:38] pen: ddv: how is it better than activemodel serializer?
[09:04:44] universa1: ddv: because am-serializers are a viable alternative? ;)
[09:05:06] pen: universa1: I have searched google and seems like respond_to is slower in some cases
[09:05:11] pen: and it will render view
[09:05:33] pen: https://github.com/rails/rails/issues/11250
[09:05:35] pen: something like this?
[09:05:44] universa1: pen: respond_to do |f|; f.json { render json: "{}" }
[09:06:59] pen: oh, but i'm just wondering if serialization count as view rendering
[09:07:01] krz: pen: i would just render :json :foo and let ASM handle whatevery object to throw into your json response
[09:07:01] pen: but it shouldn't be right
[09:07:26] pen: well, that's the fallback, but I am just wondering if respond_to is really rendering view somehow, dunno what it is rendering
[09:07:39] universa1: pen: development? production? code? ;)
[09:07:50] pen: production
[09:08:26] pen: just use an activemodel serializer and try to do respond_to with render json
[09:08:32] pen: it should be enough to reproduce
[09:08:56] sevenseacat: pen: if you want help, the burden of producing code is on you
[09:09:26] sevenseacat: you can't tell us to just go install gems and write code to test out *your* problem
[09:09:39] pen: well, all I want to know if someone knows if respond_to renders view, if not it's ok. i'm not asking for something that I need sample of
[09:09:48] pen: since it's not really a bug in my program i say
[09:09:50] pen: it's more in rails
[09:10:08] pen: and activemodel serializer maybe
[09:10:14] arrowcircle: hi! i want to make an activemodel class, that will save group of items (AR models) and have custom validations. what is the best way to do this? im against initialization of these items and assignment of items params in controller. Any ideas?
[09:10:18] krz: pen: render json and be done with it. i personally dont use respond_to and respond_with respectively
[09:10:24] sevenseacat: it's much more likely to be a bug in your code, than rails. but seeing as you havent shown any code...
[09:10:29] rails_noob: sevenseacat: could you explain the respond_with change to me? as I understand it you can???t set your responses at a class level now right? So I must set respond_to blocks for each def right? is this the correct understanding?
[09:10:44] sevenseacat: Rails_noob: no idea what you're talking about.
[09:11:01] pen: whether respond_to rendering view in a json request is my code's bug?? seriously
[09:11:14] sevenseacat: pen: if you have a problem with your code, gist your code.
[09:11:18] sevenseacat: or stop wasting people's time.
[09:11:27] workmad3: Rails_noob: are you alluding to responders being moved out of rails core and into the responders gem in rails 4.2?
[09:11:49] pen: you are not getting paid who is wasting your time?
[09:12:03] sevenseacat: pen: you are.
[09:12:05] workmad3: ah yes, because time is donated freely, it must be worthless
[09:12:46] rails_noob: so im assuming they are trying to get to a point where this responders isn???t being used anymore?
[09:13:11] universa1: pen: you deduced that it's rendering some "view" by seeing time spent on the rendering part in the request log? haven't checked into the isntrumentation, etc... but i highly suspect the timing tstarts at the call of render and stops whenever it is finished.
[09:13:15] arrowcircle: How to deal with activemodel nested ar models? https://gist.github.com/arrowcircle/bfac5fb01ee6b1776683
[09:13:16] rails_noob: but they have put it into a gem for now for depreciation?
[09:13:32] pen: universa1: yea, it's in the log
[09:13:42] pen: so I am wondering why views when it is a json request
[09:13:43] workmad3: Rails_noob: not really... DHH basically decided that he didn't like the pattern anymore, so wanted to ditch it... plataformatec already had a gem called 'responders' that added in some useful stuff around the rails core feature, so they basically took over the entire code chunk and incorporated it into the gem
[09:13:45] pen: response
[09:14:39] rails_noob: workmad3: but then the question is should we be finding out how to work without the respondors or are we just going to need to add this gem in every time?
[09:14:53] sevenseacat: if you want to use the responders, you add the gem.
[09:15:10] universa1: pen: so, check into how the rendering time is calculated... ...but responding with json is essentially view rendering... ...if you want to check it, just do json_response = WhateverSerializer....to_json; and respond_to do |f|; f.json json_response; end
[09:15:14] sevenseacat: if you dont, and a lot of people don't, then you don't.
[09:15:36] workmad3: Rails_noob: it's been moved into a third-party gem... if you want to use responders, add the gem, same as if you wanted to, say, use devise you add the gem... or want to use haml, you add the gem...
[09:15:56] sevenseacat: devise depends on responders, btw.
[09:16:53] pen: universa1: oh, I see maybe yea let me try
[09:17:36] universa1: arrowcircle: what is your question?
[09:18:19] arrowcircle: universa1, i want to assign items to composer in controller like composer.assing_attributes(composer_attributes), but active model dont have this method
[09:18:28] arrowcircle: universa1, how to make it right?
[09:18:28] pen: universa1: that's interesting, seems like passing with to_json seems to reduce view time, so the time spend in render is view I think that's interesting. this applies to render json: object as well.
[09:19:34] pen: universa1: oh, nvm have to test with bigger data
[09:31:00] PotatoChipz: How to validate doorkeeper API's client app ID and secret?
[09:31:41] PotatoChipz: Because right now, my API doesn't seem to validate the app id and secret of the app signing up
[10:06:34] mikecmpbll: are there any negative implications of using a stabby lambda as the value for the `if` or `unless` condition on a validation, as opposed to a Proc like the guides use
[10:07:13] mikecmpbll: validate :name, uniqueness: true, unless: Proc.new { |model| model.partial_build } vs validate :name, uniqueness: true, unless: -> (model) { model.partial_build }
[10:07:38] jhass: the only thing I could come up if the api for it changes, like it no longer passes a parameter or adds another one
[10:07:45] jhass: so not really, I guess
[10:08:39] tbuehlmann: I agree, not really
[10:08:47] arrowcircle: hi! how to deal with activemodel class with nested activerecord models? https://gist.github.com/arrowcircle/bfac5fb01ee6b1776683 . It works for new items records, how to make it work with existing items?
[10:09:50] mikecmpbll: tbuehlmann, jhass: i also note that with a stabby lambda I can simply do -> { partial_build }
[10:10:55] mikecmpbll: okay, sweet.
[10:10:57] jhass: mikecmpbll: which actually means there's code that handles them, try -> { }.call(1) or ->(model) { }.call in pry
[10:11:20] mikecmpbll: jhass: indeed that was my thinking
[10:23:31] arup_r: {{{{{}}}}}
[10:30:50] Veejay: Hello, I've noticed that the url helpers produce escaped paths in Rails 4.2 (as oppsed to the behaviour I was noticing on Rails 3.2). An example of that is: page_path(@page) => "/pages%2F12"
[10:31:27] Veejay: There used to be a "escape" option on url_for in previous versions of Rails but I can't find the reason why those paths are escaped
[10:33:39] aawe: Veejay: it does not do that
[10:33:51] aawe: how are you outputting it
[10:38:53] mikecmpbll: Veejay: there's a old github issue on this somewhere, 1 sec
[10:39:11] mikecmpbll: basically you have to use glob in your route definition to avoid it
[10:46:09] mikecmpbll: Veejay: https://github.com/rails/rails/issues/14636
[10:46:15] mikecmpbll: not sure that that's the issue i read before, but it's related.
[10:48:26] platzhirsch: after_update is not triggered after Base.save!, only after_save
[10:48:33] platzhirsch: that doesn't match up with the docs if I am not wrong
[10:57:20] Radar: it is triggered after both
[11:00:29] platzhirsch: yep.. but it's not : (
[11:01:12] jhass: are you sure it's not a new record?
[11:01:15] jhass: "The sequence for calling Base#save for an existing record is similar, except that each _create callback is replaced by the corresponding _update callback"
[11:01:53] platzhirsch: jhass: Base.make is called in my RSpec before block...
[11:02:26] platzhirsch: yes.. just looking up the docs
[11:02:58] jhass: There's no AR::Base#make
[11:03:03] platzhirsch: oh Machinist gem
[11:03:23] platzhirsch: should be equivalent to .new then, so I think you're spot on
[11:03:52] platzhirsch: well, the docs says it's saved
[11:23:29] lxsameer: guys, I have to desing a website and a very high traffic web API. My website is just for show off and giving a way some info. The api do the main thing
[11:23:48] lxsameer: I want to create the API on top of JVM using clojure and website using rails
[11:24:16] lxsameer: any suggestion to make this easier ? some thing like torquebox or similar ?
[11:27:06] ddv: lxsameer: define very high traffic
[11:27:40] ddv: lxsameer: https://github.com/intridea/grape is pretty nice
[11:27:40] lxsameer: ddv: about five million request per hour
[11:31:58] nerium: Since when was it not possible to pass a hash to redirect_to ?
[11:34:45] mikecmpbll: nerdman: since never?
[12:10:13] apeiros: uh??? in rails 3.2.21, are associations always validated? I neither have a `validate_associated`, nor an `accepts_nested_attributes_for`, yet model validation fails when one of its associations is not valid
[12:10:40] apeiros: somehow I thought I had to explicitly require validation of associations??? but I haven't used 3.2 for quite some time now???
[12:12:13] apeiros: aha! has_many :foos, validate: false
[12:12:24] apeiros: didn't remember that :-S
[12:20:47] ddv: has_many :fools
[12:32:06] mikecmpbll: hrmpf. is it possible to update a has_many association using the foo_ids= setter and not validate the Foos?
[12:32:36] tbuehlmann: phew. have you tried validate: false as second argument?
[12:32:48] mikecmpbll: to the association?
[12:32:53] universa1: mikecmpbll: Foo.where(id: foo_ids).update_all bar_id: some_id
[12:33:23] mikecmpbll: universa1: erg, thing is i'm doing it through a form and @bar.update(bar_params) (where bar_params includes foo_ids: [1,2,3,4])
[12:33:40] mikecmpbll: i guess there's no solution without diverting off that path
[12:33:51] universa1: mikecmpbll: hmm, why do you not want to validate?
[12:34:00] universa1: mikecmpbll: do you only not want to validate in that specific case?
[12:34:06] mikecmpbll: universa1: yes, only in that case
[12:34:16] mikecmpbll: universa1: they're partially constructed objects from a multistep form
[12:34:55] universa1: mikecmpbll: hmm, save(validate: false) doesn't work? or do you want to validate the base object?
[12:35:03] mikecmpbll: universa1: yes, the latter :'(
[12:35:18] creature: Hello. I'm trying to figure out some weird behaviour around the Rails session cookie. When I hit my app through the production config, I get a _myapp_sessionid cookie set as you'd expect. If I try to access it directly through unicorn, no such cookie is set. I am tearing my hair out over this.
[12:35:32] universa1: mikecmpbll: hmm, validates_assoicated :foos, if: :some_method ?
[12:35:38] universa1: mikecmpbll: guessing there
[12:35:54] creature: (I'm testing this by using `curl -svo /dev/null http://example.com/` to examine the response headers.
[12:38:21] universa1: creature: works for me locally, with a freshly installed unicorn
[12:39:29] creature: universa1: No doubt! I'm approaching this from an "There's an oddity in our setup" angle, not "There's a bug in Rails" angle. :)
[12:40:28] creature: I also get a sessionid set when I access my development instance, which is going through thin (ie. via `rails s`).
[12:41:03] creature: And I don't see what would prevent that header being *sent*. Even if the browser determined it was invalid, and opted not to actually set the cookie.
[12:41:23] creature: I don't know if (Rails|Rack|Unicorn) is going to examine any of those headers and strip them out if it thinks they don't apply.
[12:41:40] creature: (For instance, if we've managed to set an invalid domain or declared that cookie as ssl only or something).
[12:43:33] universa1: creature: did you set it to ssl only?
[12:44:33] mikecmpbll: universa1: nope no luck, because it fails to add the association regardless of any validations on the parent model
[12:44:37] djellemah: Snap poll: other than "we've always done it that way", is there a good reason that rails still uses @ivars to pass data from controller to view?
[12:45:00] Morkel: I have some Triggers in posstgres. Why does my test with fixtures not trigger this db triggers?
[12:45:08] creature: universa1: "Kind of". In production, it's set to ssl only. On development, it's not. But I've tried taking that option out (and bouncing Unicorn) and that hasn't made a difference.
[12:45:10] universa1: djellemah: what are the alternatives?
[12:45:40] universa1: creature: ok. no clue, was also just checking if it's a general problem, or a more specific one to your app :-)
[12:45:56] creature: Furthermore, in production we're terminating SSL on an nginx instance before passing off the request to haproxy, which in turn passes it off to another nginx, then it hits Unicorn. So the production instances shouldn't be seeing any SSL anyway.
[12:45:59] mikecmpbll: hm this is awkward. might have to overload user_ids on UserGroup and check for some virtual attribute that i can shove in my form
[12:46:33] creature: Morkel: Which database do you have configured for use in config/database.yml? Have you set your "test" environment to use postgres?
[12:46:57] Morkel: creature: Yes, the triggers are also in the test db
[12:47:39] djellemah: universa1: methods
[12:50:18] christopherbull: Are people here using Bower? Which approach are you guys using, bower-rails or rails-assets?
[12:50:38] mikecmpbll: christopherbull: i use rails-assets, but that's not really using bower
[12:50:52] universa1: christopherbull: rails-assets ... ...tried bower-rails, didn't really like all the additional dependencies ;)
[12:51:08] christopherbull: interesting, thanks guys, no horror-stories?
[12:51:17] christopherbull: was going to go with it but it looks almost too good to be true hah
[12:51:22] mikecmpbll: christopherbull: never had a problem with it. extremely straight forward.
[12:51:38] mikecmpbll: it just automates all the nonsense involved with maintaining JS library wrapper gems
[12:51:40] universa1: christopherbull: some edge-case packages with less-than-optimal bower configs might not work
[12:51:44] mikecmpbll: which tbh was long overdue, that ecosystem was a mess
[12:52:05] christopherbull: yeah I agree, all those 'x-rails' gems were pretty annoying
[12:52:29] christopherbull: great, thanks mikecmpbll and universa1, will give it a go
[12:52:36] universa1: djellemah: hmm, i read something about it, can't really remember anymore. the ivars is still the de-facto standard, but you're free to deviate from it :-)
[12:52:50] universa1: djellemah: it probably was related to the hexagonal rails stuff etc...
[12:53:03] christopherbull: means no messing around with cap either, which is a bonus
[12:53:40] jhass: christopherbull: the approach falls apart when you want to develop your own lib while integrating it into your rails app to test the changes, but other than that I like it
[12:54:08] christopherbull: jhass: yeah I can imagine, I'm just looking for better ways to manage front-end deps, so that's not me at the moment thankfully
[12:54:47] jhass: yeah, I love how it unified dependency management for me, bundle outdated is the one stop shop now
[12:54:51] creature: universa1: Sorry, I timed out. So if you had any other ideas for investigation, I missed it.
[12:55:05] christopherbull: i used to work on a project when bower was new and none of this existed, spent ages f'n around with grunt/bower/sprockets trying to get everything going. total nightmare, glad it's all matured
[12:55:07] universa1: creature: nope :-) sadly not
[13:01:34] toomus: Maybe someone know, is it possible. I have in my html.erb view, inline javascript, where I want to render partial with javascript variable. How to pass this variable to <%= %>?
[13:02:41] toomus: This <%= %> is inside javascript code
[13:03:35] Sylario: toomus > this is basically text output, you can do "var foo = <%= @something %>" as long as it is inline
[13:03:44] mikecmpbll: fwiw, this worked: https://gist.github.com/mikecmpbll/82ecd8264570441de076 thanks for the tips guiz.
[13:05:10] toomus: <Sylario> I need something like $("div").append("<%= render some_partial, locales: { data: javascript_variable } %>");
[13:05:42] Sylario: toomus> it looks like the same use case than js for ajax
[13:06:14] toomus: Probably you are right
[13:06:20] Sylario: There is a method
[13:06:34] Sylario: j something or whatever, that will escape a html partial for javascript
[13:07:00] Sylario: toomus: here it is : http://api.rubyonrails.org/classes/ActionView/Helpers/JavaScriptHelper.html
[13:08:17] toomus: <Sylario> I know about j function
[13:08:58] Sylario: than, there is no problem
[13:09:04] Sylario: just do that
[13:11:10] Veejay: mikecmpbll: Sorry for the belated thank you I was out for lunch
[13:11:12] Veejay: I'll have a look
[13:11:16] mikecmpbll: Veejay: np :0
[13:11:28] toomus: <toomus> OK, accessing javascript variables in <% %> is impossible :) THX
[13:13:03] Sylario: toomus: you wanted to get JS variable from ruby code? You should learn about client-server separation before trying to do rails
[13:13:40] toomus: <Sylario> Now i know :P
[13:13:44] Veejay: mikecmpbll: Yeah I saw those comments about globbing. Not sure how that applies to me since I'm using the basic CRUD resources and nothing more though
[13:14:01] mikecmpbll: Veejay: where's the "/" coming from?
[13:14:28] Veejay: Not sure I understand the question sorry
[13:14:46] mikecmpbll: Veejay: the URI that you mentioned had a %encoded "/" character in it
[13:15:39] mikecmpbll: %2F or whatever
[13:17:03] Veejay: mikecmpbll: Ah you're right, I do have a route that is not defined as a resource
[13:17:18] Veejay: get '/blog/:path', to: 'articles#show', as: :article, constraints: { path: /[0-9]+\/.*/ }, it's an older route
[13:17:22] Veejay: I guess I have to change that
[13:17:42] mikecmpbll: if that's the one causing the problem then sure. it's possible you have a problem with resource based routes too if you're overriding to_param
[13:17:45] mikecmpbll: in any of your models
[13:18:01] Veejay: Don't think I am but there's something to check there
[13:18:28] Veejay: Can't believe my problem is with blogs and articles haha, there's no escaping that in a Rails app it seems
[13:18:35] mikecmpbll: Veejay: heh :)
[13:19:14] Veejay: Also that regex in the route is awful, it needs to go away
[13:19:25] soahccc: Can anyone lend me a hand with this DB query? I have it working except that it doesn't show complete empty buckets. I tried these two versions: the former melts my PC (after 1 hour I still don't know what the results might be) and the ladder still doesn't show the empty ones... The second where should manage that I though :( https://gist.github.com/2called-chaos/90b835f11a2309e8ff34
[13:21:37] aawe: soahccc: read the SQL that rails generates
[13:21:41] aawe: in the rails console
[13:22:08] kshitijlakshmi: Hi. I have such method http://pastie.org/10093873 . I believe that it is possible to make this method works without helper variable, but I don't know how. Please help me to get rid of bad_searches var
[13:24:15] creature: kshitijlakshmi: Why do you want to?
[13:25:47] kshitijlakshmi: creature: Because I think it is a sort of bad code and it can be done without using unnecessary variables
[13:26:51] soahccc: aawe: I updated the gist to contain the generated SQL. There are millions of keys so I guess the former join doesn't use the indices and therefore takes forever. Still no idea why the second one doesn't return empty buckets. If I remove the second where clause I get them but I therefore query for "id is null". I'm missing something :( https://gist.github.com/2called-chaos/90b835f11a2309e8ff34
[13:29:54] kapowaz: hi; is it possible to interrogate a given controller from within a view to determine which layout it has been assigned?
[13:31:01] universa1: kapowaz: <% I_AM_LAYOUT = "FOOBAR" %>
[13:31:20] universa1: kapowaz: but you can also probably "ask" the controller isntance
[13:34:45] kapowaz: universa1: I_AM_LAYOUT is what, a magic constant containing the layout?
[13:39:03] Veejay: kapowaz: http://stackoverflow.com/questions/3326579/rails3-get-current-layout-name-inside-view
[13:39:08] Veejay: If that can help
[13:39:39] kapowaz: Veejay: that's helpful, thanks
[13:40:13] Veejay: Here's the query I used: "access layout from within rails view"
[13:44:13] devsyc: Hello. I have a strange behaviour of my rails app. I currently use rails 4.2. Since the last update of some css (+ adding new images) i get the following error after restarting the server: Missing template sessions/new, application/new with {:locale=>[:en], :formats=>[:png]...
[13:44:22] devsyc: Why should there be a template for a png file?
[13:46:08] universa1: devsyc: you're requesting a path which is not handled by the asset-pipeline and therefore runs into the rails stack, and is then redirected to your login action
[13:46:23] universa1: devsyc: the rails log should have something.
[13:46:56] vasilakisFiL: my site is down.. how can I quickly redirect all routes to a static route from rails routes ?
[13:47:22] devsyc: universal: the rails log says that its missing the template for format png my views folder
[13:47:22] universa1: vasilakisfil: if your site is down, your rails routes will not be accessed.
[13:47:27] universa1: devsyc: before that.
[13:47:38] vasilakisFiL: yeah sorry I meant some parts in the backend
[13:47:53] vasilakisFiL: match '*path' => redirect('/static_page') would that work ?
[13:48:03] universa1: vasilakisfil: !try
[13:48:03] helpa: vasilakisfil: Why don't you try it and find out for yourself?
[13:48:20] universa1: and with that i'm off
[13:48:24] devsyc: universal: it tries to reach assets/icon_name-<fingerprint>.png
[13:48:53] devsyc: and in public/assets/ the file is there
[14:04:30] mikecmpbll: pointless question of the day: is there an opposite of .any? or .exists? on AR relation?
[14:05:33] mikecmpbll: no, nvm, question stands.
[14:08:40] wmoxam: mikecmpbll: !collection.exists?
[14:09:01] mikecmpbll: wmoxam: yeah, that's why it was a pointless question but i was wondering if an opposite method exists :p
[14:29:32] foucist: why would changing git repositories cause capistrano gitflow to start failing (there's no permission issues to creating tags)
[14:31:25] mikecmpbll: foucist: failing why?
[14:33:49] foucist: mikecmpbll: well it starts doing a tag_#<environment_name> (which isn't even a valid tag) and throws a method missing error
[14:33:52] foucist: it's just weird
[14:34:20] nettoweb: gys Im using link_to with remote: true and my ajax response is console.log("test"); but it doesnt log on console. seems that code dont run after request the page
[14:34:23] mikecmpbll: k. i don't know anything about 'gitflow' so probably not best placed to help.
[14:34:49] mikecmpbll: nettoweb: what's the status of the request?
[14:35:02] mikecmpbll: nettoweb: you can inspect the respect in the browser's developer tools
[14:35:17] nettoweb: mikecmpbll 200 OK and is a JS
[14:35:27] mikecmpbll: and the content is ?
[14:35:57] nettoweb: mikecmpbll Processing by NegociosController#tab as JS
[14:36:10] nettoweb: mikecmpbll response is $('.widget-classificado').html("test");
[14:36:12] mikecmpbll: you should be able to see the response
[14:36:22] nettoweb: but the jquery dont take efect on page
[14:36:24] mikecmpbll: ok. so that's not console.log?
[14:36:36] nettoweb: mikecmpbll console.log just to test another thing.
[14:37:02] nettoweb: just to debug, any of them dont work... like is not calling this JS
[14:37:04] mikecmpbll: nettoweb: if you copypaste that into the console window
[14:37:13] mikecmpbll: do you see the expected change on page?
[14:37:38] nettoweb: if a paste this in console it work...
[14:37:47] mikecmpbll: nettoweb: can you gist the request and response headers?
[14:38:02] mikecmpbll: from chrome inspect or whatever.
[14:40:39] nettoweb: mikecmpbll https://gist.github.com/osnysantos/154a39175612909c6bfa
[14:42:14] mrbubbles: in my controller tests I???m using factorygirl to create acounts to test. when I???m testing the ???create??? method, can I use the factorygirl parameters and somehow pass them to create? so intsead of account = FactoryGirl.create(:account) maybe account = FactoryGirl.build(:account) and then post "create", account: account (or something)
[14:42:19] mrbubbles: Sorry if that makes no sense
[14:42:28] mrbubbles: Just seems silly to type out the list of parameters again
[14:44:17] nettoweb: mikecmpbll when I use just jquery I run ... success: function(data){ console.log(data); } ... and it works. but seems the output are not running.
[14:44:27] mikecmpbll: nettoweb: i do believe you've got the request and response headers mixed up :)
[14:44:43] tubbo: mrbubbles: you could try `post :create. account: account.attributes`
[14:44:48] mikecmpbll: nettoweb: it's the response headers which have Content-Type: text/html; charset=utf-8
[14:44:57] mikecmpbll: nettoweb: so the browser doesn't know to interpret it as javascript.
[14:44:58] tubbo: might have to slice 'em out but i think that should work
[14:45:49] nettoweb: mikecmpbll In rails console I see this: Processing by NegociosController#tab as JS but in response header I see: Content-Type: text/html; charset=utf-8
[14:45:51] mrbubbles: tubbo: that worked :D
[14:46:10] mrbubbles: my only thing is ArgumentError: '0' is not a valid account_status??? which is becuase account_status is an enum
[14:46:15] mikecmpbll: nettoweb: yeah, that's because you're requesting JS, and that's what rails is processing it as, but you're returning text/html
[14:46:53] mikecmpbll: nettoweb: so you're doing something wrong probably in your controller, so gist that if you're unsure.
[14:46:54] mtree: hey, im looking for nice diagram tool for mac, do you know any modern one?
[14:47:00] nettoweb: mikecmpbll so it I fix in respond_to controller
[14:49:10] mrbubbles: mtree: I was looking for one for ages. apparently omnigraffle is the best but it???s got a steep learning curve and I don???t really like it
[14:49:39] mtree: mrbubbles: thanks, ill give it a look
[14:50:45] DaniG2k: hello fellow rubyists
[14:51:42] mikecmpbll: nettoweb: yes.
[14:53:26] tweeeaks: stupid js... https://gist.github.com/anonymous/8dac98c704171bbdd60f#file-gistfile1-rb-L16
[15:13:18] GeorgesLeYeti: Let's say that I have a string like 'Hi World. Hello World World World ' I want to have 'Hi World. Hello'. So something like a.gsub(/World \z/, "") but recursivly.
[15:13:56] GeorgesLeYeti: I.E. Remove all occurence of "World" at the end of a string
[15:14:27] Sigma00: GeorgesLeYeti: all occurrences of World that are together?
[15:15:18] foucist: a.gsub(/World/, 'World' => '')
[15:15:25] foucist: gsub accepts a hash
[15:15:56] GeorgesLeYeti: Sigma00, Only at the end of my string. I can have inside my sentence Hello World World . My name is World World. The result is suppose to be Hello World World . My name is
[15:16:47] Sigma00: GeorgesLeYeti: ((\s+)?World)+\Z
[15:17:40] Sigma00: GeorgesLeYeti: https://regex101.com/r/xY9hX0/1
[15:17:53] Sigma00: I set some unit tests for you (on the right, the checkmark icon)
[15:18:06] Sigma00: you should set more
[15:18:51] GeorgesLeYeti: Sigma00, Nice ty a lot.
[15:19:17] Sigma00: if you need to share your regex/unit tests, hit the Update regex button on the menu on the left
[15:19:29] Sigma00: (if you're working on a new regex it'll say 'save regex' and be a disk icon
[15:20:18] GeorgesLeYeti: This website is awesome.
[15:20:43] GeorgesLeYeti: I have so much difficulties with regex
[15:21:50] tubbo: GeorgesLeYeti: you can also use ruby-specific regex at http://rubular.com
[15:22:22] tubbo: i typically use that when my regex isn't working very well...just paste the whole thing into the input and provide some test data, then you can see exactly how it's matching
[15:24:33] DaniG2k: Rubular is awesome for ruby regex
[15:31:06] makerop: join #r_netsec
[15:37:42] guillaume-rb: Hi ! I have 2 model event and user. An user can suscribe to an event. So I should do this: event.users << new_user. Except event have a max_user so can I make a before action on a new relation to check if max user is not reach?
[15:38:25] guillaume-rb: I would prefer avaid use just a method add user because if another dev use event.users << new_user the new method won???t stop him
[15:45:51] kyrofa: Anyone around here familiar with using SSL in the database.yml?
[15:46:44] kyrofa: I'm using PostgreSQL, and I have SSL working great running the app itself in production. However, whenever I run a rake task (with the production env) authentication always fails because SSL is never enabled!
[15:46:52] kyrofa: If I disable SSL in the database, rake tasks run fine
[15:47:14] kyrofa: What's the difference between these two?
[15:47:24] kyrofa: Why doesn't rake use my database.yml correctly?
[15:48:27] mikecmpbll: kyrofa: it should be exactly the same
[15:48:44] mikecmpbll: kyrofa: how're you using the db connection in the rake task?
[15:48:55] kyrofa: ACTION checking...
[15:49:57] Sigma00: guillaume-rb: you can use a validator that checks size. This would error when you try to save the event object if max size is reached
[15:52:10] kyrofa: mikecmpbll: Forgive me, I should have checked exactly that. The project I'm using actually shells out to the system, so this doesn't involve Rails at all. I'm sorry!
[15:52:22] mikecmpbll: kyrofa: ah :)
[15:52:24] guillaume-rb: the only kind of validator i found was on the attribute and not relation. I???m not an english speaker and i even don???t know we could talk about relation if we speak about instance of an object. Could you confirm my vocabulary?
[15:52:29] kyrofa: mikecmpbll: I made assumptions based on how *I* would have done it :P
[15:52:58] Sigma00: guillaume-rb: you can use a custom validator to check event.users.size is not greater than something
[15:53:02] Sigma00: http://stackoverflow.com/questions/1270663/validate-max-amount-af-associated-objects
[15:54:31] joelataylor: I put some logging information into a controller, but it only get???s read once after I tell the app to restart. How can I force the controller to be read with each request?
[15:55:25] guillaume-rb: thx I look into it :)
[15:56:03] Sigma00: joelataylor: !code
[15:56:03] helpa: joelataylor: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[15:57:42] mikecmpbll: joelataylor: why?
[15:57:58] mikecmpbll: joelataylor: put the logging information somewhere that gets executed on each request, if you want that.
[15:58:42] joelataylor: mikecmpbll: but I want to debug the controller.
[15:59:15] mikecmpbll: joelataylor: you're going to have to explain what you're actually doing
[16:00:11] joelataylor: http://pastebin.com/00PA13H0
[16:00:44] mikecmpbll: joelataylor: ok, that is run everytime the index page is requested.
[16:01:19] joelataylor: mikecmpbll: but I'm only getting a single entry in my log file on multiple refreshes ...
[16:02:04] Sigma00: and you're in developer environment?
[16:02:17] mikecmpbll: joelataylor: then your refreshes aren't making their way to your app code.
[16:02:53] Sigma00: you wouldn't happen to have something caching stuff in front of your app, would you
[16:04:28] nettoweb: mikecmpbll: my controller: https://gist.github.com/osnysantos/154a39175612909c6bfa#file-rb
[16:04:40] nettoweb: seems ok, respond_to JS, no?
[16:04:47] joelataylor: I don't think so. I'm looking at the development.rb config settings - and most look correct. http://pastie.org/private/70b8selnyktmuthho7dg
[16:05:16] mikecmpbll: nettoweb: seems ok, and what's the view file called?
[16:05:17] nettoweb: mikecmpbll and my link_to: <%= link_to "Tst", {:controller => "negocios", :action => "tab", :format => :js}, :remote => true, 'data-toggle' => 'tab', 'data-target' => '#indexcontent' %>
[16:09:06] nettoweb: I'll update my gist
[16:11:02] mikecmpbll: nettoweb: spotted the problem yet?
[16:12:35] tubbo: ugh...can someone please explain to me why Mongoid fails to provide docs for their sorting and limitation methods?
[16:12:42] nettoweb: mikecmpbll: https://gist.github.com/osnysantos/154a39175612909c6bfa#file-tag-html-erb
[16:12:44] tubbo: who the fuck wrote this shit
[16:13:14] mikecmpbll: nettoweb: yeah, did you spot the error?
[16:13:33] tubbo: oh it's here
[16:13:35] tubbo: http://mongoid.org/en/origin/docs/options.html
[16:13:40] tubbo: because i'm supposed to know that mongoid uses underlying libs
[16:14:05] mikecmpbll: ACTION hands tubbo a whisky
[16:14:07] nettoweb: mikecmpbll no.. Tha's the first time Im using remote true for this. Controller seems ok because just have the respond_to for JS
[16:14:18] mikecmpbll: nettoweb: ah okay, well your view file isn't named correctly
[16:14:20] nettoweb: mikecmpbll do you see something wrong?
[16:14:23] mikecmpbll: nettoweb: it needs to be a .js.erb
[16:14:35] mikecmpbll: because you're returning js, not html :)
[16:14:47] nettoweb: sorry, I miss it in gist, but here is .js.erb
[16:14:53] rhizome: still waiting for tubbos mongoid ebook
[16:14:56] nettoweb: just when I was editting gist
[16:15:11] nettoweb: but just the tag.js.erb
[16:15:18] nettoweb: the classifieds is _classifieds.html.erb
[16:16:34] mikecmpbll: nettoweb: I've got no idea then
[16:16:54] mikecmpbll: nettoweb: can you confirm that it's entering the format.js block, by changing it to format.js { raise "in" }
[16:17:28] nettoweb: ok, i'll try
[16:17:33] mikecmpbll: been a while since i've nerded up on the Accept header specification
[16:17:35] nettoweb: mikecmpbll take a look at the response: http://cl.ly/image/1q3G3P45363z
[16:17:38] mikecmpbll: can't remember exactly what Accept: */*;q=0.5 means
[16:18:06] mikecmpbll: nettoweb: yes, it's returning the correct data, but it's returning it as HTML
[16:18:12] mikecmpbll: so that's why it's not executed.
[16:18:59] nettoweb: mikecmpbll right, i'll try your suggestion
[16:20:04] rhizome: look in the log. it will say something like "Processing by FooController#bar_action as SOMEFORMAT"
[16:20:25] nettoweb: mikecmpbll Im getting: RuntimeError (in): app/controllers/negocios_controller.rb:31:in `block (2 levels) in tab'
[16:20:44] mikecmpbll: rhizome: yeah it says JS.
[16:21:22] rhizome: sorry, hard to parse the convo
[16:21:40] mikecmpbll: nettoweb: can you do another screenshot of the requests tab in chrome inspect, just wanna confirm your earlier info re: headers
[16:21:46] mikecmpbll: headers tab*
[16:23:07] nettoweb: mikecmpbll http://cl.ly/image/090H3G0b3w3k
[16:24:11] mikecmpbll: nettoweb: hmm.
[16:24:21] mikecmpbll: have you got something overwriting the response headers somewhere?
[16:24:51] Wixy: Hi! I want to add an index to a table so I can get a list of channels by score desc. what index would this be?
[16:25:13] mikecmpbll: everything seems as expected except the response format, can't work out why
[16:25:26] Wixy: add_index :channel, ???, order: { score: :desc }
[16:25:36] Wixy: :channels I meant
[16:26:48] nettoweb: mikecmpbll I dont think so... Need I put this Js to get the response and put in my DOM? like this: http://stackoverflow.com/a/8673600/1102592
[16:27:12] mikecmpbll: nettoweb: nah
[16:27:31] mikecmpbll: nettoweb: tell you what, just remove your format: :js option from the link_to and it'll probably work
[16:27:43] mikecmpbll: just realised that's superfluous and might be causing the problem
[16:29:19] nettoweb: mikecmpbll I removed but the response is still text/html
[16:30:05] mikecmpbll: nettoweb: i'm baffled then mate.
[16:30:28] mikecmpbll: nettoweb: not much i can do unless you can reproduce in an app and put it on github
[16:31:12] nettoweb: mikecmpbll thank you for your help... I'll try a little more
[16:32:10] dudedudeman: good morning everyone!
[16:34:38] nettoweb: mikecmpbll http://www.alfajango.com/blog/rails-js-erb-remote-response-not-executing/
[16:34:52] nettoweb: mike response says Processing by NegociosController#tab as JS
[16:50:55] nettoweb: mikecmpbll i can with this JS: https://gist.github.com/osnysantos/154a39175612909c6bfa#file-gistfile1-txt
[16:51:04] nettoweb: so it work...
[16:51:28] mikecmpbll: nettoweb: that's terrible though
[16:51:50] nettoweb: mikecmpbll yes, but I still dont know the cause ... so
[16:51:55] mikecmpbll: nettoweb: hm.
[16:52:48] mikecmpbll: nettoweb: what version of rails btw?
[16:57:26] mikecmpbll: nettoweb: there's a mismatch in your gisted code, your controller has @productos = ... and your view file uses @products
[16:57:45] mikecmpbll: is this a copy paste mistake? i'd really rather have you exact code.
[16:58:17] nettoweb: mikecmpbll It's a missmatch, because I tried with a simple text like "Text" and dont worked
[16:58:27] platzhirsch: Who else uses 'be' as an alias for 'bundle execute' ?
[16:58:52] nettoweb: maybe it runs before jquery, because I load jquery at bottom of my page
[16:59:20] mikecmpbll: nettoweb: nah it's not running at all, because it thinks it's html :)
[16:59:30] mikecmpbll: nettoweb: the problem is literally the response format
[17:00:03] nettoweb: ok, maybe something with jquery_ujs, the loa order or another thing. I'll check out
[17:00:19] mikecmpbll: nettoweb: but little things like the dodgy tab spacing in your "negocios_controlle.rb" make me wonder whether i'm seeing the whole picture
[17:00:47] mikecmpbll: but anyway, nuff staring at code.
[17:02:54] skyjumper: silly question maybe, but has anyone used rails 3.0.x with ruby 2.1?
[17:03:31] mikecmpbll: skyjumper: don't think rails 3 supports 2.1
[17:03:46] skyjumper: not officially, but it mostly works
[17:04:36] mikecmpbll: skyjumper: ok, i'll let you track down the complex errors :p
[17:05:03] weaksauce: skyjumper why?
[17:05:25] skyjumper: hoping someone has tracked down the complex errors
[17:05:39] skyjumper: i just found a new one, would be nice if there was a known fix
[17:05:57] weaksauce: no I mean why are you attempting it instead of a known good configuration?
[17:06:23] skyjumper: because 2.1 is way the fuck faster than 1.9.x, especially for development
[17:09:05] bricker: skyjumper: my opinion is that you will run into a lot of weird problems that won't be trivial to fix and that it's not worth it if you're doing it for speed alone. 3.2.x is barley hanging on by a thread, luckily some nice folks are pushing ruby 2.2 patches to the 3-2-stable branch
[17:09:13] bricker: skyjumper: no such thing in 3-0-stable branch though
[17:09:23] skyjumper: bricker: been doing it for months, it's almost trouble-free
[17:10:01] bricker: well then why are you here
[17:10:03] skyjumper: i don't think i'll be running a sketchy setup in production, though
[17:10:08] skyjumper: because i had a trouble, heh
[17:10:14] bricker: skyjumper: what trouble?
[17:10:44] skyjumper: activerecord mass-assignment doesn't seem to be calling user defined setter methods
[17:13:19] skyjumper: i'd have to set up a bare rails 3.0 app, and someone else would have to run it... would anyone care enough?
[17:13:49] bricker: skyjumper: sure
[17:14:05] skyjumper: taking your word for it
[17:14:58] bricker: skyjumper: only because I like you I think
[17:15:04] bricker: I get people mixed up in here
[17:15:12] bricker: I think you're nice
[17:15:20] bricker: are you nice?
[17:15:49] allcentury: any ruby guys care to review a benchmark I can't seem to make sense of here? - http://codereview.stackexchange.com/questions/86983/logging-to-a-file-vs-udp
[17:18:40] rhizome: allcentury: dunno, but I would just use syslog
[17:20:27] Senjai: allcentury: Any network connection is going to be slower than file interaction. It goes through the OSI model: http://en.wikipedia.org/wiki/OSI_model
[17:20:45] Senjai: Which is much more extensive than operating on files you know this system controls
[17:21:50] Senjai: allcentury: Writing to the file is done using a bunch of simple system calls. Open a file, append x number of bytes to the end of it (very simplified).
[17:22:16] Senjai: When doing network things, a packet has to be created which has an address that needs to be resolved, it needs to be sent and then received and dismantled by the receiving party
[17:22:47] Senjai: allcentury: I'll actually just answer this in the SO
[17:24:55] allcentury: that be great Senjai
[17:26:00] Senjai: allcentury: http://codereview.stackexchange.com/questions/86983/logging-to-a-file-vs-udp/86984#86984
[17:28:45] bricker: I need a haircut
[17:28:48] bricker: I hate getting my hair cut
[17:29:43] Senjai: allcentury: made a slight edit
[17:29:45] Senjai: bricker: Me too :(
[17:30:32] tubbo: i love getting my hair cut
[17:30:50] tubbo: but my barber also has beers so...that might be why
[17:31:18] bricker: tubbo: I feel like most barbers have beer
[17:31:23] bricker: I can get beer anywhere
[17:31:36] bricker: Also I don't want hair in my beer
[17:35:15] tubbo: it's in a bottle lol
[17:35:43] tubbo: but yeah the barbershop i go to has some beer in the fridge so you can sit down and crack one open while you wait
[17:35:53] tubbo: bricker: do most barber shops have beer where you live?
[17:39:16] bricker: tubbo: I think so
[17:39:20] bricker: I go like twice a year
[17:39:27] bricker: but they always seem to have beer
[17:39:34] bricker: "Look how cool we are we have beer"
[17:39:44] bricker: But it's like miller lite or some shit
[17:41:35] tubbo: nah this is usually an IPA of some kind...and typically local
[17:43:13] bricker: not impressed
[17:43:20] bricker: tubbo: try harder to impress me
[17:43:32] bricker: If they gave you BJs while you waited
[17:43:35] bricker: now THAT would impress me.
[17:44:03] Sylario: I wish CSS had parenthesis
[17:44:16] Sylario: for selectors
[17:44:19] Senjai: bricker: That's not impressive, just amazing disgusting lol
[17:44:39] Senjai: bricker: I think it'd be safer to call it a brothel with hair cutting services
[17:45:01] bricker: Sure, call it what you want
[17:45:16] bricker: Sylario: example?
[17:54:12] thomcom: Hail Rubyists
[17:54:46] wmoxam: Hail thomcom
[17:55:33] wmoxam: helpa: ping
[17:56:12] thomcom: wmoxam: What do you think about using STI for roles? Presently I'm adding a kind of authorization to my site, and wondering if I should add some kind of canonical Role system.
[17:56:54] rhizome: thomcom: overkill
[17:56:58] wmoxam: thomcom: I'm not a fan
[17:57:19] wmoxam: don't use STI when the state is mutable
[17:57:20] thomcom: thank you for saving me hours of trouble hahaha
[17:57:46] thomcom: wmoxam when is the state not mutable?
[17:58:28] wmoxam: class Cow < Animal; class Chicken < Animal; an animal shouldn't be able to change from a Cow to a Chicken
[17:58:47] wmoxam: ie it's type is not mutable
[17:59:26] thomcom: Then in that context STI is useless for user account management.
[17:59:47] wmoxam: because cows becoming chickens is craziness
[17:59:50] thomcom: STI is for building abstract inheritance diagrams out of database tables?
[18:00:09] thomcom: Human cows on the otherhand become human chickens all the time
[18:00:11] wmoxam: you could still use it if you wanted
[18:00:25] wmoxam: a user could have a role
[18:00:32] wmoxam: and roles are STI
[18:00:40] thomcom: user roles are pretty mutable though
[18:00:45] wmoxam: and changing roles means one is swapped for another
[18:00:50] wmoxam: (not changed)
[18:00:52] thomcom: Saying that User #165 will never be an admin seems insane to me.
[18:01:14] thomcom: hmm I think I
[18:01:17] thomcom: I'm lost now
[18:01:33] thomcom: Like Consumer < User; Producer < User;
[18:01:45] wmoxam: yeah, you don't want that
[18:01:48] thomcom: for a particular user that Role is very mutable
[18:02:05] thomcom: Ok but isn't that was STI is for?
[18:02:12] wmoxam: User belongs_to :role
[18:02:33] wmoxam: Consumer < Role, Producer < Role
[18:03:52] wmoxam: changing an instance's type is bad, changing it's membership is ok ;)
[18:04:42] thomcom: But my consumer table and my producer table are different in this case, aren't they?
[18:04:56] thomcom: with Consumer < Role and Producer < Role?
[18:06:07] thomcom: It seems like what you just described to me is three tables - consumer table, producer table, and role table
[18:06:31] thomcom: But consumer and producer have tons of identical columns, which is what I imagined the objective of role-ing is
[18:06:55] thomcom: Hopefully I'm not babbling idiocy.
[18:08:00] rhizome: or a user table with consumer/producer roles
[18:08:57] thomcom: And now my roles table is just 1: consumer, 2: producer?
[18:13:59] gabeodess: Hello, I???m having trouble getting foreman to start sidekiq with the proper queues in development. Can anyone help me with this? https://gist.github.com/gabeodess/8eb03f930e79bad5fa1f#file-output-L15
[18:14:30] gabeodess: as you can see I???ve specified the queues in sidekiq.yml, but when I start foreman it only load the ???default??? queue
[18:16:11] tubbo: gabeodess: typo in your command
[18:16:24] tubbo: gabeodess: ` -C .config/sidekiq.yml` should be ` -C ./config/sidekiq.yml`
[18:17:18] gabeodess: tubbo: that???ll do it
[18:17:35] gabeodess: tubbo: thanks
[18:22:27] cytoskeletor: I'm having issues with capybara finding a link on my page
[18:22:42] powersurge: I'm trying to update a user with a manager via update
[18:23:11] powersurge: in rspec I put :update, user: { manager: manager.id }
[18:23:34] powersurge: using update_attributes in the update action I get back an argument mismatch, string vs. Manager
[18:23:41] powersurge: can I not use update_attributes in this way?
[18:31:35] tubbo: powersurge: i think you need to do user: { manager_id: manager.id }
[18:32:49] powersurge: but if I do that then I can possibly set the manager_id to the id of a manager that doesn't exist, I think. ideally it would look it up in the db to make sure the manager exists
[19:12:40] Maadison: hi. newbie question: it seems that rails generate recognizes certain column names and knows default datatypes for them (like title and url). how do I find out which column names are 'special' like that?
[19:15:57] tweeeaks: Maadison, http://radar.github.io/rails-reserved-words/
[19:16:29] Maadison: tweeeaks: that's interesting, but it doesn't seem to know these
[19:20:43] rhizome: Maadison: default is string, so title and url would naturally get that datatype if otherwise unspecified
[19:21:33] Maadison: ahhh, is that what happens? it's not that those fields are recognized, it's just that the default is string
[19:45:22] sloggerkhan: How might I run one of my tests while in IRB mode?
[19:49:03] dudedudeman: are you using rake tests at all?
[19:49:14] dudedudeman: because you could do that outside of irb
[19:54:12] thomcom: ok so I have more questions about roles now
[19:54:22] weaksauce: SloggerKhan what test framework?
[19:54:33] weaksauce: thomcom ask away
[19:54:50] sloggerkhan: Built in. Minitest.
[19:54:58] thomcom: I'm in the process of adding a fourth kind of user to the system.
[19:55:07] weaksauce: you could perhaps load the file again.
[19:55:39] thomcom: When I took over the project the developer previously had been trying to create a role for User, but failed, and I was left with something half finished so I dropped it and just have basic if unreliable flags on the User table for what kind of user
[19:56:12] thomcom: So, I've now got a hierarchy of users: boss < teacher < user
[19:56:30] thomcom: I'm adding a second kind of boss, now.
[19:56:58] thomcom: Here's the part that maybe has lead me in here - the half finished role from the previous developer was implemented as Teacher, with its own table.
[19:57:08] weaksauce: like rhizome said. use some sort of enum, or role type id
[19:57:31] thomcom: Teacher does not properly inherit from User though, so I've got a User table and a Teacher table and keeping their indices straight was the biggest malfunction in the early days of the project.
[19:58:19] thomcom: Ok, using a role_id sounds pretty good
[19:58:44] thomcom: And I'll just make another table for role, or are you suggesting I use an Enum in code, without referencing it via table?
[19:58:54] thomcom: So role_Id is _just an integer_ and code says what that means.
[20:00:09] Sigma00: role_id is just an integer and your code knows to look for that integer in the ID column on your Role model, yes
[20:01:16] thomcom: If I have a Role model, doesn't that implicate that I also have a role table?
[20:03:52] sloggerkhan: thomcom: Usually. Barring custom table names, etc. Though I think it'd be roles by default probably.
[20:05:09] mrbubbles: Is it true that you shouldn???t nest resources more than 1 level deep?
[20:06:34] weaksauce: thomcom something like enum role: [:user, :teacher, :admin, :boss]
[20:06:39] thomcom: ok, so identifying a role by a role table seems simple enough. Now what about inheriting characteristics of another class?
[20:07:22] thomcom: Do I make Teacher < User, then create a new table for Teacher that holds the newly inherited attributes?
[20:08:04] thomcom: ah ok weaksauce now I just use those hashes throughout my ruby
[20:08:13] thomcom: rhizome you watting at me?
[20:08:53] thomcom: so the previous developer created a Teacher object that they didn't finishing linking with the User
[20:09:05] weaksauce: thomcom yeah. it really depends on many things as to if you need inheritance or maybe a module mixin or just permission checks when you go to do something
[20:09:16] thomcom: So first they'd make a User, then they'd make a Teacher and link it with the User via id
[20:09:26] weaksauce: and everyone is just a user with one role
[20:09:37] thomcom: For example the Teacher table then has stuff like "Title" in it
[20:11:40] thomcom: I like mixins weaksauce, can I use a mixin style with ActiveRecord?
[20:12:36] thomcom: Doesn't seem like it, unless I was writing a bunch of utility methods for activerecord objects
[20:12:43] thomcom: which I am loathe to do
[20:13:49] rhizome: no 'e' on the adj form
[20:13:58] thomcom: rhizome Having a teacher role extend attributes onto a user role is absurd enough to wat, or explanation still doesn't make sense?
[20:14:18] bricker: jesus you guys are still talking about this
[20:14:19] rhizome: i'm just unclear on what's going on
[20:14:45] thomcom: I'm trying to implement roles in a healthier fashion on this project I'm working on.
[20:14:59] thomcom: Presently, roles are handled essentially by boolean flags on individual user accounts.
[20:15:05] sloggerkhan: Mixins are pretty common in rails. Like instead of having multitable inheritance have a bunch of models include Sellable module in a number of different models.
[20:16:35] thomcom: Plus, there's a Teacher object that was an attempt to extend the User object, adding things like "Title" and "facebook id". We presently identify if a User has the Teacher role by seeing if there is a Teacher that has :user_id => User.last.id
[20:18:11] nettoweb: is there a way to compile these two .css together importing this way? <%= stylesheet_link_tag "home", params[:controller], :media => "all" %> Im doing this way because I use controller specific JS
[20:18:16] thomcom: SloggerKhan Yeah makes a bit more sense than inheritance. But can I have a model object for the Sellable module, or can it only implement methods? Can making an object include from a module also set its attributes?
[20:18:57] thomcom: Sigh. Well, obviously I'm fairly new to ruby on rails.
[20:19:14] thomcom: Unfortunately I have a lot more questions than you guys have answers lol I'll just go figure something out.
[20:19:37] sloggerkhan: For user roles I'd look at pundit, personally. It'd work fine if you used a table to match roles to users. I question putting stuff like facebook ID or title in a teacher table, though, as they potentially have nothing to do with teachers, in some cases administrators might have the same things, etc. As for the question you just asked...
[20:20:26] sloggerkhan: Rails has modules, which assuming your schema has a right fields, cover pretty much anything you might want to reuse.
[20:20:28] thomcom: SloggerKhan I'm trying to work with what I have :)
[20:20:44] et09: hi - i'm getting this bug trying to precompile: NoMethodError: undefined method `bytesize' for nil:NilClass
[20:20:53] et09: it's driving me nuts - anyway know how to resolve?
[20:21:39] sloggerkhan: thomcom: Concerns are also pretty decent
[20:22:07] coetry: Has anyone come across an error message like this?
[20:22:11] coetry: https://gist.github.com/anonymous/645c0eec6a6afabe509f
[20:22:31] thomcom: haha that sounds like a sucky error in precompilation et09
[20:22:32] sloggerkhan: This is a random page form google, but the last example is relevant: http://richonrails.com/articles/rails-4-code-concerns-in-active-record-models
[20:22:39] thomcom: Can't you do a verbose precompile?
[20:22:43] et09: everything i tried to resolve it is coming up short
[20:22:56] et09: and no, it doesn't tell me when i do. not even when i add a stdout logger in production.rb
[20:23:16] et09: i filed a bug report in sprockets because it doesn't tell you which file it's starting, only which file it finished
[20:23:21] sloggerkhan: thomcom: Concerns are like modules specifically for reuse in activerecord models.
[20:23:40] et09: then i tried to fork sprockets so it'd tell me, but the bundle wouldn't work...
[20:23:56] thomcom: I will read about pundit and concerns SloggerKhan, thanks
[20:24:35] thomcom: Try deleting files out of your precompile list until you find the file that is causing it, et09?
[20:24:43] et09: i tried commenting *all* of them out
[20:24:44] et09: same error
[20:24:45] thomcom: You could start by deleting out all the ones that you've already seen finish in the log
[20:24:53] darmousseh: I have a random question. Say I want to match any incoming route which has a .html in it and 301 to the same route without the .html. Any ideas how to do this?
[20:25:13] et09: i also tried moving them all out of the assets directory
[20:25:14] et09: same error
[20:25:23] et09: literally exhausted
[20:25:24] thomcom: does it happen for every environment et09? If it happens when there are no files to precompile then you need to try another complete environment right
[20:25:35] thomcom: Create a whole new rails project, put the assets there, and try to precompile them.
[20:26:32] thomcom: If it happens in a completely empty, brand new project, you need to uninstall the current version of rails and try a different version I'd think.
[20:27:05] thomcom: Could also be in your various environment precompilation options, which you could do line by line elimination of
[20:27:27] thomcom: Or could be in your minifier if you have one specified
[20:27:50] thomcom: Just throwing ideas out et09 sounds like Serious Debugging
[20:29:24] thomcom: well I'm not running Rails 4 anyway @SloggerKhan so Concerns are out.
[20:29:32] et09: ok i got them to precompile on the other app
[20:29:44] sloggerkhan: They're available as a gem for 3.x I think.
[20:29:49] thomcom: Now rebuild your environment config file from the one in the new app et09
[20:30:13] thomcom: could just be a corrupt project, try using the whole environment config file from the uncompilable app in the new app
[20:30:16] sloggerkhan: And if not, they're a really light wrapper around convention anyway.
[20:32:49] darmousseh: nevermind i figured it out
[20:34:01] darmousseh: https://gist.github.com/turlockmike/7abc9f35d0f9d696e699
[20:34:18] darmousseh: This is to redirect any path ending in .html to a path without the .html in it
[20:34:29] darmousseh: can someone check it out and let me know if it could be better
[20:34:31] et09: i think it's working...
[20:37:45] et09: precomp finished, but missing some files
[20:37:49] et09: thanks, that's a good start
[20:42:55] et09: my application is named Oa
[20:43:00] et09: so in my old production.rb
[20:43:12] et09: OA::Application.configure do - as opposed to - Rails.application.configure do
[20:43:39] rhizome: first is pre-4.0
[20:44:04] et09: could it possibly cause a bug like i had? or even, non-reporting of a bug in an asset?
[20:44:13] et09: possibly sprockets using it to infer rails version?
[20:44:15] rhizome: could what what
[20:44:37] rhizome: iirc it will throw an unknown constant error
[20:45:14] et09: because as far as i can tell, that's the only remaining difference between the two files
[20:48:26] et09: ok many thanks thomcom
[20:48:29] et09: i owe you one
[20:48:50] thomcom: supes glad I could help et09
[20:51:10] mrbubbles: I have 2 classes of user, admin and non-admin. should i do this as two contexts in my rspec, and then test each api endpoint as each? or is there a cleaner way to do it?
[20:51:45] mrbubbles: i have a feeling that I should really be testing access in the routes spec and only the actual implementation in the controller spec...
[20:56:57] tubbo: mrbubbles: the routes spec actually just checks if a route is defined in routes.rb, it doesn't actually visit the route. to make real URL requests, you need something like capybara which will actually run an http server.
[20:57:11] tubbo: mrbubbles: the controller specs are for nitty-gritty unit testing of the controller _class_
[20:57:21] mrbubbles: Aaah. So does that include it?
[20:57:22] weaksauce: mrbubbles integration tests would cover the access control testing
[20:59:09] mrbubbles: so I???d need capybara
[21:00:38] mrbubbles: But I???ve read a few things that say don???t use capybara!
[21:01:30] et09: https://www.youtube.com/watch?v=kRgf_jACSDQ
[21:01:39] et09: most famous capybara
[21:03:26] tubbo: mrbubbles: i've read a few things that say "don't use Rails", but you're still doing it.
[21:03:31] tubbo: s/you're/we're ;)
[21:09:29] mrbubbles: weaksauce: so api integration tests are effectively controller tests no? so maybe that is the right place to put it?
[21:09:42] Sylario: Well, any idea why i am getting downvotted? : http://stackoverflow.com/questions/29660166/google-map-not-displayed-correctly-after-div-is-show
[21:09:51] weaksauce: mrbubbles is there authentication?
[21:10:05] tubbo: api integration tests are not effectively controller tests
[21:10:12] tubbo: they're not even in the same layer of testing
[21:10:24] mrbubbles: Yep. I was using factory girl to generate an admin user and a non-admin user at the start of each context and sign in
[21:10:25] tubbo: integration tests are "outside-in", unit tests are "inside-out"
[21:13:55] mrbubbles: So tubbo your vote is for capybara
[21:15:16] cytoskeletor: I have a simple jquery issue that I can't seem to crack. I'm trying to change the background color of a specific div when an item is added to a cart.
[21:15:30] zelrik: who is looking for a job here? :p
[21:16:03] cytoskeletor: here is the gist https://gist.github.com/Joshuaatt/0dae5e481cf496a44c12
[21:17:14] cytoskeletor: I already have the create.js.erb reloading the cart info on the page so I thought I would use it to change the color of the div as well
[21:18:23] thomcom: I'm looking for a raise got one of those? :)
[21:18:38] tubbo: mrbubbles: i use capybara, and i like it :) certainly easier to comprehend than cucumber and it has phantomJS support to boot (with poltergeist)
[21:18:44] tubbo: so you can run acceptance tests headless
[21:19:14] bricker: poltergeist
[21:19:19] bricker: I just. fucking. got it.
[21:19:54] cytoskeletor: I tried many things including $('#<%= accessory.id %>').css("background-color", "green"); but 'accessory' isn't within scope
[21:19:56] rhizome: is that a thing with poltergeists?
[21:20:26] bricker: rhizome: I think so
[21:21:09] rhizome: HUMPDAY NEWS
[21:21:22] rhizome: great learnings
[21:21:30] bricker: cytoskeletor: what is "accessory"?
[21:21:43] bricker: where is that coming from?
[21:21:47] rhizome: in other news, it's time to read "visualizing sql joins" for the umpteenth time
[21:22:11] bricker: cytoskeletor: what do you expect the value of "accessory.id" to be?
[21:22:15] tubbo: bricker: haha...it's also because phantomJS :)
[21:22:19] cytoskeletor: Oh, it's coming from <% @model.accessories.each do |accessory| %>
[21:22:31] bricker: cytoskeletor: and where is that code?
[21:22:40] tubbo: bricker: there's also http://casperjs.org/ and http://slimerjs.org/ :)
[21:22:56] cytoskeletor: bricker: https://gist.github.com/Joshuaatt/0dae5e481cf496a44c12
[21:23:47] cytoskeletor: bricker: line 2
[21:26:43] bricker: cytoskeletor: right but create.js.erb is a totally different file that gets loaded in a totally different request
[21:27:34] digital-ghost: I need a remote: true link to do its thing, then after it's been clicked disable it completely. I only want one request to go through - is there a proper way to handle this?
[21:28:10] digital-ghost: I had tried to use jQuery to detect when the link is clicked, remove the href and data-remote-true, but this stops the request entirely.
[21:28:28] cytoskeletor: bricker: it reloads the cart_text partial. I figured it could change the color of the div as well
[21:29:54] bricker: cytoskeletor: I would be surprised if that second line is really being run, because the line above it should throw an error
[21:30:06] cytoskeletor: bricker: It does
[21:30:54] cytoskeletor: bricker: I just threw it in the gist to give an idea of what I'm trying to do
[21:32:08] bricker: cytoskeletor: you need to replace "accessory" with a variable that exists.
[21:32:35] mrbubbles: tubbo so if i???m folllowng you correctly??? I???d use request specs to check that each endpoint actually returns what it???s supposed to, but then integration tests (via capybara) to test that each user level can access the correct endpoints?
[21:32:54] bricker: cytoskeletor: you could probably just use the hidden field accessory_id too, since that's all you're using
[21:33:21] tubbo: mrbubbles: well actually you'd use integration tests to make sure that users can actually *use* the site. capybara, for example, has a DSL for interacting with the page and testing whether content/tags exist on it.
[21:33:38] cytoskeletor: bricker: I think I tried that, but I will mess with that some more. Thank you
[21:33:40] tubbo: mrbubbles: it's probably easier/faster to test user level constraints in the controller test.
[21:33:46] bricker: digital-ghost: you set a callback on form submit, which registers a callback on button click, which prevents the button from being clicked
[21:34:54] bricker: $('.form').on('submit', function() { $('.form .submitbutton').on('click', function(e) { e.preventDefault(0; }) })
[21:34:55] digital-ghost: bricker: If this is just a AJAX hyperlink and not a form, is there something similar?
[21:34:57] bricker: something like that
[21:35:02] mrbubbles: okay that makes sense. cheers :)
[21:35:34] bricker: digital-ghost: same concept, just change 'submit' to 'click'
[21:36:22] bricker: digital-ghost: and you probably would want to use .one() instead of .on() for the root-level callback,
[21:36:57] digital-ghost: bricker: Thanks, I will play with this to see if I can get it to work. A coworker was saything preventDefault won't work, because it needs to be unbound by rails too?
[21:37:00] digital-ghost: Not sure I followed him.
[21:44:29] tubbo: digital-ghost: there are actually a few methods on event that stop default actions from running. for example, on a form you need event.stopPropagation() as well as event.preventDefault()
[21:44:33] tubbo: there's also event.stopAllPropagation()
[22:00:02] nettoweb: guys Im trying to do a @import 'colors' in my user.css.sass but it dont work, only if I rename _colors.sass to _colors.scss
[22:00:12] Radar: !didntwork
[22:00:12] helpa: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[22:00:17] Radar: steps to reproduce in a new app plzkthx
[22:00:19] nettoweb: is it possible to import sass file or just scss file?
[22:00:26] Radar: it should be possible to import either
[22:00:31] Radar: [08:00:17] <Radar> steps to reproduce in a new app plzkthx
[22:01:32] digital-ghost: bricker: Figured out a way to do it. The previous code (after tweaking) wasn't working. I was seeing network requests still going out when fast-clicking on the link.
[22:02:27] balr0g: hello, working in an app, angular front, rails back... trying to use cookies im getting: TypeError: undefined is not a function , is there any other thing to setup beside add angular-cookies to the require in application.js ?
[22:02:58] Radar: balr0g: !steps
[22:02:58] helpa: balr0g: Please provide some steps to reproduce the problem.
[22:03:21] Radar: balr0g: "undefined is not a function" is almost as bad as saying "undefined method" and not providing any stacktrace or further context.
[22:03:33] Radar: balr0g: If you want help from us, show us an app where this problem is occurring.
[22:04:08] balr0g: Radar: you mean some jsfiddle? its hard to reproduce the whole app, isnt?
[22:04:31] Radar: balr0g: You effectively want us to look for a black cat in a pitch black room where the cat may not exist. We're going to need more context.
[22:04:44] Radar: balr0g: If showing us a whole brand new app helps us to understand the problem, then yes that's what I wnat.
[22:05:05] balr0g: ok.. lets see...
[22:13:38] bricker: digital-ghost: oh, you can use jquery's debounce()
[22:19:00] digital-ghost: bricker: https://gist.github.com/gronski/76e07e97447a40d6ca38 - This was my solve, but I'm being requested to not use remote true anymore :P
[22:20:20] bricker: digital-ghost: you could just tell it to do nothing instead of removing allt he stuff
[22:20:26] bricker: don't care
[22:20:34] Vulix: So if I develop a fairly basic rails app on my Windows box, can I just take the app's folder and drop it into my Linux install and it should be good to go?
[22:21:29] gavit: is there a way to automate certain 'browsing clicks'?
[22:29:23] Radar: vulix: Probably not.
[22:29:45] Radar: There may be some gems in the Gemfile.lock that'll only work on Windows.
[22:29:49] Vulix: Radar thanks for the honest answer xD
[22:29:54] Radar: vulix: Best to develop on a similar style of platform that you deploy on.
[22:29:56] Radar: gavit: !explain
[22:29:57] helpa: gavit: Please explain your problem better as we are having trouble understanding what you mean. A Gist (http://gist.github.com) is always helpful!
[22:31:32] Vulix: Radar: I'm not used to Rails. Is every app self-contained in it's folder? You would need to just make sure the deployment system has the same dependencies as your dev machine?
[22:31:59] Radar: No, there are gems that get installed to wherever the gem path is
[22:33:25] Radar: And those gems on Windows might be compiled especially for Windows.
[22:33:29] philcrissman: vulix: not to mention if some gems depend on system libraries. eg, imagemagick, mysql, etc. nokogiri bundles its own libxml iirc, but some gems depend on system libs.
[22:33:42] Radar: Developing Rails apps on Windows is not easy
[22:34:17] Vulix: Mysql is considered as a system lib?
[22:34:42] philcrissman: vulix: the mysql2 gem depends on some of mysql's libraries.
[22:35:32] philcrissman: vulix: eg, https://rubygems.org/gems/mysql2 "binding to libmysql"
[22:35:41] Vulix: the api the gem provides should be the same on linux or windows though? I'd just swap out the gem itself depending on platform?
[22:36:05] Radar: I am not sure I can make this more clearer
[22:36:11] Radar: DO NOT DEVELOP RAILS APPS ON WINDOWS
[22:36:18] Radar: Maybe that is as clear as I can make it.
[22:36:49] philcrissman: ACTION slow clap
[22:36:59] Vulix: Hm alright
[22:37:10] Vulix: I'm looking for a framework I can dev on across platforms, thats a bit unfortunate
[22:37:16] philcrissman: I had some friends who consulted for wellsfargo, where it was mandated that they develop on windows.
[22:37:22] philcrissman: vulix: you could use vagrant
[22:37:52] Radar: I'm not saying that you *can't* do it. I'm saying that it's not worth the amount of effort you're going to put in while trying to develop on one flavour of OS and then deploy on another.
[22:38:07] Radar: You may as well write a book in Swahili and expect native English speakers to read it.
[22:38:14] philcrissman: the wellsfargo project wound up being jruby on windows... I can't remember the whole rube goldberg setup they had (this was about 3-4 years ago, also). Apparently spinning up the app, even just to run the tests, took forever.
[22:38:16] Radar: There's that much of a difference between the OS'es.
[22:39:01] Vulix: even for something basic like just grabbing some data out of a DB and throwing it on a web page?
[22:39:06] Senjai: philcrissman: Wellsfargo people can be stupid, larger corporations often breed stupidy faster. There are many exceptions. Just dont do ruby on windows, use a proper server.
[22:39:10] Vulix: seems like it I guess since the mysql thing
[22:39:14] Senjai: vulix: There's an app for that (tm)
[22:39:22] Vulix: About Vagrant: Is it an image or a vm in itself, kind of confused on that
[22:39:37] philcrissman: vulix: I mean.. why would you _need_ to use windows for development? There's vagrant; you could effectively develop on windows but in a Linux VM. That's probably the best option if you simply must use windows.
[22:39:49] philcrissman: vulix: but you could just... use linux/
[22:40:02] Radar: Let's take the mysql2 gem for instance.
[22:40:03] Radar: https://rubygems.org/gems/mysql2
[22:40:12] Vulix: I'm fine with Linux, but I have to work with some undergrad who are Win only
[22:40:16] Radar: It will install the x86-mingw32 version when you run "bundle install"
[22:40:17] Vulix: that's my problem xD
[22:40:25] Radar: When you deploy to Linux, it will try to install that version.
[22:40:27] Radar: Hence, problems.
[22:40:28] Senjai: vulix: Dont use ruby. Or convince them to stop being terrible lol
[22:40:47] philcrissman: Senjai: oh yeah, it was nuts. All the devs knew developing rails on windows was a crazy idea. It was mandated by their IT dept, or something.
[22:40:51] Vulix: Got it Radar ty
[22:42:07] Senjai: philcrissman: I just wouldn't do it.
[22:42:39] Senjai: philcrissman: Id suggest the other things meant to run on windows if we HAD to stay on windows. Like .NET.
[22:42:43] philcrissman: Senjai: it was a paycheck, I guess; my friend who worked on it was just there for 3 months, I think.
[22:43:34] Vulix: Honestly the only thing I have found that works great on both Linux and Windows with minimum tinkering is Java funny enough, but it's too much overhead for what I need
[22:43:39] Senjai: philcrissman: Some places have to use IIS, or windows, for some being organizational reason, and thats totally legitimate, but you still have to use the best tool for the job. Windows support in many gems is poor, and crappy, and you will encounter many many errors. Its best to use the best tool for the platform, to solve that particular problem
[22:43:49] philcrissman: vulix: developing in a linux vm isn't that hard... I used to do it on mac all the time, even though I could have just developed natively. I don't know. I haven't really tried it on windows as I don't have a windows computer.
[22:44:03] Senjai: vulix: Python works fine on windows. Or so I hear, I dont write python
[22:44:09] philcrissman: Senjai: you don't need to convince me. :)
[22:44:37] Vulix: It does, I've done some Django stuff, I just find Python boring to write. It is a pretty legitimate choice though
[22:45:02] Senjai: vulix: It is a -better- choice, than ruby. Just objectively, even if you like ruby more, gotta choose the best tool.
[22:45:06] philcrissman: Radar: say, are you going to railsconf?
[22:45:24] Radar: philcrissman: Not unless someone else is springing me the 3k that it'll take to get me there.
[22:45:48] philcrissman: Radar: ew, yeah... You're back in AU, that's right. Isn't it?
[22:45:55] philcrissman: That's a long way.
[22:47:13] Senjai: Radar: Eh, I've heard its pretty broad and entry level in terms of content
[22:47:16] Radar: Cheapest decent flight I can find is $1,294.70 return, which isn't as bad as I thought.
[22:47:24] Radar: Senjai: what is?
[22:47:31] Senjai: Radar: The conference
[22:47:38] Radar: Senjai: yeah I know. I've been twice :)
[22:47:52] Senjai: Radar: I haven't, but nobody I know is going either, for that reason.
[22:48:00] philcrissman: Radar: still, that's ... that's still a lot.
[22:48:12] Senjai: philcrissman: round trip?
[22:48:14] Senjai: not really
[22:48:27] Radar: Oh then there's the $900 late admittance ticket
[22:48:30] Radar: and the $500~ for hotels
[22:48:33] Radar: sooooo yeah, no?
[22:48:42] philcrissman: Senjai: the list of talks is online... There are a handful of beginner talks. I wouldn't say it looks all entry level.
[22:48:56] Radar: There's a pretty decent spread of talks there.
[22:48:57] Senjai: philcrissman: The only talks I enjoy are those from tenderlove
[22:49:06] Senjai: The others are pretty self explanitory
[22:49:10] philcrissman: Radar: yep, that adds up. I wouldn't be going if my workplace weren't footing the bill.
[22:49:11] Senjai: At least now
[22:49:16] Senjai: They weren't when I first started
[22:49:51] philcrissman: Senjai: if I were only going for the talks I'd just wait till they were on confreaks. I want to go so I can talk to people.
[22:50:08] Senjai: Yeah, thats kegut
[22:50:28] Senjai: Id rather just go to other cities for a weekend and attend their ruby meetups, like seattle rb
[22:50:45] Senjai: Or bug you assholes on irc, w4m
[22:50:45] Vulix: Do you guys see Ruby expanding into more general use or do you think it's destined to be mostly focused on web development? I know it already is a general purpose language, but Python seems to have more momentum there right now
[22:51:07] Senjai: vulix: Thats a question asked thousands of times a day, my question is: Does it matter?
[22:51:11] Senjai: You can use any language for anything
[22:51:16] philcrissman: It's always nice to be in a good talk (there are some pretty decent-sounding ones scheduled), but I have a lot of friends from other parts who'll be there. Not to mention people I've only ever met on twitter, etc.
[22:51:26] Senjai: you can write all of the scientific libs that make python famous, in ruby, if you wanted to
[22:51:45] Senjai: philcrissman: As I said, totally legitimate reason :P
[22:52:17] Senjai: They dont exist in ruby because they exist in python, and you just use python if you want to use them
[22:52:27] Senjai: use ruby if you want, or shell, or perl, or a thousand different other things
[22:54:20] Vulix: Tbh I do a lot of text processing and Ruby seemed nice for it's Perl-ish features
[22:54:28] tfitts: anyone have a minute to look throug https://github.com/mattsears/stamps and see if you can tell why adding a def get_url method to https://github.com/mattsears/stamps/blob/master/lib/stamps/client/account.rb wouldn't allow me to call it the same way as I call get_purchase_status that is declared in the same Module?
[22:54:28] Vulix: surprised to see more perl people aren't using ruby
[22:55:02] Senjai: vulix: People use what they're comfortable with, if its an appropriate tool for the job, who cares? :P
[22:55:13] nickjj: vulix, python 2.7x comes on a ton of systems. ruby's versions are wildly different between distros/version
[23:00:36] Radar: tfitts: wat
[23:00:38] Radar: tfitts: !gist?
[23:21:02] crystalneth: The [engine_name]:install:migrations rake tasks seems not to appear unless the gem name matches the engine namespace?
[23:27:31] crystalneth: My engine gem is called foo_rails, and my engine namespace is Foo. This make sense to me. However the install:migrations task doesn???t exist. If I change the gem name to foo (matching the engine namespace) then the install:migrations task does exist.
[23:35:48] rhizome_: hmm, in case i was disconnected when i asked:
[23:35:50] rhizome_: sql nerds, i have a Word model and its join model, both of which can be categorized. should i pull the superset of model instances from Category (or Categorizations), or Word or elsewhere?
[23:53:35] jake_g: Hi everyone. I???m looking into javascript source maps. We???re using sprockets and I???m having a hard time finding information. It looks like it was merged here: https://github.com/sstephenson/sprockets/pull/311 but I cant find any sort of documentation. Also looked through the sprockets-rails gem and it didn???t have much info. Could someone point me in the right direction?
[23:53:59] jake_g: We???re getting a decent number of bugsnags and theyre pretty difficult to interpret/resolve
[23:59:32] bricker: jake_g: it's not supported until sprockets 4
[23:59:34] bricker: which isn't released yet
[23:59:47] Radar: HAHHAHAHAHAHAHA SPROCKETS
[23:59:53] Radar: Oops sorry that was meant to be in my head