« Back to channel list

#RubyOnRails - 25 November 2015

« Back 1 day Forward 1 day »
[00:03:56] ebbflowgo: has joined #RubyOnRails
[00:07:33] IrishGringo: has joined #RubyOnRails
[00:11:09] smathy: I wish ActiveSupport::Duration#since was called hence instead.
[00:12:19] ubersapiens: has joined #RubyOnRails
[00:13:57] Radar: smathy: alias_method bro
[00:16:00] smathy: Radar, I wish I cared enough to do that :) The grammar of 4.days.since just irks me every time.
[00:16:29] smathy: (and from_now is just really sad)
[00:17:13] matthewd: I'd argue from_now is the correct spelling for that, and the fact since works is basically an implementation detail
[00:17:15] pawnbox: has joined #RubyOnRails
[00:17:25] tubbo: 4.score + 7.years.ago
[00:17:32] tubbo: (4.score + 7.years).ago
[00:18:02] Bit_Bendr1: question about .js manifest precompilation, gimmie a sec to type it out
[00:18:14] smathy: matthewd, what are you talking about, from_now is an alias for since.
[00:18:18] matthewd: (i.e., giving from_now a parameter would read ridiculously, and likewise not giving one to since)
[00:18:57] Bit_Bendr1: I???m following a course on lynda.com. The instructor duplicated and renamed application.js to public.js
[00:19:10] smathy: matthewd, no, with an arg it should be just `from`
[00:19:33] Bit_Bendr1: He then edited so that it only includes a demo.js using //= require demo
[00:19:33] barhum2013: I added an index to a table, got a failing test becasue of it. I noticed that if I add a sleep before the assertion everything passes. I would hate to leave the sleep in there, is there a wait to make rspec wait for the db change in the assertion? These are unit tests.
[00:19:37] Denarii: tubbo: (4.score + 7).years.ago :P
[00:19:58] owenjones: has joined #RubyOnRails
[00:20:28] Bit_Bendr1: He the used javascript_include_tag(???public???) in layouts/application.html.erb and it just worked
[00:20:46] matthewd: barhum2013: !code
[00:20:46] helpa: barhum2013: 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.
[00:21:10] Bit_Bendr1: when I try I get the error that I need to add Rails.application.config.assets.precompile += %w( public.js ) to config/initializers/assets.rb
[00:21:29] Bit_Bendr1: When I do that it works, but I don???t understand why
[00:21:48] barhum2013: https://gist.github.com/33volcanoes/16ef5002c50bbc3eb805
[00:22:05] Bit_Bendr1: I downloaded his project files and he doesn???t even have a config/initializers/assets.rb
[00:22:24] yoongkang: has joined #RubyOnRails
[00:23:59] pydave6367: has joined #RubyOnRails
[00:24:53] Bit_Bendr1: also my view source shows the files are getting fingerprinted, but his weren???t. are we in different environments?
[00:25:04] kies: has joined #RubyOnRails
[00:25:38] roshanavand: has joined #RubyOnRails
[00:25:54] matthewd: barhum2013: I'm not seeing where a delay can occur. What's Marketing.find_customers(params) doing?
[00:26:07] matthewd: barhum2013: Also, why the braces on line 21?
[00:26:19] barhum2013: matthewd: building a join
[00:26:53] barhum2013: matthewd: those should be parenthesis, just a moment of desperation there
[00:27:30] matthewd: barhum2013: Well something must be creating these alleged customers, which means we're missing relevant code
[00:28:25] barhum2013: matthewd: https://gist.github.com/33volcanoes/16ef5002c50bbc3eb805
[00:28:52] matthewd: barhum2013: If the problem is that line B seems to be running before line A, we're gonna need to look at both of them
[00:31:00] matthewd: I still don't see anything that creates a customer. I see something that deletes them all, and I see something that seemingly expects to find one.
[00:34:34] arooni: has joined #RubyOnRails
[00:34:34] barhum2013: matthewd: https://gist.github.com/33volcanoes/16ef5002c50bbc3eb805 added it, the on_trial method is the only one being called in the test
[00:37:27] wovow: has joined #RubyOnRails
[00:37:44] matthewd: barhum2013: Do we have different definitions of the word create? :/
[00:39:24] barhum2013: matthewd: sorry they are being created by the order factory
[00:42:33] matthewd: barhum2013: Okay, so what am I going to ask for next? :)
[00:42:45] shock_one: has joined #RubyOnRails
[00:42:54] barhum2013: factory coming up
[00:43:08] nettoweb: has joined #RubyOnRails
[00:45:55] juddey: has joined #RubyOnRails
[00:47:56] tuelz: do people actually use factory classes in ruby often?
[00:48:22] tuelz: I recently started on a new clients project that had a few of them. Never seen them outside of java
[00:50:19] lacrymology: has joined #RubyOnRails
[00:50:46] patrick2: has joined #RubyOnRails
[00:51:02] lacrymology: I've got a Time instance, how do I turn it into a string with YYYY-mm-dd format?
[00:51:03] htmldrum: has joined #RubyOnRails
[00:51:28] baweaver: lacrymology: what have you tried?
[00:52:28] lacrymology: baweaver: strftime which didn't seem to exist, but I think I just had a typo
[00:52:39] baweaver: http://ruby-doc.org/core-2.2.0/Time.html#method-i-strftime
[00:52:55] baweaver: Make sure it's a Time object
[00:53:44] j4d: has joined #RubyOnRails
[00:54:53] sevenseacat: has joined #RubyOnRails
[00:55:14] SteenJobs: has joined #RubyOnRails
[00:56:33] pawnbox: has joined #RubyOnRails
[00:59:02] ascarter: has joined #RubyOnRails
[00:59:38] annlewis: has joined #RubyOnRails
[01:03:46] ewnd9: has joined #RubyOnRails
[01:04:02] RegulationD: has joined #RubyOnRails
[01:06:12] Radar: http://www.foragoodstrftime.com/
[01:09:00] K_r3aPeR: has joined #RubyOnRails
[01:09:05] Grundell: has joined #RubyOnRails
[01:12:04] goodcodeguy: has joined #RubyOnRails
[01:13:48] ur5us: has joined #RubyOnRails
[01:17:00] sankaber: has joined #RubyOnRails
[01:19:18] creature: Have any of you played with react-rails? How did you find it?
[01:20:13] exadeci: has joined #RubyOnRails
[01:21:59] rickmasta: has joined #RubyOnRails
[01:22:16] ql6wlld: has joined #RubyOnRails
[01:23:29] Synthead: has joined #RubyOnRails
[01:23:31] yoongkang: has joined #RubyOnRails
[01:23:46] nettoweb: has joined #RubyOnRails
[01:24:31] bruce_lee2: has joined #RubyOnRails
[01:26:21] pawnbox: has joined #RubyOnRails
[01:28:23] atomical: has joined #RubyOnRails
[01:28:35] bruce_lee2: has joined #RubyOnRails
[01:30:52] mostlybadfly: has joined #RubyOnRails
[01:31:22] lessless: has joined #RubyOnRails
[01:33:08] Pazician: has joined #RubyOnRails
[01:33:13] baweaver: you're better off using Bower or another manager than depending on gem bundled solution of 3rd party assets
[01:33:37] ja: Radar: What a lovely site.
[01:33:41] one_zero: has joined #RubyOnRails
[01:34:11] shibabu: has joined #RubyOnRails
[01:34:17] ja: baweaver: Have you found that Bower integrates nicely with Rails? I can't remember what my issues were last I tried the bower-rails (or w/e) gem.
[01:34:29] roshanavand: has joined #RubyOnRails
[01:34:33] baweaver: If they don't just straight use bower instead
[01:35:39] ja: Sure. Why not, come to think of it???
[01:41:56] badoo: has joined #RubyOnRails
[01:42:15] creature: baweaver: From what I've seen, the benefit of react-rails is less "asset packaged as gem", and more "render JSX inside your Rails app" and "make React components easier to build into your views."
[01:42:41] baweaver: ah, thought of it as something akin to jquery-rails and friends
[01:43:08] sevenseacat: it provides a helper method to embed components directly, yeah
[01:43:29] baweaver: then again I tend to try and segregate my front/backend where possible
[01:43:34] sevenseacat: plus integrates jsx into the asset pipeline
[01:44:00] creature: Well, I'm a big fan of progressive enhancement, so I definitely don't want to move away from server-rendered markup.
[01:44:03] rdavila: has joined #RubyOnRails
[01:44:17] creature: But I'm also a fan of DRY, so the last thing I want is an ERB version of a thing & a JSX version of a thing.
[01:44:20] elcontrastador: has joined #RubyOnRails
[01:44:59] baweaver: Careful with dry, sometimes it makes things brittle
[01:46:15] creature: Sure, but the alternative is "You will have a React version and a server-side version of every component template", and that seems like a cesspit of lurking horrors.
[01:46:22] baweaver: breaks really incredibly then totally loses effect
[01:46:37] creature: Just begging for things to get out of sync, or be overlooked in integration tests, or something else.
[01:48:01] ascarter: has joined #RubyOnRails
[01:52:16] shinnya: has joined #RubyOnRails
[01:53:04] owenjones: has joined #RubyOnRails
[01:55:16] joshkovach: has joined #RubyOnRails
[01:57:10] j_v-asd: has joined #RubyOnRails
[01:58:39] FailBit: you know what I want?
[01:58:46] FailBit: SRP in my models
[01:58:52] FailBit: it looks ridiculous to even try
[01:58:58] FailBit: they're so disgusting
[01:59:05] creature: In what way?
[02:00:32] annlewis: has joined #RubyOnRails
[02:01:13] FailBit: I have four models that are over a thousand lines long
[02:01:36] _3dwardsharp: has joined #RubyOnRails
[02:02:01] FailBit: not because what they do is inherently complex, mind you, but largely because the initial version of this app was hacked together by a kernel programmer
[02:02:22] FailBit: you know how it is
[02:03:01] RTG`: has joined #RubyOnRails
[02:03:53] Palsson: has joined #RubyOnRails
[02:04:21] rory096: has joined #RubyOnRails
[02:05:30] nso95-: has joined #RubyOnRails
[02:06:42] rory096: i'm having a problem where JBuilder is requerying the database for every single partial for an association, even though i've .include'd the association when i queried for the overall object
[02:06:54] waka: has joined #RubyOnRails
[02:06:58] rory096: any ideas what's going wrong? it's ending up with hundreds of separate sql queries instead of like 3...
[02:07:10] sevenseacat: rory096: !code
[02:07:10] helpa: rory096: 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.
[02:08:29] threeminutemonta: has joined #RubyOnRails
[02:09:22] matthewd: FailBit: Our largest three models are > 1900 lines... though for two of them, 20 of those lines (each) are spent including mixins
[02:09:40] FailBit: holy shit...
[02:09:51] FailBit: how long does your app take to boot
[02:09:55] matthewd: https://github.com/ManageIQ/manageiq/blob/master/app/models/host.rb
[02:10:04] creature: Fat model, thin controller... :)
[02:10:05] FailBit: and how many gems do you have
[02:10:46] rory096: here's the gist: https://gist.github.com/RoryStolzenberg/f0d864147e787e74caf3
[02:11:00] matthewd: creature: ApplicationController is 2622 lines, so... :P
[02:11:44] creature: `virtual_column` is some home-rolled helper, right?
[02:12:13] matthewd: FailBit: We use autoload in production, so boot is a more.. gradual process
[02:13:07] matthewd: creature: Yeah; it fakes some reflection stuff for the reporting engine, or something.
[02:14:02] rory096: sevenseacat: would it be helpful to add a gist of the profiler results? basically the vast majority of the calls are on that polymorphic, but it's even querying for each individual feature (the parent of the polymorphics)
[02:14:30] sevenseacat: rory096: let's start with the code. also, its quite hard to eager load polymorphic associations.
[02:14:49] rory096: code is here: https://gist.github.com/RoryStolzenberg/f0d864147e787e74caf3
[02:15:07] rory096: it actually seems to be querying for the polymorphics properly in the beginning. just ignores them later and re-fetches
[02:15:39] ubersapiens: has joined #RubyOnRails
[02:17:01] sevenseacat: what is it refetching? the viewable, because you're calling it again in _feature.json.jbuilder ?
[02:17:12] JoshGlzBrk: has joined #RubyOnRails
[02:17:18] sevenseacat: and the viewable isnt being eager loaded
[02:17:30] rory096: sevenseacat: it's refetching the features for each channel and each of the viewables for each feature
[02:17:50] sevenseacat: can you add the logs to the gist?
[02:19:00] FailBit: matthewd: RAM usage per app instance?
[02:19:41] s2013: has joined #RubyOnRails
[02:20:42] rory096: sevenseacat: done
[02:21:06] s2013: any of you build mobile apps and used rails for backend and use devise. how do you handle password reset? do you send them an email? some other way?
[02:21:22] FailBit: I send them an email
[02:21:47] s2013: do they reset the password on the web then?
[02:21:49] Wingar: has joined #RubyOnRails
[02:22:38] FailBit: I see what you mean
[02:22:58] FailBit: a mobile app powered by a rails api, not a mobile version of the site
[02:23:50] s2013: im thinking of sending them some sort of random token and they need to enter it in the app to reset the password..
[02:24:17] yoongkang: has joined #RubyOnRails
[02:24:21] FailBit: how much entropy
[02:24:23] rory096: incidentally *can* you eager load polymorphics? i was going by http://stackoverflow.com/questions/1683265/activerecord-has-many-through-and-polymorphic-associations and assuming it's not directly possible. though it occurs to me now that that's 6 years old
[02:24:37] FailBit: rory096: it's gonna be slow as hell
[02:24:44] roshanavand: has joined #RubyOnRails
[02:24:57] The_Phoenix: has joined #RubyOnRails
[02:25:05] FailBit: databases do not like AR's joins
[02:25:13] FailBit: or joins in general
[02:25:40] rory096: FailBit: what if most of the polys are of one type, and only a tiny few the other? (besides, i'm gonna have to get them anyway at some point)
[02:25:41] FailBit: I stick with includes() because I don't pay network overhead for extra database queries
[02:26:21] njero: s2013: i just passed that phase :P
[02:26:21] s2013: k i think im going to go the mobile optimized page route for password reset
[02:26:35] s2013: n_e_o what did you end up doing?
[02:26:48] njero: not finished yet.. I
[02:27:12] pydave6367: has joined #RubyOnRails
[02:27:23] njero: passing token link which can be opened in browser or within app
[02:27:26] nickenchuggets: has joined #RubyOnRails
[02:27:36] njero: http://stackoverflow.com/questions/2448213/how-to-implement-my-very-own-uri-scheme-on-android
[02:27:48] rory096: FailBit: wait, what's the difference between includes and eager loading?
[02:27:56] rory096: are you saying only .joins eagerly load?
[02:28:17] s2013: interesting
[02:28:23] FailBit: .eager_load and .preload do different things with the same interface
[02:29:05] ewnd9: has joined #RubyOnRails
[02:29:08] njero: s2013: are you using device token auth?
[02:29:18] FailBit: ActiveRecord_Relation#eager_load executes a JOIN on the database and returns everything in one query, it is ideal if you have high latency to the database
[02:29:33] rory096: gotcha. i'm just using include()s right now
[02:30:20] matthewd: FailBit: ~200MB for the UI worker, I think. But that's probably shortly after boot.. tbh I have no idea what it does after that. I guess it'd depend what sorts of things the appliance was managing.
[02:30:33] FailBit: rory096: ActiveRecord_Relation#preload makes another query to eagerly fetch the relations from the first query
[02:30:34] s2013: yeah n_e_o
[02:30:44] FailBit: this is almost always faster
[02:30:53] FailBit: and it is the default for #includes
[02:31:20] FailBit: if you are using #includes to fetch from a poly relation, then it has to use preloads and not eager loads
[02:31:55] njero: s2013: awesome..
[02:31:55] FailBit: JOINs are slow
[02:31:55] koprom: has joined #RubyOnRails
[02:32:48] FailBit: if your database is on your server, avoid them; if it is not, then consider whether joins are faster than multiple queries
[02:33:36] matthewd: I don't think that you can preload polymorphic associations.. though I may be wrong
[02:33:40] rory096: i guess my main problem right now is still that even the non-poly relation gets one DB query for all the has_many children among a whole collection (features belong_to channels, in this case), but rails/jbuilder is still ignoring that earlier query and requerying when it needs to use them
[02:35:08] pawnbox: has joined #RubyOnRails
[02:35:52] confounds: has joined #RubyOnRails
[02:36:13] matthewd: rory096: Are you accessing them through the preloaded relationship? It doesn't look like it to me.
[02:36:21] rory096: oh wait, huh. looks like i fixed that by getting rid of the attempts at the half- poly includes
[02:37:05] rory096: matthewd: yeah it's going @channels do |channel| channel.features do |feature| feature.[poly]
[02:37:40] rory096: so alright then, looks like we're back to what should i do about the poly loading
[02:39:04] FailBit: includes(..., :features => [:titles])
[02:39:58] nso95-: has joined #RubyOnRails
[02:39:58] nso95-: has joined #RubyOnRails
[02:40:29] K_r3aPeR: has joined #RubyOnRails
[02:40:42] rory096: FailBit: where titles is the polymorphic, or one of the two classes being morphed to?
[02:40:56] FailBit: that's the name of the relation
[02:41:12] FailBit: if it's has_one/belongs_to then just use :title
[02:41:13] s2013: has joined #RubyOnRails
[02:41:22] confounds: has joined #RubyOnRails
[02:41:34] rory096: ah yep, that did it! even with the polymorphic
[02:41:37] matthewd: Yeah, I think I was in fact wrong before... polymorphic associations do seem preloadable. I was thinking of a different issue.
[02:41:48] rory096: it just automatically did two queries for the two classes being morphed to
[02:41:51] rory096: thanks guys!
[02:42:08] hnanon_: has joined #RubyOnRails
[02:42:32] FailBit: ACTION goes back to reading morbid stories about PHP developers
[02:43:33] jetpackjoe: has joined #RubyOnRails
[02:45:12] K_r3aPeR: has joined #RubyOnRails
[02:45:43] hnanon_: I have: <%= link_to (image_tag deposit.receipt.url(:thumb)) %>
[02:45:45] beauby: has joined #RubyOnRails
[02:45:52] hnanon_: I want to link to the actual image, though.
[02:46:14] hnanon_: I'm not sure what the second parameter of should be for the link_to helper.
[02:47:18] b2zeldafreak: has joined #RubyOnRails
[02:47:48] FailBit: link_to "Image", deposit.receipt.url(:thumb)
[02:48:53] hnanon_: Failbit: I want to show the image and link to it.
[02:50:03] hnanon_: I used: <%= link_to (image_tag deposit.receipt.url(:thumb)), deposit.receipt.url(:thumb) %>
[02:50:03] FailBit: <%= link_to(image_tag deposit.receipt.url(:thumb), deposit.receipt.url(:thumb)) %>
[02:50:15] FailBit: hurr parens
[02:50:16] hnanon_: It's working thanks to your hint.
[02:50:25] FailBit: but yes that's the idea
[02:50:26] VeryBewitching: FailBit: My favorite article about PHP: http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
[02:50:37] FailBit: read it 4 times yet
[02:50:43] jury: has joined #RubyOnRails
[02:51:02] FailBit: I sometimes want to write stories about the curses of PHP developers
[02:51:07] nso95: has joined #RubyOnRails
[02:51:14] FailBit: those who live their lives in shame
[02:51:44] VeryBewitching: I can't help but agree.
[02:51:51] VeryBewitching: You should do it.
[02:52:20] FailBit: there have to be plot twists and a sad ending
[02:52:58] jury: Hi guys!, I'm trying to get better at Rails, I'm trying to get an idea to develop but I don't get anything that seems "not too simple", some help here?
[02:53:16] FailBit: jury: do you know ruby?
[02:53:21] VeryBewitching: FailBit: You should write it in MD and write rspec tests describe the story.
[02:53:32] FailBit: ACTION shudders
[02:53:41] FailBit: one word too many
[02:54:08] FailBit: jury: examples of things that need explaining?
[02:54:34] jury: I'm looking for Ideas to develop (i.e: a blog).
[02:54:42] VeryBewitching: Radar has a Gist somewhere that proposes an app to develop, with some loose specification.
[02:54:44] FailBit: VeryBewitching: it "should not use rspec" do ; end
[02:55:04] VeryBewitching: But I can't remember the URL to it.
[02:55:21] Rubie: has joined #RubyOnRails
[02:55:45] VeryBewitching: FailBit: I find RSpec assists me more, and I prefer the syntax.
[02:56:00] VeryBewitching: I don't have anything against Minitest though.
[02:56:11] FailBit: DSLs make me sad
[02:56:19] jahbrewski: has joined #RubyOnRails
[02:57:00] VeryBewitching: FailBit: describe, context and it help me visualize the test more.
[02:57:41] Grundell: has joined #RubyOnRails
[02:58:04] creature: jury: An online shop. A music website (allow artists to upload files; allow users to listen to them & comment on them). A dating site, with a paywall (free users can browse, but you have to pay to contact people).
[02:58:18] baweaver: has joined #RubyOnRails
[03:00:51] FailBit: rewrite 4chan in rails
[03:00:54] FailBit: or infinity
[03:01:09] annlewis: has joined #RubyOnRails
[03:01:21] FailBit: also, remember to install gentoo
[03:03:07] VeryBewitching: Install Ubuntu and save your processor from contributing to global warming. :)
[03:03:31] jury: No thanks, I use Fedora
[03:03:58] jetpackjoe: has joined #RubyOnRails
[03:04:01] FailBit: yall can't even /g/
[03:04:11] jury: thanks for the ideas, more ideas are welcome
[03:04:34] ace05: has joined #RubyOnRails
[03:04:38] VeryBewitching: jury: Build an app that let's you connect with a friend and play rounds of paper, rock, scissors
[03:06:37] SteenJobs: has joined #RubyOnRails
[03:06:54] Radar: VeryBewitching: jury: https://gist.github.com/radar/3037d4c5f8d3240afd43
[03:07:02] barhum2013: has joined #RubyOnRails
[03:07:20] VeryBewitching: Yes! That's what I was talkinga bout earlier jury ^
[03:08:54] dideler: has joined #RubyOnRails
[03:10:30] rhizome: jury: https://www.reddit.com/r/SomebodyMakeThis/
[03:11:15] jury: Thanks Radar, VeryBewitching!
[03:11:31] Radar: jury: !r4ia
[03:11:31] helpa: jury: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[03:11:34] Radar: There is also this book that I wrote.
[03:13:34] sevenseacat: its a good book :)
[03:13:41] Radar: sevenseacat: also wrote it
[03:13:43] sevenseacat: (disclaimer: I also wrote it)
[03:13:48] Radar: TBF she wrote > half of it
[03:14:16] sevenseacat: all the buggy parts, they were me.
[03:14:18] rickmasta: has joined #RubyOnRails
[03:14:25] sevenseacat: j/k. there are no buggy parts.
[03:14:41] Radar: FLAWLESS VICTORY
[03:16:00] sarink: has joined #RubyOnRails
[03:17:56] goodcodeguy: has joined #RubyOnRails
[03:18:40] greengriminal: has joined #RubyOnRails
[03:19:28] FailBit: My code is perfect
[03:19:32] FailBit: it never has bugs
[03:20:13] mary5030: has joined #RubyOnRails
[03:21:41] Axsuul: has joined #RubyOnRails
[03:22:34] goodcodeguy: has joined #RubyOnRails
[03:23:39] gambl0re: has joined #RubyOnRails
[03:24:41] sankaber: has joined #RubyOnRails
[03:25:02] yoongkang: has joined #RubyOnRails
[03:25:45] Fire-Dragon-DoL: sevenseacat: so you are Rebecca Skinner? :O wasn't aware of it
[03:25:53] sevenseacat: Fire-Dragon-DoL: I sure am.
[03:26:03] sevenseacat: Fire-Dragon-DoL: pleased to meet you.
[03:26:06] patrick2: has joined #RubyOnRails
[03:26:33] roshanavand: has joined #RubyOnRails
[03:26:47] greengriminal: can someone help me understand this. https://gist.github.com/davidpatters0n/2ba8936b84828ead314b
[03:26:55] Fire-Dragon-DoL: sevenseacat: pleased to meet you too! I'm Francesco Belladonna (for fairness) ;)
[03:27:11] greengriminal: currently i am doing: params.fetch(:ticket).fetch(:access_keys) but have swapped it out for `params[:ticket][:access_keys]` which works
[03:27:13] Fire-Dragon-DoL: not as famous as you though :P
[03:27:18] sevenseacat: haha I'm not famous
[03:27:31] greengriminal: my understanding is that if a key can not be found by #fetch it will raise/render an exception
[03:27:46] Fire-Dragon-DoL: well, you appear as an author in one of the books I read, you are famous for me :P
[03:28:13] Fire-Dragon-DoL: Radar is famous too, I was aware of him since a while now
[03:28:28] greengriminal: SO... doing: params.fetch(:ticket).fetch(:access_keys) when it raises an exception and runs on "create" thats where it would raise the double render exception.
[03:28:28] greengriminal: Can someone confirm if that sounds reasonable.
[03:33:49] Radar: greengriminal: that in itself won't cause a double render exception
[03:33:54] Pazician: has joined #RubyOnRails
[03:34:00] Radar: You know by now to provide stacktraces for errors
[03:34:03] Radar: son, I am disappoint
[03:34:36] greengriminal: :-( i was being lazy. It was something that i could put together quickly.
[03:35:44] Radar: greengriminal: with great disappointment comes great frowny face making
[03:36:00] Rubie: has joined #RubyOnRails
[03:36:46] MaDErroR123: has joined #RubyOnRails
[03:36:56] nso95-: has joined #RubyOnRails
[03:37:10] pawnbox: has joined #RubyOnRails
[03:37:18] ascarter: has joined #RubyOnRails
[03:38:44] lacuna: has joined #RubyOnRails
[03:39:56] greengriminal: Radar, updated with stackrace: https://gist.github.com/davidpatters0n/2ba8936b84828ead314b#file-stacktrace-txt
[03:40:30] akira: has joined #RubyOnRails
[03:40:43] Radar: 22:35:54 web.1 | config/initializers/denser_logs.rb:30:in `block (2 levels) in <top (required)>'
[03:40:44] Radar: What is this
[03:40:55] sevenseacat: can you post the actual controller action?
[03:41:02] greengriminal: that something within an app I am working on.
[03:41:04] roshanavand: has joined #RubyOnRails
[03:41:07] sypheren: has joined #RubyOnRails
[03:41:15] Radar: greengriminal: And your Gemfile, please.
[03:41:21] Radar: greengriminal: I want to know why you're including the strong_parameters gem.
[03:41:33] greengriminal: The app we're using is on rails 3.2
[03:41:39] greengriminal: we're in the mids of upgrading.
[03:41:46] greengriminal: so the gem strong_params will be dropped
[03:41:48] sevenseacat: we can tell that its rails 3.2
[03:42:07] ewnd9: has joined #RubyOnRails
[03:42:11] sevenseacat: but we are not psychic and cannot read the code behind "some create stuf"
[03:42:44] njero: has joined #RubyOnRails
[03:43:08] greengriminal: Its okay sevenseacat i will dig into this further tomorrow. But thanks though.
[03:43:44] sevenseacat: well that was a good way to spend 20min. good chatting with you.
[03:44:02] User458764: has joined #RubyOnRails
[03:44:16] greengriminal: :| well i can't exactly post my #create action. apologies
[03:44:45] Radar: greengriminal: !consultant
[03:44:45] helpa: greengriminal: Your question, problem, and/or attitude requires more than free internet advice from an irc channel. May I suggestion hiring a consultant or life coach?
[03:45:27] sevenseacat: we're gonna get a lot of mileage out of that one
[03:46:21] nya: has joined #RubyOnRails
[03:47:50] Fire-Dragon-DoL: sevenseacat: your blog has been added to my RSS feeder, be prepared! ;) no but really, found some interesting articles (elixir one especially, since I'll be studying it during Christmas probably)
[03:48:13] sevenseacat: I havent written much there. i should get back to that.
[03:52:39] pawnbox: has joined #RubyOnRails
[03:53:09] nya: has joined #RubyOnRails
[03:55:35] nyaa: has joined #RubyOnRails
[03:56:02] Fire-Dragon-DoL: I plan on writing in my blog since a while, I have yet to finish DEVELOPING it, lol
[03:56:12] Rubie: has joined #RubyOnRails
[03:56:13] Fire-Dragon-DoL: (the design at least)
[03:57:07] sevenseacat: mine is really simple and I built it in an afternoon using jekyll, and published on github pages
[03:59:12] baweaver: has joined #RubyOnRails
[03:59:30] tjbiddle: has joined #RubyOnRails
[04:00:46] Meow-J: has joined #RubyOnRails
[04:00:55] ascarter: has joined #RubyOnRails
[04:01:27] Maletor: has joined #RubyOnRails
[04:01:56] annlewis: has joined #RubyOnRails
[04:03:08] Fire-Dragon-DoL: sevenseacat: well my plan was similar, but my wife designed me a very nice graphics, so I was implementing it. I was using middleman (more or less like Jekyll), that's all I guess
[04:03:41] Fire-Dragon-DoL: but I have other side projects I'm bringing on, and working a lot lately (happily, but a lot), so yes, ended up not doing anything :(
[04:05:00] stannard: has joined #RubyOnRails
[04:07:49] Diabolik: o/ everyone
[04:08:11] Fire-Dragon-DoL: good night everyone, see you tomorrow ;)
[04:10:52] tjbiddle: Someone mind helping with an ActiveRecord table-join problem? Not experienced on that end at all: https://gist.github.com/thomasbiddle/d921495cdb3d6f81388d - Just a joins or includes doesn't seem to work, I think I want outer join?
[04:10:57] messine: has joined #RubyOnRails
[04:16:05] braincrash: has joined #RubyOnRails
[04:16:57] ubersapiens: has joined #RubyOnRails
[04:17:08] j_v-asd: has joined #RubyOnRails
[04:17:21] The_Phoenix: has joined #RubyOnRails
[04:18:54] shock_one: has joined #RubyOnRails
[04:23:28] ellisTAA: has joined #RubyOnRails
[04:25:08] b2zeldafreak: has joined #RubyOnRails
[04:25:31] ascarter: has joined #RubyOnRails
[04:25:38] yoongkang: has joined #RubyOnRails
[04:25:49] rubyonrailed: has joined #RubyOnRails
[04:26:08] rakm: has joined #RubyOnRails
[04:28:43] hahuang65_: has joined #RubyOnRails
[04:30:51] ace05: has joined #RubyOnRails
[04:30:58] tjbiddle: Anyone? Banging my head on the table here
[04:32:59] Radar: !crickets
[04:32:59] helpa: *chirp chirp*
[04:33:10] Aeyrix: Your issues with SQL itself don't really pertain to this channel.
[04:33:22] Aeyrix: Moreover, the structure of that gist makes me want to go and drink, as opposed to anything else.
[04:34:10] DanielN: has joined #RubyOnRails
[04:34:19] Radar: Aeyrix: Wow. Rude.
[04:34:28] Oog: has joined #RubyOnRails
[04:35:00] jetpackjoe: has joined #RubyOnRails
[04:35:19] Aeyrix: Not really.
[04:35:28] Radar: !kick Aeyrix
[04:35:28] helpa: Radar: No.
[04:35:35] Radar: helpa: et tu bot?
[04:35:38] Aeyrix: It's not an activerecord issue, they indicated they wanted to use sql joins.
[04:35:53] MaDErroR123: has joined #RubyOnRails
[04:36:10] Aeyrix: That table structure is just... weird.
[04:36:16] Radar: I agree. There is probably a reason for it.
[04:36:24] Aeyrix: lol good one
[04:36:38] Radar: Benefit of the doubt bro
[04:37:22] baweaver: tjbiddle: do you have the real data?
[04:37:25] tjbiddle: Aeyrix: How so? (Is it weird) - I have one table with the bulk of information, the others are options to be merged into the it so that I can selectively choose which version of the information I want.
[04:38:10] Aeyrix: tjbiddle: will an avatar ever have both?
[04:38:11] Aeyrix: or just one?
[04:38:20] tjbiddle: Aeyrix: Always
[04:38:28] Aeyrix: So just put them both in the avatars table
[04:38:53] baweaver: http://guides.rubyonrails.org/active_record_querying.html#eager-loading-associations
[04:39:34] baweaver: http://guides.rubyonrails.org/association_basics.html#polymorphic-associations
[04:39:35] Aeyrix: baweaver: Realistically I think just putting the columns in the avatars table would achieve the desired effect slightly more efficiently.
[04:39:38] Aeyrix: Zero joins.
[04:39:53] tjbiddle: I knew you were going to say that the second I typed that - Why am I an idiot. Would that be easier if I only wanted to expose one of them at a time though? I'd need to strip both of them, and then re-add one as a generic field for the end result, no?
[04:40:09] Aeyrix: just default to one
[04:40:09] baweaver: for the most part if you have a one to one just merge the models
[04:40:11] Aeyrix: if one isn't there
[04:40:13] Aeyrix: use the other
[04:40:15] Aeyrix: don't have
[04:40:17] xcesariox: has joined #RubyOnRails
[04:40:26] Aeyrix: <a version> <b version> <version used>
[04:40:28] baweaver: less headache down the road
[04:40:34] Aeyrix: just have <a version> <b version> and use a unless it's not there
[04:40:50] Servant: has joined #RubyOnRails
[04:44:18] Servant: has left #RubyOnRails: ()
[04:44:51] tariqc: has joined #RubyOnRails
[04:46:13] owenjones: has joined #RubyOnRails
[04:46:15] Grundell: has joined #RubyOnRails
[04:48:05] Radar: gg baweaver and Aeyrix
[04:48:59] ur5us: has joined #RubyOnRails
[04:49:53] messine: has joined #RubyOnRails
[04:50:00] sypheren: has joined #RubyOnRails
[04:50:39] mrd_: has joined #RubyOnRails
[04:53:27] Rubie: has joined #RubyOnRails
[04:54:12] pawnbox: has joined #RubyOnRails
[04:59:19] rubyonra_: has joined #RubyOnRails
[04:59:54] DanielN: has joined #RubyOnRails
[05:01:48] pawnbox: has joined #RubyOnRails
[05:01:54] theery: has joined #RubyOnRails
[05:02:17] dideler: has joined #RubyOnRails
[05:02:40] annlewis: has joined #RubyOnRails
[05:04:59] MEATCHICKEN: Is there a way to disable secrets.yml?
[05:05:06] MEATCHICKEN: since I am using rails for json api
[05:05:11] MEATCHICKEN: I don't need the secret_key_base
[05:05:29] Radar: meatchicken: delete it.
[05:05:37] MEATCHICKEN: Radar, okay thanks
[05:05:52] MEATCHICKEN: Radar, Wait - I don't need it for a json api right? just to be certain
[05:06:19] Radar: meatchicken: I don't actually know.
[05:06:23] Radar: I don't think so.
[05:07:45] ellisTAA: has joined #RubyOnRails
[05:09:21] pawnbox: has joined #RubyOnRails
[05:09:30] Rubie: has joined #RubyOnRails
[05:10:41] pawnbox_: has joined #RubyOnRails
[05:12:09] n1lo: has joined #RubyOnRails
[05:12:21] Caius: has joined #RubyOnRails
[05:12:21] Caius: has joined #RubyOnRails
[05:13:26] pramodas23: has joined #RubyOnRails
[05:17:09] SteenJobs: has joined #RubyOnRails
[05:18:01] ubersapiens: has joined #RubyOnRails
[05:18:55] ellisTAA: has joined #RubyOnRails
[05:20:55] djellemah: has joined #RubyOnRails
[05:21:17] shortCircuit__: has joined #RubyOnRails
[05:23:20] shortCircuit__: I will be trying to implement a ActiveRecord model like thing in javascript though. so I am trying to understand how it works..
[05:30:13] helpa: http://i.imgur.com/tyViD.gif
[05:31:04] shortCircuit__: firstly I guess on calling ActiveRecord::Base.establish_connection does it create a singleton class object? so that some class inherits AR::Base, it creates a table name (acc. to cond), now those tables/classes gets the methods create/find , but how does it fire sql specific queries , and I mean whatid\f I want to have an in memory database?
[05:32:23] trosborn: has joined #RubyOnRails
[05:33:22] joshkovach: has joined #RubyOnRails
[05:34:19] matthewd: shortCircuit__: That.. doesn't sound like something you actually want to do
[05:34:45] shortCircuit__: oh. erm, then how do I approach the problem?
[05:34:52] Pazician: has joined #RubyOnRails
[05:36:06] sevenseacat: what problem?
[05:36:14] sevenseacat: you havent mentioned one yet
[05:36:24] matthewd: If your problem is "implement AR in JS", 'approach' is not one of the things I'd be doing to it ;)
[05:37:05] shortCircuit__: yes that is the problem .. its not like an error ..
[05:37:29] shortCircuit__: I am asking about the approach I should take
[05:37:56] ur5us: has joined #RubyOnRails
[05:39:17] Radar: !xy so hard right now
[05:39:17] helpa: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[05:39:20] Radar: Why do you want to implement AR in JS?
[05:39:27] Radar: !botsnack
[05:39:27] helpa: Nom nom. Thanks, Radar!
[05:39:40] pawnbox: has joined #RubyOnRails
[05:39:52] matthewd: shortCircuit__: Then I'm not sure what the question is. If it boils down to "how does AR work?", that seems unlikely to be an IRC-sized discussion.
[05:40:34] iateadonut: has joined #RubyOnRails
[05:40:46] Radar: matthewd: Do you have access to the bot yet?
[05:40:54] matthewd: So, my advice is to question the assumption that you want to make such a thing in the first place
[05:41:52] matthewd: Radar: Yes, you did so-equip me, thank you. Though I do have to remember the relevant magics to invoke it intelligently... there isn't a list anywhere of known factoid thingies, is there?
[05:42:12] helpa: Just the tips: http://logs.ryanbigg.com/tips
[05:42:39] Radar: matthewd: https://github.com/radar/railsbot has more commands too
[05:42:46] rvanlieshout: has joined #RubyOnRails
[05:42:47] Radar: But most of it is on /tiops
[05:42:53] matthewd: ACTION sets aside the recursive irony ;)
[05:43:09] SteenJobs: has joined #RubyOnRails
[05:43:50] matthewd: Yeah, I'd found the code... maybe I should PR a /tips link into the readme.
[05:43:51] AzaToth: has joined #RubyOnRails
[05:44:19] shortCircuit__: Radar I like the way I used to do it in rails .. actually I am looking for some approach to do the ORM thing .. I only know about ActiveRecord .. I mean I would like to do ORM.create_connection({database: "inmemory", ...someOtherConfigurations}) and then User = ORM.create_table("users", [columnNames]); so then I can do user = User.find(id) and stuff
[05:44:30] Radar: shortCircuit__: Ember does this already
[05:44:35] Radar: shortCircuit__: why are you reinventing this wheel?
[05:45:48] Mia: has joined #RubyOnRails
[05:45:48] Mia: has joined #RubyOnRails
[05:45:55] shortCircuit__: :( um, well since this is not workplace stuff so I would like to focus on the keyword: "invent" out of that statement. and :)
[05:46:39] rvanlieshout: then why are you using rails?
[05:46:47] rvanlieshout: if you want to invent it all
[05:46:55] rvanlieshout: and hello all :)
[05:49:10] matthewd: shortCircuit__: Okay, well.. I think some people have written blog series on how Rails works... you might be able to find a dive through AR along those lines?
[05:49:20] Oog: has joined #RubyOnRails
[05:49:23] shortCircuit__: please donot do this invent reinvent .. :'( I believe that if I implement even a simple version of it I would have to learn something new that I wouldn't if I just used the stuff to get it done.. so for real work I would definitly use the already discovered stuff ... I mean I am not that talented you know, I have to practice a lot to do what I do which is like nothing.
[05:49:41] shortCircuit__: matthewd ok looking into them
[05:49:49] owenjones: has joined #RubyOnRails
[05:49:54] matthewd: shortCircuit__: But AR leans on the database to do a lot of heavy lifting, which you miss out on if you're using your own in-memory storage
[05:49:55] lessless: has joined #RubyOnRails
[05:50:20] lxsameer: has joined #RubyOnRails
[05:50:20] lxsameer: has joined #RubyOnRails
[05:51:49] matthewd: shortCircuit__: Just know that you've picked a huge, difficult project, and as a maintainer of ActiveRecord, I advise against it as a learning exercise
[05:52:22] matthewd: shortCircuit__: But that said, I'm happy to answer *specific* questions as you encounter them
[05:52:51] shortCircuit__: oh.. awesome you must be cool ..
[05:52:55] srinidhi: has joined #RubyOnRails
[05:53:44] MaDErroR123: has joined #RubyOnRails
[05:55:09] pawnbox: has joined #RubyOnRails
[05:55:19] zoidfarb: has joined #RubyOnRails
[05:56:22] zoidfarb: Hi, I've got a problem with the asset pipeline: Everything shows up fine in development, but deployed on a server (using Ansible), none of the assets are loading. Looking in public/assets, it seems the assets ARE getting precompiled, but the URL helpers don't seem to be serving the "compiled" versions of things?
[05:58:01] rvanlieshout: did you run assets:precompile?
[05:58:22] rvanlieshout: and how do you know they are?
[05:58:50] krz: has joined #RubyOnRails
[05:59:26] matthewd: zoidfarb: What's the symptom you're actually seeing?
[05:59:38] zoidfarb: rvanlieshout: Yes, there's an ansible task that runs `rake assets:precompile`, and if I SSH in, the files are there.
[05:59:49] zoidfarb: matthewd: Page loads without images, stylesheets or JS
[05:59:52] rvanlieshout: and where is there?
[06:00:06] zoidfarb: http://staging.printedonion.com/
[06:00:14] rvanlieshout: where are the files located on disk?
[06:00:32] SteenJobs: has joined #RubyOnRails
[06:00:35] rvanlieshout: and does the fingerprint match what is in the generated html?
[06:00:38] zoidfarb: /releases/20151124233109/public/assets
[06:00:52] matthewd: Okay, so it's getting the images right
[06:00:57] zoidfarb: rvanlieshout: That's what I'm saying, the generated HTML seems to refer to all non-compiled versions
[06:01:07] rvanlieshout: did you restart your rails server intances?
[06:01:39] zoidfarb: rvanlieshout: Yeah
[06:02:03] rvanlieshout: are you able to verify it has been restarted?
[06:02:12] zoidfarb: TASK: [deploy | Restart unicorn] <- is in the ansible log
[06:02:20] zoidfarb: I can manually ssh in and restart it
[06:02:30] sypheren: has joined #RubyOnRails
[06:02:43] rvanlieshout: well. that would restart it, but is there a way to verify that
[06:02:49] rvanlieshout: e.g. start time of processes
[06:03:18] zoidfarb: $ ps aux | grep unicorn
[06:03:18] zoidfarb: ubuntu 32657 0.0 0.0 10464 924 pts/1 S+ 05:57 0:00 grep --color=auto unicorn
[06:03:29] annlewis: has joined #RubyOnRails
[06:03:38] zoidfarb: rvanlieshout: Thanks for your help, by the way
[06:03:42] matthewd: zoidfarb: So there's a public/assets/style-*.css, right?
[06:03:47] rvanlieshout: zoidfarb: that's not the unicorn process
[06:03:59] rvanlieshout: what if you stop unicon, check if the website is unaccessible and start it again
[06:04:01] matthewd: What's the fingerprint in that filename? Does it work if we stick it in a URL?
[06:05:04] zoidfarb: matthewd: There doesn't actually appear to be a style-*.css There are images and fonts, but not CSS or JS
[06:05:32] drale2k: has joined #RubyOnRails
[06:05:34] Axsuul: has joined #RubyOnRails
[06:05:38] adavia_: i have a collection select that shows a list of categories. Is there any way to change it name to categories instead category_ids which is what expects?
[06:05:45] matthewd: zoidfarb: Then I think you need to manually run the precompile, and see what happens
[06:05:52] matthewd: zoidfarb: Maybe you don't have a JS runtime available?
[06:06:04] confounds: has joined #RubyOnRails
[06:06:07] Rubie: has joined #RubyOnRails
[06:06:49] dionysus69: has joined #RubyOnRails
[06:07:30] trosborn: has joined #RubyOnRails
[06:08:41] pawnbox: has joined #RubyOnRails
[06:08:47] zoidfarb: matthewd: I just manually ran 'bundle exec rake assets:precompile. I got a warning WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.9.1
[06:08:55] matthewd: adavia_: :name and/or :id keys in html_options (the *second* hash parameter), maybe?
[06:09:03] rvanlieshout: zoidfarb: that's ok
[06:09:09] rvanlieshout: that's it? check the logs too
[06:09:14] zoidfarb: matthewd: And then a bunch of INFO messages "Writing ... "
[06:09:21] zoidfarb: but it only wrote fonts and images
[06:09:36] zoidfarb: no errors about CSS or JS that I can see
[06:09:47] rvanlieshout: what do you have in app/assets/stylesheets?
[06:09:50] matthewd: zoidfarb: Oh, you need to add the relevant files to the precompile list
[06:10:15] adavia_: matthewd: i know i can change that.. but as i sais it expects to be named category_ids otherwise i get an ActiveRecord::AssociationTypeMismatch
[06:10:33] zoidfarb: matthewd: That...sounds like an extremely important thing I did not know I had to do.
[06:10:47] matthewd: zoidfarb: Are you using old versions of things, or have you turned off the relevant check? :/
[06:10:54] rvanlieshout: adavia_: why would you want to change the name?
[06:10:57] zoidfarb: matthewd: I assumed it would precompile anything in the /assets/ folders
[06:11:10] rvanlieshout: zoidfarb: true for non js and css. for those two it's only application
[06:11:25] matthewd: zoidfarb: If old version, see config/environments/production.rb... if newer, it moved to config/initializers/assets.rb or something along those lines
[06:12:03] zoidfarb: rvanlieshout: app/assets/stylesheets/ has style.css.scss
[06:12:13] rvanlieshout: zoidfarb: it's common to use application.css.scss
[06:12:14] adavia_: rvanlieshout: because i want to match the name of the field with the error field name. So an error throws categories but my field is category_ids
[06:12:17] pawnbox: has joined #RubyOnRails
[06:12:33] rvanlieshout: if you do not want application add it to the list of files that needs to be precompiled, as what matthewd wrote
[06:13:10] rvanlieshout: adavia_: that makes sence, but most helper libraries for forms also access errors without the _ids if rendered for a _ids-field.
[06:13:10] zoidfarb: rvanlieshout: Thanks, let me see
[06:13:14] rvanlieshout: that feels like a better approach
[06:13:36] rvanlieshout: cause validating categories over category_ids is better, and using the name we all expect also is
[06:14:19] zoidfarb: Can I flip this setting, too? # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = false
[06:14:41] rvanlieshout: zoidfarb: you don't want that :)
[06:14:47] SteenJobs: has joined #RubyOnRails
[06:14:59] naftilos76: has joined #RubyOnRails
[06:15:02] rvanlieshout: you don't want your precious rails server instances serving assets
[06:15:02] rory096: zoidfarb: not recommended on production http://stackoverflow.com/questions/8821864/config-assets-compile-true-in-rails-production-why-not
[06:15:31] rory096: zoidfarb: but you can @import or *=require your libraries in your main css file
[06:16:03] adavia_: rvanlieshout: i see but is not usefull of you want to validate that with js =/
[06:16:13] rory096: so you don't have to link them separately or add them to the config.assets.precompile list
[06:16:24] rvanlieshout: adavia_: have your controller do what it's supposed to do
[06:16:41] rvanlieshout: adavia_: in the mvc world both the view and model are right here
[06:17:03] nickenchuggets: has joined #RubyOnRails
[06:17:03] nickenchuggets: has joined #RubyOnRails
[06:17:27] xcesariox: has joined #RubyOnRails
[06:17:37] adavia_: i need to do a messy js regex validation to match both =/
[06:18:13] rvanlieshout: what code do you have now for that validation?
[06:18:18] rvanlieshout: it doesn't have to be messy
[06:19:31] adavia_: rvanlieshout: http://pastie.org/10579476
[06:19:39] matthewd: zoidfarb: What are your rails/sprockets/sprockets-rails versions? It's really supposed to be very difficult to accidentally get that wrong these days, so if the relevant cleverness failed you, I'd like to understand why.
[06:20:39] rvanlieshout: adavia_: what is 'errors' here and where does it come from?
[06:20:52] zoidfarb: matthewd, rvanlieshout: Adding files to config.assets.precompile seems to have done the trick! Thank you both very much.
[06:21:09] zoidfarb: matthewd: Probably a couple years out of date
[06:21:24] zoidfarb: matthewd: I'm picking up where some other devs left off
[06:21:45] matthewd: Ah, okay... as it sounded like an initial deploy, I was assuming it was more recent
[06:21:53] rvanlieshout: zoidfarb: so.. now a couople of questions left. a) why are you not using the standard application.css? b) how many assets have you got included in your view file?
[06:22:33] matthewd: zoidfarb: Newer versions are better versions :D
[06:22:52] adavia_: rvanlieshout: http://pastie.org/10579479
[06:22:55] adavia_: sorry there it is
[06:23:13] rvanlieshout: oh. it's just a static list
[06:23:19] rvanlieshout: so why not just use category_ids there
[06:23:55] adavia_: rvanlieshout: i mean that is the json response from the server
[06:23:56] zoidfarb: rvanlieshout: a) I didn't know there was such a thing as a standard application.css, I figured it didn't matter what your CSS file was called, as long as it was in the right directory b) Including all images, CSS and JS?
[06:24:10] rvanlieshout: adavia_: so let's get to that code
[06:24:25] zoidfarb: matthewd: Obviously. Upgrading is certainly on my to-do list.
[06:24:30] rvanlieshout: zoidfarb: limit that second to 1 js and 1 css
[06:24:44] rvanlieshout: a browser won't fetch > 4 at the same time, so your load times increase
[06:24:51] zoidfarb: rvanlieshout: Just include everything from within that one file?
[06:25:02] rvanlieshout: zoidfarb: exactly.. a file like application.js :)
[06:25:11] ace05: has joined #RubyOnRails
[06:25:28] adavia_: rvanlieshout: http://pastie.org/10579484
[06:25:30] DoubleMalt: has joined #RubyOnRails
[06:25:37] zoidfarb: rvanlieshout: Is that true even for JS libraries loaded from a CDN? I would assume it'd be better to load jquery from like the Google CDN, and hope most of your users have it cached already.
[06:25:45] aganov: has joined #RubyOnRails
[06:25:53] adavia_: http://pastie.org/10579486
[06:26:19] rvanlieshout: zoidfarb: true, in that case it only counts for your css and js files
[06:26:31] rvanlieshout: although i personally always have my own app just include it in the global file
[06:26:50] rvanlieshout: adavia_: we need the server code
[06:26:55] rvanlieshout: the thing that renders the json response
[06:27:00] rvanlieshout: cause that response is wrong :)
[06:27:07] dhjondoh: has joined #RubyOnRails
[06:29:25] blackhuey: has joined #RubyOnRails
[06:29:34] SteenJobs: has joined #RubyOnRails
[06:29:39] zoidfarb: matthewd: You asked about versions of things. According to the Gemfile, rails 4.0.2, sprockets 2.10.1, sprockets-rails 2.0.0
[06:31:10] rvanlieshout: adavia_: or you need to strip _ids and use some pluralize js library
[06:31:17] adavia_: rvanlieshout: http://pastie.org/10579494
[06:31:58] trosborn: has joined #RubyOnRails
[06:33:54] trosborn: has left #RubyOnRails: ()
[06:33:55] rvanlieshout: adavia_: ok. thinking about it i would say a clean way is to have a mapping table in your client code. So that it knows not use field when it's category_ids. Stripping _ids would be easy, but the pluralize requires some additional library and that feels much for this
[06:34:29] adavia_: yeah i think its a lot for something like this
[06:34:46] camilasan: has joined #RubyOnRails
[06:34:51] Grundell: has joined #RubyOnRails
[06:34:58] Oog: has joined #RubyOnRails
[06:35:02] rvanlieshout: adavia_: so a simple table that only contains category_ids -> categories
[06:35:07] rvanlieshout: and use that table over field
[06:35:30] adavia_: will check that..
[06:35:34] adavia_: rvanlieshout: thanks
[06:35:43] zoidfarb: Thanks for everyone's help!
[06:35:45] zoidfarb: has left #RubyOnRails: ()
[06:36:21] Oog: BEGIN; SAVEPOINT foo; select row for update; RELEASE foo; IS ROW LOCKED HERE? commit;
[06:36:41] rvanlieshout: Oog: i would say yes, but
[06:36:54] Oog: how could i test...
[06:37:01] rvanlieshout: open 2 db consoles
[06:37:17] rvanlieshout: run it and stop at your IS ROW LOCKED HERE
[06:37:22] rvanlieshout: then try to update that row in the other console :)
[06:39:53] Oog: rvanlieshout looks like you are right :)
[06:40:53] ellisTAA: has joined #RubyOnRails
[06:41:09] bhaveshletter: has joined #RubyOnRails
[06:43:52] hahuang61: has joined #RubyOnRails
[06:46:15] Pazician: has joined #RubyOnRails
[06:46:45] Pazician: has joined #RubyOnRails
[06:47:38] tagrudev: has joined #RubyOnRails
[06:51:25] roshanavand: has joined #RubyOnRails
[06:52:38] codezomb: has joined #RubyOnRails
[06:52:42] jondot: has joined #RubyOnRails
[06:55:00] maloik: has joined #RubyOnRails
[06:57:37] SteenJobs_: has joined #RubyOnRails
[06:59:04] dionysus70: has joined #RubyOnRails
[06:59:06] arBmind: has joined #RubyOnRails
[07:02:02] ur5us: has joined #RubyOnRails
[07:02:37] nocontrol: has joined #RubyOnRails
[07:04:14] annlewis: has joined #RubyOnRails
[07:07:38] moeabdol: has joined #RubyOnRails
[07:10:42] quarters: has joined #RubyOnRails
[07:10:59] lubekpl: has joined #RubyOnRails
[07:11:05] quarters: hello. I was wondering how I can use different versions of ruby depending on the environment
[07:11:45] quarters: I could only find one site that really tried to grapple with this issue: http://stackoverflow.com/questions/24481866/different-ruby-versions-by-environment-in-a-gemfile-for-rails-application
[07:12:36] sevenseacat: quarters: thats a really bad idea.
[07:13:04] sevenseacat: and I mean, a *really* bad idea.
[07:13:16] quarters: gotcha. I'll take your word for it
[07:13:33] sarink: has joined #RubyOnRails
[07:13:48] ace05: has joined #RubyOnRails
[07:14:00] User458764: has joined #RubyOnRails
[07:14:02] jetpackjoe: has joined #RubyOnRails
[07:15:23] lacuna: has joined #RubyOnRails
[07:17:21] pawnbox: has joined #RubyOnRails
[07:19:38] ubersapiens: has joined #RubyOnRails
[07:19:58] jahbrewski: has joined #RubyOnRails
[07:20:07] arBmind: has joined #RubyOnRails
[07:21:25] roshanavand: has joined #RubyOnRails
[07:21:42] pawnbox: has joined #RubyOnRails
[07:21:53] rickmasta: has joined #RubyOnRails
[07:21:57] roshanavand: has joined #RubyOnRails
[07:22:00] troys: has joined #RubyOnRails
[07:25:37] srinidhi1: has joined #RubyOnRails
[07:25:56] nso95-: has joined #RubyOnRails
[07:25:56] nso95-: has joined #RubyOnRails
[07:26:37] trautwein: has joined #RubyOnRails
[07:26:49] sandstrom: has joined #RubyOnRails
[07:27:34] yoongkang: has joined #RubyOnRails
[07:30:24] emilkarl: has joined #RubyOnRails
[07:32:02] defsdoor: has joined #RubyOnRails
[07:32:36] tetraktys: has joined #RubyOnRails
[07:33:40] lubekpl: has joined #RubyOnRails
[07:33:45] annlewis: has joined #RubyOnRails
[07:34:08] pawnbox: has joined #RubyOnRails
[07:35:57] MaDErroR123: has joined #RubyOnRails
[07:38:44] yardenbar: has joined #RubyOnRails
[07:41:49] tibra: has joined #RubyOnRails
[07:42:30] srinidhi: has joined #RubyOnRails
[07:42:59] SteenJobs: has joined #RubyOnRails
[07:46:05] ace05: has joined #RubyOnRails
[07:54:16] tjbiddle: has joined #RubyOnRails
[07:55:04] shock_one: has joined #RubyOnRails
[07:55:05] The_Phoenix: has joined #RubyOnRails
[07:57:23] jas02: has joined #RubyOnRails
[07:57:51] mark3: has joined #RubyOnRails
[07:57:58] solars: has joined #RubyOnRails
[07:58:46] norc: has joined #RubyOnRails
[07:59:20] Guest21657: has left #RubyOnRails: ()
[07:59:29] User458764: has joined #RubyOnRails
[07:59:38] norc: has joined #RubyOnRails
[08:00:23] norc: Hi. I have an Oracle Database that uses Windows-1252 as its encoding. I'm getting ActionView::Template::Error (incompatible character encodings: UTF-8 and Windows-1252) for some special characters across my views that try to display such columns
[08:00:43] norc: I'm using activerecord-oracle_enhanced-adapter for the record.
[08:00:53] norc: (These errors pop up in my HAML templates)
[08:01:12] drale2k: has joined #RubyOnRails
[08:02:19] norc: Now without resorting to turning my entire Rails application into W1252, what are my options here?
[08:03:17] jondot: has joined #RubyOnRails
[08:04:02] Palsson: has joined #RubyOnRails
[08:04:55] SteenJobs: has joined #RubyOnRails
[08:05:44] roshanavand: has joined #RubyOnRails
[08:06:46] agit0: has joined #RubyOnRails
[08:08:37] Scripore: has joined #RubyOnRails
[08:10:12] asoliman: has joined #RubyOnRails
[08:11:13] pawnbox: has joined #RubyOnRails
[08:12:15] matthewd: norc: PG has a client_encoding setting, which can differ from the server's encoding... perhaps the Oracle adapter offers something similar?
[08:12:26] emilkarl: has joined #RubyOnRails
[08:12:29] pawnbox_: has joined #RubyOnRails
[08:14:53] comrad: has joined #RubyOnRails
[08:15:32] darutoko: has joined #RubyOnRails
[08:16:18] norc: matthewd: The ruby-oci8 should do automatic translation based on my NLS_LANG settings, but I have a feeling this is a bug.
[08:17:37] rdavila: has joined #RubyOnRails
[08:18:05] Scripore: has joined #RubyOnRails
[08:18:43] yfeldblum: has joined #RubyOnRails
[08:21:38] ubersapiens: has joined #RubyOnRails
[08:23:20] Grundell: has joined #RubyOnRails
[08:23:22] moeabdol: has joined #RubyOnRails
[08:24:43] maloik: has joined #RubyOnRails
[08:25:53] roshanavand: has joined #RubyOnRails
[08:25:59] Cervajz_: has joined #RubyOnRails
[08:27:29] yoongkang: has joined #RubyOnRails
[08:27:53] quarters: I'm trying to deploy a rubyonrails app that uses jruby 1.7.28. For some reason, heroku picks up my app as using 1.7.11
[08:28:36] sevenseacat: does heroku support jruby 1.7.28?
[08:28:54] Cervajz__: has joined #RubyOnRails
[08:29:14] sevenseacat: doesnt appear to
[08:29:25] sevenseacat: https://devcenter.heroku.com/articles/ruby-support#available-runtimes
[08:31:10] marr: has joined #RubyOnRails
[08:32:37] roshanavand: has joined #RubyOnRails
[08:33:30] sarink: has joined #RubyOnRails
[08:34:31] annlewis: has joined #RubyOnRails
[08:36:20] SteenJobs: has joined #RubyOnRails
[08:38:43] dhjondoh: has joined #RubyOnRails
[08:39:09] A124: has joined #RubyOnRails
[08:39:34] sandstrom: has joined #RubyOnRails
[08:40:40] ur5us: has joined #RubyOnRails
[08:42:47] zpe: has joined #RubyOnRails
[08:43:23] yoongkang: has joined #RubyOnRails
[08:44:46] sarink: has joined #RubyOnRails
[08:45:04] hahuang61: has joined #RubyOnRails
[08:45:17] pawnbox: has joined #RubyOnRails
[08:47:05] nso95: has joined #RubyOnRails
[08:47:50] artto: has joined #RubyOnRails
[08:49:11] owenjones: has joined #RubyOnRails
[08:49:22] bersimoes: has joined #RubyOnRails
[08:49:42] akshat: has joined #RubyOnRails
[08:57:25] shock_one: has joined #RubyOnRails
[08:58:29] nettoweb: has joined #RubyOnRails
[08:59:42] ismaelga: has joined #RubyOnRails
[09:01:05] emilkarl: has joined #RubyOnRails
[09:02:00] drale2k: has joined #RubyOnRails
[09:02:25] moeabdol: has joined #RubyOnRails
[09:04:31] jetpackjoe: has joined #RubyOnRails
[09:07:14] bersimoes: has joined #RubyOnRails
[09:07:32] SteenJobs: has joined #RubyOnRails
[09:08:29] jondot: has joined #RubyOnRails
[09:09:24] DoubleMalt: has joined #RubyOnRails
[09:10:24] pawnbox: has joined #RubyOnRails
[09:11:21] nettoweb: has joined #RubyOnRails
[09:12:15] blackmesa: has joined #RubyOnRails
[09:13:16] Emmarof: has joined #RubyOnRails
[09:13:50] Emmarof: I have a question guys
[09:14:25] CornishPasty: Emmarof: don't ask to ask; just ask
[09:14:31] kimegede: has joined #RubyOnRails
[09:14:43] norc: Mhm, ransack generates bad SQL on Oracle when I try to sort by an attribute of an association
[09:14:55] mices: has joined #RubyOnRails
[09:15:21] CodingWolf: has joined #RubyOnRails
[09:16:09] norc: https://gist.github.com/anonymous/9e54d576516198e42a59
[09:16:35] norc: Any way I can make Rails select the associated attributes (i.e. eager loading) in that subquery as a workaround?
[09:17:05] Emmarof: I am a php developer and I want to develop a web app in ruby(just an adventure) can anyone suggest any ruby webapp projects specifically one that has video chatting feature?
[09:17:12] Palsson: has joined #RubyOnRails
[09:17:28] sevenseacat: mices: !rule12
[09:17:28] helpa: mices: Do not PM members of the channel without first asking if that is OK.
[09:17:32] pawnbox: has joined #RubyOnRails
[09:18:03] Gabriel413: has left #RubyOnRails: ()
[09:18:25] jsrn_: has joined #RubyOnRails
[09:18:49] akshat: has joined #RubyOnRails
[09:19:38] Gabriel403: has joined #RubyOnRails
[09:19:40] arBmind: has joined #RubyOnRails
[09:19:42] vigasdeep: has joined #RubyOnRails
[09:23:20] shock_one: has joined #RubyOnRails
[09:23:24] rickmasta: has joined #RubyOnRails
[09:23:33] Emmarof: My question is hanging
[09:24:35] sevenseacat: its not really an answerabe question in its current form - are you looking for services to use? open source code to borrow? what?
[09:25:59] sevenseacat: also, we're not all guys here, so people might not answer you if you leave them out.
[09:26:26] build22: has joined #RubyOnRails
[09:26:28] nettoweb: has joined #RubyOnRails
[09:26:54] Cohedrin: I'm just confused what the question is
[09:27:14] Cohedrin: happy to help anyone come into rails ecosytem, I don't understand what you would like to do
[09:27:43] nya: has joined #RubyOnRails
[09:28:27] arathald: I don't think they do either - that was the question.
[09:28:47] arathald: but no one can really answer that for you. find a problem you want to solve
[09:28:51] arathald: and solve it
[09:29:10] Or1on: has joined #RubyOnRails
[09:29:10] Or1on: has joined #RubyOnRails
[09:29:38] Emmarof: Sorry for that.
[09:29:39] Emmarof: Let me reframe my question
[09:30:43] Emmarof: i have an idea to build an app for recruitment
[09:30:48] goldbug: has joined #RubyOnRails
[09:31:10] Emmarof: I just started out with ruby but I'm a php developer.
[09:31:22] sevenseacat: we won't hold that against you ;)
[09:31:28] cina: has joined #RubyOnRails
[09:32:14] goldbug: Morning all. rvanlieshout and others may remember this problem from a couple of weeks ago, where I am trying to get part of a form to reload based on the language selected. I seem to have it all kind of working, in that I have no errors and the server is definitely GETting something. But nothing is actually changing on the page when I select a language. https://gist.github.com/classicgol
[09:32:14] goldbug: dbug/dd0f0250d2900b9d84a8
[09:32:25] vigasdeep: has joined #RubyOnRails
[09:32:32] goldbug: Currently running at: https://xcds-classicgoldbug.c9.io/people/3/edit
[09:32:52] SteenJobs: has joined #RubyOnRails
[09:33:41] patrick3: has joined #RubyOnRails
[09:34:10] arathald: goldbug: your gist is a 404
[09:34:27] goldbug: Don't think it is?
[09:34:30] Emmarof: I'll like to follow some opensource RoR projects so I can just learn.I want some suggestions on such projects.I want one with video chatting feature.
[09:34:30] Emmarof: I hope you get it?
[09:34:32] goldbug: Works for me.
[09:34:33] pawnbox: has joined #RubyOnRails
[09:34:33] arathald: and was dbug/dd0f0250d2900b9d84a8 the login for the site?
[09:34:40] rvanlieshout: goldbug: i'll be in in 30 min
[09:35:03] arathald: check the url? it's definitely showing up as a 404
[09:35:09] annlewis: has joined #RubyOnRails
[09:35:47] goldbug: Think you might have miscopied it - it works fine if I double-click it from within mIRC!
[09:35:50] Cohedrin: his line broke, he meant: https://gist.github.com/classicgol
[09:35:50] Cohedrin: [01:32:14] <goldbug> dbug/dd0f0250d2900b9d84a8
[09:36:05] goldbug: Ah. https://gist.github.com/classicgoldbug/dd0f0250d2900b9d84a8
[09:36:21] goldbug: It no go breaky in MY window (;
[09:36:53] arathald: and where do I select a language? do I need to log in?
[09:37:03] bob_f: has joined #RubyOnRails
[09:37:12] bersimoes: has joined #RubyOnRails
[09:37:23] sevenseacat: so how have you tried debugging it? "nothing changes" isnt something we can help with
[09:37:52] goldbug: Should be a dropdown at the top of the page, arathald.
[09:37:58] bob_f: Hi. From within an AR instance method, how do I set an ORM attribute ?
[09:38:14] arathald: goldbug: I'm looking at a login screen
[09:38:29] goldbug: arathald: Ah. Hmm.
[09:38:57] goldbug: Gimme a minute q:
[09:39:52] Spami: has joined #RubyOnRails
[09:39:53] sevenseacat: bob_f: self.my_attribute = my_value ?
[09:40:10] TvL2386: has joined #RubyOnRails
[09:41:22] mices: has left #RubyOnRails: ()
[09:41:31] bob_f: sevenseacat: Yeah, that's what I thought. Just doesn't seem to be getting saved. I'm trying to set User.password and User.password_confirmation - maybe Devise does some magic here ?
[09:41:48] sevenseacat: bob_f: you didny say anything about saving it, just setting it
[09:41:50] helpa: bob_f: 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.
[09:42:45] nfk|laptop: has joined #RubyOnRails
[09:43:26] kriskhaira: has joined #RubyOnRails
[09:43:56] bob_f: sevenseacat: I call save afterwards, but it doesn't write to the DB.
[09:44:14] sevenseacat: you dont save passwords in plain text in the db.
[09:44:23] sevenseacat: please show the code you're working with.
[09:44:51] sevenseacat: I'll get grumpy if I have to ask a third time.
[09:44:52] bob_f: def set_password; self.password = 'blah'; self.password_confirmation = self.password; save!; end
[09:44:57] bob_f: Oh no. :(
[09:45:07] baweaver: has joined #RubyOnRails
[09:45:18] sevenseacat: Devise enforces a length requirement on passwords. your `save!` will raise an exception.
[09:45:22] bob_f: I'm just asking if Devise does magic here and I need to call something externally, or if the above should work and Devise will handle the hashing for me.
[09:45:32] bob_f: Devise only does that if you tell it to.
[09:45:44] sevenseacat: (which it does by default)
[09:46:26] sevenseacat: so what does the save! do?
[09:46:26] nya: has joined #RubyOnRails
[09:46:42] bob_f: Returns true, does not write to DB.
[09:46:52] sevenseacat: show the logs of what happens when you call it
[09:47:02] nya: has joined #RubyOnRails
[09:47:21] matthewd: The password isn't already set to 'blah', is it?
[09:47:34] sevenseacat: thats what I was thinking.
[09:47:41] ace05: has joined #RubyOnRails
[09:48:06] bob_f: matthewd: Nope.
[09:49:19] bob_f: Just wanted to check I wasn't missing some Devise cleverness with internal/external method lookup.
[09:49:40] bob_f: Anyway, it seems to be working now, so god knows what I was doing wrong yesterday.
[09:49:48] sevenseacat: you might be. we weren't to that point in the debugging process yet.
[09:50:40] bob_f: Here's the non-pseudo-code by the way: https://bpaste.net/show/5065a79ddd39
[09:50:53] sevenseacat: if the problem is solved, its irrelevant now, isnt it?
[09:51:07] bob_f: Why are Ruby guys always so grumpy. :(
[09:51:18] sevenseacat: because you assume we're all guys, for starters
[09:51:44] bob_f: Everyone's guys.
[09:51:50] bob_f: But not everyone's a guy.
[09:52:03] helpa: We're not all guys here - while you probably didn't mean to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[09:52:20] bob_f: Why are Ruby y'all so grumpy. :(
[09:52:26] sevenseacat: its the *first thing* in the channel topic, people.
[09:52:34] annlewis: has joined #RubyOnRails
[09:52:40] sevenseacat: read the freaking rules. keep everyone happy.
[09:53:27] bob_f: So why else ? :)
[09:53:35] Cohedrin: its just a courtesy thing, some people take offense to it, so why not just avoid the problem altogether
[09:53:56] kimegede: has joined #RubyOnRails
[09:54:01] bob_f: Cohedrin: If we never said anything that some people took offense to we wouldn't really get much said at all, would we.
[09:54:01] shibabu: has joined #RubyOnRails
[09:54:14] Cohedrin: the other thing that makes people "grumpy" is when people show us psudeo code, then ask us to debug it
[09:54:22] sevenseacat: Cohedrin: +10000
[09:54:24] Cohedrin: because 9/10 the pseudo code is right
[09:54:28] Cohedrin: the real code is wrong
[09:54:34] Pumukel: has joined #RubyOnRails
[09:54:35] Cohedrin: thats why you have a bug ;)
[09:54:51] unreal: has joined #RubyOnRails
[09:55:02] bob_f: http://www.oxforddictionaries.com/definition/english/guy (guys) People of either sex:
[09:55:19] bob_f: So I'm kind of a bit annoyed that you think I'm assuming anything at all about your sex based on that.
[09:55:24] sevenseacat: exactly. pseudocode is you trying to simplify your own code, which something is obviously incorrect in your understanding of, otherwise you wouldnt have a bug in the first place!
[09:55:25] jbermudes: Cohedrin: But then you might find out their super secret intellectual property and hack the planet!
[09:55:36] theod: has joined #RubyOnRails
[09:55:46] sevenseacat: bob_f: to be frank, the rule on 'guys' is not up for any debate.
[09:56:09] matthewd: bob_f: Grumpiness varies based on the flow of the conversation. Trick questions, and perceived attitude about suggested explanations, are not a good opener.
[09:56:13] Cohedrin: whoa buddy calm down there jbermudes. It sounds like you're saying my sick rails app that lets people sign up for a mailing list isn't worth protecting from hackers
[09:56:18] bob_f: sevenseacat: I'm not asking for a debate. I'm telling you I think it's a silly rule and misses the entire point, and that you stated that you thought I assumed you were male, which isn't true.
[09:56:31] sevenseacat: bob_f: you're allowed to think it's silly, but you still have to follow it.
[09:56:35] arathald: bob_f: the issue isn't with saying "guys", it's with getting all defensive when someone asks you not to use it like that
[09:56:48] Isthar: has joined #RubyOnRails
[09:56:48] artto: has joined #RubyOnRails
[09:56:52] jbermudes: Cohedrin: brb, filing a patent that starts out with "it's like X.... but with a computer!"
[09:56:54] arathald: bob_f: if you just said "oh, alright, I can do that", no one would bat an eye
[09:56:59] bob_f: arathald: Nope, I was defensive at the suggestion that I assumed anyone was male.
[09:57:03] sevenseacat: if someone asked you not to call them something, and they did it anyway, would you get annoyed?
[09:57:18] Cohedrin: omg jbermudes, every bd I've ever talked to thats trying to pitch me
[09:57:20] arathald: bob_f: the rule very explicitly says that it doesn't assume anything about your intent
[09:57:23] sevenseacat: *if you asked someone
[09:57:49] arathald: "while you probably didn't mean to be exclusive"
[09:57:56] bob_f: 09:51 < sevenseacat> because you assume we're all guys, for starters
[09:58:05] kriskhaira: In my company, we usually test with one specific user e.g. User.find(3125). To make things easier while using the console, I'm thinking of writing an initializer to do `demouser = User.find(3125)`. So we can easily access it from the console without having to initialize demouser everytime. Should I be worried about any security issues related to doing this?
[09:58:06] bob_f: I didn't assume anything. :)
[09:58:14] ChanServ: +q *!*@unaffiliated/bob-f/x-6028553
[09:58:19] sevenseacat: thanks for playing.
[09:58:25] bob_f: has left #RubyOnRails: ()
[09:58:26] Cohedrin: kriskharia, wait, why are you doing that?
[09:58:28] sevenseacat: I said it wasn't up for debate.
[09:58:41] Cohedrin: rip in perperonies bob_f
[09:59:06] BLuEGoD: has joined #RubyOnRails
[09:59:07] jbermudes: Cohedrin: yep, I've had my fair share of "come on, help me code this for free, It'll be the next facebook!" solicitations. It'd be funny if it weren't so sad
[09:59:16] arathald: I see it all the time. I guess I'm particularly used to being cool with whatever terms a person wants being in the lgbt community
[09:59:24] BLuEGoD: AR/Arel related. I have a STI model which has a many to many relationship through a mapping table, such as Stis <-> Things. I want to do Sti.joins(:things) but is complaining about the parent model parent.thing_id does not exist... Any idea how to achieve this?
[09:59:27] Cohedrin: when you say "test" with a user, is this for a demo, or is this for unit testing pruposes>
[09:59:37] arathald: but a ton of getting defensive because their words are sacred or something i dunno?
[09:59:41] rodfersou: has joined #RubyOnRails
[09:59:49] loechel: has joined #RubyOnRails
[10:00:05] ChanServ: -q *!*@unaffiliated/bob-f/x-6028553
[10:00:08] matthewd: BLuEGoD: Join the mapping table first
[10:00:17] sevenseacat: huh, helpa can't do it if they're gone
[10:01:05] nettoweb: has joined #RubyOnRails
[10:01:31] sevenseacat: oh no, it worked.
[10:02:01] BLuEGoD: matthewd: thanks, I've done that but I get the same error. Do I have to explicitely tell the join columns?? (on blah..)
[10:02:02] nya: has joined #RubyOnRails
[10:02:05] matthewd: kriskhaira: You can write code that'll only get run when the console's starting
[10:02:14] matthewd: BLuEGoD: !code
[10:02:14] helpa: BLuEGoD: 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.
[10:04:39] bersimoes: has joined #RubyOnRails
[10:06:11] pramodas23: has joined #RubyOnRails
[10:06:49] ych: has joined #RubyOnRails
[10:07:38] arathald: anyway, falling asleep now. bye
[10:08:22] BLuEGoD: matthewd: https://gist.github.com/bluegod/8b128585dbea67cb9084
[10:08:47] pawnbox: has joined #RubyOnRails
[10:09:17] matthewd: BLuEGoD: Oh, if you're using habtm, you don't want the extra join
[10:10:19] matthewd: BLuEGoD: The error is from your .where(), I think
[10:10:45] BLuEGoD: matthewd: I tried joining only on things or on stis_things, but still, same error
[10:10:49] BLuEGoD: I'm gonna update the gist with the migration for the mapping table...
[10:11:37] BLuEGoD: let me try with ids instead...
[10:12:47] ql6wlld: has joined #RubyOnRails
[10:14:31] dionysus69: has joined #RubyOnRails
[10:15:58] drale2k: has joined #RubyOnRails
[10:16:38] arup_r: has joined #RubyOnRails
[10:17:02] nya: has joined #RubyOnRails
[10:17:54] BLuEGoD: matthewd: same error. I'm doing Sti.joins(:stis_things).where(thing_id: thing_ids)
[10:19:42] Guest55224: has joined #RubyOnRails
[10:20:57] BLuEGoD: ok I think I got it working using 'where in (?)' and naming the join table manually.. doesn't look great but it does the job
[10:21:49] roshanav_: has joined #RubyOnRails
[10:22:19] roshanavand: has joined #RubyOnRails
[10:23:15] Guest55224: hi i am getting
[10:23:20] Guest55224: utc convertion error
[10:23:20] roshanavand: has joined #RubyOnRails
[10:23:24] Guest55224: my code is processedtime.in_time_zone(TZInfo::Timezone.get('UTC'))
[10:23:55] Cervajz_: has joined #RubyOnRails
[10:24:34] StevenXL: has joined #RubyOnRails
[10:25:54] Cohedrin: what is proccessedtime
[10:26:23] roshanavand: has joined #RubyOnRails
[10:27:01] ubersapiens: has joined #RubyOnRails
[10:28:18] Detch: has joined #RubyOnRails
[10:28:25] will_wielder: has joined #RubyOnRails
[10:29:31] TPBallbag: has joined #RubyOnRails
[10:36:52] brt: has joined #RubyOnRails
[10:37:35] bersimoes: has joined #RubyOnRails
[10:39:08] Gustavo: has joined #RubyOnRails
[10:43:40] roshanavand: has joined #RubyOnRails
[10:45:45] tvw: has joined #RubyOnRails
[10:46:10] baweaver: has joined #RubyOnRails
[10:46:26] nya: has joined #RubyOnRails
[10:47:05] nya: has joined #RubyOnRails
[10:48:19] ldnunes: has joined #RubyOnRails
[10:48:52] yardenbar: has joined #RubyOnRails
[10:49:05] ace05: has joined #RubyOnRails
[10:49:10] nso95-: has joined #RubyOnRails
[10:49:10] nso95-: has joined #RubyOnRails
[10:51:14] yuujinlee: has joined #RubyOnRails
[10:51:39] lacuna: has joined #RubyOnRails
[10:51:39] lacuna: has joined #RubyOnRails
[10:51:48] maloik: has joined #RubyOnRails
[10:52:10] masscrx: Im trying to create role in postgres database by PG gem's class, so conn = PG.connect( dbname: main_db, host: host, user: username, password: password ) and then conn.exec("CREATE ROLE #{db_username} with LOGIN PASSWORD '#{db_password_plain}'"), how to get result if role was created properly ?
[10:52:44] DoubleMalt: has joined #RubyOnRails
[10:52:50] bersimoes: has joined #RubyOnRails
[10:53:02] annlewis: has joined #RubyOnRails
[10:53:51] slash_nick: masscrx: i dunno, list the roles?
[10:54:16] Ergo: has joined #RubyOnRails
[10:54:51] cina: has joined #RubyOnRails
[10:55:21] masscrx: slash_nick: its possible but I have another queries which would be nice to get result
[10:55:33] masscrx: if action is performed succesfully
[10:58:29] srinidhi1: has joined #RubyOnRails
[11:01:31] will_wielder: has left #RubyOnRails: ()
[11:02:02] nya: has joined #RubyOnRails
[11:03:00] yardenbar: has joined #RubyOnRails
[11:04:19] artto: has joined #RubyOnRails
[11:05:23] stannard: has joined #RubyOnRails
[11:05:47] Prasun: has joined #RubyOnRails
[11:06:00] futilegames: has joined #RubyOnRails
[11:06:46] Grundell: has joined #RubyOnRails
[11:07:21] platzhirsch: has joined #RubyOnRails
[11:07:42] platzhirsch: Any good method to connect to a different database for a specific Resque worker? Just AR::Base.establish_connection and bang the details in there?
[11:09:37] badoo: has joined #RubyOnRails
[11:13:18] sevenseacat: has joined #RubyOnRails
[11:13:45] Prasun: has joined #RubyOnRails
[11:14:18] eisi: has joined #RubyOnRails
[11:15:12] yoongkang: has joined #RubyOnRails
[11:19:38] yoongkang: has joined #RubyOnRails
[11:20:31] rickmasta: has joined #RubyOnRails
[11:21:55] quazimodo: has joined #RubyOnRails
[11:22:16] ebbflowgo: has joined #RubyOnRails
[11:24:45] maloik_: has joined #RubyOnRails
[11:24:48] yardenbar: has joined #RubyOnRails
[11:25:46] bersimoes: has joined #RubyOnRails
[11:26:58] Tempesta: has joined #RubyOnRails
[11:27:16] curses: has joined #RubyOnRails
[11:27:37] sandstrom: has joined #RubyOnRails
[11:27:55] Grundell: has joined #RubyOnRails
[11:30:34] drale2k: has joined #RubyOnRails
[11:30:39] ql6wlld: has joined #RubyOnRails
[11:30:59] kriskhaira: matthewd: Ok cool. I'll look into your suggestion.
[11:31:28] nya: has joined #RubyOnRails
[11:32:03] nya: has joined #RubyOnRails
[11:33:08] platzhirsch: How can I access which worker is currently being forked in the after_fork hook of Resque?
[11:33:19] srinidhi: has joined #RubyOnRails
[11:34:40] platzhirsch: well, ENV["QUEUE"] works here for me
[11:34:54] cina: has joined #RubyOnRails
[11:38:04] goldbug: Okay dudes, I'm back and this time I have actually deployed my app so others can see it. https://hidden-coast-4212.herokuapp.com/people/1/edit
[11:39:36] sevenseacat: goldbug: when you change language, you get a 500 error
[11:40:32] goldbug: sevenseacat: Yes, depends on the language though. Try Dutch or German or French or something where the language code matches the locale code. (This is a known issue!)
[11:40:42] goldbug: Here's updated gist: https://gist.github.com/classicgoldbug/dd0f0250d2900b9d84a8
[11:41:47] sevenseacat: so... what exactly is supposed to happen?
[11:43:01] sevenseacat: and again, what have you done to debug it?
[11:43:20] goldbug: It should reload the name fields with a different locale. I would expect the locale letters below the dropdown to change from 'en' too.
[11:43:20] Peg-leg: has joined #RubyOnRails
[11:43:25] yoongkang: has joined #RubyOnRails
[11:43:29] jahbrewski: has joined #RubyOnRails
[11:43:45] sevenseacat: do you know which, if any, of your callbacks are being triggered?
[11:43:54] sevenseacat: seems like a good place to start debugging
[11:45:10] AimlessRAven: has joined #RubyOnRails
[11:45:32] Cohedrin: has joined #RubyOnRails
[11:45:38] goldbug: How would I find out?
[11:45:57] sevenseacat: we're teaching javascript now? :/
[11:46:09] sevenseacat: read through https://api.jquery.com/jquery.get/ and how to set callbacks
[11:46:31] sevenseacat: specifically done/fail
[11:46:40] Cohedrin: please no javascript, I have bad memories
[11:47:02] nya: has joined #RubyOnRails
[11:47:04] baweaver: has joined #RubyOnRails
[11:47:27] AimlessRAven: hi guys, i have question about ransnack rails searck .. ok if i have relation i use = f.select :status_id_eq
[11:47:28] dkam: has joined #RubyOnRails
[11:47:32] AimlessRAven: but when status is enumerize
[11:47:35] goldbug: Ah. I have those! (But yeah, I know SFA about javascript. Basically about as much (or less) as is in my code.)
[11:47:48] sevenseacat: not in that code you don't
[11:47:49] kimegede_: has joined #RubyOnRails
[11:48:26] AimlessRAven: what i can use
[11:48:29] goldbug: Lines 16 and 18, no?
[11:48:34] goldbug: Of the coffeescript
[11:49:30] goldbug: That's not a "success callback function"?
[11:50:11] kimegede_: has joined #RubyOnRails
[11:50:17] AimlessRAven: hi guys, i have question about ransnack rails searck .. ok if i have relation i use = f.select :status_id_eq
[11:50:22] AimlessRAven: but when :status is enumerize
[11:50:24] goldbug: What. . . what is it then?
[11:50:31] sevenseacat: AimlessRaven: we heard you the first time.
[11:50:37] sevenseacat: goldbug: some random attribute. i dont know.
[11:50:46] sevenseacat: did you check the docs i gave you?
[11:50:56] AimlessRAven: oks, anyone know how to search when :status is enumerize?
[11:51:29] goldbug: I did. Looks like the same thing to me!
[11:51:45] sevenseacat: err. where does it say you can just tack on arbitrary success: and error: methods?
[11:51:53] atomical: has joined #RubyOnRails
[11:51:56] jsrn_: has joined #RubyOnRails
[11:51:57] sevenseacat: and expect them to be called?
[11:51:59] build22_: has joined #RubyOnRails
[11:52:43] sevenseacat: goldbug: read the second last exampe on the page. thats how you define a success callback.
[11:53:38] tetraktys: has joined #RubyOnRails
[11:54:04] sevenseacat: you can do the same thing with `fail` for an error callback.
[11:54:07] pawnbox: has joined #RubyOnRails
[11:54:32] shibabu: has joined #RubyOnRails
[11:55:10] goldbug: Ah. This looks like a deprecation?
[11:55:32] goldbug: "The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callback methods introduced in jQuery 1.5 are deprecated as of jQuery 1.8. To prepare your code for their eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead."
[11:55:42] sevenseacat: you havent written them either.
[11:55:49] matthewd: Sounds like success-as-property is a thing, but not on the multi-argument form of $.get that you're using
[11:56:03] sevenseacat: goldbug: your code does not match anything on that page.
[11:59:20] maloik: has joined #RubyOnRails
[11:59:35] mrfoto: has joined #RubyOnRails
[12:00:03] owenjones: has joined #RubyOnRails
[12:01:07] annlewis: has joined #RubyOnRails
[12:01:23] goldbug: ACTION throws a glance in the direction of rvanlieshout
[12:01:26] mrfoto: has joined #RubyOnRails
[12:03:05] goldbug: sevenseacat: So you reckon I need to rewrite this?
[12:03:11] goldbug: I can certainly give it a go.
[12:03:28] sevenseacat: well if you want it to work, you have to fix it, yes.
[12:03:33] rvanlieshout: i wasn't reading along
[12:03:57] sevenseacat: its only a couple lines of js
[12:04:48] skullcrasher: how can I execute functions after an ActiveResource has been instantiated?
[12:05:05] goldbug: rvanlieshout: Your jQuery is being impugned q:
[12:05:12] sevenseacat: goldbug: no, yours is.
[12:05:20] skullcrasher: my resource has a type, and I want to automatically popuplate an attribute "src" based on the type
[12:05:27] goldbug: *Knew* you'd say that (;
[12:05:32] sevenseacat: blaming people who try to help you isnt a good way to get people to continue to help you.
[12:06:02] badoo: skullcrasher: you can use the update_attribute method in your controller
[12:06:18] goldbug: rvanlieshout: *My* jQuery is being impugned. But you may have more idea why. . .
[12:07:13] skullcrasher: badoo, is there no other way so that the model itself can have the function?
[12:07:16] sevenseacat: goldbug: was something i said, or the examples i gave, unclear?
[12:07:23] matthewd: goldbug: You really need to be able to take the above information and at least make an attempt at fixing it yourself
[12:08:12] goldbug: Well, I'm always game to have a go.
[12:08:22] badoo: skullcrasher: maybe an after_update method in your object model that checks the type and then updates the src sttribute it shouldnt be complicated
[12:08:28] goldbug: But FYI this will be my first attempt at jQuery, ever.
[12:08:36] sevenseacat: who wrote the rest of it then?
[12:08:37] bersimoes: has joined #RubyOnRails
[12:08:43] badoo: a method that you call with the after_update callback*
[12:09:20] badoo: skullcrasher: you know how to do that ?
[12:09:49] skullcrasher: badoo, that's what I try to find. I think you talk about callbacks?
[12:10:00] goldbug: sevenseacat: Bit of copy/pasting here, bit of help from these fine folk there. That particular section comes from rvanlieshout's extremely useful and comprehensive attempt to get my code working.
[12:10:27] sevenseacat: right. definitely time for you to write some code yourself then.
[12:10:37] goldbug: Indeed. I'll have a go and get back to you.
[12:11:27] badoo: skullcrasher, yea in your model you create the method that updates the src attribute, and then call this method with the after_update callback in your model
[12:11:28] lxsameer: has joined #RubyOnRails
[12:11:28] lxsameer: has joined #RubyOnRails
[12:12:02] badoo: the problem is that it's going to run everytime you update your model but there are ways to check if the type attribute has been changed
[12:12:35] flip_digits: has joined #RubyOnRails
[12:12:35] skullcrasher: badoo, ok, nice. That after_update is what I was looking for.
[12:12:41] skullcrasher: thx, I'll figure out the rest
[12:12:50] badoo: happy to help :)
[12:15:33] skullcrasher: badoo, damn :/ looks like ActiveResource has no callbacks?
[12:16:27] nya: has joined #RubyOnRails
[12:17:10] pawnbox: has joined #RubyOnRails
[12:17:41] badoo: skullcrasher, you just have to add this in your model: after_update :update_src_based_on_type
[12:17:46] badoo: and then create the method
[12:17:58] skullcrasher: already did, but breakpoint is not reached
[12:18:34] skullcrasher: I use ActiveResource, not ActiveRecord
[12:18:39] skullcrasher: seems to make a difference
[12:18:41] CodingWolf: has joined #RubyOnRails
[12:19:26] badoo: what's the difference ?
[12:19:54] MachbooSS: has joined #RubyOnRails
[12:20:43] sadaf2605: has joined #RubyOnRails
[12:20:49] skullcrasher: well, I can't find any callbacks in the documentation
[12:21:00] CodingWolf: has joined #RubyOnRails
[12:21:19] robert45: has joined #RubyOnRails
[12:21:26] badoo: I see that there are ways to add the activerecord callbacks to activeresource
[12:21:27] rvanlieshout: https://github.com/rails/activeresource/blob/04c6c9656ce327065da81d58e52bac24f9f5e68c/test/cases/callbacks_test.rb
[12:21:30] rvanlieshout: there are some
[12:21:40] badoo: http://stackoverflow.com/questions/11106339/can-i-set-active-record-callbacks-for-arbitrary-model-methods/30800222#30800222
[12:22:45] badoo: why do you use activeresource ? I never even heard of it :p
[12:23:14] skullcrasher: well I have to :D
[12:23:19] skullcrasher: the data comes from a REST api
[12:25:15] skullcrasher: rvanlieshout, hmm quite some.
[12:26:13] skullcrasher: but nothing I could use. I think I would need something like 'after_load'
[12:26:50] rvanlieshout: after initialize?
[12:26:51] atomical: has joined #RubyOnRails
[12:26:56] rvanlieshout: or what do you want?
[12:27:45] skullcrasher: something like that, yes
[12:27:47] skullcrasher: but: undefined method `after_initialize'
[12:28:46] rvanlieshout: http://stackoverflow.com/questions/9270003/getting-activemodelcallbacks-to-work-with-activeresource
[12:28:50] rvanlieshout: read his proposed patch
[12:31:27] nya: has joined #RubyOnRails
[12:32:01] nya: has joined #RubyOnRails
[12:32:44] dionysus69: has joined #RubyOnRails
[12:33:13] pippo: has joined #RubyOnRails
[12:34:07] skullcrasher: rvanlieshout, well ok. I think I will implement this. thx
[12:36:05] pawnbox: has joined #RubyOnRails
[12:38:21] shibabu: has joined #RubyOnRails
[12:38:46] RegulationD: has joined #RubyOnRails
[12:39:51] tknz: has joined #RubyOnRails
[12:40:35] tetraktys: has joined #RubyOnRails
[12:41:10] roshanavand: has joined #RubyOnRails
[12:42:08] lxsameer: has joined #RubyOnRails
[12:42:08] lxsameer: has joined #RubyOnRails
[12:42:18] njero: has joined #RubyOnRails
[12:44:29] drale2k: has joined #RubyOnRails
[12:46:09] flip_digits: has joined #RubyOnRails
[12:46:10] ldnunes: has joined #RubyOnRails
[12:47:01] nya: has joined #RubyOnRails
[12:47:16] dhjondoh: has joined #RubyOnRails
[12:50:00] ace05: has joined #RubyOnRails
[12:53:22] pawnbox: has joined #RubyOnRails
[12:56:35] trautwein: has joined #RubyOnRails
[13:00:53] ql6wlld: has joined #RubyOnRails
[13:01:32] jstew: has joined #RubyOnRails
[13:01:43] arup_r: has joined #RubyOnRails
[13:05:15] kp666: has joined #RubyOnRails
[13:09:23] arup_r1: has joined #RubyOnRails
[13:11:04] annlewis: has joined #RubyOnRails
[13:12:03] carlosd: has joined #RubyOnRails
[13:12:24] cina: has joined #RubyOnRails
[13:12:33] bersimoes: has joined #RubyOnRails
[13:13:03] arup_r: has joined #RubyOnRails
[13:14:23] yottanami1: has joined #RubyOnRails
[13:16:28] nya: has joined #RubyOnRails
[13:18:21] dionysus69: has joined #RubyOnRails
[13:20:14] kp666_: has joined #RubyOnRails
[13:21:26] hardtail: has joined #RubyOnRails
[13:23:42] tibra: has joined #RubyOnRails
[13:24:00] User458764: has joined #RubyOnRails
[13:24:00] dviola: has joined #RubyOnRails
[13:24:18] avril14th: has joined #RubyOnRails
[13:25:04] avril14th: Hello, when connecting to a 3rd party service from my rails app, is there any reason why I should use a connection pool?
[13:26:02] tuelz: has joined #RubyOnRails
[13:26:20] wozow: has joined #RubyOnRails
[13:27:44] rvanlieshout: avril14th: a connection pool in your database.yml?
[13:27:51] rvanlieshout: cause that one is not really related to who is using your application
[13:28:11] avril14th: nope to a third party service i connect to through http
[13:28:17] atomical: has joined #RubyOnRails
[13:29:00] rvanlieshout: ah. that's also not related
[13:30:00] rvanlieshout: have you checked your db adapter's documentation about what the db pool means?
[13:30:18] matthewd: rvanlieshout: Huh?
[13:30:51] adre: has joined #RubyOnRails
[13:31:26] nya: has joined #RubyOnRails
[13:31:45] matthewd: rvanlieshout: Not related to what? Who said database? :/
[13:32:03] nya: has joined #RubyOnRails
[13:32:16] rvanlieshout: connection pool
[13:32:26] rvanlieshout: ooh. it could be an outbound connection pool
[13:32:30] rvanlieshout: hey.. it's just to !vague
[13:33:13] matthewd: Yeah, agree on that
[13:34:00] matthewd: avril14th: The answer to your question is "obviously, yes... there are reasons why you might want to use a connection pool"
[13:34:48] matthewd: avril14th: But you're going to need to provide more information if your actual question is "should I use a connection pool for this particular purpose?"
[13:35:26] goodcodeguy: has joined #RubyOnRails
[13:35:51] matthewd: avril14th: I'd certainly suggest it's something you'd consider *after* you have a non-pooled version working, if you haven't done that yet
[13:35:57] avril14th: well, my question was whether is there any reason why I should use a connection pool when connecting to a 3rd party API through HTTP.
[13:36:46] matthewd: Again, yes, there are reasons you might do that
[13:37:10] matthewd: But at sane scale, it's unlikely to be worthwhile
[13:41:17] Axsuul: has joined #RubyOnRails
[13:42:13] moeabdol: has joined #RubyOnRails
[13:42:28] beauby: has joined #RubyOnRails
[13:43:37] worknick: has joined #RubyOnRails
[13:44:07] worknick: has joined #RubyOnRails
[13:47:07] jondot: has joined #RubyOnRails
[13:50:54] ace05: has joined #RubyOnRails
[13:54:28] worknick: how can i troubleshoot if my comments are not being saved to db?
[13:55:00] Grundell: has joined #RubyOnRails
[13:55:20] atomical_: has joined #RubyOnRails
[13:55:23] worknick: it says ROLLBACK after BEGIN.
[13:55:28] worknick: is this normal?
[13:55:49] wozow: has joined #RubyOnRails
[13:55:58] arup_r: has joined #RubyOnRails
[13:56:04] tbuehlmann: worknick, chances are one of your validations kicked in
[13:56:15] dviola: I have a client that wants me to write a script that opens their web site, does login, submit, etc. and they want me to meassure the time it takes to do login and write that on the db, is there something I can use for this? capybara is meant to be used for specifications only (feature specs), right?
[13:56:27] tbuehlmann: you can check `comment.errors` after trying to save the comment
[13:57:24] worknick: oh right. min length 5!
[13:57:35] qejk: has joined #RubyOnRails
[13:57:50] worknick: tbuehlmann: how can I make it write the error on that page itself instead of redirect to new
[13:58:01] Pinn: has joined #RubyOnRails
[13:58:20] worknick: dviola: i think there is something from apache. but i dont remember correctly.
[13:58:50] gremly: has joined #RubyOnRails
[13:58:50] drale2k: has joined #RubyOnRails
[13:58:51] dviola: worknick: ab?
[13:59:17] Gustavo: has joined #RubyOnRails
[13:59:40] worknick: dviola: whats ab?
[13:59:46] dviola: apache benchmarking tool
[14:00:10] tbuehlmann: worknick, instead of redirect_to ...` you'd do `render :new`
[14:00:18] B1n4r10: has joined #RubyOnRails
[14:00:19] tbuehlmann: then somehow display the errors on the page
[14:00:24] dhjondoh: has joined #RubyOnRails
[14:00:24] lacrymology: has joined #RubyOnRails
[14:00:36] worknick: tbuehlmann: ok.
[14:01:27] nya: has joined #RubyOnRails
[14:02:04] nya: has joined #RubyOnRails
[14:02:55] lacrymology: how can I make a 'noop' scope?
[14:03:43] lacrymology: technically it's a 'order(something) if something.present? else noop'
[14:04:00] bersimoes: has joined #RubyOnRails
[14:04:25] FailBit: tl;dr don't make it a scope
[14:04:53] User458764: has joined #RubyOnRails
[14:05:00] erich: has joined #RubyOnRails
[14:05:03] tbuehlmann: lacrymology, you mean, return an empty relation?
[14:05:05] FailBit: also note that where(nil) is noop
[14:07:20] n1lo: has joined #RubyOnRails
[14:08:22] arup_r: What you people use to run test suite to check the health Travis CI or Semaphore ?
[14:08:41] arup_r: Which one I should use ?
[14:09:06] arup_r: Any recommendations ? or both is ok to use. ?
[14:09:17] lacrymology: tbuehlmann: no, I mean not affecting the current result set
[14:09:28] tbuehlmann: lacrymology, oh, then just don't call anything on it?
[14:09:36] lacrymology: tbuehlmann: no
[14:10:06] fschuindt1: has joined #RubyOnRails
[14:10:19] lacrymology: FailBit: why not make it a scope? I mean, I want to do some checks in the scope, and have it not do anything in case things are "bad", basically (where(nil) works for me, but I want to know why I shouldn't do that)
[14:11:05] tbuehlmann: lacrymology, when you're defining a scope and you don't want to change the relation, simply don't do anything (== return nil), it will return the relation as is
[14:11:26] lacrymology: tbuehlmann: I'm doing that, and it's telling me I can't call other scopes on a nil object
[14:11:49] annlewis: has joined #RubyOnRails
[14:11:55] lacrymology: like, MyModel.where(something).this_scope(params).other_things << other_things are failing because this_scope returns nil
[14:12:02] matthewd: lacrymology: You want .all
[14:12:09] tbuehlmann: lacrymology, show the code. I'm thinking you are not defining a scope but a class method
[14:12:12] lacrymology: matthewd: yes, I was thinking of that
[14:12:29] lacrymology: tbuehlmann: that'd be true. But I did that as a matter of syntax. The docs say they're the exact same thing
[14:12:29] moeabdol: has joined #RubyOnRails
[14:12:37] tbuehlmann: yeah, they are not
[14:12:39] matthewd: lacrymology: Or, use an actual scope instead of a class method, as tbuehlmann said -- which will automatically use .all if it returns nil
[14:12:50] lacrymology: I'll do that, thanks
[14:13:51] lacrymology: perfect, thank you
[14:14:49] jstrong: has left #RubyOnRails: ()
[14:16:14] yoongkang: has joined #RubyOnRails
[14:16:52] pawnbox: has joined #RubyOnRails
[14:17:08] nya: has joined #RubyOnRails
[14:17:21] ramortegui: has joined #RubyOnRails
[14:17:27] worknick: has joined #RubyOnRails
[14:17:31] skullcrasher: how can I get an assetUrl in my model?
[14:18:10] Detch: has joined #RubyOnRails
[14:18:13] tbuehlmann: skullcrasher, I have to ask: what has a model to do with assets?
[14:18:30] fschuindt2: has joined #RubyOnRails
[14:18:54] skullcrasher: tbuehlmann, well I want to set a imageUrl as attribute of the model right after initialization
[14:19:03] skullcrasher: it depends on the models type
[14:19:42] skullcrasher: so I thought the model should be able to do this by itself
[14:20:55] tbuehlmann: what's the use case exactly?
[14:21:17] tbuehlmann: I'm really asking because it sounds like something you actually don't want
[14:22:22] skullcrasher: I get data by a REST api. The ActiveResource will be forwarded to some js functions (drawing on map etc)
[14:22:31] pawnbox_: has joined #RubyOnRails
[14:22:56] skullcrasher: and the js needs the image source, for putting it as a marker image on the map
[14:23:48] skullcrasher: and the image depends on the "type" attribute of the ActiveResource
[14:24:53] skullcrasher: I thought building the image url should be easier in rails than in js
[14:25:23] beauby: has joined #RubyOnRails
[14:25:56] masscrx: I would like to use create_database method for postgresql, how to use it ? http://apidock.com/rails/ActiveRecord/ConnectionAdapters/PostgreSQL/SchemaStatements/create_database
[14:26:08] skullcrasher: tbuehlmann, if you have better ideas, no problem :)
[14:26:19] masscrx: Im trying from console irb(main):021:0> db = ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements.
[14:26:25] masscrx: but there is no create_database method
[14:26:45] skullcrasher: tbuehlmann, I just thought the model should be independent from any controller to get its imageUrl
[14:26:59] tbuehlmann: skullcrasher, the image depends on your actual host and the path/filename, right? what if the hosts changes? I personally would have a decorator for that, I guess
[14:27:24] roshanavand: has joined #RubyOnRails
[14:27:28] allcentury: has joined #RubyOnRails
[14:27:56] lacuna: has joined #RubyOnRails
[14:28:48] skullcrasher: tbuehlmann, yes, the image is located in the assets folder. what does a decorator do?
[14:29:12] dhjondoh: has joined #RubyOnRails
[14:29:40] clayreed: has joined #RubyOnRails
[14:30:03] sankaber: has joined #RubyOnRails
[14:30:38] tbuehlmann: skullcrasher, it decorates a model, adding methods to it meant for presentation, for example
[14:31:03] skullcrasher: tbuehlmann, so you talk about some helper functionality, that my model can use to get the image path?
[14:31:16] clayreed: Hello there.
[14:31:20] clayreed: How would one determine if a request is being made by a search engine or a normal user?
[14:31:26] skullcrasher: I found something about AssetUrlHelper, but this seems only to be possible in a controller
[14:31:54] clayreed: I would like to write a before_action for controllers that will do something to "normal users" but not search engines.
[14:32:00] mag42c: has joined #RubyOnRails
[14:32:04] TvL2386: has joined #RubyOnRails
[14:32:19] tbuehlmann: skullcrasher, as said, I'd try to keep away request related stuff from the model
[14:32:28] tbuehlmann: as it's mostly used for presentation
[14:32:36] tbuehlmann: and I don't think that's a model's job
[14:33:06] clayreed: What characterizes a request made by a scraper as opposed to, say, a user with a browser, etc?
[14:33:12] kp666: has joined #RubyOnRails
[14:33:36] clayreed: Is there anything in the header clearly distinguishing a request made by a scraper?
[14:33:49] worknick: iis there any good blog engine which i can integrate with my own app for admin blog purpose?
[14:33:50] badoo: good question
[14:33:53] drbayer: has joined #RubyOnRails
[14:33:54] worknick: or creating my own is better?
[14:34:51] badoo: worknick I think that there are some good gems out there
[14:34:56] skullcrasher: tbuehlmann, so should I loop over all fetched models in the controller, add the src and then output it?
[14:35:19] Scripore: has joined #RubyOnRails
[14:35:28] orolo: has joined #RubyOnRails
[14:35:38] worknick: badoo: yeah. i searched ruby toolbox. there is lot of independent bloggisg gems. i wanted somethiing i can integrate with my own raiils app.
[14:35:40] tbuehlmann: skullcrasher, there are libraries for that, if you don't mind another gem in your gemfile
[14:35:58] tbuehlmann: skullcrasher, https://github.com/drapergem/draper is the one I'm using mostly
[14:36:26] tbuehlmann: only change in your controller: YourModel.find(...) => YourModel.find(...).decorate
[14:36:31] mdel: has joined #RubyOnRails
[14:37:01] skullcrasher: tbuehlmann, these looks a nice approach
[14:37:03] badoo: worknick I know casein is simple and easy to integrate but I never tried it
[14:37:40] tbuehlmann: skullcrasher, you could also just use helper methods, but I prefer the OO approach using decorators/presenters
[14:38:40] badoo: in which cases do you guys use decorators ?
[14:39:49] RegulationD: has joined #RubyOnRails
[14:41:26] tbuehlmann: when presenting model data in views and when doing things after_{save,...} in a controller
[14:41:34] joshkovach: has joined #RubyOnRails
[14:42:17] rclanan: has joined #RubyOnRails
[14:46:26] nya: has joined #RubyOnRails
[14:48:48] Sigfrid: has joined #RubyOnRails
[14:49:15] Grundell: has joined #RubyOnRails
[14:49:49] stannard: has joined #RubyOnRails
[14:51:48] ace05: has joined #RubyOnRails
[14:53:01] agit0: has joined #RubyOnRails
[14:53:05] nya: has joined #RubyOnRails
[14:55:45] trautwein: has joined #RubyOnRails
[14:55:59] ych: has joined #RubyOnRails
[14:56:04] badhatter: has joined #RubyOnRails
[14:56:04] badhatter: has joined #RubyOnRails
[14:56:30] davidw: has joined #RubyOnRails
[14:56:54] podman: has joined #RubyOnRails
[14:58:00] nfk|laptop: has joined #RubyOnRails
[14:59:02] sankaber: has joined #RubyOnRails
[15:00:53] artto: has joined #RubyOnRails
[15:01:34] blackmesa: has joined #RubyOnRails
[15:03:36] flashpoint9: has joined #RubyOnRails
[15:04:39] draken: using rails a backend to ionic is pretty fun
[15:06:31] User458764: has joined #RubyOnRails
[15:07:07] Tempesta: has joined #RubyOnRails
[15:07:13] User458764: has joined #RubyOnRails
[15:07:57] lacrymology: is has_one's scope a scope on the parent model or the child?
[15:08:38] lacrymology: I want to define a has_one that returns a specific object in another relation that is a has_many
[15:09:08] lacrymology: .telemetry = self.telemetry_message_boards.latest_first.first
[15:09:38] adavia_: has joined #RubyOnRails
[15:09:39] badoo: has joined #RubyOnRails
[15:12:36] annlewis: has joined #RubyOnRails
[15:12:43] bratsche: has joined #RubyOnRails
[15:15:46] bersimoes: has joined #RubyOnRails
[15:15:52] Grundell: has joined #RubyOnRails
[15:18:28] Gustavo: has joined #RubyOnRails
[15:18:32] pawnbox: has joined #RubyOnRails
[15:19:39] Spami: has joined #RubyOnRails
[15:19:58] rubyonrailed: has joined #RubyOnRails
[15:20:49] uri: has joined #RubyOnRails
[15:21:00] hello9: has joined #RubyOnRails
[15:21:09] worknick: badoo: thanks. will check it. bye.
[15:21:24] arup_r: lacrymology: parent
[15:21:35] hello9: does putting say 1 js function in an erb template considered "smelly"/ugly code?
[15:21:47] hello9: using a script tag / javascript_include_tag
[15:21:47] akshat: has joined #RubyOnRails
[15:22:00] arup_r: Parent has_one child Child belongs_to parent lacrymology
[15:22:14] worknick: has joined #RubyOnRails
[15:22:18] s2013: has joined #RubyOnRails
[15:22:27] worknick: has left #RubyOnRails: ()
[15:27:10] fryguy: hello9: yes
[15:28:13] drale2k: has joined #RubyOnRails
[15:28:18] mrfoto: has joined #RubyOnRails
[15:28:57] stannard: has joined #RubyOnRails
[15:30:48] lacrymology: has joined #RubyOnRails
[15:30:53] ewnd9: has joined #RubyOnRails
[15:33:15] Signum: has joined #RubyOnRails
[15:33:15] Signum: has joined #RubyOnRails
[15:35:51] tubbo: hello9: yes.
[15:36:04] Frem: has joined #RubyOnRails
[15:36:18] hello9: @tubbo so putting it in a js.erb and using include is considered better?
[15:36:28] hello9: include-js-helper-tag
[15:36:42] tubbo: hello9: kinda depends on what you're doing
[15:36:49] tubbo: hello9: why do you need erb?
[15:37:03] beauby: has joined #RubyOnRails
[15:38:01] tubbo: like i don't see anything wrong with using an .html.erb partial to store like a tracking cookie or two, but if you find yourself doing that a lot it's probably time for Segment.io or Google Tag Manager.
[15:38:44] antgel: has joined #RubyOnRails
[15:39:15] jas02: has left #RubyOnRails: ()
[15:40:22] tuelz: has joined #RubyOnRails
[15:42:54] bennysan: has joined #RubyOnRails
[15:44:15] sankaber: has joined #RubyOnRails
[15:45:55] platzhirsch: has joined #RubyOnRails
[15:46:16] platzhirsch: How can I establish two AR connections in the same AR class? One for reads, and one for writes?
[15:46:19] wpp: has joined #RubyOnRails
[15:46:42] shinnya: has joined #RubyOnRails
[15:46:51] atomical: has joined #RubyOnRails
[15:47:17] s2013: has joined #RubyOnRails
[15:49:08] hello9: @tubbo the function is a click event to send the target's id to the server with ajax
[15:49:20] hello9: i can gist but its basic
[15:49:43] tubbo: hello9: then no, absolutely not.
[15:49:55] baweaver: has joined #RubyOnRails
[15:50:01] unreal: has joined #RubyOnRails
[15:50:02] hello9: @tubbo its not bad practice to have it in a script tag in the erb youre saying?
[15:50:32] tubbo: hello9: it's absolutely bad practice. why are you trying to get me to validate your bad decisions?
[15:50:50] hello9: haha no i didn't know what "then no, absolutely not" meant
[15:50:58] sarink: has joined #RubyOnRails
[15:51:02] hello9: i see it now
[15:51:06] hello9: regarding js.erb
[15:51:16] hello9: so a straight js file and use the include tag in the template?
[15:51:32] tubbo: hello9: !gist what you want to do
[15:51:32] helpa: hello9: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[15:52:25] ace05: has joined #RubyOnRails
[15:52:26] Rubie: has joined #RubyOnRails
[15:52:45] alex88: has joined #RubyOnRails
[15:53:35] bersimoes: has joined #RubyOnRails
[15:55:50] JoshGlzBrk: has joined #RubyOnRails
[15:56:16] User458764: has joined #RubyOnRails
[15:58:49] cornerma1: has joined #RubyOnRails
[16:01:00] hello9: @tubbo https://gist.github.com/anonymous/4a4ae3c950235101e090
[16:01:13] hello9: top file is how it is now
[16:01:18] hello9: after is after moved to separate file
[16:02:44] tubbo: hello9: i see. yeah there's just not a really good reason to do that. you should really be putting *all* your JS in app/assets/javascripts, so it can be compiled and minified in production to a single file called application.js
[16:03:35] hello9: looks like the standard is to put them in public/javascripts
[16:03:46] hello9: even internal/custom functions
[16:03:50] hello9: for this app
[16:04:05] hello9: i will try that
[16:04:59] adavia_: has joined #RubyOnRails
[16:06:14] Gustavo: has joined #RubyOnRails
[16:06:26] futilegames: has joined #RubyOnRails
[16:06:30] tubbo: hello9: the standard is really to put them in app/assets/javascripts, unless you are using a ridiculously old version of rails.
[16:07:19] Yomero2: has joined #RubyOnRails
[16:08:39] s2013: has joined #RubyOnRails
[16:08:57] s2013: morning yall
[16:09:23] hello9: @tubbo i wasnt trying to contradict you, i meant whats going on in the project im working on. and yes, its ancient rails :)
[16:09:28] sankaber: has joined #RubyOnRails
[16:09:46] Jasaka: has joined #RubyOnRails
[16:10:50] s2013: whats ancient hello9 l
[16:12:30] tubbo: hello9: yeah definitely. i feel for you, had to work on rails 2.x a lot last year
[16:13:13] s2013: tubbo when did you start with rails? like what version was it on
[16:13:22] annlewis: has joined #RubyOnRails
[16:13:34] tubbo: 2.3.4 i believe
[16:13:39] tubbo: or maybe earlier
[16:13:53] pipework: tubbo pre-dates rails, back to the great gold rush before we had rails to do the heavy lifting.
[16:14:14] bersimoes: has joined #RubyOnRails
[16:14:22] tubbo: in my day, we hiked 15 miles through the snow just to fulfill an order that was placed on our eCommerce store!
[16:14:26] s2013: tubbo is rails
[16:14:33] s2013: tubbo is dhh in isguise
[16:14:45] pipework: tubbo answers HTTP requests in real time, and even implements TLS!
[16:15:00] s2013: i really wish i got into rails when it came out. but cause i was on widnows i couldnt get it to work and i thought it was a fad
[16:15:22] pipework: s2013: Your life is a fad, live it.
[16:15:27] s2013: my life is sad :(
[16:15:41] pipework: bad fads are sad.
[16:16:05] arup_r: has joined #RubyOnRails
[16:16:26] s2013: is action cable like socket.io of rails? i havent used it yet.. i usually use node/socket.io for things i need real time stuff
[16:16:34] s2013: anyone used it? feedback?
[16:16:50] tubbo: it's basically like the nickelodeon of distributed platforms
[16:17:00] tubbo: it's essentially the comedy central of asynchronous operation
[16:17:19] tubbo: the fox news channel of software architecture
[16:17:34] CornishPasty: Hey now, is it really that bad?
[16:17:45] s2013: fox news is awesome
[16:18:01] CornishPasty: If you see it as the satire it is
[16:18:38] s2013: nah fox is love, fox is life
[16:18:45] pipework: I wonder if Fox News ever buckled down and really competed, if they'd be able to outdo comedycentral in hilarity.
[16:19:24] s2013: meh all the major news network are ridiculous in their own way.. just depnds on your political outlook
[16:19:28] artto: has joined #RubyOnRails
[16:19:34] yoongkang: has joined #RubyOnRails
[16:19:36] tubbo: i don't think actioncable actually works
[16:19:38] s2013: msnbc is just as horrible and biased but since most internet nerds are liberal leaning they dont go after it
[16:20:03] s2013: tubbo gotcha . i just totally forgot about it until recently someone was talking about it
[16:20:20] hello9: @tubbo yes, 2.x is "ancient", anything without includes/where/joins
[16:20:22] tubbo: i dunno, was hoping someone would chime in and go "HEY! we use it on our project!"
[16:20:55] s2013: anyone went to ruby conf this year?
[16:20:56] Scripore: has joined #RubyOnRails
[16:21:21] iateadonut: has joined #RubyOnRails
[16:21:36] smathy: has joined #RubyOnRails
[16:21:43] creature: I went to Bath Ruby.
[16:22:09] pipework: Bathing with ruby, an exploration of the clean, the not so clean, and the downright dirty parts of ruby.
[16:23:02] s2013: it was like an hour from me and i forgot about it. might go to railsconf next year
[16:23:07] someish: has joined #RubyOnRails
[16:24:07] pyemkey: has joined #RubyOnRails
[16:24:42] defsdoor: has joined #RubyOnRails
[16:25:09] tubbo: heard good things about railsconf
[16:25:24] elaptics: creature: me too - it was good :)
[16:25:53] ellisTAA: has joined #RubyOnRails
[16:27:33] nickenchuggets: has joined #RubyOnRails
[16:28:34] s2013_: has joined #RubyOnRails
[16:29:19] maloik: has joined #RubyOnRails
[16:29:51] s2013_: yeah railsconf is good tubbo you should check it out
[16:29:56] s2013_: i went couple of years ago
[16:30:16] creature: elaptics: It definitely was! I really enjoyed it.
[16:31:32] barhum2013: has joined #RubyOnRails
[16:31:40] tom_ilsinszki_: has joined #RubyOnRails
[16:34:25] disgrntld: has joined #RubyOnRails
[16:34:34] disgrntld: has left #RubyOnRails: ()
[16:35:17] Axsuul: has joined #RubyOnRails
[16:35:20] medright: has joined #RubyOnRails
[16:35:21] fedexo: has joined #RubyOnRails
[16:35:24] disgrntld: has joined #RubyOnRails
[16:38:12] thejamespinto: has joined #RubyOnRails
[16:38:23] ivalentine: has joined #RubyOnRails
[16:38:43] raj___: has joined #RubyOnRails
[16:39:13] bersimoes: has joined #RubyOnRails
[16:41:53] s2013: has joined #RubyOnRails
[16:42:23] drbayer: has joined #RubyOnRails
[16:45:47] jbrhbr: has joined #RubyOnRails
[16:45:52] Prasun: has joined #RubyOnRails
[16:46:21] arup_r1: has joined #RubyOnRails
[16:49:10] JoshGlzBrk: has joined #RubyOnRails
[16:50:27] goodcodeguy: has joined #RubyOnRails
[16:50:43] baweaver: has joined #RubyOnRails
[16:51:22] kies: has joined #RubyOnRails
[16:52:09] ellisTAA: has joined #RubyOnRails
[16:54:30] will_wielder: has joined #RubyOnRails
[16:58:06] mary5030: has joined #RubyOnRails
[16:58:07] skyjumper: has joined #RubyOnRails
[16:59:02] mary5030: has joined #RubyOnRails
[16:59:11] jahbrewski: has joined #RubyOnRails
[17:00:07] Detch: has joined #RubyOnRails
[17:00:39] wsewolod: has joined #RubyOnRails
[17:00:57] towski_: has joined #RubyOnRails
[17:01:26] raj___: has joined #RubyOnRails
[17:01:26] JoshGlzBrk: has joined #RubyOnRails
[17:02:00] raj___: My rails app when deployed compiles all the files inside vendor/assets which I don't want. Where do I find the relevant configuration?
[17:04:48] tubbo: raj___: you don't. that's what vendor/assets is for.
[17:05:09] tubbo: raj___: you can put stuff you don't want compiled, but you do want available to the frontend, in public/
[17:05:12] raj___: yes, it isnt supposed to compile which it does now
[17:05:23] Detch: has joined #RubyOnRails
[17:06:24] baweaver: has joined #RubyOnRails
[17:07:36] ql6wlld: has joined #RubyOnRails
[17:10:07] allcentury: has joined #RubyOnRails
[17:10:37] tibra: has joined #RubyOnRails
[17:12:16] barhum2013: has joined #RubyOnRails
[17:13:28] avril14th: has joined #RubyOnRails
[17:14:09] annlewis: has joined #RubyOnRails
[17:14:30] avril14th: does anyone has a proper link explaining how to use accepts_nested_attribute with polymorphic has_one. google is full of outdated answers from rails 3 time
[17:15:26] safety_cut: has joined #RubyOnRails
[17:16:08] bersimoes: has joined #RubyOnRails
[17:16:09] arBmind1: has joined #RubyOnRails
[17:17:41] drale2k: has joined #RubyOnRails
[17:20:28] yoongkang: has joined #RubyOnRails
[17:23:41] Detch: has joined #RubyOnRails
[17:24:40] badoo: has joined #RubyOnRails
[17:28:29] dionysus69: has joined #RubyOnRails
[17:28:57] masscrx: I need some help with associations and database schema, I have customer model with has_one account, account has_many services, and service is connected to offer so 1.I select service ex."Sale" 2.select offer ex."Winter offer" with some limits {limit_shops: 1, limit_sales: 100} (hstore type)
[17:29:22] masscrx: how to design db schema and assocs for that
[17:30:04] maloik: has joined #RubyOnRails
[17:30:32] masscrx: for fetching for example Customer.first.services.where(name: "Winter offer").first.offer.limits
[17:31:09] Guest52138: has joined #RubyOnRails
[17:31:20] jhass: service has_one offer or what?
[17:31:28] jhass: not sure what you're asking tbh
[17:31:29] corioliss: has joined #RubyOnRails
[17:31:36] masscrx: service has one offer
[17:31:58] claytonzaugg: has joined #RubyOnRails
[17:32:42] masscrx: assume that I have services: [sales, crm], and assign 'sale' service to customer, and then create some offer
[17:33:15] masscrx: after some time customer buy 'crm' service and then I can create some custom offer for that service for that customer ;]
[17:34:22] jhass: so an offer is also tied to a single customer or account?
[17:34:43] masscrx: offer to service
[17:34:51] masscrx: Account -> Service -> Offer
[17:35:14] lacuna: has joined #RubyOnRails
[17:35:14] lacuna: has joined #RubyOnRails
[17:35:20] jhass: I don't get your question, it seems like you already made up your mind on what you want to design your schema like
[17:35:23] masscrx: Customer -> Account -> Service -> Offer
[17:36:29] masscrx: the problem is between Service <-> Offer, because to create Offer I need service, and for service I need offer
[17:36:53] masscrx: Im not sure if it is possible but I need to create table like account_services_offer ?
[17:37:22] jhass: no, make a simple service has_one offer
[17:38:11] masscrx: and offer ... ? belongs_to service or has_many services? I need some join table for that
[17:38:14] jhass: when creating records, either have accept_nested_attributes_for_offer in service or simply make sure to use .new instead of .create, setup the association and then .save! both records
[17:38:57] jhass: I thought a service can only have one offer?
[17:39:27] jhass: so why are you thinking about offer has_many services?
[17:39:48] masscrx: because I would like to assign "Winter offer" for many customer
[17:39:59] masscrx: for different customers services
[17:40:46] jhass: so an offer is the opportunity of an customer (or account?) to buy one (or more?) services?
[17:40:58] s2013: has joined #RubyOnRails
[17:41:42] jhass: that were three questions actually, answer all of them
[17:43:08] theod: has joined #RubyOnRails
[17:43:29] flip_digits: has joined #RubyOnRails
[17:44:00] masscrx: Scenario: Customer-1 buy service "Sales" with offer "Winter offer", Customer-2 buy service "Sales" with offer "Summer offer", and Customer-1 can buy additional service "Crm" with offer "Crm - 30 day trial", for Customer-2 the same
[17:44:31] jhass: that answers neither of the two open questions
[17:45:26] Detch: has joined #RubyOnRails
[17:45:44] ellisTAA: has joined #RubyOnRails
[17:46:11] masscrx: - offer is the opportunity of an account to buy one service
[17:46:49] jhass: okay, one last clarification: offers are always all visible to all accounts?
[17:47:27] nickenchuggets: has joined #RubyOnRails
[17:47:32] lacuna: has joined #RubyOnRails
[17:47:39] jhass: that's a simple service has_many offers
[17:47:49] jhass: offer belongs_to service
[17:48:02] Fire-Dragon-DoL: mhhh activesupport requiring minitest
[17:48:06] jhass: and to list the offers simply Offer.all
[17:48:10] Fire-Dragon-DoL: I don't like it :\
[17:48:36] jhass: I wouldn't even make it mandatory for an offer to exist when creating a service
[17:48:41] bersimoes: has joined #RubyOnRails
[17:49:06] dionysus69: has joined #RubyOnRails
[17:49:19] masscrx: hmm Ill try that way
[17:51:33] safety_cut: has joined #RubyOnRails
[17:51:39] lemur: has joined #RubyOnRails
[17:52:16] Maletor: has joined #RubyOnRails
[17:52:44] pvertenten: has joined #RubyOnRails
[17:53:59] ace05: has joined #RubyOnRails
[17:56:22] Nvp: has joined #RubyOnRails
[17:57:01] thejamespinto: has joined #RubyOnRails
[17:57:17] NullVoxPopuli: has joined #RubyOnRails
[17:57:38] dionysus69: has joined #RubyOnRails
[17:58:01] NullVoxPopuli: Anybody know of a way to promote gems? I'm trying to get people to test this gem I made: https://github.com/NullVoxPopuli/skinny_controllers
[17:58:37] jhass: rubyflow.com
[17:58:48] NullVoxPopuli: jhass: thanks, I'll check it out
[17:58:56] jhass: /r/ruby works too I guess
[17:59:09] jhass: there's probably some /r/rails or so, idk, I don't reddit
[17:59:17] jbrhbr: has joined #RubyOnRails
[18:00:08] NullVoxPopuli: jhass: I submitted my gem to both /r/ruby and /r/rails, but it didn't seem to generate much discussion / any :-\
[18:00:33] Grundell_: has joined #RubyOnRails
[18:05:01] ascarter: has joined #RubyOnRails
[18:05:01] badoo: has joined #RubyOnRails
[18:05:21] colleenmcguckin: has joined #RubyOnRails
[18:05:54] medright: has joined #RubyOnRails
[18:06:11] dionysus69: has joined #RubyOnRails
[18:07:24] blackmesa: has joined #RubyOnRails
[18:09:09] nso95-: has joined #RubyOnRails
[18:09:09] nso95-: has joined #RubyOnRails
[18:10:59] alphaatom: has joined #RubyOnRails
[18:14:07] nya: has joined #RubyOnRails
[18:14:54] annlewis: has joined #RubyOnRails
[18:15:04] B1n4r10: has joined #RubyOnRails
[18:17:03] lacuna: has joined #RubyOnRails
[18:17:48] tubbo: NullVoxPopuli: use it in your own apps.
[18:17:49] tubbo: to test it
[18:17:54] pipework: NullVoxPopuli: What gem?
[18:18:10] colleenmcguckin: has joined #RubyOnRails
[18:18:38] NullVoxPopuli: tubbo, I am :-)
[18:18:51] NullVoxPopuli: pipework: thisone: https://github.com/NullVoxPopuli/skinny_controllers
[18:19:08] cs44: has joined #RubyOnRails
[18:19:14] blackmesa: has joined #RubyOnRails
[18:19:32] tubbo: looks good...like a cross between https://github.com/tubbo/controller_resources and https://github.com/apotonick/trailblazer, the latter of which i was disappointed to discover had no extraction of Trailblazer::Operation so i could use it without needing to bank on the rest of the gem.
[18:19:46] towski_: has joined #RubyOnRails
[18:20:04] dionysus69: has joined #RubyOnRails
[18:20:25] tubbo: it was also surprising considering nearly every other component of the trailblazer architecture is modular and can be used on its own..
[18:20:46] zpe: has joined #RubyOnRails
[18:21:05] NullVoxPopuli: tubbo, interesting. I didn't know trailblazer had that limitation.
[18:21:21] Bit_Bendr1: has joined #RubyOnRails
[18:21:25] tubbo: yup...here's where the operation code lives: https://github.com/apotonick/trailblazer/tree/master/lib/trailblazer
[18:21:32] cs44: has left #RubyOnRails: ()
[18:21:36] NullVoxPopuli: I *think* I've designed skinny_controllers to have everything be optional
[18:22:30] NullVoxPopuli: Personally, I didn't like how they wanted validations outside of the model
[18:23:34] pawnbox: has joined #RubyOnRails
[18:23:45] pipework: NullVoxPopuli: inb4fatshaminggithubissue
[18:24:28] NullVoxPopuli: pipework: you mean, people thought their models were getting too fat, and wanted validations elsewhere? hmm
[18:24:45] tubbo: i kinda think validations belong on the model, just not business logic. it's a bit hard for most people to grasp the difference, but let's say you have a system where your read database and write database are two totally different programs.
[18:25:06] tubbo: in that case, you want an object that can validate form data, but isn't coupled to any one "hard" dependency
[18:25:25] shinnya: has joined #RubyOnRails
[18:26:33] tubbo: i'd like to see a version of trailblazer's operations framework that didn't require me to use representable and reform
[18:26:42] tubbo: for example, i'd rather use draper.
[18:26:52] tubbo: draper and/or AMS
[18:27:30] NullVoxPopuli: I use AMS with my project
[18:27:38] tubbo: NullVoxPopuli: just so you know, you *don't* need to overhaul your rails app's structure to use trailblazer, it might be a little confusing from the way the book tells you, but afaik you can just use what you want from trailblazer and not worry about the parts you don't use.
[18:28:05] bersimoes: has joined #RubyOnRails
[18:28:55] lacuna: has joined #RubyOnRails
[18:28:55] lacuna: has joined #RubyOnRails
[18:29:12] colleenmcguckin: has joined #RubyOnRails
[18:29:26] corioliss: has joined #RubyOnRails
[18:29:56] ych: has joined #RubyOnRails
[18:30:55] NullVoxPopuli: I'm kinda curious where my own development of skinny_controllers takes me... because I have a couple controllers that the actions only have `render json: model` ... so.. at that point I could just get rid of the controller all together -- kinda like how in ember, *a lot* of things have implicit defaults
[18:31:19] smathy: tubbo, although reform is a gem dependency for trailblazer, you don't have to use it. Your operation only has to implement a `process` method, you can do whatever you want in there.
[18:31:35] tubbo: that's a good point
[18:32:01] smathy: ...although I don't really know what trb offers without that integration, I mean it's mostly a DSL for dealing with reform objects/contracts in a nice way.
[18:32:06] tubbo: smathy: i was more concerned with using representable. is there a way i can supply a different kind of object to use in the presenter's place?
[18:32:16] Bit_Bendr1: any sublimetext users here who can help me force all .html.erb files to open with the proper syntax?
[18:32:31] NullVoxPopuli: my goal with skinny_controllers is to optimize api development
[18:32:44] Bit_Bendr1: sublime apparently hates multiple extentions
[18:33:01] NullVoxPopuli: Bit Bendrl, there are *.erb packages for sublime text
[18:33:04] maloik: has joined #RubyOnRails
[18:33:06] NullVoxPopuli: that do proper syntax coloring
[18:33:13] PlasmaStar: has joined #RubyOnRails
[18:33:18] Olipro_: has joined #RubyOnRails
[18:33:24] NullVoxPopuli: Though, I prefer Atom now
[18:33:29] leeky: has joined #RubyOnRails
[18:33:34] srinidhi: has joined #RubyOnRails
[18:33:35] srinidhi: has joined #RubyOnRails
[18:33:46] smathy: tubbo, I think that anything will work as long as it implements the API expected by Reform: https://github.com/apotonick/reform#the-api
[18:34:18] Bit_Bendr1: NullVoxPopuli: I have them, but I have a snippets package that only works if that syntax view is selected but sublime only sees the ???html??? in .html.erb for some reason
[18:34:34] Bit_Bendr1: I tried to get into Atom but found it too hard to configure
[18:35:02] based_pdev_: has joined #RubyOnRails
[18:35:07] Bit_Bendr1: granted, part of that was deciding which add-ons to choose
[18:35:30] smathy: tubbo, although you're fundamental point is right that this is not part of the public API of Reform, so you're in mirky waters.
[18:35:57] tubbo: smathy: that's good to know, but i was more concerned with changing out the representers provided by roar with something like draper or AMS.
[18:36:15] tubbo: ...i just think trailblazer did a lot of "reinventing the wheel" and i'd rather it be more omakase :P
[18:36:32] NullVoxPopuli: what's omakase?
[18:36:59] tubbo: NullVoxPopuli: https://en.wikipedia.org/wiki/Omakase, http://david.heinemeierhansson.com/2012/rails-is-omakase.html
[18:37:27] Bit_Bendr1: Anyway, I have this great pack of snippets https://github.com/matthewrobertson/ERB-Sublime-Snippets but every single time I open a .html.erb file I have to choose Rails -> HTML (Rails) from the syntax list in order for them to work.
[18:37:28] smathy: tubbo, yeah, I'm sure that's easy too although I don't know as much about that side of trb - and also, AMS, blergh!
[18:37:31] tubbo: in other words, trailblazer has a good idea...operations, but it's diluted by reinventing presenters, form objects, et. al....
[18:37:45] NullVoxPopuli: tubbo, thanks for the links
[18:38:01] tubbo: smathy: here are the fucks i give about your opinion of my software:
[18:38:05] tubbo: oh sorry nil can't be converted to String
[18:38:05] smathy: tubbo, you know what he's like, he'll have reinvented absolutely everything by the time trb is done.
[18:38:20] NullVoxPopuli: tubbo, skinny_controllers leaves the presenting up to you :-)
[18:38:31] tubbo: smathy: i thought trailblazer was done
[18:39:12] roshanavand: has joined #RubyOnRails
[18:39:41] ellisTAA: has joined #RubyOnRails
[18:39:57] smathy: tubbo, it's sufficient right now, but a long way from done.
[18:40:16] pwnd_nsfw: smathy, I looked up on it and it seems really interesting
[18:40:38] pwnd_nsfw: The only problem I'd have with it is that not enough people have adopted it
[18:40:41] tubbo: "architecture" not done
[18:40:52] pwnd_nsfw: So, knowing it would be on a hobby basis
[18:41:18] srinidhi: has joined #RubyOnRails
[18:41:36] smathy: pwnd_nsfw, yeah, you've nailed it's main problem. Docs are scant, and generally it's not mature - there are quite a few corner case issues which are still outstanding.
[18:42:03] pwnd_nsfw: Radar, I looked through your gists a little bit ago to see if I could find the criteria for a program that'd basically explain that you know rails enough. That t-shrit app. Do you still have that somewhere? I wasn't able to find it when I was looking.
[18:42:58] pwnd_nsfw: smathy, do you have an example app using tb?
[18:43:51] SteenJobs: has joined #RubyOnRails
[18:43:58] pawnbox: has joined #RubyOnRails
[18:44:00] badoo: has joined #RubyOnRails
[18:44:16] rhizome: sadly, both tshrit.com and tshrits.com are already registered
[18:44:25] tom_ilsinszki_: Is it possible to use environment variables in config/mongoid.yml? I get a "NoMethodError (undefined method `to_sym' for nil:NilClass):" error message when I switch the line "database: my_development" to "database: <%= ENV['MONGOID_DB_NAME'] %>" in my config/mongoid.yml file.
[18:44:45] rhizome: even with the hyphen
[18:44:49] smathy: pwnd_nsfw, Nick has his own example app that he's using in the book: https://github.com/apotonick/gemgem-trbrb/tree/chapter-11 (note that you need to stick to the latest branch(es))
[18:45:34] rhizome: tom_ilsinszki_: i think that's saying the var doesn't exist
[18:47:18] smathy: tom_ilsinszki_, if the ERB wasn't being processed then the raw ERB string would be the resulting value.
[18:47:45] pawnbox: has joined #RubyOnRails
[18:48:00] smathy: tom_ilsinszki_, ...suggests that you haven't set that env var like you think you have (so the ERB is evaluating to nil or "" or whatever it is in YAML)
[18:48:01] nickenchuggets: has joined #RubyOnRails
[18:48:07] rhizome: in rails, does YAML take ERB 100% of the time?
[18:49:04] ajustrun: has joined #RubyOnRails
[18:49:22] NullVoxPopuli: smathy, if you find cases with skinny_controllers could use improvement, I could add whatever it is fairly quickly :-)
[18:49:47] s2013: has joined #RubyOnRails
[18:50:52] tom_ilsinszki_: smathy: rhizome: thank you both, you are probably right. i will investigate further. would it be possible to check somehow what the variable value is within the yml file?
[18:51:07] dionysus69: has joined #RubyOnRails
[18:51:30] adavia_: is there anyway to display association validation errors to match the field name. Ex i have a category_ids field but im gettings the error as "categories"
[18:52:19] maloik: has joined #RubyOnRails
[18:52:20] lemur: has joined #RubyOnRails
[18:52:29] rhizome: adavia_: google "rails custom validation errors association" or similar
[18:53:19] smathy: NullVoxPopuli, I think you got me confused with someone else, I'm not using your gem.
[18:53:50] annlewis: has joined #RubyOnRails
[18:53:50] adavia_: yeah i check this patch https://iada.nl/blog/article/rails-tip-display-association-validation-errors-fields but is not working for me
[18:53:52] smathy: tom_ilsinszki_, you can run any code in <% %> - just write/log the value if you wanted.
[18:53:54] NullVoxPopuli: smathy, what gem were you talking about where docs are incomplete?
[18:54:02] smathy: NullVoxPopuli, trailblazer.
[18:54:25] tom_ilsinszki_: smathy: thanks a lot! i will do that
[18:54:29] NullVoxPopuli: I may be secretly trying to get people away from trailblazer to use my gem (shhhhh) :-)
[18:54:37] ace05: has joined #RubyOnRails
[18:55:34] colleenmcguckin: has joined #RubyOnRails
[18:55:47] smathy: NullVoxPopuli, I'm reporting you to The One Gem To Rule Them All Department.
[18:55:57] NullVoxPopuli: what's that mean?
[18:56:06] rhizome: Hail The Conquering Gem
[18:56:23] lacuna: has joined #RubyOnRails
[18:56:23] lacuna: has joined #RubyOnRails
[18:56:52] rhizome: adavia_: that article is like 4x too long for this problem, in what way is it "not working?"
[18:56:52] pvertenten: has joined #RubyOnRails
[18:57:04] smathy: NullVoxPopuli, I'm poking fun at the idea that you were (or that I thought you were), ie. that gems are in competition with each other.
[18:57:35] Scriptonaut: Hey guys, I put a csv file in my /public/csv directory. I have a link on one of my pages with href: "/csv/my_file.csv", and when you click it, it downloads just fine. However, when I push it to my staging server (heroku), clicking it brings me to a blank white page and the server log says it responded with a status of 406. Is it not finding the file? Is public not the proper place to put this for production/staging?
[18:57:44] NullVoxPopuli: they probably could be used together, cause all my operation / policy stuff is namespaced to SkinnyControllers
[18:58:18] smathy: Scriptonaut, no, it should work.
[18:58:32] rhizome: look up what a 406 error is
[18:58:44] Scriptonaut: It's improper headers
[18:58:46] Scriptonaut: or something like that
[18:58:49] Scriptonaut: not sure what that means
[18:58:53] adavia_: rhizome: i override the error_message method in ActiveModelInstanceTag but i still get category_ids from my form field
[18:59:06] stannard_: has joined #RubyOnRails
[18:59:15] rhizome: adavia_: that isn't any technique i've ever heard of (i didn't read the article)
[18:59:17] Pazician: has joined #RubyOnRails
[18:59:41] adavia_: any technique you might be aware of?
[18:59:48] Pazician: has joined #RubyOnRails
[18:59:57] roshanavand: has joined #RubyOnRails
[19:00:09] smathy: Scriptonaut, http://www.checkupdown.com/status/E406.html
[19:00:56] Scriptonaut: Ya, that's what I read
[19:01:25] Scriptonaut: I'm not sure how what I'm doing would cause that
[19:01:40] rhizome: adavia_: using i18n or something like @instance.errors.add(:base, "foo")
[19:02:09] pwnd_nsfw: Thanks for the link smathy
[19:02:20] smathy: Np pwnd_nsfw
[19:04:22] theod: has joined #RubyOnRails
[19:04:46] Scriptonaut: it must mean the file doesn't exist
[19:04:57] Scriptonaut: when I go to: my_domain.com/asdf.csv
[19:05:01] Scriptonaut: it returns a 406 also
[19:05:04] ajustrun: has left #RubyOnRails: ()
[19:05:11] cac: has joined #RubyOnRails
[19:05:19] Scriptonaut: too bad I can't look at my file system on heroku
[19:05:29] drbayer: has joined #RubyOnRails
[19:05:59] rhizome: does heroku do any automagic on /public?
[19:06:19] Scriptonaut: not that I'm aware of. I do know that it was in our .gitignore
[19:06:23] Scriptonaut: so I had to git add -f
[19:06:27] medright: has joined #RubyOnRails
[19:07:07] Scriptonaut: maybe my config in staging doesn't serve static assets
[19:07:12] drale2k: has joined #RubyOnRails
[19:07:53] baweaver: has joined #RubyOnRails
[19:08:19] Scriptonaut: the only reference to serving static assets I find in the codebase is this in my Gemfile.lock: rails_serve_static_assets
[19:09:32] cac: has joined #RubyOnRails
[19:10:01] B1n4r10: has joined #RubyOnRails
[19:10:16] masscrx: is it ok to have join table for 3 models ? How to handle them ?
[19:10:20] rhizome: "heroku run bash; ls public"
[19:10:23] colleenmcguckin: has joined #RubyOnRails
[19:10:47] rhizome: masscrx: define "handle"
[19:11:05] masscrx: I mean writing/quering
[19:11:20] Scriptonaut: oh wow rhizome
[19:11:23] Scriptonaut: hrm, the file is in there
[19:11:34] based_pdev: has joined #RubyOnRails
[19:11:47] rhizome: checking logs would probably be a good idea
[19:11:59] rhizome: masscrx: rails will let you, yes.
[19:12:20] masscrx: I was talking before with another guy but Im not sure how to make model and table for that join table
[19:12:50] masscrx: Account belongs_to :customer, has_many :account_services_offer, has_many :services, through: account_services_offer
[19:13:06] masscrx: Service has_one :offer
[19:13:13] rhizome: so you're going to want at least account_id and service_id
[19:13:18] masscrx: and now create table account_services_offer ?
[19:13:31] masscrx: AccountServicesOffer [belongs_to :account, :service, :offer]
[19:13:41] masscrx: is it ok ?
[19:13:51] rhizome: gist what you're thinking
[19:14:01] teaearlgraycold: So I'm trying to query a model by a boolean attribute. I know for a fact that certain records have this boolean set to true, but when I do State.where(action_required: true) I still get no results
[19:14:19] teaearlgraycold: I can do State.find(10).action_required and see it's true
[19:14:31] masscrx: rhizome: https://gist.github.com/masscrx/df69499ef39ca5c76335
[19:14:31] teaearlgraycold: But there's something fucky when actually querying
[19:14:41] rhizome: teaearlgraycold: are you using default_scope?
[19:15:16] smathy: teaearlgraycold, what's the SQL that's generated?
[19:15:30] teaearlgraycold: SELECT "states".* FROM "states" WHERE "states"."action_required" = ? [["action_required", "t"]]
[19:15:32] shibabu: has joined #RubyOnRails
[19:16:07] masscrx: rhizome: but not sure how to design join table and assocs for that 3 models account,service,offer
[19:16:20] smathy: teaearlgraycold, ok, and do State.find(10).attributes_before_type_cast
[19:16:37] rhizome: masscrx: gonna need HMT from Service to Account, and does a Service really have only one Offer?
[19:16:48] masscrx: rhizome: yes
[19:16:58] teaearlgraycold: smathy: {"id"=>10, ... "action_required"=>"true"}
[19:17:16] smathy: teaearlgraycold, ok, so how did it get set to "true" when it should have been "t"
[19:17:31] masscrx: rhizome: Offer will have limits like limit_shops, limit_sales stored as hstore
[19:17:36] rhizome: masscrx: so it's not a 3way then, it's just an HMT from Account to Service with Offer hanging off of Service
[19:17:58] teaearlgraycold: Oh, I'm using some gem to import models. I guess that's the issue.
[19:18:02] teaearlgraycold: Thanks, I'll fix that
[19:18:10] smathy: teaearlgraycold, y/w
[19:18:16] rhizome: what's the gem so we know to avoid it
[19:18:47] masscrx: HMT = Has Many Throught, right ?
[19:18:53] smathy: rhizome, might not be the gem's fault, maybe the data.
[19:19:11] teaearlgraycold: Well it's my bad for telling it to import from a CSV where the column was set to "true" for the boolean. I'll just set it to "t"
[19:19:20] rhizome: teaearlgraycold: is that sqlite3?
[19:19:33] teaearlgraycold: The gem is "activerecord-import"
[19:19:50] rhizome: use 1/0 for true/false
[19:19:53] masscrx: rhizome: so how should look like offer table ?
[19:20:03] rhizome: i'm 60% sure the adapter doesn't cover that
[19:20:11] rhizome: maybe i'm thinking :default in table_create
[19:20:41] rhizome: masscrx: fine the way it is. gonna need offer_id in Service
[19:20:49] roshanavand: has joined #RubyOnRails
[19:20:52] teaearlgraycold: rhizome: well I'd already done "t" and that worked
[19:21:10] rhizome: now try the false case :)
[19:21:31] yoongkang: has joined #RubyOnRails
[19:21:36] rhizome: regardless, sqlite3 doesn't really have datatypes
[19:21:52] teaearlgraycold: Well that's shitty
[19:22:18] rhizome: so you have to query based on what's actually there. see also: 'f' will be true :)
[19:22:36] masscrx: rhizome: so in which table will be stored data with relation account -> service -> offer ?
[19:22:47] teaearlgraycold: I'm querying with the ruby true/false objects
[19:22:57] rhizome: masscrx: you don't need to track offer because service is already connected to it
[19:23:27] rhizome: teaearlgraycold: [["action_required", "t"]] "t" is a string there
[19:23:42] teaearlgraycold: Well that's the SQL that rails is generating
[19:23:49] rhizome: your intent might be not to query on strings, but.
[19:24:11] teaearlgraycold: But .where(action_required: true) / .where(action_required: false) both seem to work correctly
[19:24:42] teaearlgraycold: If active record wants to query by a string, that's fine with me
[19:25:17] bersimoes: has joined #RubyOnRails
[19:26:46] drbayer: has joined #RubyOnRails
[19:27:00] masscrx: rhizome: Service describes available rails engines (sales,crm,schedules), Offer describes limits for that engines (how many sales can customer do etc) and now I need to store that information in some table so "Which engines/services customer bought, and which offer for each engine/service" thats why I need join table for that (I guess)
[19:28:13] Radar: GOOD MORNING
[19:28:28] masscrx: fiu fiu fiu, morning! ;-}
[19:28:29] Radar: pwnd_nsfw: https://gist.github.com/radar/3037d4c5f8d3240afd43
[19:29:48] brt: has joined #RubyOnRails
[19:29:52] Scriptonaut: in my beta, staging, and production environment files, serve_static_files is explicitly set to false for all of them. To fix my issue with the csv file, I have to change this to true. Is there any reason why we wouldn't want to serve_static_files? I can't get in contact with any of the other devs (they all took off early for Thanksgiving :)
[19:30:52] Radar: your nginx/apache/whatever should be serving the static files
[19:31:02] Radar: how are you running your servers in beta/staging/production?
[19:31:09] Scriptonaut: Radar: heroku
[19:31:19] Scriptonaut: They use nginx right?
[19:31:20] Radar: Scriptonaut: use the rails_12factor gem
[19:31:32] Scriptonaut: rather than setting the config?
[19:31:46] masscrx: rhizome: so from Admin side, when visiting customer's profile page, he will be able to choose from dropdown some Service and then related offer, and save that 3 informations to table
[19:32:02] badoo: has joined #RubyOnRails
[19:32:21] Axsuul: has joined #RubyOnRails
[19:33:37] Radar: Scriptonaut: yes
[19:33:52] Scriptonaut: thanks Radar I'll check it out
[19:34:01] Radar: https://devcenter.heroku.com/articles/getting-started-with-rails4
[19:34:16] arup_r: has joined #RubyOnRails
[19:34:20] Radar: https://devcenter.heroku.com/articles/getting-started-with-rails4#heroku-gems
[19:34:52] rhizome: masscrx: that's not what you're saying your setup is: a service can only have one offer, so you only need to record that in Service
[19:35:12] yfeldblum: has joined #RubyOnRails
[19:37:36] drbayer: has joined #RubyOnRails
[19:37:37] kadoppe: has joined #RubyOnRails
[19:38:21] BlackCoyote: has joined #RubyOnRails
[19:39:30] claytonzaugg: has joined #RubyOnRails
[19:39:58] juddey: has joined #RubyOnRails
[19:40:00] claytonzaugg: How do I make a certain version of ruby my default under OS X? I just downloaded ruby-2.2.3
[19:40:29] Scriptonaut: claytonzaugg: do you use rvm or rbenv?
[19:40:39] claytonzaugg: rvm is what my friend had me use
[19:40:56] rhizome: what does rvm info say?
[19:40:59] Scriptonaut: you can set a global ruby version in rvm I think (I use rbenv)
[19:41:03] claytonzaugg: Ruby Version Manager
[19:41:18] rhizome: right, what happens when you run the command "rvm info"?
[19:41:24] roshanavand: has joined #RubyOnRails
[19:41:30] claytonzaugg: how does one do that Scriptonaut or can you link me to a good tutorial / guide?
[19:41:32] Scriptonaut: claytonzaugg:
[19:41:43] Scriptonaut: rvm --default use ruby-2.2.3
[19:41:53] claytonzaugg: oh lol rhizome sorry about that! Let me run that syntax, I am obviously new to it!
[19:42:02] colleenmcguckin: has joined #RubyOnRails
[19:42:15] Scriptonaut: then test it with ruby -v n whatnot
[19:42:29] claytonzaugg: looks like at the top, when I run rvm info, it has ruby-2.2.3 listed
[19:42:46] s2013: has joined #RubyOnRails
[19:42:51] rhizome: i forget the best command to use to determine whether rvm is available as a function
[19:42:55] B1n4r10: has joined #RubyOnRails
[19:43:39] claytonzaugg: Thank you guys/gals for your help! I may be on here a bit the next few weeks as I try and learn the syntax.
[19:43:56] Radar: no worries :) We will still be here.
[19:44:39] rhizome: the author hangs out in #rvm
[19:45:19] Scripore: has joined #RubyOnRails
[19:45:28] masscrx: rhizome: https://gist.github.com/masscrx/df69499ef39ca5c76335 correct ?
[19:45:30] claytonzaugg: Nice! I like how Node.JS built off of RoR, it's making my learning a little bit easier :)
[19:46:40] Radar: You might be thinking of Express, more than Node.
[19:47:08] arup_r: WHhat is Express ?
[19:47:21] pipework: Node isn't really very railsy.
[19:47:39] dviola: arup_r: sinatra-inspired framework for node
[19:47:54] pawnbox: has joined #RubyOnRails
[19:48:00] Scriptonaut: I've considered learning node for a while, but so far it doesn't seem to offer anything that rails doesn't, and I'm already invested in rails
[19:48:01] arup_r: oh.. thanks for telling dviola
[19:48:02] rhizome: masscrx: seems reasonable
[19:48:08] arup_r: I didn't know it
[19:48:33] Fire-Dragon-DoL: when APIs are crap (js): getUTCFullYear returns year, getUTCMonth returns month, what does getUTCDay return? day OF THE WEEK (0...6), -_-, getUTCDate returns day of month <.<
[19:49:24] masscrx: rhizome: looks strange but correct for me:P maybe because I treat word "service" as collection of available engines in my project
[19:49:47] nickenchuggets: has joined #RubyOnRails
[19:50:13] masscrx: "services" = available engines instead of bought services by customer, but thats fine
[19:50:22] rhizome: i have no idea what you're actually doing, so i can't say anythnig about your terminology
[19:50:29] colleenmcguckin: has joined #RubyOnRails
[19:50:48] rhizome: masscrx: "features"
[19:50:50] beingjohnm: I have a model profile which belongs to both :user and :dependent (each can have multiple profiles). How can I check from inside the model if it is being used as user.profile or depenedent.profile?
[19:50:56] masscrx: oh yeah exactly ;]
[19:51:27] arthurnn: has joined #RubyOnRails
[19:51:48] rhizome: masscrx: if you have time to read: https://www.google.com/search?q=rails+feature+flags
[19:52:07] alphaatom: has joined #RubyOnRails
[19:53:02] baweaver: has joined #RubyOnRails
[19:53:10] masscrx: nice thank you
[19:55:24] ace05: has joined #RubyOnRails
[19:56:49] colleenmcguckin: has joined #RubyOnRails
[19:57:11] DoubleMalt: has joined #RubyOnRails
[19:57:38] teaearlgraycold: So what does this mean? "arguments passed to url_for can't be handled. Please require routes or provide your own implementation"
[19:58:00] teaearlgraycold: When I visit some pages that error shows up, and then causes every other page to spew that error
[19:58:02] ur5us: has joined #RubyOnRails
[19:58:10] teaearlgraycold: I need to restart the application to fix it
[19:58:58] alphaatom: has joined #RubyOnRails
[19:59:26] sandstrom: has joined #RubyOnRails
[20:01:02] WillAmes: has joined #RubyOnRails
[20:01:59] roshanavand: has joined #RubyOnRails
[20:02:35] JoshGlzBrk: has joined #RubyOnRails
[20:03:36] annlewis: has joined #RubyOnRails
[20:03:55] davidw: has joined #RubyOnRails
[20:04:16] teaearlgraycold: has left #RubyOnRails: ("WeeChat 1.0.1")
[20:05:30] badoo: has joined #RubyOnRails
[20:06:09] s2013: has joined #RubyOnRails
[20:07:09] medright: has joined #RubyOnRails
[20:08:36] Coldblackice: has joined #RubyOnRails
[20:09:10] s2013: <%= a.select :state, options_for_select( [["State", "state"]] + State::NAMES), {}, { class: 'form-control' } %> i have this.. for some reason if someone submits the form but it rerenders, they need to reselect the state from the dropdown.. but the text fields and stuff are filled out with previous values properly
[20:09:12] rickmasta: has joined #RubyOnRails
[20:09:19] VeryBewitching: has joined #RubyOnRails
[20:09:44] n00bDev: has joined #RubyOnRails
[20:09:53] DanielN: has joined #RubyOnRails
[20:11:02] n00bDev: What field type should i store a UNIX Timestamp as?
[20:11:38] n00bDev: not datetime or time?
[20:11:45] VeryBewitching: UNIX TS is an integer.
[20:11:52] n00bDev: okay makes sense
[20:11:53] VeryBewitching: Number of seconds since the UNIX epoch
[20:12:00] ql6wlld: has joined #RubyOnRails
[20:14:16] baweaver: has joined #RubyOnRails
[20:14:43] beingjohnm: I have a model "profile" that can belong to either "users" or "dependents". How can I check within "profile" if it is being used as "user.profile" or "dependent.profile"?
[20:15:19] jessemcgilallen: has joined #RubyOnRails
[20:16:06] arBmind: has joined #RubyOnRails
[20:16:07] netzfisch: has joined #RubyOnRails
[20:16:39] Liothen: has joined #RubyOnRails
[20:16:39] Liothen: has joined #RubyOnRails
[20:16:59] ellisTAA: has joined #RubyOnRails
[20:17:22] yoongkang: has joined #RubyOnRails
[20:17:34] atomical: has joined #RubyOnRails
[20:17:44] beingjohnm: actually, just got it.
[20:18:33] iateadonut: has left #RubyOnRails: ()
[20:20:50] lemur: has joined #RubyOnRails
[20:21:34] drale2k: has joined #RubyOnRails
[20:21:52] Ergo: has joined #RubyOnRails
[20:22:33] roshanavand: has joined #RubyOnRails
[20:22:59] lemur: has joined #RubyOnRails
[20:24:49] alphaatom: has joined #RubyOnRails
[20:26:21] platzhirsch: has left #RubyOnRails: ()
[20:26:27] Jasaka: has joined #RubyOnRails
[20:26:42] Grundell: has joined #RubyOnRails
[20:28:22] alphaatom: has joined #RubyOnRails
[20:31:46] claytonzaugg: has joined #RubyOnRails
[20:35:09] ubersapiens: has joined #RubyOnRails
[20:37:06] pawnbox: has joined #RubyOnRails
[20:39:32] claytonzaugg: is there a channel for homebrew for osx?
[20:39:47] Radar: claytonzaugg: #homebrew
[20:39:59] Radar: claytonzaugg: Sorry, #machomebrew
[20:39:59] claytonzaugg: Thank you Radar
[20:40:04] claytonzaugg: ah, okay thanks
[20:41:33] dionysus69: has joined #RubyOnRails
[20:42:45] Pazician: has joined #RubyOnRails
[20:42:48] claytonzaugg: hmm, i know this is off topic and I just asked it in the homebrew channel, but if someone knows the answer that'd be incredibly helpful
[20:42:49] claytonzaugg: Is there an apt-get update, apt-get upgrade equivelant when using homebrew?
[20:43:11] n00bDev: i usually do
[20:43:13] n00bDev: brew doctor
[20:43:16] n00bDev: then brew update
[20:43:18] braincrash: has joined #RubyOnRails
[20:43:26] baweaver: has joined #RubyOnRails
[20:43:55] claytonzaugg: okay thank you n00bdev
[20:44:44] zpe: has joined #RubyOnRails
[20:44:45] kimegede: has joined #RubyOnRails
[20:44:51] manfrin: has joined #RubyOnRails
[20:45:00] lemur: has joined #RubyOnRails
[20:45:20] iateadonut: has joined #RubyOnRails
[20:46:11] MEATCHICKEN: has joined #RubyOnRails
[20:46:37] m3_del: has joined #RubyOnRails
[20:47:39] theod: has joined #RubyOnRails
[20:48:43] agit0: has joined #RubyOnRails
[20:50:06] drbayer: has joined #RubyOnRails
[20:52:05] owenjones: has joined #RubyOnRails
[20:52:21] jbrhbr: has joined #RubyOnRails
[20:53:13] cac: has joined #RubyOnRails
[20:53:56] baweaver: has joined #RubyOnRails
[20:54:09] Kedric: has joined #RubyOnRails
[20:55:16] Kedric: Is there anyway to get a form to submit like a url click so it reloads the page with turbo links? I have a ransack form that is triggered as a get request
[20:57:05] claytonzaugg: I'm getting the following error when I'm trying to do a bundle install, was wondering if someone could help decipher it.
[20:57:13] claytonzaugg: An error occurred while installing rmagick (2.15.4), and Bundler cannot continue.
[20:57:13] claytonzaugg: Make sure that `gem install rmagick -v '2.15.4'` succeeds before bundling.
[20:57:37] claytonzaugg: My question is why did bundle not install it and why do I need to then manually install it?
[20:57:49] pawnbox: has joined #RubyOnRails
[20:57:59] m3_del: has joined #RubyOnRails
[20:58:13] VeryBewitching: It may not have installed because you're missing a system dependency for the gem. I'm assuming it uses ImageMagick from the name.
[20:59:29] FailBit: lol I just shell out to magick
[20:59:33] FailBit: I'm so evil
[20:59:33] claytonzaugg: No idea, this is my first go at RoR and I'm working on a project with a friend but he's not available to help at the moment.
[21:00:16] VeryBewitching: Well you would just need the image magick version specified with development headers so the gem can build it's native extensions.
[21:00:18] Radar: wow people are so helpful today
[21:00:26] Radar: claytonzaugg: "brew install imagemagick" might fix that
[21:00:37] claytonzaugg: Thank you Radar
[21:01:39] mostlybadfly: has joined #RubyOnRails
[21:02:01] Radar: claytonzaugg: You might be able to find the answer next time with "<gem> install OS X"
[21:02:18] claytonzaugg: what does that do / mean?
[21:02:29] colleenmcguckin: has joined #RubyOnRails
[21:02:36] tubbo: FailBit: that sucks
[21:02:36] Radar: claytonzaugg: Oops, I missed a keyword: "google"
[21:02:45] tubbo: i mean...it must have sucked to develop
[21:02:52] rakm: has joined #RubyOnRails
[21:03:08] Radar: bbl walking to work
[21:03:15] pipework: Radar: walk like an egyptian
[21:03:17] jgpawletko: has joined #RubyOnRails
[21:03:28] claytonzaugg: Cool, as simple as that sounds, not knowing the correct syntax for searching in google leaves a person googling aimlessly
[21:03:31] pipework: Radar: https://www.youtube.com/watch?v=Cv6tuzHUuuk
[21:03:35] roshanavand: has joined #RubyOnRails
[21:03:42] pipework: claytonzaugg: What OS are you on?
[21:03:51] safety_cut: has joined #RubyOnRails
[21:04:00] pipework: claytonzaugg: Do you have homebrew installed?
[21:04:07] claytonzaugg: I do now, yes
[21:04:10] SteenJobs: has joined #RubyOnRails
[21:04:17] pipework: claytonzaugg: did you run the command that Radar showed you?
[21:04:22] annlewis: has joined #RubyOnRails
[21:04:23] pipework: brew doctor if that fails.
[21:04:33] claytonzaugg: I've been learning a lot from first being told to run "bundle install" inside a folder, then I had to do a lot after things broke or didn't work :)
[21:04:54] Trynemjoel: has joined #RubyOnRails
[21:05:04] claytonzaugg: Radar, running brew install imagemagick worked, then when I ran bundle install again, it completed the entire process this time. Thank you
[21:05:55] claytonzaugg: Sorry guys/gals, thankfully I've used node and understand a little bit the RoR world, but it's still taking me a couple minutes to feel comfortable. Though I've learned a crap ton today between this channel and #machomebrew
[21:06:18] drbayer_: has joined #RubyOnRails
[21:06:25] claytonzaugg: like having to get MariaDB instead of MySQL through me off course
[21:06:56] pipework: claytonzaugg: Are you married to MariaDB? Why not use Postgresql?
[21:07:23] claytonzaugg: I have NEVER use MariaDB before, but was told for this project, especially when it broke on MySQL gem, that i needed to install that first
[21:07:28] rhizome: update libxml all you nokogiri users
[21:07:34] diegoviola: has joined #RubyOnRails
[21:08:10] cac: has joined #RubyOnRails
[21:08:25] n00bDev: has joined #RubyOnRails
[21:08:44] ace05: has joined #RubyOnRails
[21:09:03] claytonzaugg: Okay, so now that I have MariaDB installed I was told I needed to create a local database (dbname) then I need to "rake:migrate"
[21:09:07] davidw: has joined #RubyOnRails
[21:09:11] claytonzaugg: does that sound correct?
[21:09:36] claytonzaugg: as far as order of process goes? I'll need to google what rake does
[21:09:57] VeryBewitching: claytonzaugg: rake is the Ruby make equivalent.
[21:10:18] User458764: has joined #RubyOnRails
[21:10:31] claytonzaugg: okay, let me get the two db's created in MariaDB first, then I'll research rake and come back if I get stuck. Thanks again
[21:11:03] dionysus69: has joined #RubyOnRails
[21:12:57] claytonzaugg: If I need to go to antoerh channel on this one, please advise, but following instructions on MariaDB, I did brew install mariadb first and now it says to install it do unset TMPDIR and mysql_install_db. What does brew compile vs installing using those keywords do?
[21:13:01] michaeldeol: has joined #RubyOnRails
[21:13:25] claytonzaugg: when they say install, are they talking about configuring it or what did brew just do?
[21:14:10] based_pdev: has joined #RubyOnRails
[21:14:37] nettoweb: has joined #RubyOnRails
[21:14:51] claytonzaugg: https://mariadb.com/kb/en/mariadb/building-mariadb-on-mac-os-x-using-homebrew/
[21:14:58] claytonzaugg: that's the walkthrough I'm following btw
[21:15:35] claytonzaugg: I'm confused what complie from brew does and then it tells me later after that, to run these install commands. What's going on in brew that it doesn't install it?
[21:17:16] tubbo: claytonzaugg: it can't run the commands within 'Caveats' automatically, as you can see, because they kinda depend on a user decision
[21:18:18] VeryBewitching: tubbo: I'm not a Mac user, does brew install packages, or compile everything from sources?
[21:18:20] tubbo: if you see that message, mariadb should be installed. read that caveats section carefully, it will usually instruct you on the best way of running these services (pg, mysql, mongo, etc.) on your OS X machine.
[21:18:22] claytonzaugg: okay tubbo, thanks. I just ran unset TMPDIR but was curious what that did. Then I ran mysql_install_db and a whole ton of stuff occured. Just wondering what's going on when I do these things.
[21:18:59] tubbo: VeryBewitching: depends. a lot of the packages have 'bottles' which i believe are pre-compiled directories that it just untars into a /usr/local/Cellar/.. dir
[21:19:45] tubbo: VeryBewitching: it's not like APT/deb packages wherein the `./configure && make && make install` pattern is "pre-defined", but configurable.
[21:23:12] VeryBewitching: claytonzaugg: When you install MariaDB or MySQL, there are steps involved afterwards to setup the base configuration of the database backend.
[21:23:29] claytonzaugg: yeah reading through those now VeryBewitching. Thank you!
[21:24:16] roshanavand: has joined #RubyOnRails
[21:25:33] hnanon: has joined #RubyOnRails
[21:26:44] hnanon: I'm following this guide for paperclip: https://devcenter.heroku.com/articles/paperclip-s3
[21:26:49] dikaio: has joined #RubyOnRails
[21:27:43] hnanon: I'm using C9 to develop at the moment and the files are not being saved to my S3 bucket.
[21:27:51] podman: has joined #RubyOnRails
[21:27:58] hnanon: Instead, they're saved to my C9 instance.
[21:29:49] VeryBewitching: tubbo: Oh I see, just looked at some of the formulas, interesting.
[21:30:03] yfeldblum: has joined #RubyOnRails
[21:30:05] claytonzaugg: ugh, I'm sorry to ask, but I'm using Sequel Pro and I'm trying to find out how I connect to the MariaDB / mysql db I just started. I'm looking for a certain port that's standard, but I can't find it in the oducmentation I'm reading. ANy know off the top of their heads?
[21:30:40] VeryBewitching: If it's the same default as MySQL
[21:31:10] claytonzaugg: okay, here's the documentation I just found, I'll compare and verify: http://www.sequelpro.com/docs/connecting_to_a_local_mysql_server
[21:31:34] VeryBewitching: claytonzaugg: And I've confirmed that Maria's default is 3306
[21:31:47] claytonzaugg: okay cool, thank you!
[21:33:47] claytonzaugg: perfect VeryBewitching, 3306 worked and I connected. Thank you! I'm about to jump on the rake:migrate part, so I'll be back if I get stuck (and this is a pre-emptive if anyone is here ready to answer my questions lol)
[21:33:53] michaeldeol: has joined #RubyOnRails
[21:34:37] alphaatom: has joined #RubyOnRails
[21:34:39] flashpoint9: has joined #RubyOnRails
[21:35:03] drbayer: has joined #RubyOnRails
[21:35:45] drale2k: has joined #RubyOnRails
[21:37:02] medright: has joined #RubyOnRails
[21:37:23] waldi_: hi, i'm new to rails, i'm getting an error when i want to create a modal user, but i don't exactly know what i did wrong.. "rails g model User" results in: "/methods.rb:261:in `const_get': uninitialized constant User (NameError) "
[21:37:28] waldi_: someone knows why?
[21:40:13] Radar: Waldi_: !gist the whole stacktrace please
[21:40:13] helpa: Waldi_: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[21:40:16] otherj: has joined #RubyOnRails
[21:41:02] [Butch]: has joined #RubyOnRails
[21:41:16] waldi_: Radar: https://gist.github.com/waldi/13e630dfb6de56496bee
[21:41:17] otherj: anyone have an idea why these seemingly similar migrations would, for create donations, make the weight field an int and for create purchases make it varchar in the database?
[21:41:19] otherj: https://gist.github.com/otherjustin/a370ad971ac6bc54e0f0
[21:41:37] theod: has joined #RubyOnRails
[21:41:51] Radar: Waldi_: Looks like Devise is expecting the user model to exist already. Remove this line from your config/routes.rb: https://gist.github.com/waldi/13e630dfb6de56496bee#file-gistfile1-txt-L17
[21:42:52] waldi_: Radar: yeah thank you that solved the problem :))
[21:43:51] solars: has joined #RubyOnRails
[21:44:25] towski_: has joined #RubyOnRails
[21:44:51] roshanavand: has joined #RubyOnRails
[21:45:13] Radar: Waldi_: np
[21:46:24] DanielN: has joined #RubyOnRails
[21:48:16] pwnd_nsfw: has joined #RubyOnRails
[21:49:18] _3by8: has joined #RubyOnRails
[21:49:25] cac: has joined #RubyOnRails
[21:50:12] _3by8: So, in my database I've got printers with many cartridges but I also have users with many printers. How would I string it together to retrieve all of a user's cartridges?
[21:51:50] claytonzaugg: rake db:migrate worked just fine! Thanks again everyone for your help, I think I'm off to a great start with rails :)
[21:52:46] yoongkang: has joined #RubyOnRails
[21:53:17] medright: has joined #RubyOnRails
[21:54:40] baweaver: has joined #RubyOnRails
[21:54:55] gaustin: has joined #RubyOnRails
[21:55:27] Aasha: has joined #RubyOnRails
[21:55:28] VeryBewitching: Grats claytonzaugg, have fun!
[21:57:41] _3by8: Better yet, what would I even Google if I'm trying to learn how to do that?
[22:00:02] cac: has joined #RubyOnRails
[22:00:38] baweaver: has joined #RubyOnRails
[22:02:19] htmldrum: has joined #RubyOnRails
[22:05:00] baweaver: has joined #RubyOnRails
[22:05:10] annlewis: has joined #RubyOnRails
[22:05:26] roshanavand: has joined #RubyOnRails
[22:07:25] quazimodo: has joined #RubyOnRails
[22:08:47] dkam: has joined #RubyOnRails
[22:08:58] shibabu: has joined #RubyOnRails
[22:09:31] xybre: _3by8: sounds like you want a join query?
[22:10:26] dionysus69: has joined #RubyOnRails
[22:12:21] Axsuul: has joined #RubyOnRails
[22:13:07] dionysus69: has joined #RubyOnRails
[22:13:58] RockLee: has joined #RubyOnRails
[22:14:18] davidw: has joined #RubyOnRails
[22:14:18] davidw: has joined #RubyOnRails
[22:15:19] djbkd: has joined #RubyOnRails
[22:15:24] barhum2013: has joined #RubyOnRails
[22:16:16] xcesariox: has joined #RubyOnRails
[22:21:17] dikaio: has joined #RubyOnRails
[22:25:12] SteenJobs: has joined #RubyOnRails
[22:25:17] _3by8: xybre: I'll look into that, thanks
[22:26:01] roshanavand: has joined #RubyOnRails
[22:26:11] pawnbox: has joined #RubyOnRails
[22:29:37] uris: has joined #RubyOnRails
[22:30:33] briandeweese: has joined #RubyOnRails
[22:30:45] Scripore: has joined #RubyOnRails
[22:31:29] djbkd: has joined #RubyOnRails
[22:34:20] blackhuey: has joined #RubyOnRails
[22:36:05] Cohedrin: has joined #RubyOnRails
[22:41:29] VeryBewitching: _3by8: You can use a has many through association for that too.
[22:42:48] quazimodo: has joined #RubyOnRails
[22:43:33] m3_del: has joined #RubyOnRails
[22:43:37] baweaver: has joined #RubyOnRails
[22:44:24] colleenmcguckin: has joined #RubyOnRails
[22:46:51] _3by8: VeryBewitching: does it work the same? Will it know that it has to go through the join table for cartridges and printers?
[22:47:28] VeryBewitching: User has_many :cartridges through: :printers
[22:47:44] _3by8: Interesting. Printers doesn't have to be a join table?
[22:47:53] _3by8: It just knows?
[22:48:02] VeryBewitching: If it has a user_id and a cartridge_id, it'll work out
[22:48:28] _3by8: Well the printers table currently stores information about printers.
[22:48:38] _3by8: Are you saying write a migration that adds user_id and cartridge_id?
[22:48:48] Prasun: has joined #RubyOnRails
[22:48:54] pawnbox: has joined #RubyOnRails
[22:49:03] VeryBewitching: _3by8: See http://guides.rubyonrails.org/association_basics.html#the-has-many-through-association
[22:49:16] VeryBewitching: No, I'm saying if :printers already has that, the join will work
[22:49:58] VeryBewitching: You said user has many printers has many cartridges
[22:50:19] drale2k: has joined #RubyOnRails
[22:50:25] VeryBewitching: Although, wait, my bad.
[22:50:53] dionysus69: has joined #RubyOnRails
[22:52:01] VeryBewitching: Yes, you'd have to use join()
[22:52:16] redondo: has joined #RubyOnRails
[22:53:19] alvaro_o: has joined #RubyOnRails
[22:53:25] _3by8: VeryBewitching: thanks.
[22:53:59] _3by8: VeryBewitching: I mean the alternative is just getting the customer's printers first and then getting their cartridges, right? But that's two queries as opposed to one, am I right?
[22:54:09] _3by8: Not that it matters for this project. Think I'll just do the former.
[22:54:28] VeryBewitching: That depends on how you load it.
[22:54:36] _3by8: What do you mean?
[22:56:10] baweaver: has joined #RubyOnRails
[22:56:19] VeryBewitching: Well, you could eager load all of it, but I'm not sure if I'd suggest it.
[22:57:15] VeryBewitching: But if you're just looking for the cartridges for a given user, http://guides.rubyonrails.org/active_record_querying.html#joining-tables
[22:58:12] lemur: has joined #RubyOnRails
[23:00:04] _djbkd: has joined #RubyOnRails
[23:00:15] m3_del: has joined #RubyOnRails
[23:01:06] Scriptonaut: I'm using send_data to export a csv file, as far as the charset, should I use utf-8, or iso-8859-1 or what?
[23:01:17] nso95-: has joined #RubyOnRails
[23:01:17] nso95-: has joined #RubyOnRails
[23:01:19] Scriptonaut: or do I even need to specify it?
[23:01:21] badhatter: has joined #RubyOnRails
[23:01:21] badhatter: has joined #RubyOnRails
[23:01:26] VeryBewitching: Scriptonaut: MS compatible?
[23:01:33] Scriptonaut: it needs to work on IE
[23:01:40] Aeyrix: ah, use iso
[23:01:58] VeryBewitching: Windows multibyte char set
[23:02:00] Scriptonaut: ok, so will that also work in the other browsers?
[23:02:00] Aeyrix: I mean, UTF-8 works *everywhere*, but that ^ would be guaranteed to work on Windows.
[23:02:14] Scriptonaut: wait, CP-1252, what's that
[23:02:17] VeryBewitching: UTF-8 should be supported everywhere.
[23:02:27] Aeyrix: https://en.wikipedia.org/wiki/Windows-1252
[23:02:28] VeryBewitching: CP-1252 is the windows default multibyte character set.
[23:02:29] chrisja: has joined #RubyOnRails
[23:02:34] Scriptonaut: I'll set it as utf-8 for now, and then test across browsers and change accordingly
[23:02:43] Scriptonaut: damn Microsoft
[23:02:54] Aeyrix: It's a superset of 8859.
[23:03:03] Aeyrix: So, just use UTF-8 like you ventured.
[23:03:07] Aeyrix: Should honestly work just fine.
[23:03:11] Scriptonaut: thanks for the tips guys
[23:03:12] Aeyrix: And it means it'll work across the board.
[23:03:17] maloik: has joined #RubyOnRails
[23:04:20] chrisja: has joined #RubyOnRails
[23:05:54] annlewis: has joined #RubyOnRails
[23:06:03] lacuna_: has joined #RubyOnRails
[23:06:54] roshanavand: has joined #RubyOnRails
[23:06:57] atomical_: has joined #RubyOnRails
[23:07:20] cac: has joined #RubyOnRails
[23:07:58] Radar: UTF-8 will be fine
[23:08:25] diegoviola: what do you guys use for graphing?
[23:08:58] Radar: diegoviola: on logs.ryanbigg.com/p/Radar/activity I use d3.js
[23:09:06] Radar: Its API is... intense.
[23:09:19] Radar: Depends on what kind of charts you want, really.
[23:09:32] DrShoggoth: has joined #RubyOnRails
[23:09:43] Grundell_: has joined #RubyOnRails
[23:09:53] ebbflowgo: has joined #RubyOnRails
[23:10:05] Cohedrin: http://chartkick.com/
[23:10:19] diegoviola: a client wants me to hit their login page and create some charts about the seconds it take to do login (measure the time)
[23:10:22] diegoviola: so I came with this: https://gist.github.com/diegoviola/afdf7020135023952fb3
[23:10:33] diegoviola: I could just do a POST and measure it with curl
[23:10:35] Cohedrin: chartkick is about as easy as it gets for that imo
[23:10:48] diegoviola: but they want browser simulation
[23:11:01] Radar: diegoviola: How about monitoring it with something like Skylight or New Relic?
[23:11:15] Radar: Then you get visibility into _why_ it's taking a long time, more than it's just taking a long time.
[23:11:50] beauby: has joined #RubyOnRails
[23:12:32] diegoviola: Radar: I could suggest that
[23:13:02] diegoviola: Radar: but they don't even have access to the code they are trying to profile
[23:13:30] Radar: Ok, well then this is probably as close as you're going to get to it.
[23:13:34] ql6wlld: has joined #RubyOnRails
[23:13:38] ebbflowgo: has joined #RubyOnRails
[23:16:21] djbkd: has joined #RubyOnRails
[23:16:49] dkam_: has joined #RubyOnRails
[23:17:09] johnflux: has joined #RubyOnRails
[23:17:43] Aeyrix: Have you tried using the blockchain?
[23:17:48] Radar: Aeyrix: Not now.
[23:18:02] Aeyrix: Yeah, I know.
[23:18:04] Aeyrix: The future.
[23:18:08] WhereIsMySpoon_: has joined #RubyOnRails
[23:18:10] rhizome: diegoviola: selenium
[23:18:14] pawnbox: has joined #RubyOnRails
[23:19:14] davidw: has joined #RubyOnRails
[23:19:14] davidw: has joined #RubyOnRails
[23:19:37] Scriptonaut: If I'm inside a resource block in my routes file, does anyone know of a shorthand way to make a route for that collection with a certain parameter?
[23:19:42] Scriptonaut: that was a crappy way to explain it
[23:20:24] Scriptonaut: I'm inside the :exports resource block. I would like to have a param :scope come after exports, so I want to match /exports/person, /exports/task, etc
[23:20:33] diegoviola: Aeyrix: you can get a debit card from advcash.com and add credit with BTC
[23:20:50] Scriptonaut: something like: get '/:scope', action: :new
[23:20:52] SteenJobs: has joined #RubyOnRails
[23:21:17] jessemcgilallen: has joined #RubyOnRails
[23:21:38] diegoviola: rhizome: selenium is just a backend no?
[23:22:33] Aeyrix: diegoviola: neat
[23:22:39] Aeyrix: diegoviola: except i get paid in dollarydoos
[23:22:46] mentero: has joined #RubyOnRails
[23:22:52] Aeyrix: diegoviola: then again, the dollarydoo : usd exchange rate isn't fab right now
[23:23:01] Trynemjoel: has joined #RubyOnRails
[23:23:17] Aeyrix: 0.72. Meh.
[23:23:22] jhass: Scriptonaut: collection do; get ":scope" => :new end
[23:23:26] diegoviola: Aeyrix: neteller, xapo and advcash allow you to add funds to your card with BTC
[23:23:47] smathy: Scriptonaut, that didn't work?
[23:23:52] Aeyrix: diegoviola: I don't have any btc
[23:23:54] jhass: Scriptonaut: or get ":scope" => :new, on: :collection
[23:24:03] Aeyrix: diegoviola: because i put my money into other things
[23:24:07] Aeyrix: diegoviola: like shiny gold weapons in video games
[23:24:09] smathy: Oh right, you weren't in collection block :)
[23:24:23] diegoviola: Aeyrix: lol ok
[23:25:02] Scriptonaut: thanks guys that did it
[23:27:04] ql6wlld: has joined #RubyOnRails
[23:27:39] Radar: diegoviola: Selenium will drive a real Firefox browser
[23:27:44] roshanavand: has joined #RubyOnRails
[23:29:22] ebbflowgo: has joined #RubyOnRails
[23:30:28] djbkd: has joined #RubyOnRails
[23:31:28] Tempesta: has joined #RubyOnRails
[23:34:14] diegoviola: yeah I just tried selenium-webdriver in capybara today and noticed how it opened a firefox window, it just seemed a bit overkill for the purpose of measuring login time
[23:34:23] banister: has joined #RubyOnRails
[23:34:25] nso95-: has joined #RubyOnRails
[23:34:25] nso95-: has joined #RubyOnRails
[23:34:52] rhizome: it'll take you an hour and the ppl asking for it will be happy
[23:35:06] pwnd_nsfw: Good thing that's not necessarily what that is designed for lol
[23:35:30] claytonzaugg: has joined #RubyOnRails
[23:35:46] SteenJobs_: has joined #RubyOnRails
[23:36:16] claytonzaugg: So I stepped away from my computer, turned it off in fact, and when I went to launch the server again "Rails server" it gives me errors and won't start
[23:36:44] havenwood: has joined #RubyOnRails
[23:37:01] diegoviola: pwnd_nsfw: do you think just using curl is better for this?
[23:37:15] claytonzaugg: Checked in 'GEM_PATH=/Users/clayton/.rvm/gems/ruby-2.2.2@serenity:/Users/clayton/.rvm/gems/ruby-2.2.2@global', execute `gem env` for more information
[23:37:15] claytonzaugg: from /Users/clayton/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/dependency.rb:324:in `to_spec'
[23:37:15] claytonzaugg: from /Users/clayton/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:64:in `gem'
[23:37:17] claytonzaugg: from /usr/local/bin/rails:22:in `<main>'
[23:37:46] diegoviola: also, my client mentioned something like "hit the login page every 15 minutes and add the time it takes to do that on the db", so I'll probably write a separate script and run it via cron
[23:37:52] diegoviola: or I'm not sure if there is a better way?
[23:38:32] lacuna: has joined #RubyOnRails
[23:38:32] lacuna: has joined #RubyOnRails
[23:38:42] claytonzaugg: Here's the info cleaner: http://pastebin.com/sjRKx1iJ
[23:40:00] pwnd_nsfw: diegoviola, curl would be great. your client is silly, but a'ight
[23:40:15] claytonzaugg: Here's the info if someone can help me figure out why rails server no longer runs: https://gist.github.com/claytonzaugg/772cf207cc30f4b71062
[23:40:27] Sidoniuns: has joined #RubyOnRails
[23:40:40] pwnd_nsfw: claytonzaugg, bundle install myb
[23:40:44] havenwood: has left #RubyOnRails: ("Bye!")
[23:40:45] pwnd_nsfw: also, lol@dev on windows
[23:41:10] claytonzaugg: dev on windows? Running a mac here buddy, but I'll try installing myb. Thank you.
[23:41:27] nso95-: has joined #RubyOnRails
[23:41:31] pydave6367: has joined #RubyOnRails
[23:41:37] pwnd_nsfw: I'm not your buddy pal
[23:41:40] nso95-: has joined #RubyOnRails
[23:41:40] nso95-: has joined #RubyOnRails
[23:41:49] pwnd_nsfw: Sometimes I like to see things wrong on purpose.
[23:41:51] claytonzaugg: I'm not your pal guy
[23:41:59] pwnd_nsfw: My apologies
[23:42:03] diegoviola: pwnd_nsfw: like a curl script running via cron or something and hitting the server every X minutes?
[23:42:18] claytonzaugg: all good friend :)
[23:42:23] Radar: pwnd_nsfw: Did you get my message from earlier?
[23:42:28] pwnd_nsfw: Yes, thank you Radar
[23:42:48] pwnd_nsfw: it was like 3 messages away from being lost from the output buffer of my client lol
[23:43:25] claytonzaugg: Radar, now bundle won't work! It's like once I restarted the computer, everything broke!
[23:43:33] Radar: claytonzaugg: What happens when you try it?
[23:43:57] bersimoes: has joined #RubyOnRails
[23:44:00] claytonzaugg: well when I tried rails server, I got this: https://gist.github.com/claytonzaugg/772cf207cc30f4b71062
[23:44:38] tubbo: claytonzaugg: what actually most likely happened is that you started a new shell session, and that session does not have the required configuration for RVM in it right now.
[23:44:39] claytonzaugg: when I just tried bundle, I got this: https://gist.github.com/claytonzaugg/12f11c1671fc2a4df14d
[23:44:52] pwnd_nsfw: diegoviola, maybe miniprofiler will help you out
[23:44:58] Radar: claytonzaugg: Wonderful, looks like RVM is broken. How rare. This never happens.
[23:45:04] Radar: Oops, left off my sarcasterix >>> * <<<
[23:45:16] Radar: claytonzaugg: May I recommend removing RVM and using something else instead?
[23:45:18] claytonzaugg: tubbo, is that the case or is RVM broken?
[23:45:31] badoo: has joined #RubyOnRails
[23:45:56] tubbo: claytonzaugg: that is absolutely the case. but Radar is probably right, there are tools like rbenv and chruby/ruby-install that accomplish the same goals, but are a lot easier to deal with.
[23:46:05] Radar: claytonzaugg: rvm implode --force
[23:46:07] Radar: claytonzaugg: Then: http://ryanbigg.com/2015/06/mac-os-x-ruby-ruby-install-chruby-and-you/
[23:46:13] tubbo: mostly because they don't attempt to be an entire ruby environment manager
[23:46:31] ql6wlld: has joined #RubyOnRails
[23:46:37] Radar: Thousands of satisfied readers for that blog post :D
[23:46:51] Radar: Judging by the internet traffic and the lack of "omg my computer is broke now" comments
[23:46:55] nso95-: has joined #RubyOnRails
[23:46:55] nso95-: has joined #RubyOnRails
[23:47:24] tubbo: Radar: 'running win7 ultimate this shit doesnt even work'
[23:47:51] claytonzaugg: thank you Radar, I'll follow those instructions
[23:48:00] pawnbox: has joined #RubyOnRails
[23:48:02] Radar: I really wish people would stop recommend RVM
[23:48:13] tubbo: who recommends RVM?
[23:48:16] Radar: It's the multi-ton dump truck when really all you need is a vespa.
[23:48:16] claytonzaugg: How do I get rid of it? Is there an uninstall script for it?
[23:48:18] tubbo: pretty sure that's just old guides
[23:48:19] pwnd_nsfw: I would suggest to all of those using Win7 to at least run linux in a vm and develop through that
[23:48:25] Radar: claytonzaugg: "rvm implode --force" is the uninstall script
[23:48:33] pwnd_nsfw: I haven't had problems with rvm.... yet
[23:48:36] Radar: tubbo: Yup, that'd definitely be it.
[23:48:42] claytonzaugg: I thought you were joking Radar!
[23:48:53] Radar: claytonzaugg: Nope, that's literally the command.
[23:49:10] tubbo: *way* easier to uninstall than rbenv :P
[23:49:29] tubbo: with rbenv you have to chase down all the points where it fucked with your binstub and added a rbenv-specific fully-qualified path to the ruby binary
[23:49:31] tubbo: fuck you rbenv.
[23:49:34] pwnd_nsfw: Perhaps they put dev time to uninstalling... since you'd end up uninstalling some time or another.
[23:49:55] claytonzaugg: Should I restart / login again?
[23:50:09] claytonzaugg: after I removed it?
[23:50:25] tubbo: any basecamp users here? the basecamp 2 -> basecamp 3 upgrade bullshit reminds me of how shitty the rails 2 -> 3 upgrade is
[23:50:28] JoshGlzBrk: has joined #RubyOnRails
[23:50:36] tubbo: basecamp/37signals: 10 years later, we still haven't really figured out data migration
[23:50:58] tubbo: their upgrade path is (shrug) do it yourself
[23:52:51] Radar: hahahah really? That sucks.
[23:53:01] Radar: claytonzaugg: Restart your terminal to make sure it removes the stuff.
[23:53:09] Radar: claytonzaugg: Should be good if the terminal boots fine.
[23:54:07] claytonzaugg: Radar, in the blog you sent me to, it's specifying a version of Ruby. I was wondering if there was a way to get just the latest version of ruby instead of what they ahve?
[23:54:19] claytonzaugg: wget -O ruby-install-0.5.0.tar.gz \ https://github.com/postmodern/ruby-install/archive/v0.5.0.tar.gz
[23:54:20] yoongkang: has joined #RubyOnRails
[23:54:24] Aeyrix: claytonzaugg: Sure there is.
[23:54:29] Radar: claytonzaugg: That's ruby-install, which is the program which installs Ruby.
[23:54:34] Aeyrix: You look it up on ruby-lang.org
[23:54:45] claytonzaugg: Ah, okay thanks Radar
[23:54:46] Radar: claytonzaugg: "ruby-install ruby 2.2.3" after ruby-install will install the latest Ruby.
[23:54:47] Aeyrix: then you use that version instead of 2.2.0 or whatever Radar put in the blog :^)
[23:54:52] Radar: Might even be able to do it without the "2.2.3"
[23:55:00] suns: has joined #RubyOnRails
[23:55:04] Aeyrix: it installs latest stable or something if you omit the version
[23:55:16] Aeyrix: like 2.1.something last time I tried, despite 2.2.3 being out
[23:55:21] claytonzaugg: wget -O ruby-install-0.5.0.tar.gz \
[23:55:21] claytonzaugg: https://github.com/postmodern/ruby-install/archive/v0.5.0.tar.gz
[23:55:26] threeminutemonta: has joined #RubyOnRails
[23:55:35] Aeyrix: Radar: >>> Installing ruby 2.1.3 into /Users/elliot/.rubies/ruby-2.1.3 ...
[23:55:39] rubyonrailed: has joined #RubyOnRails
[23:55:42] Aeyrix: 2.1.3 is what it tries to install without args.
[23:55:59] nettoweb: has joined #RubyOnRails
[23:57:47] gdeglin: has left #RubyOnRails: ()
[23:57:51] claytonzaugg: what is chruby?
[23:58:24] tuelz: has joined #RubyOnRails
[23:58:24] claytonzaugg: and how do you prounounce that? lol CRUBY or SHRUBY or CHUHRUBY
[23:58:38] Radar: see-ach ruby
[23:59:01] claytonzaugg: lol okay cool :)
[23:59:16] claytonzaugg: and what is it Radar
[23:59:42] Radar: claytonzaugg: It's what sets up the PATH correctly for you so that it uses the Ruby installed by ruby-install, rather than the system Ruby.
[23:59:56] Radar: claytonzaugg: It will also let you switch between different versions of ruby install with ruby-install