« Back to channel list

#RubyOnRails - 16 September 2015

« Back 1 day Forward 1 day »
[00:00:15] hahuang65: has joined #RubyOnRails
[00:05:36] cs44: has joined #RubyOnRails
[00:06:23] mclee_: has joined #RubyOnRails
[00:09:14] jokke: has joined #RubyOnRails
[00:09:50] annlewis: has joined #RubyOnRails
[00:10:02] webguynow: has joined #RubyOnRails
[00:10:18] mwlang: when testing controllers, is any part of the journey router inner workings disabled or mocked?
[00:11:01] mwlang: or maybe better question: Do I need something similar to ???render views??? at top of my controller to ???turn on??? more in-depth routing features?
[00:11:21] jokke-: has joined #RubyOnRails
[00:12:12] sam_weerasinghe1: has joined #RubyOnRails
[00:13:36] charliesome: has joined #RubyOnRails
[00:13:44] livecano: has joined #RubyOnRails
[00:13:47] mwlang: this is for RoR4 and Rspec 3 if that makes any difference.
[00:14:16] workmad3: has joined #RubyOnRails
[00:15:36] pwnd_nfsw: has joined #RubyOnRails
[00:15:37] baweaver: have not heard of a journey router
[00:16:13] baweaver: Synopsis: Too complex right now. :(
[00:16:18] baweaver: does not inspire confidence.
[00:16:35] tejasmanohar: has joined #RubyOnRails
[00:16:57] Bongo: has joined #RubyOnRails
[00:16:57] mwlang: baweaver: https://github.com/rails/journey
[00:17:08] baweaver: yeah, found it.
[00:17:20] yaewa: has joined #RubyOnRails
[00:17:23] baweaver: not that I know of
[00:17:28] manfrin_: has joined #RubyOnRails
[00:17:36] baweaver: when making JSON requests I have to render views, but that's about it.
[00:17:41] mwlang: seems to be an rspec thing.
[00:17:52] baweaver: haven't seen it before honestly.
[00:17:56] Sdwrage_: has joined #RubyOnRails
[00:18:05] seank__: has joined #RubyOnRails
[00:18:18] mwlang: oh, well???I???m digging into the libraries for clues.
[00:18:26] ChadyG: has joined #RubyOnRails
[00:18:40] baweaver: Ah, my old nemesis, HABTM exact match....
[00:19:00] baweaver: makes for a nasty headache, that one.
[00:19:11] mwlang: basically, I got an app that adds routes dynamically at runtime. The tests run fine with mini-test, but cutting over to rspec, essentially the same tests are failing to even dall the Rails route redraw.
[00:19:37] fschuindt: has joined #RubyOnRails
[00:19:38] baweaver: yeah, I'd ask RSpec if they're doing anything honestly.
[00:19:43] mwlang: just beat HABTM into submission.
[00:20:04] baweaver: I find myself in a spot repeatedly where I need to have this work...
[00:20:16] baweaver: Model has_many Tags through something
[00:20:32] LateralO-: has joined #RubyOnRails
[00:20:34] baweaver: find model where it has tags a and b
[00:20:39] baweaver: and ONLY a and b
[00:20:43] nizmow-: has joined #RubyOnRails
[00:20:43] mwlang: HABTM???s diminishing usefulness is part of the vast HMT conspiracy movement. :-)
[00:20:47] jxie: has joined #RubyOnRails
[00:20:47] ipstatic_: has joined #RubyOnRails
[00:20:58] scpike_: has joined #RubyOnRails
[00:21:03] baweaver: Which I'm using, still won't help those evil cases.
[00:21:04] petersaints_: has joined #RubyOnRails
[00:21:17] totimkop1: has joined #RubyOnRails
[00:21:19] mwlang: that???s a challenging one.
[00:21:28] baweaver: working on a writeup for it while trying to solve them at work
[00:21:41] moneylot-: has joined #RubyOnRails
[00:21:45] EiNSTeiN_: has joined #RubyOnRails
[00:21:47] EiNSTeiN_: has joined #RubyOnRails
[00:21:48] baweaver: right now I'm just being dirty and cheating
[00:21:48] mhenrixon_: has joined #RubyOnRails
[00:22:13] mwlang: I think I would look for A and B and size == 2
[00:22:33] baweaver: yeah, the second fun is that it should have tags A AND B
[00:22:39] baweaver: that's just includes
[00:22:44] alexUaN: has joined #RubyOnRails
[00:22:44] michael_imac: has joined #RubyOnRails
[00:22:50] baweaver: AND gets into either sub queries or inner join shenanigans
[00:22:51] Ropeney: has joined #RubyOnRails
[00:23:01] baweaver: I can make it work but man does it feel dirty.
[00:23:33] baweaver: for the record, code does not exist here, more of trying to think of how to do that cleanly.
[00:23:38] jgt: has joined #RubyOnRails
[00:24:12] mordocai: has joined #RubyOnRails
[00:24:15] mwlang: describe your real problem.
[00:24:31] baweaver: In this case... (typing)
[00:24:32] mwlang: I usually avoid by better composition.
[00:24:50] milchschaum: has joined #RubyOnRails
[00:25:00] baweaver: A ReleaseBundle has_many Builds through ReleaseBundleBuilds
[00:25:24] baweaver: I need to find out if there's a ReleaseBundle that exists in the same Release that has the same Builds
[00:26:19] sam_weerasinghe1: has left #RubyOnRails: ()
[00:26:19] baweaver: first cheat is to denormalize the dang thing and put the build ids on the model (dirty)
[00:26:26] northfurr: has joined #RubyOnRails
[00:26:31] sam_weerasinghe1: has joined #RubyOnRails
[00:26:37] baweaver: second cheat is to just load all ReleaseBundles in the Release and cross-reference them (slow)
[00:27:05] mwlang: so you???re looking across the universe of all releasebundlebuilds?
[00:27:17] baweaver: that happen to be under a release
[00:27:18] eggoez: has joined #RubyOnRails
[00:27:28] baweaver: Release has_many ReleaseBundles
[00:27:46] baweaver: Release cannot have multiple ReleaseBundles with the same Builds
[00:28:03] djbkd: has joined #RubyOnRails
[00:28:22] borkdude_: has joined #RubyOnRails
[00:29:08] mwlang: unique indexes. :-D
[00:29:36] mwlang: or at least I???d go the route of prevention with a composite index enforcing unique constraint.
[00:29:39] baweaver: (excuse slight shorthand)
[00:30:08] kumavis_: has joined #RubyOnRails
[00:30:26] baweaver: ReleaseBundleBuilds.joins(:rbs).where(rb_id: rb_id, rb: {r_id: r_id}).pluck('rbs.builds.ids')
[00:30:39] DanKnox_: has joined #RubyOnRails
[00:30:48] badfish129: has joined #RubyOnRails
[00:31:03] jgt: has joined #RubyOnRails
[00:31:11] EiN_: has joined #RubyOnRails
[00:31:13] thang_: has joined #RubyOnRails
[00:31:18] baweaver: just shortening the names so it fits on screen
[00:31:23] fryguy9: has joined #RubyOnRails
[00:31:27] K0nserv-_: has joined #RubyOnRails
[00:31:29] hackeron_: has joined #RubyOnRails
[00:31:30] livcd_: has joined #RubyOnRails
[00:31:33] Skelz0r_: has joined #RubyOnRails
[00:31:40] baweaver: and yes, I'm aware it's not pretty. Little point in mentioning that.
[00:31:48] SteenJobs: has joined #RubyOnRails
[00:32:36] [H]unt3r: has joined #RubyOnRails
[00:32:42] gs: has joined #RubyOnRails
[00:32:56] mwlang: not everything has to be ???pretty??? Ever since I redefined what ???pretty??? means in Ruby code, I???ve gotten to writing much better Ruby code. :-D
[00:32:58] troyreadyy: has joined #RubyOnRails
[00:33:39] chancancode_: has joined #RubyOnRails
[00:33:42] dede__: has joined #RubyOnRails
[00:33:45] mwlang: if your goal???s to prevent a release having more than one release bundle with same build, I???d just enforce the RI.
[00:34:24] mwlang: and avoid the need to write something like this altogether (that???s just looking for such scenarios)
[00:34:31] mhenrixon: has joined #RubyOnRails
[00:34:35] mwlang: (that is, if I???m understanding your intent correctly)
[00:34:43] svkurowsm: has joined #RubyOnRails
[00:34:55] baweaver: build(s), that's the fun one.
[00:35:14] moneylotion: has joined #RubyOnRails
[00:36:06] prasselpikachu_: has joined #RubyOnRails
[00:36:11] jhass|off: has joined #RubyOnRails
[00:36:12] jalcine: has joined #RubyOnRails
[00:36:32] ddv: has joined #RubyOnRails
[00:36:32] Kilo`byte: has joined #RubyOnRails
[00:36:41] FailBit: love how new relic just becomes totally unresponsive when trying to view thread profiles
[00:37:08] FailBit: yes, it's lovely that you captured 16k traces
[00:37:21] FailBit: I'd like to be able to see them at some point
[00:37:26] strcmp1: has joined #RubyOnRails
[00:37:48] DEac-: has joined #RubyOnRails
[00:37:49] FailBit: and then ofc https://i.imgur.com/ix1ppP6.png
[00:37:53] LiquidInsect: has joined #RubyOnRails
[00:38:07] noodle: has joined #RubyOnRails
[00:38:16] mclee_: has joined #RubyOnRails
[00:40:09] lytol_: has joined #RubyOnRails
[00:40:30] cball: has joined #RubyOnRails
[00:40:46] chouhoulis: has joined #RubyOnRails
[00:40:46] ciree: has joined #RubyOnRails
[00:41:04] gerep: has joined #RubyOnRails
[00:42:31] podman: has joined #RubyOnRails
[00:42:31] null__: has joined #RubyOnRails
[00:42:31] cookiez: has joined #RubyOnRails
[00:42:32] podman: has joined #RubyOnRails
[00:42:38] cjk101010: has joined #RubyOnRails
[00:42:40] 6A4AAGS44: has joined #RubyOnRails
[00:42:58] null__: has joined #RubyOnRails
[00:43:42] ckinniburgh_: has joined #RubyOnRails
[00:44:27] cajone: has joined #RubyOnRails
[00:46:03] FailBit: love downloading 17MB of JSON
[00:49:06] cs44_: has joined #RubyOnRails
[00:52:28] tuelz: has joined #RubyOnRails
[00:53:39] tuelz: I've got a link_to with remote: true for UJS that when I click, it makes a GET the first time using the path helper I define without adding the query params, and then another time with the query params, any idea what's going on?
[00:53:59] totimkop1: has left #RubyOnRails: ()
[00:54:02] siemprefresco: has joined #RubyOnRails
[00:54:27] tuelz: `<%= link_to 'Some Link Text', some_path_helper_path(query_param: @data), remote: true %>`
[00:54:47] ProLoser_: has joined #RubyOnRails
[00:54:51] tuelz: so single click makes two requests
[00:55:14] goodcodeguy: has joined #RubyOnRails
[00:55:31] BlackCoyote: has joined #RubyOnRails
[00:55:53] bendangelo: has joined #RubyOnRails
[00:56:46] ziggurat81: has joined #RubyOnRails
[00:58:12] sevenseacat: has joined #RubyOnRails
[00:59:08] nettoweb: has joined #RubyOnRails
[00:59:38] tuelz: hmm just realized taking out jquery.ui.sortable fixes the problem....but I need it...hmm
[01:02:57] trbss: has joined #RubyOnRails
[01:04:32] baash05: I'm trying to construct an object with sub objects
[01:05:32] baash05: foo.new(foo_params)
[01:05:32] baash05: foo.add_options(foo_option_params)
[01:05:47] baash05: that's in the create action of a controller
[01:06:08] baash05: when I call foo.save I get undefined method `marked_for_destruction?' for 1:fixednum
[01:06:31] baash05: Anyone know where this is being called?
[01:09:15] tuelz: weird, so taking out jquery.ui.sortable OR jquery.ui.dialog fixes the problem, but if they are in together, double requests happen
[01:09:43] ziggurat81: baash05, is Foo an ActiveRecord class?
[01:10:14] FailBit: can you not use Foo , Bar etc here
[01:10:26] helpa: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[01:10:31] trbss: has left #RubyOnRails: ()
[01:10:36] annlewis: has joined #RubyOnRails
[01:11:17] ProLoser: has joined #RubyOnRails
[01:12:51] baash05: r = Reservation.new(res_params)
[01:12:51] baash05: r.add_options(res_options_params)
[01:14:27] baash05: def r.add_options(options) options.each { |option| reservation_options.build(option) } end
[01:15:04] baash05: That's all the code I'll add here.. I'll jist if there's more.
[01:16:38] boynt: has joined #RubyOnRails
[01:17:30] boynt: has left #RubyOnRails: ()
[01:17:58] FailBit: that leaves me feeling so confused
[01:18:05] apawl: has joined #RubyOnRails
[01:18:06] FailBit: I'm not sure what reservation_options is...
[01:18:15] sevenseacat: or res_options_params
[01:18:22] bonhoeffer: has joined #RubyOnRails
[01:18:41] apawl: I have a routing question. Normally when I hit a controller's methods, it's via an id (e.g apps/5)
[01:18:54] apawl: Is there a way to route to a method directly at apps?
[01:19:15] quazimodo: has joined #RubyOnRails
[01:19:18] FailBit: apawl: it's the controller's #index action
[01:19:18] apawl: I.e. I want to run on all apps, not just the one
[01:19:30] bonhoeffer: how can i make a virtual attribute that shows up from an active_record query
[01:19:37] FailBit: bonhoeffer: ?
[01:19:55] FailBit: what is a virtual attribute
[01:21:08] baash05: I'll write up a gist.
[01:21:12] apawl: FailBit: more than just index though. I don't want to list, but perform an action.
[01:21:19] bonhoeffer: def value self.name end
[01:21:27] bonhoeffer: attr_reader :value
[01:21:35] bonhoeffer: so u = User.first
[01:21:48] bonhoeffer: u.value produces the same as user name . . . etc
[01:22:09] Stuffness: has joined #RubyOnRails
[01:22:16] FailBit: bonhoeffer: I think you want alias_attribute :value, :name
[01:23:20] bonhoeffer: hmm . . . doesn???t seem to work
[01:24:04] apawl: For example, the sending a GET to /photos/new will call photos#new. I'd like to be able to send a GET to /apps/my_action, and call a method that impacts all apps
[01:25:03] FailBit: apawl: then I suppose, add a route for it and some controller actions
[01:25:13] Guest5: has joined #RubyOnRails
[01:25:28] baash05: Here we go.. reservation and reservation_controller
[01:25:31] baash05: https://gist.github.com/baash05/de1be821d49e7815d7ab
[01:25:32] apawl: FailBit: that's actually specifically what I'm asking. How can I router directly to a method like that?
[01:25:43] FailBit: resources :photos do
[01:25:55] FailBit: post 'foo', as: 'controllers#action'
[01:26:16] bonhoeffer: https://gist.github.com/tbbooher/32132d104ecf37e73c5e/
[01:26:18] apawl: and that enables GET -> photos/foo ?
[01:26:30] apawl: ok, thanks.
[01:27:06] yaymukund: has joined #RubyOnRails
[01:27:20] maz-dev: has joined #RubyOnRails
[01:27:29] maikowblue: has joined #RubyOnRails
[01:28:48] FailBit: bonhoeffer: for your _params method
[01:29:08] FailBit: er, baash05
[01:29:19] FailBit: try params.require(:reservation_options).permit([:option_id, :cost_in_cents])
[01:30:28] lampshades: has joined #RubyOnRails
[01:31:12] bonhoeffer: ha ??? i could do something like this: def attributes super.merge({'unfinished' => unfinished_items, 'finished' => finished_items}) end
[01:32:27] baash05: failbit.. You think it's the params that are passed?
[01:32:47] FailBit: not necessarily, but that permit you have is funky
[01:33:54] havenwood: has joined #RubyOnRails
[01:34:08] baash05: reservation = Reservation.new(reservation_params)
[01:34:09] baash05: reservation.add_options([{option_id: 1}])
[01:34:17] ferz_: has joined #RubyOnRails
[01:34:23] baash05: remove the params from the mix
[01:34:30] baash05: same error
[01:34:36] jenrzzz: has joined #RubyOnRails
[01:34:42] baash05: undefined method `marked_for_destruction?' for 1:Fixnum
[01:35:23] baash05: When I call reservation.save
[01:35:40] baash05: so it's not the params.. though I did fix them
[01:35:41] tjbiddle: has joined #RubyOnRails
[01:36:44] tjbiddle: Hey all - Curious on how to handle this. I have my javascript files included on the bottom of my application.html's body - And now I'm adding some in-view javascript on one of my pages, and jquery isn't included yet. Best way to handle this?
[01:36:54] tjbiddle: I'm happy to move my current in-view javascript elsewhere, just don't know where
[01:37:08] bonhoeffer: so by modifying as_json ??? Friend.first.to_json has the virtual attribute, but it doesn???t show up in /friends.json <??? any options
[01:37:09] jgt: has joined #RubyOnRails
[01:37:13] FailBit: tjbiddle: include application.js in the head
[01:37:29] FailBit: jquery will be included and compiled before page rendering starts
[01:37:32] fschuindt: has joined #RubyOnRails
[01:37:59] tjbiddle: FailBit: Is there an alternative? I'm using a WrapBoostrap theme and for whatever reason some things don't work unless it's included at the end - plus faster page-load times
[01:38:09] tjbiddle: Maybe a way to include jquery at the top and the rest at the bottom?
[01:38:37] FailBit: browsers are surprisingly good at compiling JS
[01:38:54] FailBit: so much so that compiling jquery will take only 100ms
[01:39:27] chipotle: has joined #RubyOnRails
[01:39:32] FailBit: now, if you have a crapload of other stuff in your app, then???
[01:40:06] tjbiddle: FailBit: Still is breaking one of my features though if I do that. No JS errors, just doesn't work. I only figured out that including it at the bottom fixed it by chance
[01:40:25] tjbiddle: FailBit: Loading it via <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
[01:40:28] s2013: has joined #RubyOnRails
[01:42:08] FailBit: it's interesting that your wrapbootstrap theme requires some weird placement
[01:42:22] ledestin: has joined #RubyOnRails
[01:42:24] FailBit: because with turbolinks you don't even have to care about JS compile times since it's only done once
[01:42:29] safetypin: has joined #RubyOnRails
[01:42:58] unholycrab: has joined #RubyOnRails
[01:42:58] tjbiddle: FailBit: Yeah =\ It's only one bit that doesn't work; the toggle that makes the navbar lock to the side of the page or not
[01:43:36] s2013: any generic tips on cutting down deployment time? currently it takes us 10-15 mins to deploy.. and we dont even run tests
[01:43:46] FailBit: s2013: woah
[01:43:51] FailBit: what are you doing in your deploy scripts
[01:43:55] FailBit: my deploy takes 25s
[01:44:03] tjbiddle: s2013: Define "deploy" - Just restarting the server?
[01:44:04] s2013: yea its ridiculous.. this whole app is garbage
[01:44:12] s2013: pushing new code to the server.. cap deploy
[01:44:29] sevenseacat: most of it is probably asset compilation
[01:44:43] FailBit: it might be helpful to post your config/deploy.rb (strip it of identifying info, if necessary)
[01:44:43] tjbiddle: Asset comp + bundler. Are you bundler gems in a shared directory?
[01:44:48] FailBit: and if you have a lot of assets that will hurt
[01:44:50] tjbiddle: It might be redownloading them everytime
[01:45:08] s2013: FailBit yeah ill do that.. not a huge deal. but im deploying something now so i figured id just talk about it while it deploys
[01:45:12] 64MADUT2J: has joined #RubyOnRails
[01:45:16] sevenseacat: I got used to 10-15min deploy times at my last job, they were just seen as 'a thing'
[01:45:20] ziggurat81: has joined #RubyOnRails
[01:46:18] cajone: has joined #RubyOnRails
[01:46:27] s2013: one sec let me paste something
[01:46:31] tjbiddle: FailBit: Ah - easy fix. The only function that wasn't working was the only one that wasn't in $(document).ready() :p
[01:46:41] tjbiddle: No idea why the dev had it placed outside
[01:46:51] tjbiddle: But works fine with it in
[01:46:56] FailBit: may want to file a PR against the lib
[01:47:01] FailBit: or at least open an issue of some sort
[01:47:51] s2013: https://gist.github.com/ss2k/141ac53200d00bb01004
[01:48:09] s2013: its the asset precompile
[01:48:15] s2013: what are ways to cut down on that
[01:48:24] FailBit: that's what takes the longest?
[01:48:39] FailBit: what rails ver
[01:48:59] s2013: its bunch of stuff. but thats one of the longest thing
[01:48:59] urbanmonk: has joined #RubyOnRails
[01:49:10] s2013: delayed job also takes couple of minutes
[01:49:24] FailBit: ls -R app/assets/ | wc -l
[01:50:55] FailBit: that explains much
[01:51:05] chipotle_: has joined #RubyOnRails
[01:51:39] sevenseacat: if you're using big libraries like ckeditor or tinymce, move them out of the pipeline
[01:51:49] sevenseacat: they're usually the culprits
[01:52:40] s2013: nah no huge library.. most of the files are in images folder.. i wonder maybe thats why
[01:53:21] s2013: yeah 447 is in images FailBit
[01:54:01] tjbiddle: Anyone have an opinion on using https://rails-assets.org/ for bower/JS/CSS management? I'm finding it really convenient - but wondering what best practices would say
[01:56:09] s2013: assets:precompile:if_changed maybe this might help hmm
[01:57:10] goodcodeguy: has joined #RubyOnRails
[01:58:40] diegoviola: http://imgur.com/qC3CLLH <- my new thinkpad is now windows free
[01:59:38] FailBit: tjbiddle: my issue with it is that I get duplicated assets everywhere and it's really weird
[02:01:29] tjbiddle: has joined #RubyOnRails
[02:03:00] workmad3: has joined #RubyOnRails
[02:04:14] chipotle: has joined #RubyOnRails
[02:05:04] lampshades: I tried to run kitchen create, and I get ' Message: Could not load the 'docker' driver from the load path. Please ensure that your driver is installed as a gem or included in your Gemfile if using Bundler.' on a mac
[02:05:08] s2013: FailBit hmm i updated my cap configuration file and now i get Errno::ENOENT: No such file or directory - /home/deploy/rails_apps/app/releases/20150916020503/config/database.yml
[02:05:20] s2013: i changed assets:precompile to assets:precompile:if_changed
[02:05:30] FailBit: well that's odd
[02:05:43] FailBit: I was not expecting anything to change
[02:06:06] choke: has joined #RubyOnRails
[02:06:16] s2013: me neither.. i reverted back. hpefully it deploys fine now.. :\
[02:06:18] baash05: Oh.. I found the error. It was in a validation in the reservation_options file
[02:07:19] havenwood: has joined #RubyOnRails
[02:07:41] s2013: seems like if i revert back to assets:precompile it deploys fine
[02:08:15] pwnd_nfsw: horray for simple_form
[02:09:01] sevenseacat: one of my insta-goto gems
[02:09:26] pwnd_nfsw: 99999 less code, plus frontend framework bootstraping
[02:09:47] s2013: its grrrrrrrrrr8
[02:09:48] sevenseacat: i should write a blog post about all of the insta-goto gems in my rails apps
[02:09:50] sevenseacat: ACTION makes note
[02:09:57] pwnd_nfsw: sevenseacat, not a bad idea
[02:10:01] s2013: i wrote a post a while back about top 10 useful gems
[02:10:04] pwnd_nfsw: Link me when/if you do
[02:10:05] towski_: has joined #RubyOnRails
[02:10:12] s2013: but it never got posted
[02:11:15] s2013: maybe i should post it.. i wrote about 20 blog posts but never posted them
[02:11:23] annlewis: has joined #RubyOnRails
[02:11:27] pwnd_nfsw: Maybe calls for an update
[02:11:34] s2013: nah this was from few weeks ago
[02:11:37] s2013: well summer
[02:12:19] lampshades: I made like 4 youtube vids but never posted them
[02:12:23] s2013: oh i made one too
[02:12:40] s2013: this was all for this company i was working with.. but didnt go as planned
[02:13:01] s2013: i made this tutorial video on how to build your own api using node.js
[02:13:08] horsecowdog: has joined #RubyOnRails
[02:13:27] sevenseacat: I'm just about to start a new rails app so I'll make the list then
[02:13:39] s2013: personal app?
[02:14:25] s2013: by any chance, anyone in south africa?
[02:16:02] sevenseacat: yeah personal app
[02:17:12] Maletor: has joined #RubyOnRails
[02:18:59] siempref_: has joined #RubyOnRails
[02:19:47] tuelz: has joined #RubyOnRails
[02:20:31] gambl0re: has joined #RubyOnRails
[02:27:27] baweaver: has joined #RubyOnRails
[02:27:39] bendangelo_: has joined #RubyOnRails
[02:29:22] yaymukund: has joined #RubyOnRails
[02:33:59] cjk101010: has joined #RubyOnRails
[02:34:07] draig: has joined #RubyOnRails
[02:34:19] podman: has joined #RubyOnRails
[02:34:19] null__: has joined #RubyOnRails
[02:34:29] cookiez: has joined #RubyOnRails
[02:34:34] draig: evening all
[02:34:48] chipotle_: has joined #RubyOnRails
[02:36:09] ecksit: has joined #RubyOnRails
[02:36:35] xcesariox: has joined #RubyOnRails
[02:36:35] draig: so im still fumbling my way into rails
[02:36:41] draig: i have devise setup
[02:37:14] draig: i'd like to make my page dynamic so it says welcome to your new foo if a user isnt logged in and just welcome to your foo if they are signed in
[02:37:30] draig: shouldnt this be possible?
[02:40:35] s2013: draig check for current_user
[02:41:19] FailBit: <%byte[]> when life gives you nil, make strings
[02:41:26] EminenceHC: has joined #RubyOnRails
[02:41:31] fschuindt: has joined #RubyOnRails
[02:41:55] draig: is there a way to use erb to inject strings?
[02:42:24] draig: (im pretty noob and am only now getting back into figuring things out from where i left off)
[02:43:09] FailBit: to inject strings?
[02:43:19] jgt: has joined #RubyOnRails
[02:43:43] stardiviner: has joined #RubyOnRails
[02:45:07] Rubie: has joined #RubyOnRails
[02:45:15] baweaver: FailBit: be nice.
[02:45:41] baweaver: draig: store it in a variable, though you probably want to read up on rails views a bit.
[02:45:48] FailBit: baweaver: erm?
[02:45:48] baweaver: what tutorials are you following?
[02:46:05] FailBit: sorry, I didn't mean to come off as rude...
[02:46:10] draig: none atm lol
[02:46:23] baweaver: draig: might be a good idea to go along one just to get a feel
[02:46:32] baweaver: otherwise you won't have much of a base to work off of.
[02:46:38] draig: dont worry, i get it. i was the same way to noobs to ios at y old job
[02:46:41] tjbiddle: has joined #RubyOnRails
[02:47:06] baweaver: doesn't necessarily make it a good thing
[02:48:03] FailBit: ACTION wonders how rude that was
[02:49:09] draig: i mean i know i should read up a bit more, but im super busy and working on 3 projects at once
[02:49:28] draig: a week ago i had something simmilar working but forgot the syntax
[02:50:03] draig: i'd like to inject an erb tag to return a string, inside of a <p> tag
[02:50:10] webguynow: has joined #RubyOnRails
[02:50:44] baweaver: http://guides.rubyonrails.org/layouts_and_rendering.html
[02:50:51] draig: something like <p>Welcome to your <%= if current_user then return "" else "new" => foo !</p>
[02:51:04] draig: ( but that renders in the output as is
[02:51:15] baweaver: return is inferred in ruby
[02:51:40] baweaver: also missing an end, though I'd just use a ternary there.
[02:52:04] FailBit: <%= "Welcome to your #{current_user ? "" : "new"} foo!" %>
[02:52:39] draig: so the #{} is a hash isnt it?
[02:52:44] baweaver: either way works, though I'd really consider reading through an erb tutorial
[02:52:50] baweaver: and a ruby tutorial if that's foreign
[02:53:02] sevenseacat: #{} is string interpolation
[02:53:03] baweaver: string interpolation
[02:53:26] draig: its sort of forreign, but i did a bit of it using frank-cucmber for UATs on ios a while back
[02:53:30] baweaver: if you don't recognize that one it would definitely be a good idea to go through some ruby tutorials to get some grounding.
[02:53:39] draig: cools, thats what i was looking for how to do string interpolation
[02:53:39] chipotle: has joined #RubyOnRails
[02:53:44] ngscheurich: has joined #RubyOnRails
[02:53:54] helpa: 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
[02:54:05] Rubie: has joined #RubyOnRails
[02:54:05] baweaver: sevenseacat: that covers basic ruby or no?
[02:54:11] helpa: Learn Ruby by reading this book - http://manning.com/black3 - The Well-Grounded Rubyist by David A. Black
[02:54:36] FailBit: and there's always Why's
[02:55:37] baweaver: Sounds poignant
[02:55:54] lwu_: has joined #RubyOnRails
[02:56:55] FailBit: Rubies are pointy.
[02:58:01] sevenseacat: and CHUNKY BACON oh wait
[02:58:07] iateadonut: has joined #RubyOnRails
[02:58:15] draig: i thought i liked rubymine
[02:58:23] draig: but now its seeming lame
[02:58:39] draig: (wishes xcode did ruby)
[02:58:39] s2013: any of you do much data analysis
[02:58:46] s2013: just use sublime draig
[02:59:10] draig: it is sayign there are erros but i cant figure out how to get it to show them to me
[02:59:21] s2013: what is yoru error
[02:59:25] draig: Xcode lists them nicely, and you just click and it takes you to them
[02:59:28] s2013: gist.github.com <-- pate your code there
[02:59:36] draig: not sure, i cant figure out how to see it
[02:59:44] sevenseacat: you do have to take the time out to learn how to use your IDE.
[02:59:48] sevenseacat: if you choose to use an IDE.
[02:59:59] s2013: what do you use sevenseacat
[03:00:01] s2013: vim? emacs?
[03:00:03] FailBit: <s2013> any of you do much data analysis <- does using elastic to make histograms count
[03:00:10] s2013: counts enough FailBit
[03:00:24] mrtomme: has joined #RubyOnRails
[03:00:32] s2013: i use python.. mostly numpy and pandas
[03:00:55] s2013: so you use logstash FailBit right?
[03:01:01] draig: yeah im goign back to atom, rubymine crashed trying to make the gist for me
[03:01:08] btreeinfinity: has joined #RubyOnRails
[03:01:18] FailBit: we use elastic for searching things in-app
[03:01:30] FailBit: log storage is minimal and irrelevant for us
[03:02:04] s2013: im surpsied our app loads relatively fast.. considering the amount of shitty code in it
[03:02:15] sevenseacat: you should fix that.
[03:02:31] sevenseacat: instead of bragging about how bad it is.
[03:02:35] s2013: yeah.. there are like million things on the plate
[03:02:40] s2013: how do you brag about bad things
[03:02:50] FailBit: I'm trying to knock down this page that's rendering 20ms
[03:02:55] draig: https://gist.github.com
[03:03:41] draig: https://gist.github.com/jhoughjr/b46d9f65f14ac6a6ddb5
[03:03:52] bmurt: has joined #RubyOnRails
[03:04:04] draig: are you in prod? 20 ms seems normal from what ive seen in dev
[03:04:10] sevenseacat: thats not what FailBit said to do
[03:04:14] s2013: 20ms is reeally good
[03:04:23] s2013: draig that looks really wrong
[03:04:29] draig: lol im sure it does
[03:04:30] sevenseacat: [10:52:03] FailBit: <%= "Welcome to your #{current_user ? "" : "new"} foo!" %>
[03:05:08] draig: and any html would go in the string derp
[03:05:16] s2013: http://stackoverflow.com/questions/4252936/how-do-i-use-the-conditional-operator-in-ruby read this draig
[03:05:24] s2013: you need to learn how to use the ternary operator
[03:05:26] helpa: Learn Ruby by reading this book - http://manning.com/black3 - The Well-Grounded Rubyist by David A. Black
[03:06:26] chipotle_: has joined #RubyOnRails
[03:10:35] braincrash: has joined #RubyOnRails
[03:10:49] qejk: has joined #RubyOnRails
[03:11:46] chipotle: has joined #RubyOnRails
[03:12:07] annlewis: has joined #RubyOnRails
[03:12:18] baweaver: s2013: Spark, Scala, and some of the like in Big Data land.
[03:14:06] webguynow: has joined #RubyOnRails
[03:15:38] choke: has joined #RubyOnRails
[03:15:50] chipotle_: has joined #RubyOnRails
[03:16:43] erichu: has joined #RubyOnRails
[03:18:36] chipotle: has joined #RubyOnRails
[03:19:49] Rubie: has joined #RubyOnRails
[03:21:03] siemprefresco: has joined #RubyOnRails
[03:21:13] webguynow: has joined #RubyOnRails
[03:23:18] fschuindt: has joined #RubyOnRails
[03:23:19] dopamean_: has joined #RubyOnRails
[03:24:12] chipotle: has joined #RubyOnRails
[03:26:53] darrencauthon: has joined #RubyOnRails
[03:27:02] pontiki: has joined #RubyOnRails
[03:29:12] mary5030: has joined #RubyOnRails
[03:29:58] mwlang: has joined #RubyOnRails
[03:30:05] yaymukund: has joined #RubyOnRails
[03:30:26] webguynow: has joined #RubyOnRails
[03:31:39] ProLoser: has joined #RubyOnRails
[03:35:20] mwlang: dumb question time: So I decided to try out Turnip with my brand new RoR4 app. I got it and capybara going just fine. Trouble is, I???m not quite sure what to write into the steps???.
[03:35:29] toxicbet4: has joined #RubyOnRails
[03:35:40] sevenseacat: the implementation of whatever the step says to do
[03:35:43] mwlang: For example: ???Then I see the post???s content???
[03:36:02] sevenseacat: in that example, you might check the page's content for the content you're expecting to see
[03:36:13] greengriminal: has joined #RubyOnRails
[03:36:15] mwlang: I???m guessing I put a typical expect(content).to include ???<h1>Post Title</h1>"
[03:36:16] sevenseacat: eg. expect(page).to have_content("My post title")
[03:36:47] mwlang: so where is ???page??? and ???have_content??? documented?
[03:37:31] sevenseacat: have_content is an rspec matcher that calls capybaras's has_content?
[03:37:36] sevenseacat: page is also a capybara method
[03:37:56] mwlang: ah???so I need to be digging into capybara???s docs???that???s what I wasn???t sure about.
[03:38:07] chipotle_: has joined #RubyOnRails
[03:38:15] sevenseacat: i wouldnt advise digging into too many new things at once
[03:38:26] sevenseacat: eg. adding turnip to your feature tests if you don't know how to do them yet
[03:38:44] mwlang: sevenseacat: well the sole purpose is to figure out how to do ???em. :-)
[03:38:54] sevenseacat: ok, so ignore turnip for nowq
[03:38:56] sevenseacat: learn capybara
[03:39:07] pontiki: i'm unfamiliar with turnip
[03:39:21] rhizome: sounds cukey
[03:39:30] NBarnes: has joined #RubyOnRails
[03:39:40] mwlang: I just didn???t want cucumber.
[03:39:49] mwlang: I???m an rspec kinda guy.
[03:39:49] sevenseacat: is one of the 'lets not make all of our cucumber steps global' fixers
[03:39:57] sevenseacat: so use rspec for your feature tests
[03:40:30] rhizome: only learn cucumber if someone who is paying you requires it
[03:40:33] mwlang: hmm???straight up rspec and capybara works?
[03:40:46] Lytol: has joined #RubyOnRails
[03:40:54] mwlang: well, golly gee
[03:41:05] s2013: i never really learned cucumber
[03:41:11] s2013: mostly cause i coudlnt get it to work so i said screw it
[03:41:28] sevenseacat: why aren't I surprised
[03:41:37] huck5: has joined #RubyOnRails
[03:41:41] s2013: i dont know. you tell me
[03:42:28] dima_: has joined #RubyOnRails
[03:42:30] baweaver: mwlang: cucumber always felt like a nicety step for PMs or testers than an actual dev framework.
[03:42:47] baweaver: unnecessary abstraction in my opinion, but to each their own.
[03:42:58] pontiki: gherkin is the language of business analysts
[03:43:16] sevenseacat: i can see a use case for gherkin. it's one no-one ever used, though
[03:43:16] mwlang: baweaver: yeah, I agree. I???m mostly just exploring options.
[03:43:17] baweaver: sounds like something that lives under a bridge
[03:43:22] Lytol: has joined #RubyOnRails
[03:43:35] sevenseacat: I've never seen a test written by anyone other than a dev
[03:43:38] baweaver: which I suppose is an apt description of most people in marketing at least.
[03:43:53] baweaver: sevenseacat: super-big companies do.... interesting things.
[03:44:05] pontiki: one client's BA wrote gherkin acceptance tests
[03:44:07] jgt: has joined #RubyOnRails
[03:44:09] sevenseacat: I've never worked for one of those, so
[03:44:23] baweaver: count yourself lucky
[03:44:32] pontiki: i've worked with several BA types that speak something akin to gherkin
[03:44:50] mwlang: I???ve had two or three clients write cucumber scenarios. I just wasn???t the one writing the step implementations on those projects.
[03:45:10] pontiki: user stories also tend to be gherkin-ish
[03:45:37] pontiki: i've *never* seen anyone but a dev/qa eng write steps and support code
[03:45:59] mwlang: This customer wants to write documentation, but really don???t want to go that route.
[03:46:00] s2013: oh man big companies give me the hibbie jibbies
[03:46:22] s2013: i am doing consulting with a huge multinational.. and the amount of protocols you have to follow..
[03:46:38] mwlang: if we???re going to do documentation, it should be ???living docs??? not static content stuffed into a MS-Word file to only be read once.
[03:46:52] pawnbox: has joined #RubyOnRails
[03:47:49] s2013: thats better than a lot of documentations out there mwlang
[03:48:00] s2013: better than fragmented emails with no subject lines heh
[03:48:39] mwlang: heh???how about emails that the subject line is never changed by the BA? ??? always a reply (even on totally different topic) to an old email.
[03:49:07] mwlang: I asked him one day why he never started new emails and he asked me, ???I can start a new email????
[03:49:18] gambl0re: how do i write this in haml <p>Submitted by: <%= @user.username %></p>
[03:49:30] s2013: %p Submitted by: #{@user.username}
[03:49:52] mwlang: p = ???Submitted by #{@user.username}???
[03:50:27] mwlang: meh???mangling my syntaxes.
[03:50:46] wldcordeiro_: has joined #RubyOnRails
[03:51:02] pawnbox: has joined #RubyOnRails
[03:51:05] roxtrongo: has joined #RubyOnRails
[03:51:37] mwlang: hmmm???does capybara???s page and have_content not have the HTML tags?
[03:51:47] Creeves: has joined #RubyOnRails
[03:51:48] workmad3: has joined #RubyOnRails
[03:51:48] sevenseacat: html tags arent content, theyre markup.
[03:52:45] mwlang: sevenseacat: so how do I grab a bullet list? i.e. <ul><li>one</li><li>two</li><ul> ???
[03:52:56] sevenseacat: grab how? why?
[03:53:24] webguynow: has joined #RubyOnRails
[03:53:41] baweaver: normally by using a css selector
[03:53:56] mwlang: in this case, I have a related_posts partial and I want to ensure the two related posts I created appear for the post???s content.
[03:54:08] baweaver: in protractor / webdriver syntax it'd be element.all(by.css('ul li'))
[03:54:29] sevenseacat: not sure why you need to 'grab a bullet list' for that. just make sure some selector includes the content.
[03:54:30] baweaver: which is annoying unless you have foresight to label your areas
[03:55:00] mwlang: Ah. yeah, I label ???em. semantic styling and all that jazz.
[03:55:05] sevenseacat: https://github.com/jnicklas/capybara#scoping
[03:55:40] SteenJobs: has joined #RubyOnRails
[03:56:14] Rubie: has joined #RubyOnRails
[03:56:26] mwlang: yeah, I need to swim in capybara???s docs for a while.
[03:56:56] jenrzzz: has joined #RubyOnRails
[03:58:32] yardenbar: has joined #RubyOnRails
[03:59:00] mary5030: has joined #RubyOnRails
[03:59:18] NBarnes: has joined #RubyOnRails
[04:00:55] webguynow: has joined #RubyOnRails
[04:04:12] pawnbox_: has joined #RubyOnRails
[04:04:14] dima_: has joined #RubyOnRails
[04:05:22] moei: has joined #RubyOnRails
[04:08:20] webguynow: has joined #RubyOnRails
[04:08:40] charliesome: has joined #RubyOnRails
[04:09:30] petricore: has joined #RubyOnRails
[04:09:52] mwlang: I know non-windows devs love to knock down windows developers, but geez: ???If you???re on Windows, or just not sure, _download and run the installer._???
[04:12:56] annlewis: has joined #RubyOnRails
[04:17:08] yfeldblum: has joined #RubyOnRails
[04:17:28] gambl0re: i want to create a link to a sign up page on a show page
[04:17:53] gambl0re: but when i put the link it ends up as /posts/new_user_registration
[04:18:03] gambl0re: instead of /users/new_user_registration
[04:18:04] srinidhi: has joined #RubyOnRails
[04:19:49] sevenseacat: some code might help
[04:20:30] tuelz: has joined #RubyOnRails
[04:21:52] gambl0re: https://gist.github.com/anonymous/15f2d538deb922a30df1
[04:22:14] gambl0re: the link url ends up as http://localhost:3000/movies/users/new_user_registration_path
[04:22:24] gambl0re: which is obviously incorrect
[04:22:28] sevenseacat: because thats exactly what you're telling your view to spit out
[04:22:38] sevenseacat: you're not telling Rails to get involved at all
[04:23:02] sevenseacat: typically in Rails you would use link_to to generate links, and use named routes for the link destination
[04:23:20] sevenseacat: eg. link_to "Sign up to leave a comment", new_user_registration_path
[04:25:30] gambl0re: = link_to "Sign up", new_user_registration_path
[04:25:41] webguynow: has joined #RubyOnRails
[04:25:59] gambl0re: that works but how would i make it so that the "sign up" is the link and "to leave a comment" is regular text
[04:26:10] sevenseacat: don't put it as part of the text for the link
[04:26:13] sevenseacat: just like that
[04:30:27] brnpcn: has joined #RubyOnRails
[04:31:22] sevenseacat: your code there doesn't have that text as part of the link
[04:31:31] gambl0re: https://gist.github.com/anonymous/5c8272e6d0814e79cecf
[04:31:38] gambl0re: thats what i tried...not working
[04:31:54] sevenseacat: that puts the "to leave a comment" text outside the paragraph
[04:31:54] baash05: has joined #RubyOnRails
[04:32:32] gambl0re: i put an indentation and still not working
[04:32:37] lampshades: Ive slowly getting into CI, and boy there is a lot of ways of doing it.. and so much outdated stuff its really hard to pinpoint whats the right way of doing it
[04:32:43] baash05: has joined #RubyOnRails
[04:32:46] baash051: has joined #RubyOnRails
[04:32:49] gambl0re: how do i make it so that its inside the p
[04:32:54] lampshades: what are some common ways you see CI done nowadays?
[04:33:22] baash05: has joined #RubyOnRails
[04:33:24] sevenseacat: gambl0re: you have to indent it inside the %p
[04:34:04] Rubie: has joined #RubyOnRails
[04:34:14] gambl0re: https://gist.github.com/anonymous/a161887d377f3864d11c
[04:34:19] sevenseacat: http://haml.info/docs/yardoc/file.REFERENCE.html#plain_text
[04:34:25] agent_white: has joined #RubyOnRails
[04:34:36] sevenseacat: thats a syntax error because you have said that the link is the only content of the $p
[04:34:46] sevenseacat: by putting it on the same line
[04:35:01] sevenseacat: perhaps try erb? its a lot more forgiving with syntax
[04:35:12] sevenseacat: and good for people who don't like reading the documentation
[04:35:37] mwlang: weird???so I tried to do the capybara test without turnip
[04:36:39] mwlang: straight up rspec and I create my Post with factory girl and then attempt to visit the page, but I can see in the logs that right before visit is called, rollback on savepoint executes, thus tossing the fixture out before I hit the page.
[04:36:47] gambl0re: https://gist.github.com/anonymous/01b0df7dccd5310ebce8
[04:36:51] webguynow: has joined #RubyOnRails
[04:37:22] sevenseacat: gambl0re: does it work?
[04:37:23] gambl0re: i dont know why indentation in the gist is so wide but i got it to work
[04:37:37] tjbiddle: has joined #RubyOnRails
[04:37:52] quazimodo: someone in my office today asked me if errors.add would cause a model to become invalid
[04:38:18] quazimodo: so I tried, i'd never added errors via a normal method (always through validations) and i found that it deosn't affect validity
[04:38:24] sevenseacat: quazimodo: indeed.
[04:38:44] sevenseacat: because calling valid? will clear all errors and re-run validations
[04:38:58] quazimodo: sevenseacat: yep, that's what I thought and it makes sense
[04:39:11] mwlang: but I think there???s a has_errors? that would then be ???true??? in such a case.
[04:43:06] mwlang: hmmm???there isn???t a has_errors? no idea where I got that from???however, errors.any? does become true if you manually add an error.
[04:43:08] Lytol: has joined #RubyOnRails
[04:43:12] baash05: has joined #RubyOnRails
[04:43:20] mwlang: but #invalid? or #valid? re-validates.
[04:43:38] tejasmanohar: has joined #RubyOnRails
[04:43:46] mary5030: has joined #RubyOnRails
[04:46:23] mloy: has joined #RubyOnRails
[04:46:31] Guest5: has joined #RubyOnRails
[04:46:42] mwlang: geez. It appears the DatabaseCleaner and capybara don???t get along well in rspec world.
[04:48:57] mary5030: has joined #RubyOnRails
[04:49:05] sevenseacat: mwlang: then in the fine words of someone else, 'you're doing it wrong'
[04:49:12] sevenseacat: they get along fine, they're completely unrelated.
[04:50:10] mwlang: sevenseacat: looks like it???s specifically this one: config.before(:each) { DatabaseCleaner.start }
[04:50:22] sevenseacat: definitely doing something wrong.
[04:50:55] webguynow: has joined #RubyOnRails
[04:51:22] mwlang: hmmm???what do you see that I don???t?
[04:51:34] sevenseacat: well you see a lot of things I don't, like what specifically the problem is
[04:51:43] sevenseacat: 'dont get along well' isnt something we can solve without further information
[04:51:49] mwlang: true be told, I got the config how-to from http://tomdallimore.com/blog/taking-the-test-trash-out-with-databasecleaner-and-rspec/
[04:52:10] sevenseacat: get a more recent config from the database cleaner readme
[04:52:21] fedexo: has joined #RubyOnRails
[04:52:28] sevenseacat: don't rely on random year-old blog posts
[04:52:36] mary5030_: has joined #RubyOnRails
[04:52:38] toxicbet4: has left #RubyOnRails: ("Saliendo")
[04:54:54] crdpink: has joined #RubyOnRails
[04:55:07] mary5030: has joined #RubyOnRails
[04:55:17] mwlang: heh???the test suite started more than a year ago???its capybara???s that???s new.
[04:55:27] mwlang: but I???ll go check the latest README
[04:55:43] webguynow: has joined #RubyOnRails
[04:55:44] krz: has joined #RubyOnRails
[04:55:54] ChadyG_: has joined #RubyOnRails
[04:57:05] jas02: has joined #RubyOnRails
[04:57:45] mwlang: ???If you're using Capybara with RSpec and using an external browser (not using RackTest) you'll almost certainly need to use truncation rather than transactions???
[04:57:46] sevenseacat: well, not sure what else you want me to say. you've posted a single line of code with no errors and no visible problem.
[04:59:01] Rubie: has joined #RubyOnRails
[04:59:10] mwlang: sevenseacat: you said ???nuf. The solution was read the README.
[04:59:10] tjbiddle: Anyone know of a way to speed up simple_fields_for for simple_form? It adds an extra 3 seconds to page load time
[04:59:26] mwlang: which led me to change clean method to truncation.
[04:59:48] sevenseacat: http://sevenseacat.net/2015/02/01/use_database_cleaners_deletion_strategy.html also somewhat relevant
[04:59:49] mwlang: The above quote was from the readme.
[05:00:09] tjbiddle: Example: https://gist.github.com/thomasbiddle/2d7ffc73858b3b7f9f1a
[05:00:35] pawnbox: has joined #RubyOnRails
[05:00:35] mwlang: sevenseacat: I had written the gist then after reading the readme, figured it wasn???t worth posting, but here it is: https://gist.github.com/mwlang/78a82088bb38521c6b8b
[05:03:04] webguynow: has joined #RubyOnRails
[05:05:48] wldcordeiro_: has joined #RubyOnRails
[05:06:12] bruno-: has joined #RubyOnRails
[05:06:27] melonstorm: has joined #RubyOnRails
[05:10:09] maikowblue: has joined #RubyOnRails
[05:11:47] pawnbox: has joined #RubyOnRails
[05:13:30] pawnbox: has joined #RubyOnRails
[05:13:44] annlewis: has joined #RubyOnRails
[05:15:42] ecksit: has joined #RubyOnRails
[05:19:55] n008f4g_: has joined #RubyOnRails
[05:20:01] mwlang: can I use ???within(:xpath, 'actual_xpath') do??? when doing expectations or is this only for filling out forms?
[05:20:57] wldcordeiro_: has joined #RubyOnRails
[05:21:03] sevenseacat: try it and see
[05:25:49] wethu: has joined #RubyOnRails
[05:27:23] dhjondoh: has joined #RubyOnRails
[05:28:35] mwlang: ok, that???s just way too cool.
[05:28:36] crystal77: has joined #RubyOnRails
[05:29:33] maz-dev: has joined #RubyOnRails
[05:29:45] mwlang: turnip is tossed. capybara + poltergeist + rspec == rock my world in a good way today.
[05:31:09] sandstrom: has joined #RubyOnRails
[05:31:18] codenapper: has joined #RubyOnRails
[05:35:03] dhjondoh1: has joined #RubyOnRails
[05:36:57] dionysus69: has joined #RubyOnRails
[05:37:17] webguynow: has joined #RubyOnRails
[05:37:19] sinkensabe: has joined #RubyOnRails
[05:40:28] aganov: has joined #RubyOnRails
[05:40:35] workmad3: has joined #RubyOnRails
[05:40:49] rickmasta: has joined #RubyOnRails
[05:43:19] SteenJobs: has joined #RubyOnRails
[05:43:37] rushed: has joined #RubyOnRails
[05:44:05] yardenbar: has joined #RubyOnRails
[05:45:21] konsolebox: has joined #RubyOnRails
[05:46:25] SteenJobs_: has joined #RubyOnRails
[05:47:43] ElSif: has joined #RubyOnRails
[05:48:54] mission712_: has joined #RubyOnRails
[05:51:23] webguynow: has joined #RubyOnRails
[05:54:39] liquid-silence: has joined #RubyOnRails
[05:55:10] beast_: has joined #RubyOnRails
[05:58:26] duncannz: has joined #RubyOnRails
[05:59:22] tagrudev: has joined #RubyOnRails
[05:59:44] jgt: has joined #RubyOnRails
[06:00:53] krz: has joined #RubyOnRails
[06:02:45] mordocai: has joined #RubyOnRails
[06:03:37] solars: has joined #RubyOnRails
[06:03:53] rakm: has joined #RubyOnRails
[06:05:41] mary5030: has joined #RubyOnRails
[06:05:53] webguynow: has joined #RubyOnRails
[06:10:59] eGGsha: has joined #RubyOnRails
[06:14:27] annlewis: has joined #RubyOnRails
[06:14:54] hayricicek: has joined #RubyOnRails
[06:16:29] webguynow: has joined #RubyOnRails
[06:18:12] MartinElvar: has joined #RubyOnRails
[06:18:50] kh0d: has joined #RubyOnRails
[06:19:08] iamse7en: has joined #RubyOnRails
[06:19:32] xcesariox: has joined #RubyOnRails
[06:19:55] FooBarWidget: has joined #RubyOnRails
[06:20:13] LBRapid: has joined #RubyOnRails
[06:20:22] twohlix: has joined #RubyOnRails
[06:21:03] Emily: has joined #RubyOnRails
[06:21:15] tuelz: has joined #RubyOnRails
[06:22:06] xcesariox: has joined #RubyOnRails
[06:22:51] widith_: has joined #RubyOnRails
[06:23:09] sinkensabe: has joined #RubyOnRails
[06:24:29] SteenJobs: has joined #RubyOnRails
[06:25:53] Olipro: has joined #RubyOnRails
[06:28:52] srinidhi: has joined #RubyOnRails
[06:31:13] Lytol: has joined #RubyOnRails
[06:33:59] dhjondoh1: has joined #RubyOnRails
[06:34:28] webguynow: has joined #RubyOnRails
[06:35:18] krz: has joined #RubyOnRails
[06:36:05] mordocai: has joined #RubyOnRails
[06:36:14] arup_r: has joined #RubyOnRails
[06:40:08] rhizome: pre HMT: http://respectip.com/stuff/ARAssociations.png
[06:40:09] yottanami: has joined #RubyOnRails
[06:42:10] duncannz: has joined #RubyOnRails
[06:42:10] Macaveli: has joined #RubyOnRails
[06:43:09] duncannz: has joined #RubyOnRails
[06:44:04] wilsonArteaga: has joined #RubyOnRails
[06:44:09] duncannz: has joined #RubyOnRails
[06:44:36] wilsonArteaga: has left #RubyOnRails: ()
[06:45:06] darkhex: has joined #RubyOnRails
[06:46:39] pawnbox_: has joined #RubyOnRails
[06:46:54] johnflux: has joined #RubyOnRails
[06:46:56] yottanami: I used Net::HTTP::Post to send a post request to another site and I got response #<Net::HTTPOK 200 OK readbody=true>
[06:47:01] wilsonArteaga: has joined #RubyOnRails
[06:47:12] yottanami: How should i render it as user output?
[06:47:17] rushed: yottanami: what are you trying to do?
[06:47:24] yottanami: The response.body contains HTML
[06:47:45] yottanami: rushed, sending Post information to another site and recieving the response
[06:48:23] skullcrasher: has joined #RubyOnRails
[06:49:28] jgt: has joined #RubyOnRails
[06:50:11] arup_r: yottanami: response.body.html_safe ?
[06:51:56] yottanami: arup_r, The problem is I can render with respond_to but it can not show images and CSS (because it is not on that Domain)
[06:52:11] rushed: yottanami: what are you trying to do?
[06:52:19] yottanami: arup_r, I want to simulate a post form (redirect after submit)
[06:53:01] baweaver: All you need to say after a post request is that it succeeded.
[06:53:08] arup_r: rushed: He is implementing payment gateway I think
[06:53:21] arup_r: yottanami: baweaver is correct.
[06:53:37] baweaver: didn't we say this was an awful idea before?
[06:53:50] arup_r: and depending on the response status make your own page ?
[06:54:12] yottanami: arup_r, yes I need to send some parameters by post and it will return another form that ask for user information
[06:54:19] baweaver: Anything to do with payment or auth, do not make unless you dead have to.
[06:54:36] Balzrael: has joined #RubyOnRails
[06:54:36] baweaver: and if you have to ask questions on how to do it, then flat out don't
[06:54:45] yottanami: arup_r, response is #<Net::HTTPOK 200 OK readbody=true>
[06:54:58] finnnnnnnnnnn: has joined #RubyOnRails
[06:55:16] sevenseacat: we sure did say it was a terrible idea
[06:56:01] baweaver: and yet, here we are, apparently still working on it
[06:56:23] baweaver: yottanami: I'm serious, this is a bad idea.
[06:56:32] arup_r: Genrally those payment gateways I worked on has their own interface.. send the user securely there.. and they will handle stuff and then send the response back to you after done.
[06:57:00] arup_r: there process is different.. although..
[06:57:19] baweaver: arup_r: with this type of thing, you really really really want to use something already made.
[06:57:33] yottanami: baweaver, Yes you told me and I know this is bad idea but I have to handle it
[06:57:34] arup_r: No. if it is made .. I would not recode
[06:57:47] sevenseacat: authentication and payment are indeed two things you leave to the professionals.
[06:58:10] baweaver: and by professional, that means staff level engineers with some serious chops
[06:58:17] arup_r: baweaver: I had to do some gateways BillDesk, Knet etc they are not there in ActiveMerchant
[06:58:25] arup_r: so I wrote my own code..
[06:58:27] baweaver: maybe a few senior types might go at it, but that'd be iffy
[06:58:34] sevenseacat: I would never consider it.
[06:58:35] arup_r: following their manual
[06:58:52] yottanami: arup_r, Yes this gateway have own interface too but the problem is redirecting to interface domain after posting data
[06:59:04] chuy: has joined #RubyOnRails
[06:59:12] arup_r: No idea... I have
[06:59:20] rushed: yottanami: what gateway?
[06:59:27] baweaver: I do, but I cannot justify helping this
[06:59:30] arup_r: ^^ releavnt question
[06:59:52] arup_r: yottanami: say us the pG name as rushed asked
[07:00:13] yottanami: arup_r, It is not a public payment system
[07:00:15] arup_r: maybe some one worked on already and would give you some tips.
[07:00:17] greenarrow: has joined #RubyOnRails
[07:00:26] arup_r: yottanami: :) O i see
[07:00:51] rushed: well that's not shady at all~
[07:01:12] yottanami: arup_r, you know, when we set an action to a form and post method, it will send and request and will redirect to the action URL.
[07:01:21] baweaver: If you don't even know about redirects, you need to stop
[07:01:28] yottanami: but when we use Net::HTTP it will send but not redirect to new url
[07:01:37] baweaver: I'm almost tempted to kick you from the channel so you don't screw yourself over like this
[07:01:50] Linuus: has joined #RubyOnRails
[07:02:16] yottanami: baweaver, If the response be redirect I can handle page to redirect but when the response is 200 and I got html output where should I redirect?
[07:02:22] sevenseacat: yottanami: you told us the response wasnt a redirect, so I'm not sure you know what is going on
[07:02:31] webguynow: has joined #RubyOnRails
[07:02:56] rushed: yottanami: use a client like https://github.com/sparklemotion/mechanize as opposed to raw Net:HTTP or, you know, don't do that and reconsider wtf is going on~
[07:03:12] sevenseacat: it definitely sounds like something not quite right is going on.
[07:03:48] arup_r: baweaver: teaching if he don't understand is a good idea, not kicking..
[07:04:23] yottanami: sevenseacat, Yes it is HTTPOK 200 OK readbody=true. but in real form submiting it will redirect to action url
[07:04:31] sevenseacat: there are better places to learn the basics about how the internet works, where you're not handling people's money
[07:04:37] sevenseacat: real form? as opposed to a fake form?
[07:05:09] sevenseacat: submitting a form doesn't 'redirect' anywhere
[07:05:37] baweaver: arup_r: when someone refuses to listen to clear warnings that will likely land them in a lawsuit, kicking may be the only way to make them reconsider.
[07:06:32] sevenseacat: hell, screwing up when handling money can leave you in jail.
[07:06:34] arup_r: others might have more patience ... so if it is annoying .. then just ignore .. it is a good idea.
[07:06:44] yottanami: guys I know you want to help me and thanks for helps
[07:06:48] baweaver: arup_r: it's not a matter of patience.
[07:07:00] johnflux: I do: <%= link_to "Upload new image", {controller: 'images_modal', action: 'new'}, data: { toggle: "modal", target: "#ajax-modal" } %>
[07:07:09] johnflux: to bring up a modal dialog letting the user add a new image
[07:07:13] baweaver: it's a matter of serious consequence that could screw over yottanami in the future, so we're warning them
[07:07:21] yottanami: I dont want to do fake or something like that, But I have to simulate a form submit
[07:07:25] johnflux: but how can I run some function when the user closes the modal dialog
[07:07:26] webguynow: has joined #RubyOnRails
[07:07:33] johnflux: to get the image that was added
[07:07:34] arup_r: I know baweaver, you are ture..
[07:07:38] johnflux: and do something with it on that page?
[07:08:16] rhizome: johnflux: redirect to the show action for that image
[07:08:26] baweaver: either way, bed time for me. I'm serious yottanami, look for something prebuilt, this is way above your head and will lead to serious trouble down the road. Mark my workds.
[07:08:47] johnflux: rhizome: I want to get the url for that image, and insert it into a text box
[07:09:54] rhizome: image_url(yourimage)
[07:10:11] baweaver: yottanami: please say you've turned on ssl/https at least.
[07:10:48] mordocai: has joined #RubyOnRails
[07:11:09] yottanami: baweaver, Yes it is over ssl and it is on local network
[07:11:31] rhizome: johnflux: hopefully your model isn't called Image
[07:12:07] finnnnnnnnnnn: has joined #RubyOnRails
[07:13:03] MartinElvar: has joined #RubyOnRails
[07:13:41] johnflux: rhizome: I have Pages and Images. When you make a Page, you get a textbox for the markup for that page. There's a button to insert an Image, which brings up a modal dialog for images/new
[07:14:27] johnflux: rhizome: this works, but now when you create the Image and the modal box closes, how to get that to then insert the url for the image into the Page
[07:14:39] rhizome: define "that"
[07:15:14] annlewis: has joined #RubyOnRails
[07:15:24] baash05: Hey guys.. back again
[07:15:37] helpa: We're not all guys here - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[07:15:55] johnflux: rhizome: I'm not sure. Ideally the views/pages/_form.html.erb should have some function which runs when the modal dialog closes
[07:15:56] baash05: How about peeps
[07:16:19] johnflux: rhizome: and has a way to get the Image that was just created
[07:16:46] baash05: Hey all you wild and crazy rails people :D
[07:16:57] baash05: I'm trying to use rspec_api_documentation
[07:17:27] baash05: I'm wondering if anyone here has used it because I'm trying to figure out how to structure parameters
[07:17:48] baash05: the scoping aspect is a bit hard to get working.
[07:20:29] moeabdol: has joined #RubyOnRails
[07:22:47] pawnbox: has joined #RubyOnRails
[07:24:56] sinkensabe: has joined #RubyOnRails
[07:24:57] eGGsha: has joined #RubyOnRails
[07:24:57] cjk101010: has joined #RubyOnRails
[07:25:24] solars: has joined #RubyOnRails
[07:25:24] tagrudev: has joined #RubyOnRails
[07:25:24] iateadonut: has joined #RubyOnRails
[07:25:24] cookiez: has joined #RubyOnRails
[07:25:24] null__: has joined #RubyOnRails
[07:25:46] huck5: has joined #RubyOnRails
[07:26:02] webguynow: has joined #RubyOnRails
[07:29:03] lampshades: has joined #RubyOnRails
[07:29:19] workmad3: has joined #RubyOnRails
[07:29:25] lampshades: Can anyone explain the first line on bundler.io "Docs: Previous Version (v1.9) Current Version (v1.10)"
[07:29:33] pawnbox_: has joined #RubyOnRails
[07:29:56] sevenseacat: lampshades: which version of bundler do you want the docs for?
[07:29:57] lampshades: why would the previous version be higher then the current version? is there some sort of backwards versioning that I'm not yet familiar with?
[07:31:55] lampshades: I finally got vagrant to install rvm, and now I cant install the json 1.8.3 gem, so I looked at stackoverflow and they said that I should use bundler 1.5. So naturally I went bundler -v to see my version
[07:32:16] lampshades: wouldnt it make more sense to have it as 1.09 then?
[07:32:32] lampshades: or is it a common practice that I wasn't exposed to yet?
[07:33:16] tjbiddle: has joined #RubyOnRails
[07:33:31] webguynow: has joined #RubyOnRails
[07:34:00] artto: has joined #RubyOnRails
[07:34:47] sevenseacat: bundler 1.5 is painfully old. don't use that.
[07:35:00] sevenseacat: lampshades: what if they end up with more than 100 versions of bundler 1.something ?
[07:35:16] sandstrom: has joined #RubyOnRails
[07:35:56] lampshades: sevenseacat: yes!! exactly! thats just screwy!
[07:36:16] lampshades: have you ever seen anyone else version like that?
[07:36:22] sevenseacat: so that explains why it would not be good to have 1.09
[07:36:39] sevenseacat: otherwise you'd have 1.99, and then 1.100, and you'd be in the exact same situation
[07:36:53] lampshades: sevenseacat: that makes perfect sense
[07:37:26] lampshades: severseacat: Thank you for pointing this out to me.. diving into deployment vagrant, chef, cap this week has really ruffled my feathers
[07:38:03] lampshades: sevenseacat: I thought I was a good developer, up to the point when I stopped using heroku
[07:38:21] sevenseacat: deployment and devops is a different set of skills to development
[07:38:51] lampshades: sevenseacat: yes, but we dont have a devops in our team,.. so I was pushed into it.. now I'm barely keeping my head above water
[07:38:59] habitullence: has joined #RubyOnRails
[07:39:03] rushed: lampshades: you might be better off leaving it on heroku then :)
[07:39:59] lampshades: rushed: sorry, I might have phrased it incorrectly. I was fine with heroku. Then boss asked me to setup ci, cant afford travis, and he wants it running on aws
[07:40:14] lampshades: and to make things even funner, he wants the instance to shut off after all the tests are ran
[07:40:23] lampshades: and turn back on after every commit
[07:40:32] lampshades: to save the hours
[07:40:56] rushed: lampshades: does he like to honk the horn in his clown car?
[07:41:06] workmad3: has joined #RubyOnRails
[07:41:21] lampshades: I wouldnt know, but you should see the specs he gave.. I almost walked out that very day
[07:41:39] rushed: lampshades: really? it sounds like you do know~
[07:42:20] lampshades: anyway, complaining wont get my anywhere. I started looking into docker, since it seems to me like the way to go nowadays
[07:42:35] srinidhi: has joined #RubyOnRails
[07:42:41] konsolebox: has joined #RubyOnRails
[07:42:49] rushed: honk honk~
[07:42:58] sevenseacat: it sounds like you've heard a lot of buzzwords and you havent made sense of any of them
[07:43:18] lampshades: sevenseacat: you're spot on!
[07:43:23] webguynow: has joined #RubyOnRails
[07:43:26] lulzmachine: has joined #RubyOnRails
[07:43:31] Pupeno: has joined #RubyOnRails
[07:43:57] lampshades: first, I figured if I can get a vagrant box working, with all the chef recepies, all I have to do is to run the same build on aws ec2 and it should work
[07:44:26] lampshades: then, I looked into opsworks, which was a little better, because I could actually control the scaling
[07:44:35] sevenseacat: ask your boss if he knows how to do it. when he says its not his job, then say 'well it's not mine either'
[07:44:47] sevenseacat: thats what I'd do
[07:44:49] lampshades: anyway, its not a can of worms.. its a bucket of worms,.. deadly ones too that bite and give you headache and insomnia
[07:45:01] lampshades: LOL!!! HE DOESNT
[07:45:26] darutoko: has joined #RubyOnRails
[07:45:26] lampshades: thats why I'm so scattered right now
[07:45:26] sevenseacat: oh i know. if he did, he wouldnt be asking you to do it.
[07:45:52] ybart: has joined #RubyOnRails
[07:46:08] lampshades: but hey, what doesnt kill you make you stronger
[07:46:29] rushed: lampshades: several of the CI PaaS allow a non-zero number of free private builds per month (ex https://codeship.com/pricing https://semaphoreci.com/pricing)
[07:46:49] rushed: lampshades: the point of that quote isn't that you should hit yourself in the face a lot
[07:46:57] johnflux: <%- model_class = Image -%>
[07:46:58] johnflux: <%= form_for @image, :html => { :class => "form-horizontal image" } do |f| %>
[07:47:01] sevenseacat: so does circleci, afaik
[07:47:02] johnflux: what does this "model_class" do?
[07:47:06] SteenJobs: has joined #RubyOnRails
[07:47:09] johnflux: I've tried googing it, but can't find anything
[07:47:11] johnflux: is it just a comment?
[07:47:20] sevenseacat: johnflux: in that code, nothing
[07:47:23] sevenseacat: where are you using it?
[07:47:34] johnflux: sevenseacat: it was autogenerated by some scaffold I think
[07:47:38] lulzmachine: you're just setting a local variable to a class called Image there
[07:47:54] johnflux: lulzmachine: the first line? the model_class line
[07:48:14] lampshades: rushed: thanks for that link, I looked into these sort of services. But it still leaves me with a challenge to provision that aws box, which means I need a local vagrant file
[07:48:22] johnflux: lulzmachine: thanks
[07:48:25] ybart: Hi, I have posted an ActionCable question on StackOverflow about reliably implementing user presence status : http://stackoverflow.com/questions/32591175/reliably-implement-presence-status-with-actioncable
[07:48:32] rushed: lampshades: what's the AWS box for?
[07:48:44] lampshades: just to make sure that the app works on aws
[07:49:07] lampshades: so, when a thing gets pushed to git, aws has a working copy for him to click through, and see that it actually works
[07:49:25] lampshades: and then login to ci and make sure all the tests pass
[07:49:46] lampshades: otherwise, he has no way of knowing if anything works.. becuase my cto cant code rub
[07:51:39] lulzmachine: u dotn have any testers employed? :p
[07:51:50] lulzmachine: and test server
[07:52:13] lampshades: lulzmachine: can I work for your company instead?
[07:52:28] lampshades: Im the only fricken developer here
[07:53:24] rushed: lampshades: add another heroku account?
[07:53:47] lampshades: rushed: he doesnt want to use heroku
[07:53:50] rushed: lampshades: what's the point of a staging/sandbox that doesn't match production?
[07:53:58] Ergo: has joined #RubyOnRails
[07:54:33] lampshades: well, I'll use the same recipes to deploy on ec2
[07:55:12] greenarrow: how can I check if a has_many has atleast one record in a scope
[07:55:33] jsrn_: has joined #RubyOnRails
[07:56:18] rushed: lampshades: so you are trying to move off heroku then?
[07:56:22] universa1: greenarrow: .any?
[07:56:26] lampshades: rushed: correct
[07:57:16] rushed: lampshades: seems like you already have enough crazy going on *shrug*
[07:58:02] lampshades: rushed: I know.. but if I come on top and get everything working, I'll become a better developer
[07:58:17] rushed: lampshades: you really wont
[07:58:19] lulzmachine: maybe. just dont wear yourself out; it's not worth it
[07:58:38] rushed: lampshades: you'll have learned a bunch of obscure ins and outs of devops that will have changed the next time you need it~
[07:59:28] lampshades: I remember back in the day I used to muck around with 3dsmax after school.. rendering stupid looking 3d tea pots, and after like 2-3 years of messing around with it, I landed a job rendering photoralistic simulations for investors of obscure products lol
[07:59:57] lampshades: then, I started doing actual simulations for it, all from breaking my head and long caffinated nights
[08:00:00] x-light: has joined #RubyOnRails
[08:00:03] greenarrow: universa1: like this? scope :with_links, -> { links.any? }
[08:00:13] lampshades: same things happened years ago with ruby, and now I code and getting paid for it
[08:00:19] universa1: greenarrow: no.
[08:01:43] lulzmachine: i'd love to work doing ruby instead of this archaic stuff we do. but at least it's a relaxed atmosphere
[08:02:55] johnflux: In my controller I have: format.html { redirect_to url_for(controller: :images_modal, action: 'show', id: @image.id), notice: 'Image was successfully created.' }
[08:03:14] johnflux: how do I get it to instead just show that url instead of redirecting to it?
[08:03:20] johnflux: the page contains nothing but some javascript
[08:03:29] johnflux: I don't want to replace the current page, but just run some js
[08:03:59] johnflux: so the idea is that when you click submit, the page doesn't change, but instead just some js runs
[08:04:40] webguynow: has joined #RubyOnRails
[08:05:20] Kedare: has joined #RubyOnRails
[08:06:42] rushed: johnflux: one option: use form remote + controller: "render :update" + view: update.js.coffee
[08:07:37] lampshades: has joined #RubyOnRails
[08:08:16] lampshades: does anyone have an operational vagrant box for rails somewhere laying around github?
[08:08:40] krisquigley: has joined #RubyOnRails
[08:10:32] johnflux: rushed: hmm, so I like this in the new.html.erb <%= form_for @image, :url => {controller: :images_modal, action: :create}, remote:true, :html => { :class => "form-horizontal image" } do |f| %>
[08:10:37] johnflux: rushed: with the remote:true right
[08:11:24] apg: has joined #RubyOnRails
[08:13:03] johnflux: rushed: and then in the def create in the controller: format.html { render :update } ?
[08:13:12] johnflux: rushed: I get "ActionController::InvalidAuthenticityToken"
[08:13:45] defsdoor: has joined #RubyOnRails
[08:15:11] johnflux: hmm it really doesn't like me adding the remote:true part
[08:16:09] annlewis: has joined #RubyOnRails
[08:17:15] webguynow: has joined #RubyOnRails
[08:18:48] jgt1: has joined #RubyOnRails
[08:18:53] Cervajz: has joined #RubyOnRails
[08:19:19] rushed: johnflux: authenticity_token: true for the form (or change the config default)
[08:19:21] Lytol: has joined #RubyOnRails
[08:19:40] johnflux: rushed: cool , that fixes it
[08:20:04] rushed: johnflux: make sure you're not throw js errors in the console
[08:20:06] johnflux: rushed: and then: format.html { render :update } ?
[08:20:09] rushed: *throwing
[08:20:28] rushed: johnflux: if you're in create then you could probably come up with a better name then :update :P
[08:20:38] rushed: johnflux:
[08:20:44] Cervajz_: has joined #RubyOnRails
[08:21:07] adre: has joined #RubyOnRails
[08:22:02] tuelz: has joined #RubyOnRails
[08:22:12] webguynow: has joined #RubyOnRails
[08:22:26] johnflux: rushed: I made the controller just: format.html
[08:22:41] johnflux: rushed: and it does load create.html.erb but it redirects to
[08:23:14] rushed: johnflux: need to render a js view
[08:23:37] rushed: johnflux: ie create.js.coffee
[08:24:39] johnflux: rushed: do I need to first tell it not to render the html file or something?
[08:25:04] rushed: johnflux: why does a file you don't want to render exist?
[08:25:38] johnflux: rushed: The purpose is to simply get the url for the file that you uploaded, and put it into a markdown text box
[08:26:17] rushed: johnflux: that... not sure what question you're answering :)
[08:27:18] Cervajz: has joined #RubyOnRails
[08:27:20] johnflux: rushed: I have a wikiPage and there's a button to let you upload a file, and put the "[filename.jpg]" text into the markup text box
[08:27:33] johnflux: rushed: to let users upload files to insert into the wiki
[08:27:59] Pupeno: has joined #RubyOnRails
[08:28:08] Linuus: has joined #RubyOnRails
[08:28:09] MALAZIJSKIJ_BOEI: has joined #RubyOnRails
[08:28:41] rushed: johnflux: your q: "do I need to first tell it not to render the html file" my answer: "why does a file you don't want to render exist?" ie (delete the file, or use a name that doesn't conflict)
[08:28:43] johnflux: rushed: so when the user clicks "upload image" it pops up a modal dialog and lets the user upload a file. User presses okay, modal dialog closes, and then it should get the newly-inserted image, get the url for attachment,and add that as text into the wikiPage's text
[08:29:55] apg: has joined #RubyOnRails
[08:34:00] Macaveli: has joined #RubyOnRails
[08:34:03] gregf_: has joined #RubyOnRails
[08:35:20] kimegede: has joined #RubyOnRails
[08:36:00] marr: has joined #RubyOnRails
[08:37:14] tjbiddle: Hey all - Is there something in Rails where I can narrow down an ActiveRecord relation dependent upon a certain phrase? (eg: I have a table with search functionality - I want it to narrow down the result by looking at all columns)
[08:39:37] arup_r: tjbiddle: using WHERE clause and LIKE operator .. ?
[08:45:06] webguynow: has joined #RubyOnRails
[08:48:10] maz-dev: has joined #RubyOnRails
[08:48:23] atmosx_laptop: has joined #RubyOnRails
[08:52:29] Choclo: has joined #RubyOnRails
[08:52:36] Linuus: has joined #RubyOnRails
[08:53:36] maz-dev: has joined #RubyOnRails
[08:53:38] johnflux: has joined #RubyOnRails
[08:54:10] Mia: has joined #RubyOnRails
[08:55:55] sonOfRa: has joined #RubyOnRails
[08:56:17] webguynow: has joined #RubyOnRails
[08:56:30] chouhoulis: has joined #RubyOnRails
[08:56:31] dideler: has joined #RubyOnRails
[08:58:41] maz-dev_: has joined #RubyOnRails
[09:00:08] kh0d: has joined #RubyOnRails
[09:00:14] tvw: has joined #RubyOnRails
[09:03:58] wldcordeiro_: has joined #RubyOnRails
[09:07:50] mugurel: has joined #RubyOnRails
[09:09:07] webguynow: has joined #RubyOnRails
[09:11:13] merlinp: has joined #RubyOnRails
[09:13:05] arup_r: has joined #RubyOnRails
[09:13:43] workmad3: has joined #RubyOnRails
[09:16:00] moeabdol: has joined #RubyOnRails
[09:16:57] annlewis: has joined #RubyOnRails
[09:17:04] cornerman: has joined #RubyOnRails
[09:19:15] zpe: has joined #RubyOnRails
[09:19:36] ybart: has joined #RubyOnRails
[09:22:37] pawnbox: has joined #RubyOnRails
[09:22:54] webguynow: has joined #RubyOnRails
[09:23:13] Lightsword: has joined #RubyOnRails
[09:23:24] bruno-: has joined #RubyOnRails
[09:26:11] moeabdol: has joined #RubyOnRails
[09:28:02] webguynow: has joined #RubyOnRails
[09:28:49] ddv: has joined #RubyOnRails
[09:31:00] Cervajz_: has joined #RubyOnRails
[09:34:06] voker57: has joined #RubyOnRails
[09:34:11] skroon: has joined #RubyOnRails
[09:34:14] habitullence: has joined #RubyOnRails
[09:34:21] emilkarl: has joined #RubyOnRails
[09:39:14] artto: has joined #RubyOnRails
[09:41:41] Linuus: has joined #RubyOnRails
[09:42:35] dhjondoh: has joined #RubyOnRails
[09:42:36] x-light: has joined #RubyOnRails
[09:42:44] kh0d: has joined #RubyOnRails
[09:44:04] Karpah: has joined #RubyOnRails
[09:49:12] pcpanic: has joined #RubyOnRails
[09:49:50] suchness: has joined #RubyOnRails
[09:50:26] slayerjain: has joined #RubyOnRails
[09:53:48] stamina: has joined #RubyOnRails
[09:55:58] alex88: has joined #RubyOnRails
[09:59:17] Kallis: has joined #RubyOnRails
[10:00:35] Kallis: has joined #RubyOnRails
[10:00:45] yaymukund: has joined #RubyOnRails
[10:01:20] tuelz: has joined #RubyOnRails
[10:03:39] webguynow: has joined #RubyOnRails
[10:04:13] sam_weerasinghe: has joined #RubyOnRails
[10:05:18] ybart: has joined #RubyOnRails
[10:05:18] arBmind: has joined #RubyOnRails
[10:05:50] wethu: has joined #RubyOnRails
[10:07:40] Lytol: has joined #RubyOnRails
[10:08:41] webguynow: has joined #RubyOnRails
[10:13:25] webguynow: has joined #RubyOnRails
[10:13:41] fschuindt: has joined #RubyOnRails
[10:17:41] annlewis: has joined #RubyOnRails
[10:20:22] rickmasta: has joined #RubyOnRails
[10:20:54] habitullence: Could use some advise on autoloading in Rails gem..
[10:21:02] habitullence: Anyone know a good strategy?
[10:22:02] suchness: habitullence: Are you taking the engine approach?
[10:22:51] habitullence: suchness: it's not a full engine
[10:23:41] suchness: habitullence: Do you have: class YourGem::Engine < ::Rails::Engine
[10:24:01] habitullence: suchness: nope
[10:24:41] habitullence: I think was created with rails plugin new .
[10:24:45] pcpanic: Hello peoples - anyone with seeding from excel experience? https://gist.github.com/ysinc88/eb969685510716e40b17
[10:24:46] suchness: habitullence: Well, if you make your gem a full engine, you can, in your engine class, configure the autoload paths for your gems files instead of just explicitly requiring them.
[10:25:29] suchness: habitullence: But without more information from you on whats currently wrong and what you want to move to I don't have any other advice.
[10:25:55] habitullence: suchness: I did it this way because my understanding is that an engine is an app whereas this is just a kind of assistant for setting up something in an existing app
[10:26:42] nettoweb: has joined #RubyOnRails
[10:26:43] habitullence: suchness: I'm happy that it's not an engine but would like to know how/if I should use autoloading or just require everything
[10:26:47] suchness: habitullence: An engine and a gem are basically the same thing. The difference you are talking about is more when you design your engine to be mounted.
[10:27:03] habitullence: yeah, it doesn't need to be mounted
[10:27:11] maz-dev: has joined #RubyOnRails
[10:27:34] habitullence: It just manages a table with some data imported from an API
[10:27:39] suchness: habitullence: Yeah, then engine, gem, it's all the same in your case, with the exception of the engine being able to configure autoload paths.
[10:28:12] suchness: habitullence: I make all of my 'gems' as engines anyhow, at least the ones meant to serve in rails apps.
[10:28:17] habitullence: Technically I guess it doesn't even need Rails, just activerecord
[10:29:03] habitullence: It's just going to be used for Rails though but maybe it's better for the community if it has less dependencies
[10:29:50] suchness: habitullence: You might have a look at this then: http://blog.pivotal.io/labs/labs/rails-autoloading-for-your-gem
[10:30:03] suchness: You won't get the autoloading without rails though.
[10:30:39] suchness: pcpanic: I think most here would consider themselves having seeded from csv experience.
[10:31:10] pcpanic: suchness: csv is fine with me, how would you go about doing it from csv?
[10:32:00] workmad3: habitullence: I follow the same rules in engines as I do in rails apps - if the stuff is in a default-autoloaded directory (namely, app/) then it's a) rails specific and b) going to have no real issues being autoloaded
[10:32:06] pcpanic: suchness: yup, csv returns many more results - http://stackoverflow.com/questions/12028334/having-trouble-seeding-csv-file-into-rails-app
[10:32:09] suchness: pcpanic: For lightweight things I would just use the CSV module in rails.
[10:32:26] workmad3: habitullence: but if it's in a lib/ folder, I recommend requiring it explicitly
[10:32:33] suchness: pcpanic: http://ruby-doc.org/stdlib-1.9.3/libdoc/csv/rdoc/CSV.html
[10:33:10] pcpanic: suchness: Thanks! will give it a go
[10:33:18] suchness: pcpanic: Sure thing.
[10:33:34] workmad3: habitullence: additionally, with gems you should also make sure you explicitly load your own gem dependencies as required... bundler doesn't automatically require transitive gem dependencies, so if you don't do that then you'll hit problems at some point
[10:33:41] webguynow: has joined #RubyOnRails
[10:34:57] workmad3: suchness: oh man, that pivotal 'suggestion' makes me want to hit something
[10:35:13] hayricicek: has joined #RubyOnRails
[10:35:21] suchness: workmad3: What suggestion?
[10:35:35] workmad3: suchness: 'config.autoload_paths += Dir["#{config.root}/lib/**/"]' <-- that shit
[10:35:43] suchness: workmad3: Oh I didn't see the url
[10:35:48] suchness: workmad3: Why is that?
[10:35:54] maz-dev_: has joined #RubyOnRails
[10:36:24] heidar: has joined #RubyOnRails
[10:36:39] workmad3: suchness: adding the '**/' bit means that you introduce large amounts of possible idiocies into the autoloading
[10:37:09] suchness: workmad3: Oh yeah. I never require anything by *, it always ends up being an issue later.
[10:37:24] workmad3: suchness: the ** is a stage worse than just * ;)
[10:37:37] suchness: workmad3: Haha, indeed it is.
[10:37:49] workmad3: basically means you can deeply nest crap in lib/ and ignore the namespace directory naming conventions
[10:38:04] webguynow: has joined #RubyOnRails
[10:38:05] workmad3: lib/foo/bar/fizz/buzz/user.rb could define User and rails would load it!
[10:38:41] workmad3: suchness: so yeah... seeing that crap from pivotal makes me want to hit something :)
[10:38:56] suchness: workmad3: Well I don't blame you!
[10:39:01] ybart: has joined #RubyOnRails
[10:39:10] stardiviner: has joined #RubyOnRails
[10:40:05] habitullence: suchness: interesting read, thanks
[10:40:10] marr: has joined #RubyOnRails
[10:40:18] wethu: has joined #RubyOnRails
[10:40:56] habitullence: workmad3: thanks for the advice, how do you explicitly load gem dependencies?
[10:41:20] workmad3: habitullence: normally with 'require "gemname" ', but the gem's docs will tell you for a particular gem
[10:42:46] violarium: has joined #RubyOnRails
[10:42:48] habitullence: workmad3: so just in the file where the gem is required? 
[10:43:10] habitullence: workmad3: do you have an example of a well constructed gem I could study?
[10:43:35] violarium: Hello! What do you use to store different settings in your app? Do you use dotenv, figaro or just secrets.yml?
[10:44:30] workmad3: habitullence: yeah, in the file(s) where a gem is required, add a require to load that gem (or the bits of it you need, in the case of some gems)
[10:47:30] arup_r: pcpanic: What is your DBMS ?
[10:48:03] pcpanic: arup_r: sqlite?
[10:49:05] Cervajz: has joined #RubyOnRails
[10:52:14] arup_r: pcpanic: if you use postgresql .. may be copy command would work. I meant to use some DB native command.. it is fast.. I used to export large CSVs to tables using copy command
[10:53:06] pcpanic: arup_r: I used the built in csv, it was nice and simple - http://stackoverflow.com/questions/12028334/having-trouble-seeding-csv-file-into-rails-app
[10:53:56] arup_r: pcpanic: Ruby CSV can;'t be much faster then native DB support.. :)
[10:54:10] rodfersou: has joined #RubyOnRails
[10:54:32] gerep: has joined #RubyOnRails
[10:54:45] pcpanic: arup_r: i'm just a noob, i never got the hang on postgresql
[10:55:06] pcpanic: arup_r: 1 file + 1 command is good enough for me
[10:55:47] webguynow: has joined #RubyOnRails
[10:55:49] pcpanic: arup_r: i am having issues now with non english charac]ters
[10:56:01] pcpanic: does your method take care of that?
[10:56:24] pcpanic: arup_r: im just moving back to the known mysql
[10:56:34] bonhoeffer: has joined #RubyOnRails
[10:57:14] suchness: habitullence we were just referring to using explicit paths like, /lib/foo/bar.rb instead of /lib/foo/* and such.
[10:57:17] arup_r: no idea about musql
[10:57:24] arup_r: but postgresql does
[11:00:33] lxsameer: has joined #RubyOnRails
[11:00:40] pawnbox: has joined #RubyOnRails
[11:02:05] tuelz: has joined #RubyOnRails
[11:02:15] nickFreeman: has joined #RubyOnRails
[11:02:40] habitullence: suchness: can you expand on that a bit? Not following
[11:03:01] webguynow: has joined #RubyOnRails
[11:05:24] newbie|3: has joined #RubyOnRails
[11:05:35] tvw: has joined #RubyOnRails
[11:05:53] alex88_: has joined #RubyOnRails
[11:07:10] gurnoorinder1: has joined #RubyOnRails
[11:08:32] suchness: habitullence: Sure, one moment
[11:09:28] alex88: has joined #RubyOnRails
[11:09:44] gurnoorinder1: has left #RubyOnRails: ()
[11:10:02] miguelff: has joined #RubyOnRails
[11:10:04] jas02: has joined #RubyOnRails
[11:10:15] chills42: has joined #RubyOnRails
[11:10:51] Linuus: has joined #RubyOnRails
[11:10:54] chills42: has joined #RubyOnRails
[11:11:14] gurnoorinder1: has joined #RubyOnRails
[11:11:19] Rubie: has joined #RubyOnRails
[11:11:20] suchness: habitullence: http://pastie.org/private/s8kdj3rtvobywfo5scg0pq
[11:11:46] gurnoorinder1: has left #RubyOnRails: ()
[11:12:25] gurnoorinder: has joined #RubyOnRails
[11:12:25] pawnbox: has joined #RubyOnRails
[11:12:42] gurnoorinder: Hello Everyone. I have xcode 3.2.3 on my Mac. is it sufficient for RoR dev or should i upgrade my Xcode and Cmd line tools. I am running 10.6.8
[11:12:47] miguelff: has left #RubyOnRails: ()
[11:12:51] suchness: habitullence: http://pastie.org/private/kw2wqdogsqdtw8eodpycxw
[11:13:20] suchness: gurnoorinder: I would update them anyway...
[11:14:02] jschoolcraft: has joined #RubyOnRails
[11:14:34] Pavster: has joined #RubyOnRails
[11:14:57] habitullence: suchness, workmad3: ah I see, thanks.. Wouldn't it be OK though if you made sure you followed the directory/module convention? :S
[11:15:45] habitullence: Is this because it's better to be explicit?
[11:15:49] suchness: habitullence: Indeed
[11:16:00] gurnoorinder: @suchness: any way to update them via Terminal. It is 4.1 Gb and will take a lot of time to download.
[11:16:02] habitullence: At the cost of being verbose though
[11:16:31] suchness: gurnoorinder: Not that I am aware of, if you are worried anout installing 4 gigs you should still be fine with whatever xcode version you have.
[11:16:48] habitullence: I'm no Ruby expect though, I need to look up * vs **
[11:16:56] Rubie: has joined #RubyOnRails
[11:17:13] suchness: habitullence: * will grab all files in that directory
[11:17:26] gurnoorinder: thanks suchness
[11:17:29] suchness: habitullence: */** will grab all files in the directory and all subfolders
[11:17:36] gurnoorinder: suchness: thanks
[11:17:44] suchness: habitullence: Or is is **/* I forget, one of those.
[11:18:34] habitullence: suchness: cool, so I guess a compromise could be to add files at each module level or would you add everything at the top module?
[11:18:37] annlewis: has joined #RubyOnRails
[11:18:55] habitullence: suchness: guess if you're being explicit it's nice to do it all in one place
[11:19:03] suchness: habitullence: Exactly
[11:19:25] habitullence: suchness, workmad3: helped a lot, thanks :)
[11:19:47] krisquigley: has joined #RubyOnRails
[11:20:19] habitullence: I'll jump on here when I realise my gem so you guys can burn it to the ground j/k.. Would be great to get some feedback though
[11:21:10] tuelz: has joined #RubyOnRails
[11:21:37] freeMan__: has joined #RubyOnRails
[11:22:11] cih: has joined #RubyOnRails
[11:23:15] bojan: has joined #RubyOnRails
[11:23:33] bojan: has left #RubyOnRails: ()
[11:24:02] dzejms: has joined #RubyOnRails
[11:28:05] da3mian: has joined #RubyOnRails
[11:28:44] syath: has joined #RubyOnRails
[11:32:20] jas02: has joined #RubyOnRails
[11:34:10] bruno-: has joined #RubyOnRails
[11:34:39] suchness: habitullence: Sounds good!
[11:35:19] Klumben: has joined #RubyOnRails
[11:35:47] freeMan__: Hello all! I am trying to use Net::SCP to download a txt file from a remote server to local. Even though I provide a password in the options, it still asks me in the server console for the pass. gist: https://gist.github.com/maimutza/fd45c16c220410a94420
[11:36:17] cih_: has joined #RubyOnRails
[11:36:32] freeMan__: @freeman__ Note that this problem is present in Rails 2 and Rails 3(trying to upgrade a framework to rails 4)
[11:37:00] universa1: freeMan__: password for the ssh key maybe?
[11:37:20] freeMan__: universa1: thank you for the quick response. The ssh key does not have a password
[11:37:35] turbo_MaCk: has joined #RubyOnRails
[11:38:32] zpe: has joined #RubyOnRails
[11:38:46] kidoz: has joined #RubyOnRails
[11:39:08] universa1: freeMan__: http://net-ssh.github.io/scp/v1/api/classes/Net/SCP.html#M000007 -- guessing that you might need to pass the path to the ssh key
[11:40:08] violarium: Hello! What do you use to store different settings in your app? Do you use dotenv, figaro or something else?
[11:40:23] webguynow: has joined #RubyOnRails
[11:40:32] pontiki: has joined #RubyOnRails
[11:41:02] freeMan__: universa1: I'm not seeing any path to the ssh key option there.
[11:41:04] suchness: violarium: I just use a yaml file.
[11:41:25] universa1: freeMan__: If the options hash includes an :ssh key, the value for that will be passed to the SSH connection as options (e.g., to set the password, etc.)
[11:41:35] violarium: suchness: do you use your own file or secrets.yml?
[11:42:07] suchness: violarium: My owm. One is app_configuration.yml.example that is in the repo, the other is just app_configuration.
[11:42:46] violarium: suchnes: I see. So do you use values from this file in database.yml or not?
[11:42:57] suchness: violarium: No I keep that separate.
[11:43:42] jas02: has joined #RubyOnRails
[11:43:58] violarium: suchness: thank you, one more question please. So, do you use structure as in database.yml for different environments? And have you created initilizer to parse it?
[11:44:58] suchness: violarium: I have an initialiser that parses it. It is not separated by environments because I use aws, which I have a chef script that takes json values and generates the app_configuration.yml from a template using the stack json.
[11:45:00] freeMan__: universa1: followed your advice although I have tried this before. Updated the gist: https://gist.github.com/maimutza/fd45c16c220410a94420
[11:45:06] freeMan__: universa1: it still asks for a password
[11:45:23] charliesome: has joined #RubyOnRails
[11:45:30] universa1: freeMan__: you supplied the wrong password?
[11:46:06] freeMan__: universa1: I tried supplying the wrong password. When I do that, it prompts me with Authentication error.
[11:46:19] freeMan__: universa1: but no, the pass is fine.
[11:46:24] universa1: freeMan__: so if you enter the same password again it works?
[11:46:24] violarium: suchness: I see. Because I have small opensource project and do not know where to put feedback email. Could you advice me the better place?
[11:46:35] freeMan__: universa1: yes, it does.
[11:47:14] universa1: freeMan__: no clue then, haven't used net::scp
[11:48:00] suchness: violarium: For something like that I would use this: http://guides.rubyonrails.org/configuring.html#custom-configuration
[11:48:59] freeMan__: universa1: thank you for your time.
[11:49:30] violarium: suchness: thank you
[11:49:34] suchness: violarium: Sure thing
[11:50:26] ldnunes: has joined #RubyOnRails
[11:51:44] violarium: suchness: I thought it's better to use somekind of dotenv or create own config yaml file
[11:52:09] charliesome: has joined #RubyOnRails
[11:52:18] suchness: violarium: For some things it might be, but for something simple like that I think app configuration is better. Especially if it's open source.
[11:52:55] dionysus69: has joined #RubyOnRails
[11:53:30] navo: has joined #RubyOnRails
[11:54:31] violarium: suchness: I mean feedback email for sending mails from site. When every person can deploy it with own settings. Is it fine to go to .erb file?
[11:55:18] pwnd_nfsw: has joined #RubyOnRails
[11:55:44] violarium: suchness: ow, to .rb file, not to .erb
[11:55:44] Lytol: has joined #RubyOnRails
[11:55:52] workmad3: violarium: by only using the config through the rails application configuration like that, you can effectively allow any person deploying your app to decide how they want to load config
[11:56:11] suchness: violarium: Oh I misunderstood you, the feedback is going to yourself?
[11:56:23] workmad3: violarium: because they become responsible for how they create that .rb initializer or environment hash... they can fetch data from the ENV, they could load from a yaml file, they could hardcode...
[11:56:40] suchness: violarium: You want to add a way for the community to send you email?
[11:57:01] violarium: suchness: yes, I mean, feedbask for person which deploy project. It could be me or you.
[11:57:11] cih: has joined #RubyOnRails
[11:57:22] suchness: violarium: Oh, well then I still stand by my answer, I think it should go in the app configuration.
[11:57:48] suchness: violarium: As workmad3 said, then it allows them control over setting it.
[11:57:50] violarium: suchness: and in this case should I add it to .gitignore?
[11:58:52] violarium: workmad3: I have mongoid.yml file, secrets.yml file, and I thought it better to put other settings in such way
[11:59:55] pontiki: morning o/
[12:00:02] Linuus: has joined #RubyOnRails
[12:00:20] greenarrow: has joined #RubyOnRails
[12:00:56] solars: has joined #RubyOnRails
[12:02:06] pontiki: hi elaptics :)
[12:02:37] violarium: suchness: redmine using separate yml file: https://github.com/redmine/redmine/blob/master/config/configuration.yml.example
[12:06:20] goodcodeguy: has joined #RubyOnRails
[12:07:38] krisquigley: has joined #RubyOnRails
[12:09:55] andywww: has joined #RubyOnRails
[12:12:01] mostlybadfly: has joined #RubyOnRails
[12:13:16] dionysus69: has joined #RubyOnRails
[12:13:51] andywww: has left #RubyOnRails: ()
[12:19:06] annlewis: has joined #RubyOnRails
[12:19:10] suchness: violarium: I think the best answer would come knowing exactly what you are buuilding. If its a gem type thing, then you shouldn't need to commit it anywhere because it would be set in the app, not the gem you are building.
[12:19:34] acti0nman: has joined #RubyOnRails
[12:20:03] johnflux: has joined #RubyOnRails
[12:21:06] violarium: suchness: I am building complete rails app: https://github.com/violarium/ruby_moon. And I want people and other devs just to clone it and create condigurations which they need from sample. like DB, email and so on.
[12:21:58] suchness: violarium: If that's the case, then I would continue with my suggestion to use the rails config like the link I posted, but I would have the value it's being set to pull from a yml config file.
[12:22:23] suchness: violarium: and I would commit a email.yml.example in the repo to show how that should look.
[12:22:36] suchness: or feedback.yml or whatever
[12:22:48] violarium: suchness: so, do you suggest to create sample files with configs like secrets.yml and use them in config?
[12:23:45] violarium: violarium: thank you very much
[12:25:19] Radar: good morning
[12:29:08] wethu: has joined #RubyOnRails
[12:30:22] AxonetBE: has joined #RubyOnRails
[12:30:28] dhjondoh: has joined #RubyOnRails
[12:30:32] abc123: has joined #RubyOnRails
[12:30:33] victortyau: has joined #RubyOnRails
[12:30:54] jkamenik: has joined #RubyOnRails
[12:31:16] krz: has joined #RubyOnRails
[12:31:20] AxonetBE: I use rspec and I use factoryGirl to create an object. In my class I have a query that start with Spree::Reseller.find(...), now when I run my rspec he is always telling me uninitialized constant Reseller, but should be Spree::Reseller. Why he is not usign the namespace?
[12:32:19] pontiki: show your factory, AxonetBE
[12:34:01] AxonetBE: pontiki: https://gist.github.com/DriesS/2c79726658cdb898b583
[12:35:05] milchschaum: has joined #RubyOnRails
[12:36:07] pontiki: yeah, that should work...
[12:36:29] AxonetBE: pontiki: I added my spec also https://gist.github.com/DriesS/2c79726658cdb898b583
[12:37:22] pontiki: AxonetBE: in your factory, try: ::Spree::Reseller for the class
[12:38:37] AxonetBE: pontiki: but it is on let!(:client) { create(:user, reseller_ids: reseller_account.id) } that the error is launched, because in my class eval of User class I use this https://gist.github.com/DriesS/2c79726658cdb898b583#file-reseller_model-rb-L16
[12:38:47] AxonetBE: because if I comment this line I don't get errors
[12:40:26] pontiki: i guess the more likely problem is not in the reseller factory, but in the user factory and model, then
[12:41:40] AxonetBE: pontiki: because if I change for exampe to Spree::NonExistingModel I get uninitialized constant Spree::NonExistingModel
[12:42:26] Balzrael: has joined #RubyOnRails
[12:43:24] turbo_MaCk: has joined #RubyOnRails
[12:43:47] annlewis: has joined #RubyOnRails
[12:45:15] goodcodeguy: has joined #RubyOnRails
[12:46:52] hahuang61: has joined #RubyOnRails
[12:47:23] EasyCo: has joined #RubyOnRails
[12:48:08] crdpink2: has joined #RubyOnRails
[12:48:22] urkle: has joined #RubyOnRails
[12:48:44] milchschaum: has joined #RubyOnRails
[12:49:58] ckinniburgh_: has joined #RubyOnRails
[12:50:14] btreeinfinity: has joined #RubyOnRails
[12:51:15] dstarh: has joined #RubyOnRails
[12:52:05] nibbo: has joined #RubyOnRails
[12:52:41] universa1: has joined #RubyOnRails
[12:52:47] fgo: has joined #RubyOnRails
[12:53:43] sfr^: has joined #RubyOnRails
[12:54:11] s2013: has joined #RubyOnRails
[12:55:09] jsvgoncalves: has joined #RubyOnRails
[12:55:14] Radar: https://gist.github.com/DriesS/2c79726658cdb898b583#file-reseller_model-rb-L3 this should use class_name: "Spree::Reseller"
[12:55:30] Radar: Uh, aactually I am not sure now :)
[12:55:38] rustymyers: has joined #RubyOnRails
[12:55:45] Radar: Where is the ResellerUser model? how are the associations defined there?
[12:55:51] Radar: And where is the stacktrace for the error?
[12:56:36] freeMan__: universa1: regarding net::scp, it was a..typo from my end. I used authorized_keys.pub instead of authorized_keys *facepalm*
[12:56:42] freeMan__: universa1: thank you again.
[12:56:46] Sdwrage_: has joined #RubyOnRails
[12:57:28] mary5030: has joined #RubyOnRails
[12:57:33] startupality: has joined #RubyOnRails
[12:57:45] pontiki: Radar: in FG, it's class: Spree::Reseller, which always throws me off with Rails associations
[12:58:02] quazimodo: has joined #RubyOnRails
[12:59:09] dionysus69: has joined #RubyOnRails
[13:00:22] sankaber: has joined #RubyOnRails
[13:00:46] mary5030: has joined #RubyOnRails
[13:01:07] mrchris: has joined #RubyOnRails
[13:02:08] yashinbasement: has joined #RubyOnRails
[13:02:33] bmurt: has joined #RubyOnRails
[13:03:16] mugurel: do anyone know if i can do something similar as before(:each) do stuff end and add something like except GET #index, with rspec?
[13:04:20] Fire-Dragon-DoL: has joined #RubyOnRails
[13:05:01] ramortegui: has joined #RubyOnRails
[13:05:13] elaptics: mugurel: no, pretty sure there isn't anything like that
[13:07:00] NBarnes: has joined #RubyOnRails
[13:07:16] ngr: I'm building a database scheme where an activity has multiple people associated with it which can be of different roles (following the RACI principle if you want to know). what is the rails way to build this relationship? I thought of creating three tables: activities[name,id] <-> activities_users[activity_id, user_id, role] <-> user[name, id] but I don't know how to set up the associations on a model level. I'd much appreciate any hints or google keywords
[13:07:18] AxonetBE: Radar: indeed just found it out, had to put everywhere class_name:
[13:07:34] AxonetBE: another question, Spree::Reseller.find(reseller_id) returns me an object Array
[13:07:44] AxonetBE: but neet Reseller object, how to get this?
[13:08:13] ngr: I want to be able to do "activity.responsible << user" and "activity.accountable << user"
[13:08:16] bruno-: has joined #RubyOnRails
[13:08:26] ngr: as well as "user.accountable_activities" and "user.responsible_activities"
[13:08:38] ngr: accountable and responsible being "roles" on the activities_users association
[13:10:26] violarium: has joined #RubyOnRails
[13:12:36] Linuus: has joined #RubyOnRails
[13:13:17] miguelff: has joined #RubyOnRails
[13:15:20] Radar: AxonetBE: It shouldn't return an array
[13:15:29] Radar: AxonetBE: Are you sure you're doing .find and not .where?
[13:15:33] elmhouse: has joined #RubyOnRails
[13:15:45] sfr^: has joined #RubyOnRails
[13:16:14] universa1: has joined #RubyOnRails
[13:16:21] AxonetBE: Radar: Found it, was passing array to it like [1]
[13:16:34] AxonetBE: seems when I do this that it returns an array also
[13:16:40] sevenseacat: Radar: you're on holidays gtfo IRC
[13:16:44] Radar: sevenseacat: yes maam
[13:16:55] Radar: we're faffing about in the hotel room this morning
[13:16:56] btreeinfinity: has joined #RubyOnRails
[13:17:13] sevenseacat: you're not faffing well enough if you're paying attention to the laptop
[13:17:32] Radar: sorry just releasing MTWRv2
[13:18:48] markelite: has joined #RubyOnRails
[13:19:08] hardtail: has joined #RubyOnRails
[13:20:25] webguynow: has joined #RubyOnRails
[13:20:41] sankaber: has joined #RubyOnRails
[13:20:41] charliesome: has joined #RubyOnRails
[13:23:05] megagigawatt: has joined #RubyOnRails
[13:23:18] Swappticon: has joined #RubyOnRails
[13:24:56] bendangelo_: has joined #RubyOnRails
[13:26:48] ngr: does this sound like a use case for polymorphic associations? I am having a hard time wrapping my head around all those different association types for non trivial cases
[13:27:16] jgpawletko: has joined #RubyOnRails
[13:27:38] p8m: has joined #RubyOnRails
[13:28:16] dima__: has joined #RubyOnRails
[13:28:26] nettoweb: has joined #RubyOnRails
[13:29:19] null__: has joined #RubyOnRails
[13:29:26] null__: has joined #RubyOnRails
[13:30:30] nibbo: has joined #RubyOnRails
[13:30:38] toomus: has joined #RubyOnRails
[13:31:03] arup_r: tomaw: hello
[13:31:09] arup_r: toomus: Hello
[13:31:18] toomus: I have somu finction eg. my_func(users, options)
[13:32:10] atmosx_laptop: has joined #RubyOnRails
[13:32:34] havenwood: has joined #RubyOnRails
[13:32:36] JoshL: has joined #RubyOnRails
[13:32:44] toomus: and I want to allow this function to accept as first param User object or array of User objects
[13:34:05] arup_r: use *users and remember it is always Array.
[13:34:12] turbo_MaCk: has joined #RubyOnRails
[13:34:58] toomus: what asterisk mean?
[13:35:09] toomus: some kind of pointer?
[13:35:16] suchness: toomus: "splat operator" "star operator"
[13:35:23] arup_r: toomus: ^^
[13:35:45] arup_r: Ruby don't expose pointer to us.. :)
[13:35:54] bruno-: has joined #RubyOnRails
[13:37:37] momomomomo: has joined #RubyOnRails
[13:38:11] nomadicoder: has joined #RubyOnRails
[13:38:51] habitullence: I've require 'rails/generators/active_record' in one file but this is complaining about Rails::Generators::Actions not being initialized.. I guess Rails does something with dependencies, does anyone know how I cano resolve this?
[13:38:52] miguelff: has left #RubyOnRails: ()
[13:40:21] vipaca: has joined #RubyOnRails
[13:42:02] tagrudev: has joined #RubyOnRails
[13:42:35] rickmasta: has joined #RubyOnRails
[13:43:03] codenapper: has joined #RubyOnRails
[13:43:19] AntiSpamMeta: has joined #RubyOnRails
[13:43:45] Lytol: has joined #RubyOnRails
[13:44:00] habitullence: require rails doesn't work
[13:44:20] Pazician: has joined #RubyOnRails
[13:44:36] tyl: has joined #RubyOnRails
[13:44:38] greengriminal: has joined #RubyOnRails
[13:44:57] Pazician: has joined #RubyOnRails
[13:46:15] tyl: Hi how do i retrieve the params from a NET::HTTP request?
[13:46:15] tyl: http://pastie.org/10423621
[13:49:16] habitullence: Do I need to do something magic to load Rails dependencies?
[13:49:29] darrencauthon: has joined #RubyOnRails
[13:50:36] n1lo: has joined #RubyOnRails
[13:50:56] mdel: has joined #RubyOnRails
[13:51:10] alexUaN: has joined #RubyOnRails
[13:51:22] umgrosscol: has joined #RubyOnRails
[13:52:26] kh0d: has joined #RubyOnRails
[13:53:35] codenapp_: has joined #RubyOnRails
[13:53:46] leksster: has joined #RubyOnRails
[13:55:31] SteenJobs: has joined #RubyOnRails
[13:56:24] nettoweb: has joined #RubyOnRails
[13:57:00] JoshL: has joined #RubyOnRails
[13:57:30] jsrn_: has joined #RubyOnRails
[13:58:03] webguynow: has joined #RubyOnRails
[13:58:33] jgt1: has joined #RubyOnRails
[13:58:55] s2013: habitullence what you mean
[13:59:38] apg: has joined #RubyOnRails
[13:59:38] apg: has joined #RubyOnRails
[14:00:50] habitullence: s2013: I'm creating an ActiveRecord generator that extends ActiveRecord::Generators::Base. I'd expect that file to require anything it needs but it doesn't so somehow I have to load in the whole of Rails? :S
[14:01:29] habitullence: Just getting unitialized Rails::Generators::Actions
[14:02:16] weckl: has joined #RubyOnRails
[14:02:20] s2013: did you try require 'rails/generators'
[14:03:07] habitullence: yep, then it can't even find Base
[14:03:28] s2013: hmm weird
[14:03:30] habitullence: ActiveRecord::Generators::Base
[14:08:19] habitullence: Urgh! Give up..
[14:08:48] pawnbox: has joined #RubyOnRails
[14:10:55] habitullence: Plenty of docs on engines, none on pluigns.. Yay!
[14:10:57] jgpawletko: has joined #RubyOnRails
[14:11:26] mary5030: has joined #RubyOnRails
[14:12:25] quazimodo: has joined #RubyOnRails
[14:13:30] koneko: has joined #RubyOnRails
[14:13:52] koneko: has joined #RubyOnRails
[14:14:22] beauby: has joined #RubyOnRails
[14:14:25] Pupeno: has joined #RubyOnRails
[14:16:03] idd2d: has joined #RubyOnRails
[14:16:05] jas02: has joined #RubyOnRails
[14:17:11] safetypin: has joined #RubyOnRails
[14:17:12] miguelff: has joined #RubyOnRails
[14:17:47] johnflux: has joined #RubyOnRails
[14:17:47] johnflux: has joined #RubyOnRails
[14:17:53] maz-dev: has joined #RubyOnRails
[14:18:53] jas02: has joined #RubyOnRails
[14:19:11] mugurel: has joined #RubyOnRails
[14:20:02] hashrocket: has joined #RubyOnRails
[14:20:28] habitullence: bundler/setup fixes that sh!t but I'm not really sure why
[14:21:17] habitullence: ah I know why
[14:21:20] Guest87721: Hi everyone, has anybody implemented export to PDF functionality that would have to handle +100 PDF pages of data and work synchronously in the sense that a user clicks a link and the download starts immediately, no emailing links to S3? We have a problem like that now, the client is using Heroku for their Rails app and Prawn for PDFs. It's probably the worst idea to use the
[14:21:21] Guest87721: web dynos to generate PDFs upon request so I'm trying to figure out an alternative.
[14:21:24] adavia: has joined #RubyOnRails
[14:21:27] tubbo: habitullence: $LOAD_PATH magic!
[14:21:54] tubbo: Guest87721: well how exactly could the PDF be generated otherwise? is there a better solution, like doing it in the background?
[14:21:56] slowlife: has joined #RubyOnRails
[14:22:04] chills42: has joined #RubyOnRails
[14:22:10] tubbo: Guest87721: does it require like, data input by the user to generate the PDF?
[14:22:11] towski_: has joined #RubyOnRails
[14:22:18] habitullence: tubbo: the "magic" drove me up the wall today ;)
[14:22:39] Guest87721: tubbo: I was thinking of having workers doing that, exporting the PDF to Amazon S3 and emailing a link to the user, but the client says it's too long of a path for the user.
[14:22:51] violarium: has joined #RubyOnRails
[14:22:55] Linuus: has joined #RubyOnRails
[14:23:23] tubbo: habitullence: it was actually the LACK of magic...as i see from your previous messages. ActiveSupport has this thing called Autoload which you can extend and it will automatically load in all the dependencies you need, so you won't need to `require` every file
[14:23:25] habitullence: tubbo: so Rails doesn't require what it should and relies on bundler to deal with load paths, is that the deal?
[14:23:41] tubbo: habitullence: if you just create a gem or an engine, or just a bare ruby project, none of that exists
[14:24:26] Guest87721: ACTION wonders why his nick didn't change
[14:24:34] Lloyd: Guest87721: just create the pdf, save it to s3, save the link to s3 in your database, then provide a friendly url in the e-mail, that points to a controller method that retrieves the S3 URL from the DB and redirects them to it
[14:24:39] tubbo: habitullence: Rails has some tools for eager-loading libraries, *and* it relies on Bundler to require in all the 3rd-party dependencies. if you do `require 'bundler'; Bundler.require :default, :development`, that requires in each gem in the default (e.g. no group) and the :development group from your Gemfile
[14:25:21] tubbo: Guest87721: i don't understand how taking PDF generation out of the request/response cycle changes the path for the user. it's just saving resources so the user gets a faster response.
[14:25:23] Guest87721: has left #RubyOnRails: ("cu")
[14:25:24] habitullence: tubbo: I've been a bit lost today... so internally use autoload, externally bundler?
[14:25:24] vipaca: has joined #RubyOnRails
[14:25:42] Guest87721: has joined #RubyOnRails
[14:26:21] tubbo: habitullence: whenever i've needed help with making a gem, i turned to a gem that was popular, well-written, and robust. so i typically have used https://github.com/plataformatec/devise as my example.
[14:27:07] Guest87721: Lloyd: yeah I suggested that to the client, but they say that in Square you can export a 1000-pages long PDF in the browser, the download starts after less than a minute
[14:27:29] tubbo: habitullence: autoloading helps with rails because it allows you to hook into rails dependency loading, so you can actually add your library to the config.eager_load_namespaces array, and your code will be reloaded in development and cached in production.
[14:27:40] Guest87721: tubbo: I guess the argument was that the user needs to fire up their email client and get the link there, and also wait for the email to arrive
[14:28:20] Lloyd: so farm off the PDF generation to a worker, then just show a holding screen while the generation is occuring
[14:28:27] Lloyd: or am I missing the point here?
[14:28:27] Guest87721: I'm just wondering how the big boys like Square export data on request
[14:28:36] artto: has joined #RubyOnRails
[14:28:47] tubbo: Guest87721: fwiw your nick didn't change...if that matters. you probably tried a nick that was already authenticated by nickserv, or you failed to authenticate.
[14:28:49] johnflux: has joined #RubyOnRails
[14:28:49] johnflux: has joined #RubyOnRails
[14:28:54] Lloyd: Guest87721: depends on what the data is
[14:29:07] Lloyd: Guest87721: it might be being periodically generated and stored
[14:29:18] tubbo: Guest87721: it doesn't matter though. the only other alternative is to use some kind of asynchronous pub-sub thing, like websockets, to let the user's browser know the PDF is ready for download
[14:29:25] tubbo: i suggest *also* sending an email in case that system fucks up
[14:29:37] Guest87721: tubbo: I'm authenticated via nickserv, I also tried setting the nick manually but nothing changes, nevermind for now but thanks
[14:29:57] Lloyd: I'd probably just use an ajax call to check status
[14:30:09] Guest87721: Lloyd: The data is transactions, like sales - you can apply custom date ranges so I guess it couldn't be generated periodically
[14:30:27] Lloyd: are you finding that you can't generate the same amount of data in the same time frame?
[14:31:00] pawnbox: has joined #RubyOnRails
[14:31:01] tubbo: yeah i guess it's not "the only" other alternative, but it's certainly an elegant one
[14:31:10] Guest87721: Lloyd: Yeah, ajax could work, just check for the S3 link to the doc generated by a worker, when it's ready - trigger the download. I'm wondering what would the response time be, from the click to the actual download...
[14:31:14] tubbo: you can also poll the server for changes with ajax calls and setTimeout :)
[14:31:17] habitullence: tubbo: That's the gem I've been using too but I can't see how it resolves this unless it does something funny in the test suite
[14:31:45] Lloyd: Guest87721: as in, including PDF generation time?
[14:31:54] Lloyd: how longs a piece of string :P
[14:31:59] maikowblue: has joined #RubyOnRails
[14:32:00] habitullence: tubbo: always appreciate your help btw, I have much to learn...
[14:32:16] tubbo: habitullence: this is probably an easier example to digest https://github.com/tubbo/controller_resources/blob/master/lib/controller_resources.rb and i need to require it in my spec_helper https://github.com/tubbo/controller_resources/blob/master/spec/spec_helper.rb#L7
[14:32:46] Guest87721: Lloyd: you're right :) I'll try with the ajax approach and we'll see how it works. Thanks Lloyd tubbo
[14:33:07] tubbo: habitullence: sometimes i do need to require 'rails/generators/named_base' in my gem if i want to ship generators.
[14:33:21] habitullence: tubbo: would you use autoload on generators too?
[14:33:37] tubbo: i feel like rails autoloads any generators in lib/generators anyway
[14:33:45] tubbo: because it does that for lib/tasks and i've never had to require in my generator...
[14:33:47] helpa: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[14:33:49] momomomomo: need the link
[14:33:59] kies^: has joined #RubyOnRails
[14:34:18] dionysus69: has joined #RubyOnRails
[14:34:20] tubbo: habitullence: you *do* have to have an Engine class that extends Rails::Engine in order to do that, however.
[14:34:20] habitullence: tubbo: interesting.. how do you mean ship generators? as part of a lib or independantly?
[14:34:27] tubbo: habitullence: yeah, like in a gem
[14:34:30] tubbo: rather than in your app
[14:34:41] sinkensabe: has joined #RubyOnRails
[14:34:49] koneko_: has joined #RubyOnRails
[14:35:54] habitullence: tubbo: that makes sense... I'm not extending Rails::Engine atm... My understanding is that I'd only do that for an app.. My gem just populates and manages a db table and model... Have I misunderstood?
[14:36:14] koneko_: has joined #RubyOnRails
[14:36:22] habitullence: I'm still a bit confused on when I should use a plugin vs engine
[14:36:44] tubbo: habitullence: no, but if you need to load "rails things" like generators or code in ./app, then it needs to be an engine iirc. plugin and engine are interchangeable.
[14:36:55] leex: Hi, I am using apipie and would like to set a param to be required only if another parameter is present. is there a way to do this? something like this required: (-> (p) { true if p[:other_param] == 'a' }).call(params) unfortunately params is not defined here.
[14:37:07] tubbo: the Engine class in your gem is like your "hook" into the Rails app. you can define default configuration that is available in the config object in application.rb, for example
[14:37:37] tubbo: you can also run code before or after other rails libs (like active_record) have been loaded, allowing you to safely extend them. (this is only for libs that support ActiveSupport::Notifications)
[14:39:07] anjen: has joined #RubyOnRails
[14:40:19] koneko_: has joined #RubyOnRails
[14:40:21] onebree: has joined #RubyOnRails
[14:40:41] webguynow: has joined #RubyOnRails
[14:41:17] onebree: has left #RubyOnRails: ()
[14:41:23] tyl: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[14:41:25] koneko_: has joined #RubyOnRails
[14:41:26] tyl: has joined #RubyOnRails
[14:42:13] johnflux: How can I get the controller to not redirect, but to stay on the same page?
[14:42:13] dopamean_: has joined #RubyOnRails
[14:43:21] tubbo: johnflux: render?
[14:43:28] tubbo: johnflux: !code
[14:43:28] helpa: johnflux: 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.
[14:43:36] tubbo: i don't even know why i bothered to guess :P
[14:43:44] habitullence: tubbo: I looked at options like --full and --mountable but they just created a load of scaffolding that I don't need. Pressumably I can just roll without these options and extend the engine to make one without all the fluff? It sounds like I shoud be using an engine I guess because of the generator part. I think my understanding of the plugin generator was just fuzzy, docs don't seem to talk much about using it without these options.
[14:44:12] cgfbee: has joined #RubyOnRails
[14:44:12] tubbo: habitullence: yeah you can just subclass Rails::Engine and call it YourGem::Engine, then require 'your_gem/engine' in your main lib file, and when you require that file, your engine gets included also.
[14:44:15] cfloare: has joined #RubyOnRails
[14:44:40] krz: has joined #RubyOnRails
[14:44:54] tubbo: habitullence: the plugin generator leaves a lot to be desired. i kinda wish rails included a "template" of some kind for `bundle gem`, because that's how i generate any non-rails gem libraries
[14:46:06] johnflux: quick side question first: form_tag @image, :url => {controller: :images_modal, action: :create}
[14:46:14] johnflux: would this default to :method => 'put' ?
[14:46:50] uris: has joined #RubyOnRails
[14:47:20] johnflux: config/routes.db has resources :images_modal
[14:47:22] habitullence: has joined #RubyOnRails
[14:47:28] centrx: has joined #RubyOnRails
[14:48:14] tubbo: johnflux: no, why would it?
[14:48:19] Pupeno: has joined #RubyOnRails
[14:48:32] webguynow: has joined #RubyOnRails
[14:48:33] tubbo: johnflux: well actually that's not true...the :method defaults to :put if @image.new_record?, otherwise it's :post
[14:48:34] redondo: has joined #RubyOnRails
[14:49:29] maz-dev_: has joined #RubyOnRails
[14:49:46] johnflux: @image.new_record? is true if it's a new record?
[14:50:08] johnflux: tubbo: shouldn't that be the other way around then?
[14:50:19] johnflux: post for creating a new image, and put for updating?
[14:50:41] mary5030: has joined #RubyOnRails
[14:50:55] codeurge: has joined #RubyOnRails
[14:51:23] polishdub: has joined #RubyOnRails
[14:52:46] EminenceHC: has joined #RubyOnRails
[14:52:53] bruno-: has joined #RubyOnRails
[14:54:48] kies^: has joined #RubyOnRails
[14:55:35] Zarthus: has joined #RubyOnRails
[14:57:29] chouhoulis: has joined #RubyOnRails
[14:59:01] hnanon: has joined #RubyOnRails
[14:59:14] Lytol: has joined #RubyOnRails
[14:59:31] apg: has joined #RubyOnRails
[15:00:12] hnanon: I have this in my controller:
[15:00:13] hnanon: https://gist.github.com/anonymous/7f70ac1240fdb203ed4b
[15:00:33] hnanon: Getting the error:
[15:00:35] hnanon: undefined method `essay' for #<Review::ActiveRecord_AssociationRelation:0x007f2020e09da8>
[15:00:43] maz-dev: has joined #RubyOnRails
[15:00:57] hnanon: I want to get the user (author) of that essay.
[15:01:13] gaussblurinc1: has joined #RubyOnRails
[15:03:10] krisquigley: has joined #RubyOnRails
[15:05:05] s2013: has joined #RubyOnRails
[15:05:37] Lightsword: has joined #RubyOnRails
[15:05:41] centrx: hnanon, @e1rr is a collection/result set of multiple reviews
[15:05:45] cschneid_: has joined #RubyOnRails
[15:06:18] arup_r: has joined #RubyOnRails
[15:06:34] dionysus69: has joined #RubyOnRails
[15:06:52] krisquig_: has joined #RubyOnRails
[15:07:06] idd2d: has joined #RubyOnRails
[15:07:29] jbro: has joined #RubyOnRails
[15:08:23] slash_nick: johnflux: you're right
[15:10:02] allcentury: has joined #RubyOnRails
[15:10:03] hnanon: centrx: So, in my view can I do @e1rr.essay.user.first_name?
[15:10:50] gaussblurinc1: hi! I have a trouble with i18n_data module. I can't require it via 'i18n_data' nor include I18nData despite of bundle show i18n_data command print correct path to this module
[15:10:53] hnanon: centrx: I actually have <% @e1rr.each do |review| %>
[15:11:00] centrx: hnanon, If you have multiple reviews in @e1rr, which essay is that suposed to get?
[15:11:03] allcentury: Is there an alternative to spring for Rails? To run a test it seriously takes 10 seconds to boot the app before the tests will run
[15:11:12] gaussblurinc1: could anyone help me with i18n_data?
[15:11:17] allcentury: It maybe goes down to 8 seconds with spring :|
[15:11:28] hnanon: centrx: all of them.
[15:11:32] allcentury: doing TDD w/ 8 seconds between a keystroke and a result is painful
[15:11:36] maz-dev: has joined #RubyOnRails
[15:11:48] hnanon: centrx: I actually have <% @e1rr.each do |review| %> in my view.
[15:13:08] hnanon: centrx: I tried that. It's working now (in the view). Thank you.
[15:13:44] gaussblurinc1: any help with i18n_data?
[15:14:12] centrx: gaussblurinc1, I don't know anything about it, ask a more specific question?
[15:15:56] gaussblurinc1: centrx: does this module shipped with rails 4?
[15:16:28] centrx: Not that I know of
[15:16:32] centrx: Doesn't look like it
[15:18:14] johnflux: tubbo: I made a gist: https://gist.github.com/johnflux/a66a26faa68fc8badb8d
[15:19:09] johnflux: what I'd like is for a .js file to run once you've created a new Image
[15:19:25] johnflux: and not redirect or change page at all
[15:19:46] johnflux: at the moment, it redirects and shows a blank page
[15:19:57] tubbo: johnflux: you haven't configured it to do that, it just returns html
[15:20:21] disgrntld: has joined #RubyOnRails
[15:20:24] tubbo: johnflux: if you want it to use a javascript view, you have to add it as a format to the create action
[15:20:26] smathy: has joined #RubyOnRails
[15:21:38] johnflux: tubbo: in both the form_for and the controller, right?
[15:22:15] tubbo: johnflux: no, i think if you just add the `remote: true` option to the form_for it will send it over as a JS request
[15:22:30] tubbo: johnflux: but yeah, in the controller :)
[15:23:38] momomomomo: has joined #RubyOnRails
[15:23:47] johnflux: tubbo: should i leave the format.html line in ?
[15:24:24] Rubie: has joined #RubyOnRails
[15:25:36] mitchless: has joined #RubyOnRails
[15:27:34] idd2d: has joined #RubyOnRails
[15:28:02] tubbo: johnflux: sure, why not? maybe your user doesn't have JS ;)
[15:28:23] webguynow: has joined #RubyOnRails
[15:30:18] dopamean_: has joined #RubyOnRails
[15:30:32] johnflux: tubbo: https://gist.github.com/johnflux/a66a26faa68fc8badb8d i updated
[15:31:06] tubbo: johnflux: you don't need :format => :js in your form_for. also what is this for? :url => {controller: :images_modal, action: :create},
[15:31:20] tubbo: johnflux: you shouldn't need to do that, the object will tell the form what its action url should be
[15:31:41] wildlander: has joined #RubyOnRails
[15:31:55] johnflux: tubbo: well the object goes to the 'images' controller, which is like an admin view
[15:32:11] johnflux: tubbo: that all works, and I wanted to add a modal way to add images with a popup
[15:32:25] wildlander: has joined #RubyOnRails
[15:32:34] johnflux: tubbo: I've tried it with and without the ":format => :js" bit
[15:32:35] tubbo: johnflux: so here's a question...why is there an ImagesModalController? that's smelly code right there. ImagesController#create should be able to handle asynchronous requests.
[15:32:48] tubbo: why can't it do that?
[15:33:12] johnflux: tubbo: the main reason is because at the top I have :
[15:33:13] johnflux: layout false
[15:33:20] EiN_: has left #RubyOnRails: ()
[15:33:34] EiNSTeiN_: has joined #RubyOnRails
[15:33:39] johnflux: so that it looks right when I render the create form in the modal dialog box
[15:33:43] tubbo: johnflux: i usually have a method called `use_layout?` that i use to determine whether to show the layour or not.
[15:33:48] EiNSTeiN_: has joined #RubyOnRails
[15:34:08] tubbo: johnflux: you basically need to do request.xhr? ? false : 'application', and you can make the layout macro use a method to determine its value by passing it a symbol
[15:34:13] EiNSTeiN_: guys, with all those spambot shenanigans and the new modes on the channel I can't auth my nickname without leaving this channel, this is a mild inconvenience in my daily routine and I wanted to complain publicly about it :p
[15:34:18] tubbo: johnflux: so layout :use_layout? runs the use_layout? method.
[15:34:29] tubbo: EiNSTeiN_: there's no new modes on the channel afaik
[15:34:33] EiNSTeiN_: freenode says: "EiNSTeiN_ #RubyOnRails :Cannot change nickname while banned on channel"
[15:34:40] Spami: has joined #RubyOnRails
[15:35:21] dopamean1: has joined #RubyOnRails
[15:35:34] EiNSTeiN_: because I'm not identified to my nickname, so I can't change my nickname so I can't identify ... circular dependencies suck don't they
[15:35:49] slash_nick: EiNSTeiN_: leave the channel and do what you need to... then come on back,.
[15:35:53] webguynow: has joined #RubyOnRails
[15:36:15] andrew-l: has joined #RubyOnRails
[15:36:38] tubbo: EiNSTeiN_: also make sure your client has auto-auth enabled, so that you don't get into that sticky situation again
[15:36:44] Cache_Money: has joined #RubyOnRails
[15:36:53] tubbo: mine just auths on connect and stays that way, because i use SASL: https://freenode.net/sasl/
[15:37:30] EiNSTeiN_: it does ato auth, but just not before joining the channels
[15:37:41] SteenJobs: has joined #RubyOnRails
[15:38:14] EiNSTeiN_: thanks tubbo I'll have a look at sasl auth on freenode, looks like there is ZNC support
[15:38:15] tubbo: SASL will authenticate while joining the server, so no race conditions are possible. it's a new standard in IRC iirc
[15:38:50] tubbo: EiNSTeiN_: yeah, you just need a special sasl module
[15:39:48] tyl: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[15:40:21] habitullence: tubbo: how would you debug in rspec tests? I'm using binding.pry but it seems to freeze
[15:40:38] VeryBewitching: has joined #RubyOnRails
[15:40:48] tubbo: habitullence: write more expectations :) i usually only use binding.pry when i need to open up my actual code
[15:41:14] johnflux: tubbo: I have it as just <%= form_for @image, :remote => true, :authenticity_token => true, :html => { :class => "form-horizontal image" } do |f| %>
[15:41:31] Spami: Off topic question. If you had to reach as much engineers as possible how would you do it?
[15:41:50] johnflux: tubbo: when I press ctrl+shift+k in firefox and view the network activity, I see a POST of type HTML. That's wrong, isn't it?
[15:41:53] FCser: has joined #RubyOnRails
[15:41:57] habitullence: tubbo: touch??! I just want to check a variable though because the result of the test is unexpected
[15:42:01] johnflux: tubbo: it should be js, but something is going wrong?
[15:42:24] tubbo: Spami: tell them i solved P=NP
[15:42:34] andrew-l: habitullence: you want to check the return value in your test?
[15:42:36] VeryBewitching: johnflux: No, remote: true means it's submitted via AJAX
[15:42:51] VeryBewitching: johnflux: It's still sent via POST though, unless otherwise specified
[15:43:03] habitullence: andrew-l: yep but would like to use debugger rather than puts etc
[15:43:09] Macaveli: has joined #RubyOnRails
[15:43:27] andrew-l: habitullence: did you try dropping a 'binding.pry' inside the test?
[15:43:38] andrew-l: i do that when i want add expectations
[15:43:56] johnflux: VeryBewitching: firefox says type html though, is that okay?
[15:43:58] habitullence: andrew-l: yeah, but the cursor just stops on a blank line :/
[15:44:07] johnflux: VeryBewitching: it shouldn't be type js or something?
[15:44:09] andrew-l: and just run that single test (rspec spec/model/User.rb:<test line number>)
[15:44:16] habitullence: think pry or something might be a bit broken
[15:44:36] johnflux: VeryBewitching: it's not running the format.js rule at all, only the format.html rule
[15:44:36] andrew-l: habitullence: did you put the 'binding.pry' inside the test?
[15:44:44] xcesariox: has joined #RubyOnRails
[15:44:53] johnflux: googling for "form_for remote not working" gives lots of similar errors
[15:44:56] andrew-l: habitullence: can you put a gist?
[15:45:14] habitullence: andrew-l: sorry, it's in the code the test is running
[15:45:23] VeryBewitching: johnflux: johnfluxCan you gist your controller?
[15:45:32] VeryBewitching: err.. meant that only once ;)
[15:45:40] andrew-l: habitullence: that's a pattern i use all the time so i have a hard time believing pry is broken...
[15:46:08] Macaveli: has joined #RubyOnRails
[15:46:33] habitullence: andrew-l: blam! https://gist.github.com/habitullence/4daa7b708676f48780a9
[15:46:52] johnflux: VeryBewitching: https://gist.github.com/johnflux/a66a26faa68fc8badb8d
[15:46:52] FCser: has joined #RubyOnRails
[15:46:54] andrew-l: ttps://gist.github.com/habitullence/4daa7b708676f48780a9
[15:47:00] andrew-l: err, sorry. emacs.
[15:47:46] habitullence: andrew-l: strong pinkies... try vim j/k ;P
[15:47:47] tubbo: andrew-l: emacs has an irc client now? :)
[15:47:54] andrew-l: it's always had it
[15:48:06] VeryBewitching: johnflux: https://gist.github.com/bewitchingme/2ccc9709873043bbee01#file-images_controller-rb-L2
[15:48:13] andrew-l: vim is nice, but i love emacs. sorry.
[15:48:19] VeryBewitching: Look at the line I added and highlighted.
[15:48:30] habitullence: I'm just jealous cause my brain can't remember all those key combinations ;)
[15:48:33] tubbo: andrew-l: emacs is really awesome, i wish i was smart enough to use it. but i'm a caveman so i use vim :D
[15:48:43] tubbo: jim weirich *almost* made me convert
[15:48:51] gregf_: has joined #RubyOnRails
[15:48:51] andrew-l: emacs is awesome.
[15:49:03] tubbo: yeah like his little elisp thing to turn initialize() args into ivars? killer.
[15:49:16] andrew-l: i love working in a single monitor, but have term, ruby, and debug in a single window
[15:49:20] andrew-l: and org-mode rocks.
[15:49:29] SlenderMan: has joined #RubyOnRails
[15:49:37] andrew-l: and a web browser in emacs is killer
[15:49:47] andrew-l: no ads, pure content.
[15:49:51] IceyEC: has joined #RubyOnRails
[15:50:02] neanderslob: has joined #RubyOnRails
[15:50:09] Guest87028: has joined #RubyOnRails
[15:50:25] andrew-l: ok, habitullence: looks like you're testing a module... rspec gets super funky with modules cuz i think it needs to be attached to an object
[15:50:46] habitullence: someday I'll spend more time with emacs, for now there's this thing called nvim... how vim should be :)
[15:51:09] andrew-l: you can do the same binding.pry inside a regular model and you will have access to the test code just like you would on the rails side
[15:51:18] habitullence: andrew-l: sidetracked :) yeah, the pry thing...
[15:51:39] johnflux: VeryBewitching: doesn't seem to make any difference. It's still running the format.html line and firefox confirms that it's doing POST view html, not js
[15:51:57] andrew-l: i like vim a lot, was my goto editor before... then i discovered gdb integration in emacs and never looked back.
[15:52:25] habitullence: andrew-l: but I'm calling within a class - AdminBoundsGenerator
[15:52:26] smathy: This is the most friendly emacs/vim battle I've ever seen.
[15:52:27] andrew-l: msg me anytime if you want some emacs help :-)
[15:52:43] johnflux: VeryBewitching: oh wait, i've got format.js instead of format.json
[15:52:50] johnflux: VeryBewitching: hmm no i want .js
[15:53:10] johnflux: VeryBewitching: so should it be respond_to :js, :html ?
[15:53:13] VeryBewitching: johnflux: You aren't doing anything for JS, bear that in mind too
[15:53:14] andrew-l: habitullence: yeah, it is, but is the test actually being executed? rspec will run test modules but not execute them
[15:53:27] habitullence: smathy: there's no battle, just what you like using the most ;)
[15:53:31] apg: has joined #RubyOnRails
[15:53:31] andrew-l: when there's lots of modules/mixins rspec gets fuzzy...
[15:53:43] johnflux: VeryBewitching: I thought doing format.js made it return the create.js.erb file by default
[15:53:45] smathy: Kids these days, don't even know how to have a proper editor war.
[15:53:52] VeryBewitching: johnflux: You have 'format.js' with no block.
[15:54:00] andrew-l: smathy: spacemacs is the new thing!
[15:54:21] andrew-l: i converted a hardcore vim guy to emacs... then he came back to me saying spacemacs is da bomb!
[15:54:30] smathy: I'm just surprised you guys survived in here without someone telling you how awesome Sublime is.
[15:54:36] habitullence: apparently Linus has his own that he might release one day ;)
[15:54:48] andrew-l: Hail Linus.
[15:54:51] pawnbox: has joined #RubyOnRails
[15:55:38] andrew-l: anyways, i was going to ask if anyone here had experience with the faye-websocket and rails. just have a question about the rack/middleware part
[15:55:53] smathy: andrew-l, !used
[15:55:53] helpa: andrew-l: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[15:56:16] jsvgoncalves: has joined #RubyOnRails
[15:56:18] andrew-l: smathy: thanks. will restate.
[15:56:30] pixelhandler: has joined #RubyOnRails
[15:56:31] habitullence: andrew-l: I have but yeah, ask away
[15:57:41] corioliss: has joined #RubyOnRails
[15:57:51] pontiki: has joined #RubyOnRails
[15:57:52] dionysus69: has joined #RubyOnRails
[15:58:17] andrew-l: ok, i'm using faye-websocket for a websocket app converting the heroku example here: https://devcenter.heroku.com/articles/ruby-websockets and don't like how every single call to the server now is passing through the middleware created. is there a way to have the endpoint that works with websocket to only respond instead of every single endpoint of the app (i.e. even /user/login goes through the middleware)
[15:58:17] nettoweb: has joined #RubyOnRails
[15:59:08] VeryBewitching: johnflux: You're correct, it should render it for that format by default.
[15:59:44] VeryBewitching: johnflux: I've used respond_to for HTML, JSON and XML, but never for JS, still trying to figure out what the solution should be.
[15:59:57] habitullence: andrew-l: there is an option for this I think.. one sec..
[16:00:10] towski_: has joined #RubyOnRails
[16:00:23] webguynow: has joined #RubyOnRails
[16:01:03] habitullence: andrew-l: try mount: '/path'
[16:01:33] habitullence: andrew-l: I'll gist
[16:01:39] andrew-l: habitullence: thanks!
[16:01:51] EminenceHC: has joined #RubyOnRails
[16:02:20] andrew-l: i have faye-websocket working, i just don't want EVERY call to be checked (call.websocket?)
[16:02:30] andrew-l: and feel this is a lot of overhead on every call
[16:02:39] tubbo: VeryBewitching / johnflux you need an app/views/images_modal/create.js view so the rails app has something to execute first of all
[16:02:45] habitullence: andrew-l: https://gist.github.com/habitullence/a438df73335e684f7421
[16:02:53] skullcrasher: has joined #RubyOnRails
[16:03:00] qejk: has joined #RubyOnRails
[16:03:01] johnflux: tubbo: i added a images/create.js.erb
[16:03:10] NBarnes: has joined #RubyOnRails
[16:03:12] habitullence: I had A LOT of fun with faye and rails, especially when it came to testing!!
[16:03:14] Rubie: has joined #RubyOnRails
[16:03:28] tubbo: johnflux: oh right, because it's not going to images_modal anymore
[16:03:48] andrew-l: habitullence: how did you test? and samples?
[16:03:53] codeurge: has joined #RubyOnRails
[16:03:57] dionysus69: has joined #RubyOnRails
[16:05:09] FCser: has joined #RubyOnRails
[16:05:47] shinnya: has joined #RubyOnRails
[16:06:47] gregf_: has joined #RubyOnRails
[16:07:08] kies^: has joined #RubyOnRails
[16:07:17] webguynow: has joined #RubyOnRails
[16:07:29] habitullence: andrew-l: should get you on your way https://gist.github.com/habitullence/a644bd4f787541df04f5
[16:08:25] agent_white: has joined #RubyOnRails
[16:09:16] iamse7en: has joined #RubyOnRails
[16:09:42] havenwood: has joined #RubyOnRails
[16:10:04] andrew-l: habitullence: hmmm... i'll digest this a bit and come back. thanks!
[16:10:40] habitullence: andrew-l: no problem.. I actually helped someone other than myself for a change, holy sh!t ;P
[16:10:47] andrew-l: habitullence: as for binding.pry and rspec, try dropping binding.pry in a different test (maybe spec/model/User.rb) and see the results.
[16:11:04] apg: has joined #RubyOnRails
[16:11:07] andrew-l: habitullence: now you can say you're a MAN! :-)
[16:12:09] habitullence: andrew-l: will give it a go, thanks. I've completed my rite of passage :)
[16:12:11] dionysus69: has joined #RubyOnRails
[16:12:38] andrew-l: habitullence: when you get your emacs-fu on, then you can say you're a CODER :-)
[16:13:05] bejar37: has joined #RubyOnRails
[16:13:48] habitullence: andrew-l: try and type that again in a few years when you have RSI ;)
[16:14:01] atomical: has joined #RubyOnRails
[16:14:06] tubbo: andrew-l: s/CODER/neckbeard
[16:14:21] andrew-l: who says emacs causes RSI?!
[16:15:09] habitullence: there's a reason you don't hear from anyone that uses emacs after a few years...
[16:15:22] pontiki: lies, all lies.
[16:15:28] pontiki: i've been using it since 1984
[16:15:31] suchness: vimmasterrace
[16:15:34] andrew-l: yeah, cuz we're spending time with our wives. :-)
[16:15:56] FailBit: get on my level bitches
[16:15:57] andrew-l: ed, that's hardcore!
[16:16:10] andrew-l: NOW we have an editor war!
[16:16:14] andrew-l: smathy: boom!
[16:16:28] pontiki: emacs has a mode for that
[16:16:36] codenapper: has joined #RubyOnRails
[16:16:52] Rubie: has joined #RubyOnRails
[16:16:53] andrew-l: pontiki: lol
[16:17:00] smathy: Nicely played.
[16:17:07] baweaver: has joined #RubyOnRails
[16:17:11] yardenbar: has joined #RubyOnRails
[16:17:16] smathy: pontiki, everything andrew-l has said has been an emacs macro
[16:17:28] andrew-l: M-x ansi-term
[16:17:34] dionysus69: has joined #RubyOnRails
[16:17:57] pontiki: smathy: everything *i* say is an emacs macro
[16:18:05] smathy: You are an emacs macro
[16:18:08] andrew-l: http://redgreenrepeat.com/2015/07/16/why-i-love-emacs-error/
[16:18:16] andrew-l: git gave me an error in emacs...
[16:18:40] andrew-l: smathy: M-x editor-flame-war :-)
[16:19:39] pontiki: magit to the rescue
[16:19:47] andrew-l: and that's why emacs-irc client rocks. :-)
[16:20:10] tubbo: habitullence: that's because their mouth is stuffed with cheetos and they live in their parents basement (why you don't hear from emacs users after a couple years)
[16:20:28] stef1a: has joined #RubyOnRails
[16:20:37] andrew-l: tubbo: lol. yeah, the HBO is better here. :-)
[16:20:52] habitullence: lmao... reading between the lines ;) Now we have a war!
[16:20:53] tubbo: i heard some noise about emacs having the ability to like proxy between a shell so you can actually use fully-fledged zsh within emacs
[16:21:08] tubbo: and it translates everything like colors and formatting
[16:21:08] andrew-l: tubbo: yes, ansi-term
[16:21:21] tubbo: andrew-l: do you use emacs shell or a regular shell with ansi-term?
[16:21:28] andrew-l: tubbo: yes, it's awesome. i can use binding.pry within ansi-term
[16:21:30] stef1a: i'm running a Rails app with a pgsql database, and this error started occurring with no changes to the code: "PG::ConnectionBad: could not connect to server: No such file or directory; Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?" help?
[16:21:32] johnflux: If I remove the ":authenticity_token => true" then I get a ActionController::InvalidAuthenticityToken in ImagesController#create
[16:21:39] smathy: s/like proxy.*/do any fucking thing you could possibly imagine/
[16:21:44] habitullence: andrew-l: so I moved the binding outside of my migration method and it was caught.. weird!
[16:21:51] bricker: has joined #RubyOnRails
[16:21:54] andrew-l: tubbo: ansi-term is pure shell. oh-my-zsh themes an all
[16:21:59] johnflux: maybe this is indicating the reason why my remote=> true isn't working
[16:22:11] tubbo: stef1a: your postgres server isn't running.
[16:22:13] smathy: People keep thinking that skynet will be some complex AI system, it won't, it'll be a runaway emacs plugin.
[16:22:25] smathy: (well, it'll be both ;)
[16:22:28] tubbo: stef1a: if you run `psql yourapp_development` it will probably give you the same error
[16:22:43] tubbo: smathy: M-x emacs-neural-network
[16:22:56] andrew-l: tubbo: i was using emacs shell before, but binding.pry always messed up and i needed another terminal. now with ansi-term, i have a window just to run binding.pry / test / rails c
[16:22:56] smathy: No, that'd be too obvious.
[16:23:11] smathy: M-x order-me-food
[16:23:16] habitullence: I really like prezto over oh-my-zsh... Not trying to start another war
[16:23:22] andrew-l: smathy: M-x init-skynet
[16:23:23] sam_weerasinghe1: has joined #RubyOnRails
[16:23:27] smathy: "Oh shit, I forgot to close that loop."
[16:23:29] tubbo: habitullence: shell frameworks are for suckerrrrrrrrs
[16:23:40] smathy: Oh good, a shell war too.
[16:23:54] andrew-l: habitullence: actually, i switch out oh-my-zsh... what a pig. i'm on prezto now, but can't get prompt working...
[16:24:03] andrew-l: smathy: gotta do it all!
[16:24:05] habitullence: whoop! *click click*
[16:24:15] stef1a: tubbo: how can i fix it?
[16:24:21] tubbo: stef1a: start the postgres server
[16:24:25] smathy: andrew-l, you use a shell? I can hear emacs stalwarts turning in their graves.
[16:24:45] andrew-l: smathy: code's gotta hit the pavement somewhere. :-)
[16:25:11] smathy: andrew-l, emacs hasn't re-implemented the entire kernel yet?
[16:25:18] tubbo: i'm just gonna make my own editor
[16:25:19] tubbo: with casinos
[16:25:20] Scriptonaut: has joined #RubyOnRails
[16:25:21] tubbo: and hookers
[16:25:22] habitullence: tubbo: I won't say the same about web frameworks ;P
[16:25:24] tubbo: in fact, forget the editor
[16:25:27] smathy: tubbo, and butterflies.
[16:25:36] habitullence: oh no he didaaant
[16:25:38] AzaToth: has joined #RubyOnRails
[16:25:43] rakm: has joined #RubyOnRails
[16:25:58] andrew-l: tubbo: i'm in!
[16:26:05] andrew-l: (for the hookers!)
[16:26:21] habitullence: yeah, I'm switching to zsh as my editor..
[16:26:21] Choclo: has joined #RubyOnRails
[16:26:22] EminenceHC: has joined #RubyOnRails
[16:26:34] andrew-l: habitullence: lol.
[16:26:41] smathy: IPM starting in 5 minutes, must try to prolong editor war...
[16:27:28] pontiki: can he do it, folk?
[16:27:32] stef1a: when i run `psql`, it tells me the database does not exist. why would this happen? is it safe to `bundle exec rake db:create`? will this restore the data to the db?
[16:27:32] habitullence: "I really like Eclipse!"... who the f*ck said that?!
[16:27:53] tubbo: habitullence: i mean, if you're writing java i hear it's pretty neat
[16:28:03] andrew-l: habitullence: lol. oh man... eclipse...
[16:28:18] tubbo: stef1a: well, your database server doesn't seem to be running in the first place. that's your problem.
[16:28:19] andrew-l: i won't touch that with a 10foot pole.
[16:28:22] dionysus69: has joined #RubyOnRails
[16:28:37] habitullence: tubbo: yeah that's what I hear... so long as they're far away, I don't mind
[16:28:44] FCser: has joined #RubyOnRails
[16:28:53] tubbo: stef1a: i don't know how you installed postgres or whatever but you must have forgotten to init it. if you're on mac, `brew info postgresql` has a caveat telling you how to start the server.
[16:29:23] habitullence: btw I assume everyone's on Windows 10 now?
[16:29:25] tubbo: habitullence: i used to use it when i was learning java in high school. hated it, but partially because it was new/buggy and partially because i was running it on shitty ass windows xp
[16:29:33] tubbo: habitullence: literally none of us run windows
[16:29:55] habitullence: I love how everything just kind works for a change
[16:30:09] andrew-l: smathy: now we got the OS...
[16:30:13] buhman: people said that about windows 98
[16:30:25] tubbo: hopefully no one will figure out how to leverage the automatic unstoppable updating feature
[16:30:32] tubbo: to load malware onto every single windows 10 machine ever
[16:30:33] andrew-l: win10 forever!!!
[16:30:35] smathy: stef1a, has this database ever existed?
[16:30:41] habitullence: andrew-l: I thought, "why stop with editors?"
[16:30:43] smathy: (since switching to postgres)
[16:31:00] cih: has joined #RubyOnRails
[16:31:07] andrew-l: habitullence: it's HUMP DAY, let's do it all!
[16:31:08] stef1a: smathy: yes
[16:31:15] andrew-l: carry us right into the weekend!
[16:31:22] smathy: stef1a, and is your postgres server running?
[16:31:29] stef1a: smathy: how can i determine that?
[16:31:44] smathy: stef1a, google: how do I tell if my postgres server is running
[16:31:50] habitullence: if you have windows, you can do things like errr powershell :O
[16:32:10] pontiki: if stef1a is getting "database does not exist" from psql, postgres is running
[16:32:10] andrew-l: habitullence: powershell !!!
[16:32:36] andrew-l: habitullence: the most powerful shell of them all...
[16:32:50] smathy: stef1a, there you go, pontiki recognized the error message you posted.
[16:33:30] dopamean_: has joined #RubyOnRails
[16:33:34] stef1a: the database existed and the app was working about half an hour ago
[16:33:59] stef1a: it occasionally does this when it pulls in changes from master (it does this every 30 min), but no one has pushed to master recently
[16:34:04] krz: has joined #RubyOnRails
[16:34:12] habitullence: I did actually have a contract recently where they wanted to deploy to windows... Ended up deploying to linux... Ubuntu's the best distro btw in case you didn't know... OK this has gotten outta control
[16:34:28] habitullence: some work needs to be done today
[16:34:39] andrew-l: habitullence: DEBIAN 4eva!!!
[16:34:50] andrew-l: habitullence: let the windows guys do it!
[16:34:55] andrew-l: habitullence: or the node guys
[16:35:11] rakm: has joined #RubyOnRails
[16:35:15] andrew-l: habitullence: we're the too cool for work group!
[16:35:30] mitchless: has joined #RubyOnRails
[16:36:20] habitullence: andrew-l: work pays for my windows server licenses ;P
[16:36:43] andrew-l: habitullence: don't you mean your MSDN life membership?
[16:37:28] habitullence: Talking of the too cool group.. I wish I had MSDN for life!
[16:37:54] rromanchuk: has joined #RubyOnRails
[16:38:03] andrew-l: habitullence: speaking of cool, I actually met Mr. "DEVELOPERS DEVELOPERS DEVELOPERS" once
[16:38:06] miguelff: has joined #RubyOnRails
[16:38:43] ngscheurich: has joined #RubyOnRails
[16:39:06] andrew-l: he was in line at the Apollo Theater and i saw him. I went up and asked: "This might be a crazy question, but are you Mr. 'DEVELOPERS DEVELOPERS DEVELOPERS'?" and he said: "Yes, you're right!"
[16:39:49] petricore: has joined #RubyOnRails
[16:39:49] andrew-l: i should have taken a photo with him, but he seemed busy with his family and well... the line started moving ><
[16:40:14] cs44: has joined #RubyOnRails
[16:40:51] cs44: has left #RubyOnRails: ()
[16:40:57] paulcsmith: has joined #RubyOnRails
[16:41:26] mloy: has joined #RubyOnRails
[16:44:09] skyjumper: i'd be afraid of getting a chair thrown at me
[16:44:54] SteenJobs: has joined #RubyOnRails
[16:45:28] Choclo: has joined #RubyOnRails
[16:47:05] andrew-l: skyjumper: no chairs since we were in line, but there was a line separator thingy :-)
[16:48:21] jkamenik1: has joined #RubyOnRails
[16:50:33] habitullence: andrew-l: claim to fame :)
[16:51:07] fschuindt: has joined #RubyOnRails
[16:51:25] nettoweb: has joined #RubyOnRails
[16:51:48] habitullence: does anyone know why assert_file is used so loosely, rather than expecting it to match specific contents?
[16:51:48] strcmp1: has joined #RubyOnRails
[16:52:08] habitullence: example: https://github.com/plataformatec/devise/blob/master/test/generators/active_record_generator_test.rb
[16:52:30] habitullence: surely just expecting there to be a file isn't really much of a test
[16:52:38] cs44_: has joined #RubyOnRails
[16:52:55] pontiki: who is mr. developers developers developers ??
[16:53:28] lwu_: has joined #RubyOnRails
[16:53:39] strcmp1: habitullence, assert_file to test something that generates a file seems fine
[16:53:49] fschuindt: Folks, why Page.enabled.find(params[:id]) is raising an error when it can't find? (:enabled is a scope) I want it to just go false.
[16:54:07] habitullence: strcmp1: but you can pass contents to it..
[16:54:09] pontiki: fschuindt: that's what find does.
[16:54:37] habitullence: the test in devise just seems.. pointless
[16:54:56] pontiki: fschuindt: you can use find_by(id: id) and it will return nil if it can't find the object
[16:55:02] fschuindt: pontiki: redirect_to root_url unless @page = Page.enabled.find(params[:id])
[16:55:16] pontiki: fschuindt: yes, and?
[16:55:33] fschuindt: pontiki: it just rais error, I will try find_by
[16:56:01] n008f4g_: has joined #RubyOnRails
[16:56:17] fschuindt: pontiki: It worked, thank you
[16:56:22] webguynow: has joined #RubyOnRails
[16:57:39] habitullence: can someone comment on these tests https://github.com/plataformatec/devise/blob/master/test/generators/active_record_generator_test.rb godddamitt!!!
[16:57:50] habitullence: Have I lost my mind?!
[16:58:10] mitchless: has joined #RubyOnRails
[16:58:30] arBmind: has joined #RubyOnRails
[16:59:07] andrew-l: habitullence: no, cuz... devise. :-)
[17:00:15] dionysus69: has joined #RubyOnRails
[17:00:25] habitullence: andrew-l: that's what I thought would be a good example but now I'm not so sure... I know, I know - I should have more confidence in myself
[17:00:36] pontiki: i can't believe this, my phone is *full*
[17:00:36] Pavster: has joined #RubyOnRails
[17:01:16] [Butch]: has joined #RubyOnRails
[17:01:28] yaymukund: has joined #RubyOnRails
[17:01:38] idd2d: has joined #RubyOnRails
[17:02:00] Jardayn: has joined #RubyOnRails
[17:02:02] andrew-l: habitullence: what kind of example are you looking for?
[17:03:06] habitullence: andrew-l: well devise has some similar things to what I'm working on but I'm going to come up with my own tests cuz... devise :)
[17:03:32] dideler11: has joined #RubyOnRails
[17:03:43] krisquigley: has joined #RubyOnRails
[17:03:50] Scriptonaut: does anyone know how I can render js: in response to an ajax POST, and have the JS just automatically run, as if I was rendering a action_name.js.haml
[17:04:09] Scriptonaut: when I do render js: in response to the AJAX, it just returns the JS as text
[17:04:33] rhizome: well it is text.
[17:04:41] rhizome: it's what you do with that text
[17:05:02] Scriptonaut: rails automatically runs the js rendered when the view rendered is file.js.erb
[17:05:07] Scriptonaut: Why can't I make it do taht?
[17:05:23] tubbo: Scriptonaut: are you using `remote: true` in the form_for?
[17:05:44] Scriptonaut: but it is remote
[17:05:45] tubbo: andrew-l: i love how you called steve ballmer "mister developers developers developers" haha
[17:05:58] Scriptonaut: I'm not actually submitting the form normally
[17:06:08] Scriptonaut: I'm catching the submit, preventing default, then using $.ajax
[17:06:09] tubbo: Scriptonaut: if you're using rails UJS, then it's not a "remote form" unless you set remote: true
[17:06:23] tubbo: Scriptonaut: why not just set remote: true and capture the form's ajax:success event?
[17:06:54] Scriptonaut: I wasn't aware the event occured on the form
[17:07:23] Scriptonaut: $(document).on("ajax:success", "#my_form", function() {})
[17:07:52] Scriptonaut: that's a good idea, I'll do that
[17:08:05] Scriptonaut: the problem still remains though, how can I force the JS rendered by my controller to execute in browser
[17:08:05] tubbo: Scriptonaut: https://gist.github.com/tubbo/da270f571dfb37206152
[17:08:07] cs44: has joined #RubyOnRails
[17:08:33] tubbo: Scriptonaut: why would you need JS "rendered by your controller" when you can just put the JS in your ajax:success handler?
[17:08:52] AxonetBE: has joined #RubyOnRails
[17:09:12] Scriptonaut: because turbolinks is caching stuff and returning a turbolinks.visit when I need a redirect path
[17:09:33] Scriptonaut: so I was just going to return window.location =, so that hwen Turbolinks decided to do taht it wouldn't break everything
[17:10:28] webguynow: has joined #RubyOnRails
[17:11:23] tubbo: Scriptonaut: definitely never do that.
[17:11:39] Scriptonaut: that's actually how the code worked before I started investigating it for a bug
[17:11:43] Scriptonaut: some other dev wrote it like that
[17:11:51] tubbo: Scriptonaut: that's the right way to do it, especially if you're using turbolinks.
[17:11:53] Scriptonaut: hrm, well I wonder what to do then
[17:11:54] workmad3: Scriptonaut: it's generally seen as a pretty bad idea to be producing JS from a controller action that gets rendered and sent back in response to an ajax request nowadays
[17:12:11] Scriptonaut: tubbo: which way is the right way?
[17:12:18] greengriminal: has joined #RubyOnRails
[17:12:25] Scriptonaut: the way I'm doing it by returning the path, and redirecting in the ajax:success handler?
[17:12:26] workmad3: Scriptonaut: it mashes up data and code, when really you should just send back data and already have the code in the browser from initial page load
[17:12:39] tubbo: Scriptonaut: wait, you're redirecting anyway?
[17:12:42] tubbo: what's the point of having JS?
[17:12:47] prestorium: has joined #RubyOnRails
[17:12:53] Scriptonaut: because of the damn turbolinks
[17:13:06] Scriptonaut: turbolinks, rather than returning a redirect path, is returning JS that redirects
[17:13:24] Scriptonaut: it's returning this, rather than a path: Turbolinks.visit('http://beta.brivity.com/people/clients');
[17:13:37] annlewis: has joined #RubyOnRails
[17:14:01] Scriptonaut: don't click that :P
[17:14:30] workmad3: oh the temptation...
[17:14:43] broman: has joined #RubyOnRails
[17:15:19] broman: can someone help me?? my application creates a symlink of a file, but that symlink is created with the owner being root.. how can i set this to the right user??
[17:15:24] tubbo: Scriptonaut: that's interesting, i've never seen that behavior before.
[17:15:40] Scriptonaut: I think I might force turbolinks to not work on this one page
[17:15:42] tubbo: Scriptonaut: are you using the stable released version of turbolinks, or the newest 'master' from rails/turbolinks?
[17:16:16] Scriptonaut: is what I'm using
[17:16:21] tubbo: broman: now that i know your rails app runs as root, go ahead and link me to your server so i can pwn your box ;)
[17:16:30] tubbo: broman: what do you mean by "the right user"? :)
[17:16:51] podman: has joined #RubyOnRails
[17:16:54] tubbo: Scriptonaut: yeah you're all good
[17:17:00] tubbo: just making sure it's not 3.0.0
[17:17:12] broman: tubbo, ^^
[17:17:22] mhib: has joined #RubyOnRails
[17:17:26] tubbo: Scriptonaut: https://github.com/rails/turbolinks#opting-out-of-turbolinks read the "Note:"
[17:17:28] broman: tubbo, well... i have root and a have a user called videos
[17:17:43] broman: tubbo, my videos app creates a symlink of some files into public_html
[17:17:55] tubbo: broman: is your videos app running as the videos user?
[17:17:58] broman: tubbo, but they are not accessible by nginx
[17:18:16] tubbo: broman: also...is the rails app the videos app? or is that separate? :)
[17:18:18] broman: tubbo, where i change this?? on the unicorn service??
[17:18:37] broman: the application is on one user and the videos is on other user
[17:19:04] tubbo: broman: that's gonna be tough. running both of them as the same user would solve your problems with no code changes
[17:19:08] broman: the rails app simply creates a symlink so that the user can access..
[17:19:19] broman: tubbo, yes, but there are a few other things involved :)
[17:19:20] SteenJobs: has joined #RubyOnRails
[17:19:26] broman: i would like to fix it in the code
[17:19:28] tubbo: broman: you can't create symlinks for other users unless you're root, using `sudo`, etc.
[17:19:51] tubbo: broman: run them all as the same user, problem solved.
[17:20:01] crystal77: has joined #RubyOnRails
[17:20:07] broman: tubbo, i am creating the symlinks already! but they are owned by root.. i want to change the user to videos
[17:20:08] tubbo: broman: otherwise you'll have to give your app sudo and/or root access. that is a bad idea.
[17:20:14] broman: how can i accomplish that?
[17:20:18] tubbo: broman: you CAN'T.
[17:20:34] cs44_: has joined #RubyOnRails
[17:20:39] broman: i can't live with "you can't" :(
[17:20:55] tubbo: broman: if you are running the app as root, you would be able to
[17:21:09] tubbo: broman: you just change the ownership of the file with chown
[17:21:28] tubbo: broman: but if you don't have access to do that, you'll have to give the app sudo access so it can run the command
[17:21:31] broman: tubbo, if the symlink is already created for root.. am i not running root?
[17:21:44] broman: another thing
[17:21:45] tubbo: broman: lol i'd assume so
[17:21:56] broman: on the terminal, i tried to chown videos:videos but it didnt work
[17:21:58] broman: the error:
[17:22:02] helpa: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[17:22:23] broman: chown: cannot dereference `ffa277201f94bb9fe9f895009764bf3dcbf43627.ts': No such file or directory
[17:22:29] tubbo: whoa that is weird
[17:22:37] tubbo: broman: so that's not a dir?
[17:22:39] tubbo: err, file*
[17:22:47] broman: this is a symlink
[17:22:55] tubbo: that shouldn't matter
[17:22:59] tubbo: at least it doesn't for me
[17:23:13] broman: this is very strange.. i just tried to cat it
[17:23:14] buhman: sounds like the symlink points to a file that doesn't exist
[17:23:14] smathy: ...unless the symlink is broken (pointing to something that doesn't exist)
[17:23:17] broman: and the same error ocurred
[17:23:24] buhman: s/file/path/
[17:23:32] smathy: .ts looks suspicious
[17:23:53] greenarrow: has joined #RubyOnRails
[17:23:59] broman: ts is for hls.. is a video fragment
[17:24:22] tubbo: smathy: not if this is an mp4 hls segment :D
[17:24:33] webguynow: has joined #RubyOnRails
[17:24:54] tubbo: broman: clearly the symlink path is fucked u
[17:25:03] smathy: Sorry, I was just lobbing in at the end without getting context.
[17:26:02] tubbo: so i'm just curious, what about "No such file or directory" made you think "well clearly the problem is i don't have access to this file"
[17:26:27] broman: so i just tried to create another symlink from terminal and the same error ocurred
[17:26:36] broman: cat: teste.ts: No such file or directory
[17:26:47] broman: not really a ror matter :(
[17:27:36] tubbo: teste.ts huh
[17:28:12] towski_: has joined #RubyOnRails
[17:28:22] lindii_: has joined #RubyOnRails
[17:29:27] EminenceHC: has joined #RubyOnRails
[17:31:48] Omilun: has joined #RubyOnRails
[17:34:35] nzst: has joined #RubyOnRails
[17:34:47] Omilun: hello ... i need to chenge my table name and i used this way : http://dpaste.com/2KKW77K
[17:34:47] Omilun: but i have this problem : http://dpaste.com/3ME1VJC
[17:35:25] nzst: Hi, how do I set up a *_filter that checks if a specific field was updated as my conditional?
[17:35:40] nzst: in my model, of course
[17:35:52] da3mian: has joined #RubyOnRails
[17:35:52] BlackCoyote: has joined #RubyOnRails
[17:36:12] tubbo: omilun: i suppose the migration didn't work the first time?
[17:36:13] siemprefresco: has joined #RubyOnRails
[17:36:40] i: has joined #RubyOnRails
[17:36:52] tubbo: nzst: you can use AR::Dirty... http://api.rubyonrails.org/classes/ActiveModel/Dirty.html
[17:37:00] tubbo: sorry, ActiveModel::Dirty :D
[17:37:14] nzst: tubbo: will that work in an after filter? or only a before?
[17:38:06] tubbo: nzst: there's no such thing as before and after filters in active_model. you're probably thinking of active_record callbacks: http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html
[17:38:57] Omilun: tubbo: in status my migration is up but on workbrench dose not work
[17:39:30] nzst: tubbo: you're right, I am. So, is there a similar method for ActiveRecord?
[17:39:53] tubbo: nzst: yeah, that doc i sent you tells you about all of them and examples of their use
[17:40:09] nzst: tubbo: gratzi
[17:41:22] s2013: has joined #RubyOnRails
[17:42:33] s2013: morning yall. got a question.. so we wanna track everything the user does, from which page they visit to what they search, etc..so i was thinking of creating an events table/model that tracks it.. so one column would called event_type so it would be things like "search" "visit" etc
[17:43:07] s2013: and other column could be something like term? for search term.. problem is it doesnt exactly fit properly in the model. there would be lots of null fields..
[17:43:21] s2013: so if they visit a specific product for example iw anna track that so id have a product_id
[17:43:36] s2013: but for the search term there is no prodcut id
[17:43:43] s2013: or should i make multiple tables/models?
[17:43:45] optimus55: has joined #RubyOnRails
[17:43:48] tubbo: s2013: why reinvent the wheel? https://github.com/Shopify/statsd-instrument ;)
[17:43:51] s2013: what do yall suggest
[17:44:09] tubbo: s2013: at a former company i worked at, we used statsd for a minute to get some neat statistics about various things that required high availability
[17:44:16] nzst: s2013: you might want to explore google analytics, as well to gather data on users
[17:44:22] s2013: we use ga
[17:44:34] tubbo: yeah but GA can be limiting sometimes, most notably how it presents data to you
[17:44:36] s2013: thesea re very specific things we wanna track thats relevant to our business
[17:45:09] tubbo: s2013: would kinda suck if you had to make another DB query for every page visit and search term the user performs
[17:45:20] fryguy9: has left #RubyOnRails: ()
[17:45:40] fryguy: has joined #RubyOnRails
[17:45:50] s2013: statsd looks interesting but might be overkill and not exactly what we are looking for
[17:46:02] sinkensabe: has joined #RubyOnRails
[17:46:31] EminenceHC: has joined #RubyOnRails
[17:46:40] s2013: ill definitely explore it though.. but for now we want to track specific things the user does
[17:47:28] gaussblurinc1: has joined #RubyOnRails
[17:48:16] petricore: has joined #RubyOnRails
[17:49:46] Omilun: tubbo: ex me why i can't chenge my table ?
[17:50:05] s2013: yeah i think il have one table.. makes more sense
[17:53:09] Omilun: i used this way for change my table's name : http://dpaste.com/2KKW77K
[17:53:10] Omilun: but i have this problem : http://dpaste.com/3ME1VJC
[17:53:10] Omilun: whats wrong
[17:53:22] tubbo: s2013: yeah you might just be fine with creating a table
[17:53:25] tubbo: omilun: no cluie
[17:54:27] Omilun: tubbo: ok
[17:55:24] Lightsword: has joined #RubyOnRails
[17:58:11] mhib: has joined #RubyOnRails
[17:58:21] havenwood: has joined #RubyOnRails
[17:59:05] dionysus69: has joined #RubyOnRails
[17:59:17] siemprefresco: has joined #RubyOnRails
[18:00:13] NBarnes: FOR THE LOVE OF GOD?!?!
[18:00:21] NBarnes: HATE BURNING HATE
[18:00:42] nzst: chill out, dude
[18:00:42] NBarnes: A FULL BLOODY DAY to find a = vs == bug.
[18:00:54] nzst: that's pretty glaring
[18:01:04] NBarnes: I have a headache and I am cranky.
[18:01:06] webguynow: has joined #RubyOnRails
[18:01:19] nzst: lol, i think we've al been there in some shape or form
[18:01:36] NBarnes: It's one of my most traditional typos / bugs. You'd think eventually I'd learn to notice it.
[18:01:39] NBarnes: You'd think.
[18:02:05] yaymukund: has joined #RubyOnRails
[18:02:33] srinidhi: has joined #RubyOnRails
[18:02:52] s2013: has joined #RubyOnRails
[18:03:32] nzst: i wonder how you could prevent that
[18:04:08] bricker: nbarnes: You seem pretty upset so I'm going to give you a few suggestions
[18:04:22] NBarnes: I'm listening.
[18:04:23] bricker: nbarnes: 1. Use .eq() when possible
[18:05:00] bricker: 2. Switch the sides. ` "something" == your_thing `, instead of ` your_thing == "something" `
[18:05:08] bricker: then you'll get an error if you only use 1 =
[18:05:10] NBarnes: I like that one.
[18:07:00] pwnd_nfsw: has joined #RubyOnRails
[18:08:17] bricker: nbarnes: My mistake, the method is `eql?()`, eg your_thing.eql?("something")
[18:08:42] NBarnes: I think I understand.
[18:08:50] Omilun: has left #RubyOnRails: ()
[18:10:58] havenwood: has joined #RubyOnRails
[18:11:16] tubbo: that's your MAIN problem
[18:11:30] tubbo: eql? is testing whether Object 1 has the same objectid as Object 2
[18:11:49] tubbo: not whether obj.==(other) returns true
[18:11:51] terrellt: http://stackoverflow.com/questions/7156955/whats-the-difference-between-equal-eql-and I end up at this stackoverflow like four times a year.
[18:11:53] NBarnes: That has obvious limitations when applied to the general case.
[18:12:02] stesind: has joined #RubyOnRails
[18:12:10] tubbo: nbarnes: it's not meant to be applied to the general case
[18:12:21] NBarnes: One of the things I like about CoffeeScript is that it patches the silly JS == vs === thing.
[18:12:22] tubbo: terrellt: lol why?
[18:12:50] terrellt: tubbo: I help maintain an RDF library, where the difference matters because we have to implement it.
[18:12:50] tubbo: nbarnes: JS doesn't work like Ruby
[18:12:57] tubbo: ahhh interesting
[18:12:57] NBarnes: It really doesn't.
[18:13:12] NBarnes: But I spend a lot of time in both.
[18:13:15] tubbo: nbarnes: ruby allows you to override the == method on an object, so technically i can override == to always return false, meaning my object is never equal to anything
[18:13:26] tubbo: nbarnes: javascript doesn't allow you to override operators in its language, just not how the thing wokrs
[18:13:39] tubbo: so fundamentally the ==/=== thing and the ==/eql?/etc. thing is incomparable
[18:14:38] baweaver: has joined #RubyOnRails
[18:14:44] Maletor: has joined #RubyOnRails
[18:15:57] NBarnes: I'm just thinking about the issues inherent in the abstract idea of what equals what.
[18:16:08] bricker: tubbo: you're thinking of equal?()
[18:16:16] bricker: tubbo: "a".eql?("a") #=> true
[18:16:25] bricker: tubbo: "a".equal?("a") #=> false
[18:16:29] skyjumper: here's an interesting one... (Array === Array.new) is true
[18:16:45] smathy: Object#== and Object#eql? are the same.
[18:16:57] smathy: ...just that subclasses often override eql?
[18:17:57] smathy: You're not meant to override Object#equal? which is object (ie. object_id) equivalence.
[18:19:19] nzst: So, i'm calling update! on an object in a controller, I set up an after_update callback in the activerecord model, but I can't find any methods that work to let me know something changed
[18:19:24] czerasz: has joined #RubyOnRails
[18:20:04] smathy: nzst, !code
[18:20:04] helpa: nzst: 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.
[18:20:23] nzst: hm, thought it was straight forward, one sec
[18:22:40] nzst: http://hastebin.com/iwoyakopoj.rb
[18:23:38] cih: has joined #RubyOnRails
[18:24:09] nzst: no changes are registering
[18:24:15] pragmatism: has joined #RubyOnRails
[18:24:29] The_Phoenix: has joined #RubyOnRails
[18:24:35] yfeldblum: has joined #RubyOnRails
[18:25:01] terrellt: nzst: Changes are for knowing whether or not the record needs to be persisted. Thus, when you persist (after update), those changes are erased.
[18:25:24] nzst: before_update doesn't work either
[18:26:46] crystal77: has joined #RubyOnRails
[18:29:36] sinkensabe: has joined #RubyOnRails
[18:30:43] banjara: has joined #RubyOnRails
[18:31:12] shinnya: has joined #RubyOnRails
[18:31:15] dopie: has joined #RubyOnRails
[18:31:35] idd2d: has joined #RubyOnRails
[18:32:05] arup_r: My search is fast in local .. but in production it is slow
[18:32:15] arup_r: where to look for to fix it ?
[18:32:47] beauby: has joined #RubyOnRails
[18:32:56] centrx: "My search"?
[18:33:29] smathy: nzst, what do you think `self.changed?` by itself in your method will do?
[18:34:19] nzst: smathy: return true
[18:34:51] smathy: nzst, and in that code, how would you know what it returns?
[18:35:07] nzst: i am logging it
[18:36:05] lurkmaster: has joined #RubyOnRails
[18:36:39] smathy: nzst, no you're not.
[18:37:11] smathy: nzst, which line do you think is logging the result of `self.changed?`?
[18:37:17] NBarnes: has joined #RubyOnRails
[18:37:27] nzst: i have puts in place with the code i'm running
[18:38:02] lurkmaster: I'm having an issue with using the bootstrap-sass gem with rails. when i run the dev server it doesn't seem to apply the grid formatting to my view. here's my gemfile --> http://pastie.org/10424184 my css file --> http://pastie.org/10424187 and my view -->http://pastie.org/10424190
[18:38:04] tubbo: it's straightforward if you know ruby
[18:38:11] smathy: nzst, we cannot help you with your problem if you don't show us your code.
[18:38:17] s2013: has joined #RubyOnRails
[18:38:41] s2013: is it ok to have a lot of empty fields?
[18:38:46] tubbo: s2013: no
[18:38:48] helpa: Next question, please!
[18:38:51] lurkmaster: the col-md-3 isn't being applied
[18:39:01] smathy: lurkmaster, for future if you start a line with ## in pastie then it will display as a separate file.
[18:39:03] tubbo: s2013: you talking about your Event model?
[18:39:05] smathy: (in the same pastie URL)
[18:39:11] tubbo: s2013: what's your database?
[18:39:17] capin: well r4ia arrived at my door step today :)
[18:39:17] s2013: older mysql
[18:39:18] s2013: thats why
[18:39:38] tubbo: s2013: you can still use active_record's serialize method to turn a Hash into JSON, so you can store arbitrary fields in a normal tbale.
[18:39:48] lurkmaster: smathy: thanks for the tip, didn't know you could do that
[18:39:53] tubbo: just a little harder to query on those fields
[18:40:10] tubbo: because you can't do it in a sql query, you'll need to turn the results into AR objects first
[18:40:17] smathy: lurkmaster, what's the filename of the file that those @import statements are in?
[18:40:32] nzst: smathy: http://hastebin.com/oyupodifed.rb
[18:40:47] nzst: i'm surely updating the name field
[18:40:55] lurkmaster: smathy: index.css.scss it was originally just .scss but that didn't work so I'm trying everything lol
[18:41:28] s2013: tubbo yeah thats the issue.. thing is eventually im going to run data analysis on it
[18:41:37] s2013: tubbo i havent used ams in a wile, you cant index it right
[18:41:42] tubbo: s2013: ams?
[18:41:55] s2013: active model serializer
[18:41:57] arup_r: centrx: this is my search -> https://gist.github.com/aruprakshit/41b4b925c90d1d982264#file-asset-rb-L45
[18:41:58] s2013: might be thining about the wrong thing
[18:42:15] tubbo: s2013: yeah, you are
[18:42:22] arup_r: fast in development ,, but slow in production
[18:42:34] idd2d: has joined #RubyOnRails
[18:42:34] smathy: nzst, you sure you're not getting an exception? You should be getting: NameError: uninitialized constant ActiveRecord::Dirty
[18:42:49] tubbo: s2013: wide tables take longer to query on, and are harder to reason about
[18:42:49] centrx: arup_r, Production has a lot more data right?
[18:42:56] romdi`: has joined #RubyOnRails
[18:42:57] centrx: arup_r, Or a lot more load?
[18:43:02] tubbo: s2013: if it's both wide and long, your queries will take a LOT of time
[18:43:02] s2013: but yeah can you index serialized data
[18:43:05] centrx: arup_r, You may want to check the indexing of non-string fields
[18:43:08] manfrin: has joined #RubyOnRails
[18:43:14] tubbo: s2013: no, because the `serialize` method is part of AR and not mysql
[18:43:17] centrx: arup_r, For searching inside string fields, look up Full-Text Indexing
[18:43:18] s2013: tubbo yeah.. but it will be about 5 columns
[18:43:20] s2013: yeah thats what i figured
[18:43:37] s2013: i just wish we used pg
[18:44:00] arup_r: centrx: production is just set up ... 100 data only..
[18:44:03] tubbo: s2013: that's not too bad then, 5 columns isn't that wide
[18:44:06] nzst: smathy: http://hastebin.com/ofixawotom.rb , i was just trying to exemplify the issue
[18:44:26] arup_r: centrx: how to check indexing ?
[18:44:30] havenwood: has joined #RubyOnRails
[18:44:31] tubbo: s2013: since you weren't specific in your amount ("a lot") i just assumed the worst
[18:44:39] tubbo: and assumed you were making a table with like 90 columns or something
[18:44:46] lurkmaster: smathy: any ideas? this is such a basic problem I can't get my head around why its not working
[18:44:47] smathy: nzst, you get my point here though right? We help dozens of people a day, when we ask to see your code we really want you to copy and paste your actual code.
[18:45:01] krisquigley: has joined #RubyOnRails
[18:45:03] s2013: true..what i meant more like a lot of records with empty columns
[18:45:14] s2013: so like lets say 95% of records wont have every column full if that makes sense
[18:45:44] tubbo: s2013: it's a scale thing, that really starts to matter when your db size is huge
[18:45:44] smathy: nzst, so now, go to a rails console and run: x = YourModel.first; x.update! name: "smathy" And then copy-paste the whole irb/pry session showing the original value of YourModel and the output from the callback.
[18:46:25] s2013: yeah true.. our db isnt that huge.. i mean its big butnot crazy
[18:46:58] jas02: has joined #RubyOnRails
[18:47:06] crystal77: has joined #RubyOnRails
[18:47:18] otacon-: has joined #RubyOnRails
[18:47:25] smathy: lurkmaster, well your HEAD is empty: http://pastie.org/10424190#3-4
[18:47:35] smathy: lurkmaster, so the CSS is not being included in the page.
[18:47:53] smathy: lurkmaster, probably because you're not specifying the stylesheet_include_tag for your index.css file.
[18:48:15] smathy: *stylesheet_link_tag
[18:49:06] lurkmaster: smathy: what should be in the head? i know in plain html there would be an <a> element with a link to the stylesheet, how does it work with this gem
[18:49:30] lurkmaster: smathy: i've never used bootstrap with rails, with the exception of some copy/paste tutorials
[18:49:43] smathy: lurkmaster, nothing to do with bootstrap, you don't have ANY styles included.
[18:50:56] smathy: lurkmaster, when you create a new Rails project you'll have a layout generated for you in app/views/layouts/application.html.erb - for some reason your layout is very broken, or you're not using it.
[18:51:25] nzst: smathy: it works in the console, i'm going to dig into why there's a disconnect when using update! from the controller, thanks
[18:51:34] smathy: nzst, you're welcome.
[18:51:50] smathy: nzst, probably the value of name that you're submitting is the same as the one already in the DB.
[18:52:51] lurkmaster: i get that all the stylesheets in my rails project inherit from application.html.erb, but can't i choose to leave that blank and just define each erb page individually? how does that affect the styles
[18:53:01] lurkmaster: i meant all the views inherit from*
[18:53:37] urubuz: has joined #RubyOnRails
[18:53:45] lurkmaster: my view works fine, its just not creating the columns which should be created when i add the class "md-col-6" to my divs
[18:54:12] smathy: lurkmaster, your view doesn't work fine, you have an empty <HEAD>: http://pastie.org/10424190#3-4
[18:55:01] smathy: lurkmaster, you can, of course, not use a layout. But in that case you'll need to setup your view to include the stylesheets and any JS that you need for your view to function properly.
[18:55:36] lurkmaster: my application.html.erb file --> http://pastie.org/10424254
[18:55:42] smathy: lurkmaster, each view will need to include the same lines for including those things (which is the reason layouts came into existence in the first place, to stop that sort of duplication)
[18:55:59] smathy: lurkmaster, right, but I'm explaining to you that that layout is not being used.
[18:56:24] smathy: lurkmaster, the HTML in http://pastie.org/10424190 shows that.
[18:56:52] lurkmaster: so, why is it that their is a head defined in my application.html.erb but it isn't being applied to my index view?
[18:59:50] tylerflint: has joined #RubyOnRails
[18:59:58] tylerflint: has left #RubyOnRails: ()
[18:59:59] skdomino: has joined #RubyOnRails
[19:00:02] skdomino: has left #RubyOnRails: ()
[19:00:37] smathy: lurkmaster, because you've disabled the layout somewhere, I was assuming from your previous comment about defining each erb page individually that you already knew that you had done this. Are you saying that you have no idea how the layout was disabled?
[19:00:37] Pupeno: has joined #RubyOnRails
[19:01:02] seank_: has joined #RubyOnRails
[19:01:37] siemprefresco: has joined #RubyOnRails
[19:01:49] rhizome: the word "overconfigured" comes to mind
[19:02:50] __apr__: has joined #RubyOnRails
[19:02:56] lurkmaster: smathy: i thought you meant there was something i was supposed to add to my layout, and i meant that i was defining most of the view independently of the layout. i didn't realize it wasn't applying it at all
[19:03:15] lurkmaster: smathy, i haven't edited the configuration of the app at all, where would it be disabled?
[19:03:30] __apr__: anyone knows if there is a tool that will extract all the URLs from config/routes.rb ?
[19:03:51] smathy: lurkmaster, in the controller or application controller.
[19:04:03] rhizome: __apr__: rake routes
[19:04:04] smathy: __apr__, you mean: rake routes
[19:04:09] bruno-: has joined #RubyOnRails
[19:04:21] __apr__: awesome, thanks :) I'm a total ruby noob
[19:04:22] Pavster: has joined #RubyOnRails
[19:04:44] rhizome: beginning of the semester
[19:04:56] lurkmaster: smathy, http://pastie.org/10424271
[19:05:09] lurkmaster: my controllers are about as basic as they get
[19:05:16] lurkmaster: this is really weird
[19:06:11] smathy: lurkmaster, show me the view itself.
[19:06:52] lurkmaster: smathy, http://pastie.org/10424277
[19:06:58] arup_r: All f_key has indexing ... I see https://gist.github.com/aruprakshit/41b4b925c90d1d982264
[19:07:06] arup_r: where is wrong :/
[19:07:21] smathy: lurkmaster, no, that's the HTML output.
[19:07:50] smathy: lurkmaster, show me the view, like: app/views/index/index.html.erb
[19:08:14] lurkmaster: that's the actual code i wrote, am i not supposed to use <html> tags . that might be a noob mistake
[19:08:25] miguelff: has joined #RubyOnRails
[19:08:38] smathy: lurkmaster, ah. So yeah, don't put those - they'll be messing with the DOM.
[19:09:27] smathy: lurkmaster, hopefully if you view the source you'll see the HEAD with the stylesheet link in there.
[19:10:25] cnk: has joined #RubyOnRails
[19:11:44] lurkmaster: smathy, when i view the source its showing the proper head http://pastie.org/10424288
[19:11:53] lurkmaster: smathy, still no columns though
[19:13:13] smathy: lurkmaster, no, not yet - but one step at a time.
[19:13:37] lurkmaster: smathy, so what's the next step
[19:13:39] smathy: lurkmaster, so, now you need to go here https://github.com/twbs/bootstrap-sass#installation and follow the installation steps.
[19:14:17] smathy: lurkmaster, you said before that you'd put the @import statements into index.css.sass - you can actually make that work, but based on where you're at I think you should start with the recommended installation.
[19:15:56] lurkmaster: it works now thanks :)
[19:16:11] smathy: lurkmaster, you're welcome.
[19:16:19] gurnoorinder: has joined #RubyOnRails
[19:16:33] yaymukund: has joined #RubyOnRails
[19:16:39] lurkmaster: so for future reference, the import statements will not work unless they're in the application css file
[19:16:46] lurkmaster: without some tweaking
[19:16:47] fschuindt: How can I check if @page belongs to @user, once User has_many Pages?
[19:17:13] smathy: arup_r, did you have a question?
[19:17:51] smathy: fschuindt, @page.user == @user
[19:18:02] fschuindt: smathy: oh I see, ty
[19:18:03] gurnoorinder: hello. i have been trying to update my xcode and command line tools, but i am not able to download it completely. my download freezes at around 3.5 gb's and it then just stops. have tried it 4 times since yesterday.
[19:18:14] gurnoorinder: trying to update from 3.2.3 to 3.2.6
[19:18:20] gurnoorinder: on mac os 10.6.8
[19:18:46] smathy: gurnoorinder, you're in the wrong channel (again I think).
[19:19:01] rhizome: gurnoorinder: genius bar is at the mall
[19:19:05] gurnoorinder: smathy: but u guys must have updated them for rails
[19:19:29] smathy: gurnoorinder, I don't think you understand how channels and topics work.
[19:19:33] gurnoorinder: rhizome: we dont have genius bars here in india.
[19:19:36] tubbo: gurnoorinder: that sucks
[19:19:46] rhizome: try #apple
[19:19:49] gurnoorinder: smathy: i do. but i will ask somewhere else
[19:19:51] beauby: has joined #RubyOnRails
[19:19:52] tubbo: gurnoorinder: #MacOSX is the correct channel :)
[19:20:02] gurnoorinder: tubbo: thanks mate
[19:20:03] smathy: gurnoorinder, you don't find people who must have done something similar to what you're doing, you find the channel in which the topic you're asking about is discussed.
[19:20:04] tubbo: gurnoorinder: but yeah most of us probably don't know what's wrong, a lot of the time it involves clearing a cache
[19:20:14] tubbo: gurnoorinder: that shit happened to me when i updated OS X the last time, so annoying
[19:20:25] rhizome: who here likes food i need help making a stew
[19:20:33] gurnoorinder: tubbo: it has happened to me couple times
[19:20:41] smathy: "But you guys must have made food at some point?"
[19:20:46] gurnoorinder: thanks anyways. will come back with ruby installation queries
[19:20:50] arup_r: smathy: yes, I have no idea how to go for query improvement.. search is slow....
[19:20:55] tubbo: gurnoorinder: ask #ruby for the ruby installation stuff
[19:20:56] rhizome: rails. #ruby is over there
[19:20:57] smathy: gurnoorinder, unfortunately, I'm sure you will.
[19:21:05] capin: rhizome: i like making beer :)
[19:21:17] baweaver: has joined #RubyOnRails
[19:21:19] smathy: arup_r, which query?
[19:21:34] arup_r: https://gist.github.com/aruprakshit/41b4b925c90d1d982264
[19:21:35] rhizome: capin: cool mind if i ask you some scuba questions. they both involve co2
[19:21:50] arup_r: https://gist.github.com/aruprakshit/41b4b925c90d1d982264#file-asset-rb-L45 is slow
[19:21:50] JimmyNeutron: has left #RubyOnRails: ("Leaving")
[19:21:53] capin: rhizome: sure
[19:22:49] arup_r: seems ILIKE is slow ......
[19:23:07] rhizome: having trouble replacing the scrubber of the counterlung in my rebreather
[19:23:11] smathy: Well yes.
[19:23:35] fryguy: arup_r: it's not so much that ilike is slow as having that leading % sign makes it so you can't use most index types to speed up the search, so you have to do a full tablescan
[19:23:53] rhizome: source code here: http://patentimages.storage.googleapis.com/US8272381B2/US08272381-20120925-D00003.png
[19:23:59] smathy: arup_r, ok, so the answer to my question begins like this: Asset.search_assets.... Show me an example of something which is slow.
[19:24:08] capin: rhizome: ill be honest I have no idea what a counterlung is :?
[19:24:17] sandstrom: has joined #RubyOnRails
[19:24:29] rhizome: but you make beer, so this is the place for questions about co2 equipment
[19:24:42] tubbo: capin: it's like a counterpoint
[19:24:44] tubbo: except lungs
[19:25:01] rhizome: POOL'S CLOSED
[19:25:33] arup_r: smathy: how do I show you ?
[19:25:50] smathy: arup_r, nevermind.
[19:26:04] capin: rhizome: i brewed a pumpkin spice ale over labor day :)
[19:26:06] capin: http://chrisrjones.com/articles/pumpkin-spice-ale-round-3
[19:26:17] arup_r: fryguy: I am using postgresql. Where to look for what you suggested ?
[19:26:48] fryguy: arup_r: depending on how you want to search, check out tsvector, full-text-indexing, or trigrams
[19:27:02] jenrzzz: has joined #RubyOnRails
[19:27:10] eosinx: has joined #RubyOnRails
[19:27:23] arup_r: fryguy: Ok. I am reading up this one https://wiki.postgresql.org/wiki/Full_Text_Indexing_with_PostgreSQL
[19:28:50] rhizome: capin: i'm sure it's delicious, but personally i boycott all things pumpkin spice ;)
[19:28:55] siemprefresco: has joined #RubyOnRails
[19:29:22] fryguy: arup_r: alternatively, you can index the results of reversing the string, and then do the search with an OR clause and search for the string forwards and backwards, each with a single % sign, which will allow you to do a bitmap merge of 2 b-tree indices
[19:29:26] kadoppe: has joined #RubyOnRails
[19:30:00] capin: rhizome: why's that?
[19:30:13] arup_r: fryguy: things going above my head... :(
[19:32:05] arup_r: serious I have to learn now scaling things in Rails.. I am very week in this part
[19:32:07] EminenceHC: has joined #RubyOnRails
[19:32:19] tubbo: capin: rhizome is a closet white girl
[19:32:40] arup_r: I don't able to understand even if someone throwing hints towards me
[19:32:48] arup_r: shame on me! :(
[19:33:01] tubbo: capin / rhizome - http://lolworthy.com/wp-content/uploads/2015/09/he-who-controls-the-pumpkin-spice-controls-the-white-girls.jpg (context)
[19:33:19] capin: tubbo: and that means what exactly ...hehehe NVM
[19:34:09] tubbo: arup_r: nah this kind of stuff is a bit beyond rails itself, but has more to do with general web development knowledge imho
[19:34:15] capin: tubbo can't help to think that is a Dune reference no?
[19:36:34] arBmind: has joined #RubyOnRails
[19:36:42] turbo_MaCk: has joined #RubyOnRails
[19:37:34] fostertheweb: has joined #RubyOnRails
[19:37:58] Lytol: has joined #RubyOnRails
[19:38:06] NBarnes: everything goes better with Dune references
[19:38:47] cih: has joined #RubyOnRails
[19:39:18] smathy: tubbo, DB even, not even web dev specifically.
[19:40:45] jas02: has joined #RubyOnRails
[19:41:51] rakm: has joined #RubyOnRails
[19:42:42] s2013: has joined #RubyOnRails
[19:43:37] s2013: https://gist.github.com/ss2k/cfb69d5b185cd7dd3c6b getting an error NameError: undefined method `add' for class `Class' when i try doing Interaction.add
[19:43:54] havenwood: has joined #RubyOnRails
[19:45:14] annlewis: has joined #RubyOnRails
[19:45:39] x-light: has joined #RubyOnRails
[19:45:59] s2013: undefined method `add_without_delay' for # hm getting diff error now
[19:46:12] blackmesa: has joined #RubyOnRails
[19:46:32] seank_: has joined #RubyOnRails
[19:46:38] yaymukund: has joined #RubyOnRails
[19:46:40] nettoweb: has joined #RubyOnRails
[19:47:45] AxonetBE: has left #RubyOnRails: ()
[19:47:51] miguelff: has joined #RubyOnRails
[19:48:25] s2013: its weird cause my method works without the delayed job
[19:49:37] tubbo: s2013: not sure if add_without_delay is a method or not
[19:49:43] tubbo: s2013: as you don't explicitly define it
[19:50:07] Lytol: has joined #RubyOnRails
[19:50:24] s2013: i added the handle_asynchrnous call but before id just do .delay directly and then it would say undefined method add
[19:51:00] Lightsword: has joined #RubyOnRails
[19:52:02] s2013: hmm now it wont fail .. i tried this http://stackoverflow.com/questions/7316757/delayed-job-undefined-method-error-on-any-call.. but it wont run either
[19:52:33] s2013: delayed jbo works for mail and other stuff without any issue
[19:53:04] lwu: has joined #RubyOnRails
[19:56:03] lwu_: has joined #RubyOnRails
[19:58:32] EminenceHC: has joined #RubyOnRails
[19:59:06] havenn: has joined #RubyOnRails
[19:59:25] Coldblackice: has joined #RubyOnRails
[20:00:09] baweaver: has joined #RubyOnRails
[20:00:15] hahuang65: has joined #RubyOnRails
[20:02:27] rubyonrails865: has joined #RubyOnRails
[20:03:37] chills42_: has joined #RubyOnRails
[20:05:06] voltalio: has joined #RubyOnRails
[20:08:06] fostertheweb: has joined #RubyOnRails
[20:08:08] Speed: has joined #RubyOnRails
[20:08:56] cornerma1: has joined #RubyOnRails
[20:09:26] mikelodeon: has joined #RubyOnRails
[20:09:54] krz: has joined #RubyOnRails
[20:10:13] Speed: Hi. I've been trying to cache a slow query using Rails.cache.fetch, but I'm running into some issues. The AR objects I get back contain data, but the relations are all nil, and so I get failures
[20:10:19] Speed: I'm using rails 4.1.13 for reference
[20:10:36] Speed: everything works fine if I remove the Rails.cache.fetch block
[20:11:05] Speed: ah, and I'm using the Dalli store
[20:11:45] s2013: has joined #RubyOnRails
[20:11:47] Cache_Money: Yesterday I created a new Rails app and used the newest version of Capistrano (3.4.0). Now, when I'm attempting to deploy another older Rails app (using Capistrano 3.2.1) I'm getting this error: "Capfile locked at 3.2.1, but 3.4.0 is loaded"
[20:12:14] Cache_Money: Is there an easy way to get this to work or do I need to update my older Rails apps to use the newer version of Cap?
[20:12:33] Scriptonaut: Cache_Money: you using gemsets?
[20:12:36] bricker: Cache_Money: Locking is an optional feature, your scripts might still work between versions, you just need to remove the version lock
[20:12:49] pod15_: has joined #RubyOnRails
[20:12:55] Cache_Money: Scriptonaut: no
[20:12:58] Scriptonaut: I think you can just delete your Gemfile.lock
[20:13:01] Scriptonaut: then rebundle
[20:13:17] Cache_Money: bricker: okay, thanks
[20:13:30] bricker: No, this doesn't have to do with bundler, it's the "lock" method in your Capfile or one of your deploy configs
[20:13:36] Cache_Money: Scriptonaut: So, I would need to do that every time I switch between different Rails apps I'm working on?
[20:13:52] Scriptonaut: hmm, never heard of Capfile
[20:14:36] Cache_Money: bricker: you're right, I have `lock '3.2.1'` in my config/deploy.rb file
[20:14:50] milchschaum: has joined #RubyOnRails
[20:14:55] tubbo: the `lock` feature is for people who run capistrano globally
[20:15:34] t3rm: has joined #RubyOnRails
[20:15:50] miguelff: has joined #RubyOnRails
[20:16:15] sininen: has joined #RubyOnRails
[20:16:44] smathy: Cache_Money, bundle exec cap deploy
[20:16:52] Speed: any idea about my caching issue? or should I open a rails ticket
[20:16:56] smathy: Speed, !code
[20:16:56] helpa: Speed: 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.
[20:16:57] Cache_Money: bricker: so I won't have any vulnerabilities when I remove the that line from my deploy.rb file? I did and it deployed just fine, I'm just worried about months down the road
[20:17:12] Cache_Money: smathy: I tried using bundle exec cap production deploy but that didn't work earlier
[20:17:23] pod15_: can anyone tell me how to start rails server -e production on ubuntu server 14 at boot up??
[20:17:25] smathy: Cache_Money, ewk, same error?
[20:17:47] smathy: Cache_Money, weird.
[20:18:02] FailBit: shit was so cache
[20:18:16] smathy: pod15_, sounds like you're trying to deploy your own production server - without having a clue?
[20:18:20] FailBit: https://www.youtube.com/watch?v=F_7baOCYg-Q
[20:18:44] Speed: https://gist.github.com/archSeer/e0447371c7e964033b26
[20:18:46] bricker: Cache_Money: It's probably okay. I personally never use the lock feature and I've never had any problems.
[20:18:51] Speed: if I remove the cache block, everything is fine
[20:18:55] rickmasta: has joined #RubyOnRails
[20:19:03] Speed: if I leave it in, all of the relations are nil in my tests
[20:19:23] Speed: eg "Spree::Product#master_images delegated to master.images, but master is nil"
[20:19:45] smathy: Speed, only the result of the block is cached.
[20:19:56] moeabdol1: has joined #RubyOnRails
[20:20:04] rakm: has joined #RubyOnRails
[20:20:26] tejasmanohar: has joined #RubyOnRails
[20:20:26] Speed: yeah, but from my understanding, those relations should be lazily fetched, no?
[20:20:37] pod15_: smathy, yeah but only on a lab setup!
[20:20:49] pod15_: have setup snort + snorby which uses rails
[20:20:55] EminenceHC: has joined #RubyOnRails
[20:21:01] Speed: so if I call @products.first.master, I expect it to load the relation normally, just like it does if I don't wrap it in a cache
[20:21:02] smathy: Speed, whatever data is in the array returned by the block, the return from .to_a - that will be cached.
[20:21:13] Speed: it's an array of AR objects
[20:21:42] bricker: Speed: what cache backend are you using? Regardless you have a big vulnerability in that code
[20:22:13] Speed: so when I retrieve the objects from the cache, when I start using the object, I expect AR to function regularly --> load relations as if the data was just freshly retrieved from the db
[20:22:20] Speed: Dalli and postgres
[20:22:58] Speed: bricker: what vulnerability
[20:23:23] strcmp1: has joined #RubyOnRails
[20:23:28] bricker: Speed: By using a query parameter as part of the cache key, you're essentially letting users control your cache size
[20:23:50] Speed: yeah, that parameter is not currently used, and I'm intending to remove it in the next commit
[20:23:55] Speed: what I wonder is:
[20:24:15] bricker: eg: for i in `seq 1 999999999`; do curl speedswebsite.com/coolthing?page=$i; done
[20:24:52] Speed: why is Rails.cache.fetch(...) { MyObject.find(1) }.master failing, but MyObject.find(1).master works fine
[20:25:09] Speed: in both cases, AR should see that the relation isn't loaded --> and load it
[20:25:10] bricker: Speed: Maybe `nil` is cached
[20:25:28] FailBit: you might want to bust that cache key
[20:25:42] bricker: Rails doesn't treat "nil" as "not cached", all it looks for is whether they key exists and return the cached value (whether it's nil, false, or some other value)
[20:25:59] smathy: Speed, yeah, the objects should work. Show how you're using it and the error you're getting.
[20:26:16] smathy: Speed, dalli uses Marshal by default, which is fine with (de)serializing AR objects.
[20:26:34] Speed: I tested by doing "@products.first.master" on the next line
[20:26:44] Speed: the error is "Spree::Product#master_images delegated to master.images, but master is nil:"
[20:27:13] Speed: and I think master is stored via an join table/additional query, definitely not a field on the product
[20:27:24] smathy: Speed, and what if you check `@products.first.images` directly?
[20:27:32] Speed: it works just fine
[20:27:37] Speed: if I remove the cache block, things work fine
[20:27:44] Speed: so I'm assuming it's deserializing it incorrectly
[20:27:53] pod15_: has left #RubyOnRails: ()
[20:28:14] smathy: Might be an issue with delegated methods.
[20:28:27] Speed: hmm, could be
[20:28:39] diegoviola: has joined #RubyOnRails
[20:28:43] Speed: sec, I'll try a different method that doesn't use delegation
[20:29:55] momomomomo: has joined #RubyOnRails
[20:30:12] Speed: it fails only with the delegated method
[20:31:53] Speed: I assume the best thing to do here is write a minimal reproduction case and open up an issue
[20:33:05] FailBit: you can use @instance_vars in class scope?
[20:33:41] smathy: FailBit, no.
[20:34:01] smathy: Speed, FWIW, my test here with a delegated method works.
[20:34:22] Speed: hmm, odd...
[20:34:31] FailBit: actually, seems you can
[20:34:54] smathy: Speed, not going all the way to dalli/memcached - but in and out of Marshal - which should be a valid test case.
[20:35:15] FailBit: Object.class_eval{@foo = "foo"}
[20:35:18] FailBit: Object.class_eval{@foo} # => "foo"
[20:35:51] Speed: smathy: hmm, could be an issue with Kaminari then
[20:36:12] smathy: Speed, did you define the delegation? Or is that something Spree (or something) did?
[20:36:25] Speed: it's defined in Spree
[20:36:39] smathy: Speed, ok - so maybe that's broken somehow.
[20:36:55] Lytol: has joined #RubyOnRails
[20:37:24] smathy: Speed, what if you do: @product.first.images.master ?
[20:37:50] diegoviola: so there's a client that contacted me because he wants me to improve his webapp, he asked how much I'll charge for two features, I said I charge hourly, then he asked if I can charge per-feature, I said "I'll think about it" and then I calculated how much time it'll take me, I thought a week so I calculated the number of hours * my hourly rate and gave him the cost
[20:37:54] diegoviola: he's now saying that it's "too expensive"
[20:37:58] diegoviola: what would you guys do?
[20:38:27] baweaver: Don't bother. Move on.
[20:38:29] Speed: I don't think that's a relation :/
[20:38:36] smathy: diegoviola, add him to the enormous pile of jobs that people weren't actually that interested in engaging me for.
[20:38:52] Speed: tried doing @product.each {|p| p.master.reload }, but it failed since it called reload on nil
[20:39:15] smathy: Speed, the text of the error is a little confusing - maybe it's: @product.first.master.images.master ?
[20:39:48] smathy: Speed, does that work if not cached?
[20:39:49] diegoviola: yeah thanks guys
[20:39:54] Speed: master is actually a variant with master = true
[20:40:08] Speed: and fetching master is a custom scope I think
[20:40:11] baweaver: diegoviola: remember not all people on this channel are guys.
[20:40:29] smathy: Speed, just not sure why the error talks about delegating to master.images
[20:40:43] Speed: ah, that's an earlier error sorry
[20:40:46] smathy: Speed, it's like the delegation is doing the wrong thing.
[20:40:50] Speed: my code was doing product.master_images
[20:40:58] Speed: then later on in the controller, I did product.master
[20:41:07] Speed: "@products.map(&:reload)" seems to work
[20:41:24] smathy: (but means you've lost all benefits of cachine)
[20:41:38] Speed: well, the query itself is slow
[20:41:43] Speed: but I could probably cache the ids
[20:41:50] Speed: and then do a .find(ids)
[20:41:54] tubbo: Speed: if the query itself is slow, can you optimize the query?
[20:42:10] Speed: not really, no
[20:42:13] smathy: Speed, FWIW, I'd probably cache the view - not here.
[20:42:42] Speed: I have a few things cached in the view as well
[20:42:49] tubbo: yeah i usually start view-first, then i keep going down if need be
[20:42:59] smathy: Speed, seems like this is a perfect candidate for caching in the view.
[20:43:02] Speed: but, the controller action is still slow then, since the query still happens
[20:43:49] smathy: Speed, right, you need to move that logic into the model, and call it from within the cache block in the view.
[20:44:20] Speed: did a reload, but getting different errors now, mainly timestamps not being deserialized properly
[20:44:22] Speed: "undefined method `today?' for "2015-09-06 20:39:39.052496":String"
[20:44:34] Speed: so yeah, I'll just cache the ids
[20:44:35] EminenceHC: has joined #RubyOnRails
[20:45:53] annlewis: has joined #RubyOnRails
[20:46:02] krisquigley: has joined #RubyOnRails
[20:46:25] chrisja: has joined #RubyOnRails
[20:46:29] andrew-l: has left #RubyOnRails: ("ERC Version 5.3 (IRC client for Emacs)")
[20:48:21] messine: has joined #RubyOnRails
[20:48:34] messine: what is the conventional way to have upvotes/downvotes ?
[20:49:20] seank_: has joined #RubyOnRails
[20:49:28] manfrin: has joined #RubyOnRails
[20:49:48] tubbo: messine: there's no convention
[20:50:27] tubbo: messine: you can see a collection of gems which may aid you in this task here, though -> https://www.ruby-toolbox.com/search?q=voting
[20:51:31] messine: checking it out
[20:51:39] n00bDev: has joined #RubyOnRails
[20:51:57] tvw: has joined #RubyOnRails
[20:53:32] momomomomo: has joined #RubyOnRails
[20:53:35] nik_-_: has joined #RubyOnRails
[20:53:52] moei: has joined #RubyOnRails
[20:54:25] nzst: has joined #RubyOnRails
[20:54:59] FailBit: I like having a user_interactions table
[20:55:26] FailBit: currently have around 60mil votes registered :3
[20:56:17] FailBit: anyways. user_interaction: belongs_to :user, belongs_to :interactable, polymorphic: true
[20:56:18] messine: public site?
[20:56:20] FailBit: has a value as string
[20:56:23] FailBit: messine: yes
[20:56:52] FailBit: oh actually 60mil, bah, that was a while ago, now it's 100,390,606
[20:57:39] FailBit: are you willing to look at scaled-down horses that people are entitled to
[20:58:00] messine: i don't know what that means but yes
[20:58:06] FailBit: https://derpibooru.org/
[20:58:20] ellisTAA: has joined #RubyOnRails
[20:58:51] messine: haha oh I get it, nice!
[20:59:34] ellisTAA: i???m trying to change the label on my form, i tried this but it doesn???t work <%= f.label :name, 'alsdkfjasldk' %>
[20:59:45] ellisTAA: is that an outdated way of changing form label?
[20:59:57] FailBit: EllisTAA: I think that should work, hm
[21:00:43] FailBit: ACTION looks at his = f.label :anonymous, 'Post anonymously'
[21:00:50] workmad3: docs say it should still work: http://api.rubyonrails.org/classes/ActionView/Helpers/FormBuilder.html#method-i-label
[21:00:59] FailBit: EllisTAA: the only reason I could think is that the field you have isn't present on the model
[21:01:21] workmad3: that would error out rather than not change the text though
[21:01:31] meoblast001: has joined #RubyOnRails
[21:02:01] FailBit: is there any way I can have model finds not raise ActiveRecord::RecordNotFound
[21:02:22] ellisTAA: yeah it???s not working
[21:02:27] FailBit: (and just obediently return nil like find_by)
[21:02:40] bricker: FailBit: use find_by
[21:02:55] FailBit: blargh, ok
[21:03:10] bricker: I don't understand that reaction but *shrug*
[21:03:31] bricker: EllisTAA: seems like user error based on the small amount of info we have
[21:03:49] bricker: PEBKAC as we say
[21:03:53] bricker: or PEBFAG as tubbo says
[21:04:00] ellisTAA: bricker: what do you mean user error?
[21:04:29] ellisTAA: the problem is with the model?
[21:04:32] bricker: EllisTAA: I mean that I think you're just looking at the wrong thing or updating the wrong file or something. Or you're running the server in production mode so the views aren't being reloaded
[21:04:51] bricker: EllisTAA: try deleting all of the contents of that file, what happens?
[21:05:55] ellisTAA: >< i was saving the changes and checking the production site instead of localhost >< thanks everyone for the help
[21:06:38] bricker: I do that at least once a week
[21:07:08] ellisTAA: facepalm moment
[21:07:17] workmad3: EllisTAA: set up a staging site and make sure it has a big "STAGING" banner on it somewhere... or a 'DEVELOPMENT' banner in development
[21:07:41] bricker: I change the header color to bright red for dev environment
[21:07:43] tubbo: bricker / EllisTAA - add this right below the body tag: <h1><%= Rails.env unless Rails.env.development? %></h1>
[21:07:59] Lightsword: has joined #RubyOnRails
[21:07:59] tubbo: there used to be a "fork us on github"-ish banner gem for that hsit
[21:08:02] workmad3: tubbo: I think you mean 'if' not 'unless'
[21:08:03] tubbo: can't find i tthough
[21:08:05] ellisTAA: workmad3: that???s a good idea. ill look into that
[21:08:11] workmad3: tubbo: or 'unless Rails.env.production?'
[21:08:12] tubbo: workmad3: it's 5
[21:08:18] tubbo: (where i live)
[21:08:18] SteenJobs: has joined #RubyOnRails
[21:08:26] workmad3: tubbo: it's 10pm here
[21:08:50] workmad3: tubbo: so, next excuse to blow down? :P
[21:09:07] tubbo: workmad3: i'm not high yet?
[21:09:16] workmad3: neither am I
[21:09:45] neanderslob: has joined #RubyOnRails
[21:09:51] slash_nick: workmad3: 5 is a busy time, 10 is a time where things have slowed down...
[21:09:56] slash_nick: ACTION builds tubbo's excuse back up
[21:10:10] messine: FailBit: is there a public repo for derpibooru
[21:10:21] FailBit: (but I wish there was)
[21:10:43] workmad3: slash_nick: I don't buy it... if tubbo was so busy, he wouldn't be giving out crap advice on IRC :P
[21:11:07] messine: I'm intrigued by your intractable table :/
[21:11:37] FailBit: messine: https://gist.github.com/liamwhite/4991c1aba6ee02d2f7c5
[21:12:15] messine: checking it out
[21:12:20] FailBit: the interaction_type field is for differentiating between votes and faves
[21:13:05] yfeldblum: has joined #RubyOnRails
[21:14:18] slash_nick: workmad3: what do you expect his advice to improve when he's busy?
[21:14:42] bricker: I like to use elastic for that type of data, easier to do aggregations ("top 10 submissions of this week", "highest-scoring submissions in this category from the past 4 weekends", etc)
[21:14:54] workmad3: slash_nick: well, it could hardly get worse...
[21:15:09] bricker: lolololollolo
[21:15:30] bricker: I like this dynamic developing between workmad3 and tubbo
[21:16:15] Maletor: has joined #RubyOnRails
[21:17:19] gerep: I have transaction_cost model that has_many range_costs, is it possible for me to do a database select where transaction_cost.where(app_id: app_id) and also check if it has any range_cost?
[21:17:48] smathy: .joins(:range_costs)
[21:18:00] workmad3: aww, I was about to say tubbo could redeem himself there ;)
[21:18:14] workmad3: (ok, I'll let it drop now)
[21:18:17] smathy: (well, that'll return only the ones that have range_costs - not sure if that's what you meant by "check if..."
[21:19:17] smathy: Thanks :)
[21:19:38] smathy: I wish I could use haml-style significant leading indents.
[21:20:13] smathy: ...because I never remember to close parens
[21:20:38] workmad3: I just assume everyone has a parens-autoclosing script running in their wetware
[21:21:48] bricker: Speaking of which, does anybody know how to get IntelliJ to wrap highlighted text in parens like Sublime and textmate do?
[21:21:53] cih: has joined #RubyOnRails
[21:22:46] milchschaum: has joined #RubyOnRails
[21:22:48] nettoweb: has joined #RubyOnRails
[21:24:10] smathy: IntelliJ eh? My condolences.
[21:26:01] bricker: smathy: IntelliJ is great! I prefer it to Sublime for most projects now
[21:26:09] Choclo: has joined #RubyOnRails
[21:26:23] bricker: I use Sublime for Ruby projects just because I'm used to it I guess, but everything else I am on IntelliJ now
[21:26:54] bricker: IntelliJ & Co, I should say
[21:26:58] gerep: smathy, thanks one more time :D
[21:26:59] bricker: AndroidStudio, PyCharm, etc.
[21:30:32] craysiii: I use sublime for practically everything except C#
[21:30:33] diegoviola: has joined #RubyOnRails
[21:30:39] FailBit: spring is really annoying when you change stuff in initializers
[21:30:47] FailBit: just totally borks and breaks a console
[21:32:34] Radar: FailBit: go to gemfile
[21:32:36] Radar: delete spring
[21:32:39] Radar: live happily ever after
[21:34:02] tubbo: FailBit: bin/spring stop ftw
[21:34:04] tubbo: i love spring
[21:34:12] tubbo: because i'm a smart man
[21:34:16] smathy: gerep, you're welcome.
[21:34:28] smathy: bricker, I meant because it meant you're doing Java.
[21:34:40] tubbo: FailBit: basically any time you'd need to restart the rails server when the app is in your browser is when you need to run bin/spring stop.
[21:34:48] smathy: I love spring too.
[21:34:51] bricker: smathy: I really enjoy writing Java too :( I seem to be alone in that though
[21:34:56] smathy: ...just gotta know your autoloads.
[21:34:57] tubbo: Radar is just a curmudgeon
[21:35:09] MartinElvar: has joined #RubyOnRails
[21:35:17] krisquigley: has joined #RubyOnRails
[21:35:18] Kallis: has joined #RubyOnRails
[21:35:18] smathy: Radar just likes to keep the channel free of spring-related issues, one user at a time.
[21:35:37] smathy: bricker, wow, good for you then :)
[21:35:41] pwnd_nfsw: I started out in Java, but can't say I'd like to go back to it.
[21:36:15] smathy: It was definitely up there with the least enjoyable language I've used.
[21:36:18] astrodog: I started out in C... which leads to very... functional Ruby code.
[21:36:33] Kallis: has joined #RubyOnRails
[21:36:39] pwnd_nfsw: Having started in Java, I was definitely turned off by C/C++
[21:36:39] smathy: ...although, I'll admit, that most of the problem with Java was the sort of company that uses it (and the sorts of politics in those organizations)
[21:36:44] FailBit: tubbo: it's better when you know that spring is going to explode
[21:36:50] bricker: smathy: anyways IntelliJ is useful for a lot more than just Java
[21:37:01] FailBit: I've had it randomly die (no C-c or C-\ would kill it)
[21:37:06] bricker: It was great in helping me learn Go too
[21:37:24] smathy: I used vim even when doing Java.
[21:37:34] bricker: now *that* sounds like a nightmare
[21:37:42] baweaver: has joined #RubyOnRails
[21:37:55] tubbo: FailBit: yeah that's annoying, sometimes i have to kill the ruby process.
[21:38:19] FailBit: I had spring commented out in my gemfile, and restored it for some reason
[21:38:21] tubbo: FailBit: however, it's not random at all. it only happens when i happen to quit the process (^C) before Spring can connect to the serer
[21:38:23] FailBit: ACTION comments it out again
[21:38:30] smathy: It was a long time ago, and the other options were very unpleasant.
[21:38:37] ellisTAA: i just added a new field to my migration called start_date, i then reset my db, and when i tried to add it to the form, i got an error undefined method `start_date' for #<Meetup:0x007fed9ab95340>, did i forget something?
[21:38:59] bricker: EllisTAA: rake db:migrate
[21:39:06] ellisTAA: doesn???t reset include that?
[21:39:17] ellisTAA: let me try that
[21:39:18] bricker: No, it reads from your schema
[21:39:32] ellisTAA: oh .. alright thanks ill try that
[21:40:04] smathy: I've had that too, ^Zkill `jobs -p`
[21:40:41] Speed: has left #RubyOnRails: ("WeeChat 1.3")
[21:40:52] dopamean_: has joined #RubyOnRails
[21:42:04] erichu: has joined #RubyOnRails
[21:42:50] K3VA: has joined #RubyOnRails
[21:44:49] Spami: I have a model House
[21:45:24] superlou: has joined #RubyOnRails
[21:45:25] Spami: in different places in the code I have to display houses similar to the one currently displayed
[21:45:40] based_pdev: has joined #RubyOnRails
[21:45:48] Spami: where does the code looking for similar houses should be?
[21:46:00] pwnd_nfsw: What are the details on "similar"?
[21:46:09] pwnd_nfsw: I'd probably put it in the House model
[21:46:50] annlewis: has joined #RubyOnRails
[21:46:56] Spami: pwnd_nfsw, what do you mean by details?
[21:47:08] pwnd_nfsw: Like, what makes these houses similar
[21:47:22] s2013: has joined #RubyOnRails
[21:47:44] s2013: tubbo you around? https://gist.github.com/ss2k/7b849b53123e949d631e this is what i ended up coming up with
[21:47:46] s2013: feedback?
[21:48:03] smathy: Spami, in the House model.
[21:48:10] smathy: ...as a class method.
[21:48:20] s2013: also anyone else? https://gist.github.com/ss2k/7b849b53123e949d631e feedback on this would be appreciated
[21:48:54] Spami: pwnd_nfsw, same location and same tags
[21:49:18] pwnd_nfsw: What smathy said Spami
[21:49:43] Spami: Nice, that what I did. I had second thought
[21:50:11] seank_: has joined #RubyOnRails
[21:52:40] northfurr: has joined #RubyOnRails
[21:53:11] baweaver: ooo, are we doing recommendation engines now?
[21:55:15] Spami: So here is my simple code so far for finding similar: https://gist.github.com/theonegri/dbd221313c215bc4ff15
[21:57:39] naftilos76: has joined #RubyOnRails
[21:57:53] messine: if I'm using the thumbs_up gem do I update my model in the update action? My first instinct, which is probably wrong, would be to create a seperate vote action in the controller
[21:58:10] Spami: But I'm getting some eager loading issue line 2
[21:58:14] iamse7en: has joined #RubyOnRails
[21:59:57] Lightsword: has joined #RubyOnRails
[22:00:02] czerasz: has joined #RubyOnRails
[22:01:17] jenrzzz_: has joined #RubyOnRails
[22:02:15] mary5030: has joined #RubyOnRails
[22:02:36] naftilos76: Hi, i am uploading files with ajax using parts of this tutorial: http://blog.teamtreehouse.com/uploading-files-ajax but no matter what i do i cannot render the js and erb templates that i want even though i can see that they are rendered fine without any errors in my log. I can access the uploaded files in my controller just fine. However i cannot render anything after the action is called. Has anybody got a clue why this is happening? My other
[22:02:37] naftilos76: actions work fine.
[22:03:16] naftilos76: i am using rails 4.2 and ruby 2.2
[22:07:39] bendangelo: has joined #RubyOnRails
[22:07:56] naftilos76: Has anybody been able to upload files with pure ajax?
[22:08:15] naftilos76: Not iframes and other workarounds
[22:10:09] dima_: has joined #RubyOnRails
[22:10:35] Lightsword_: has joined #RubyOnRails
[22:10:45] wethu: has joined #RubyOnRails
[22:11:23] johnflux: has joined #RubyOnRails
[22:11:58] rickmasta: has joined #RubyOnRails
[22:12:12] Jasaka: has joined #RubyOnRails
[22:13:30] turbo_MaCk: has joined #RubyOnRails
[22:18:05] s2013: has joined #RubyOnRails
[22:18:20] baweaver: has joined #RubyOnRails
[22:19:54] s2013: baweaver were you talking to me re: recommendation engine?
[22:20:11] beauby: has joined #RubyOnRails
[22:21:19] havenwood: has joined #RubyOnRails
[22:21:22] Scriptonaut: has left #RubyOnRails: ()
[22:21:44] baweaver: partially referring to.
[22:21:55] baweaver: recommendation engines are a hard problem
[22:22:19] baweaver: if you ever solve that one, Amazon will want to steal you pretty fast.
[22:22:40] petricore: has joined #RubyOnRails
[22:23:26] baweaver: just something to keep in mind when trying to build one is that it's definitely not a trivial problem
[22:29:00] s2013: has joined #RubyOnRails
[22:29:26] s2013: baweaver sorry i keep getting dc.. thats the eventual goal. yea its a hard problem. right now im just collecting the data ..they havent done any data collection at all
[22:29:48] s2013: we could have had years of data on tons of users.. but only thing they ever used was just google analytis
[22:30:30] s2013: we are a b2b company and im tracking what the businesses do on our platform.. eventual goal is to increase retention rate and do better recommendations etc
[22:31:09] s2013: but atelast now we have data for internal analysis but eventually id like to work on a neural network or something of that sort
[22:32:30] milchschaum: has joined #RubyOnRails
[22:34:11] jenrzzz: has joined #RubyOnRails
[22:37:39] northfurr: has joined #RubyOnRails
[22:42:36] jersingh: has joined #RubyOnRails
[22:47:36] annlewis: has joined #RubyOnRails
[22:48:07] theery: has joined #RubyOnRails
[22:49:01] milchschaum: has joined #RubyOnRails
[22:49:47] momon: has joined #RubyOnRails
[22:51:00] seank_: has joined #RubyOnRails
[22:52:31] jersingh: has joined #RubyOnRails
[22:54:29] duncannz: has joined #RubyOnRails
[22:55:46] allcentury: has joined #RubyOnRails
[22:56:41] simkessy: has joined #RubyOnRails
[22:56:48] seank_: has joined #RubyOnRails
[22:57:14] rodfersou: has joined #RubyOnRails
[22:57:32] momon: Is there any gem that can do uploading video directly to youtube through web form?
[22:58:43] jersingh: has left #RubyOnRails: ()
[22:59:52] jersingh: has joined #RubyOnRails
[22:59:55] atomical: has joined #RubyOnRails
[23:00:20] iateadonut: has joined #RubyOnRails
[23:02:16] bricker: momon: yes, use this example to get you started: https://developers.google.com/youtube/v3/code_samples/ruby#upload_a_video
[23:03:02] rew: has joined #RubyOnRails
[23:06:01] x-light: has joined #RubyOnRails
[23:09:17] metalic: has joined #RubyOnRails
[23:12:21] EvilEpoch: has joined #RubyOnRails
[23:12:27] EvilEpoch: Warm Greetings to all, I am The EvilEpoch.
[23:12:39] Lightsword: has joined #RubyOnRails
[23:12:40] momon: bricker: thanks
[23:12:59] hightower4: Welcome. We've been expecting you.
[23:13:09] EvilEpoch: Greetings to hightower4 from The EvilEpoch.
[23:13:12] EminenceHC: has joined #RubyOnRails
[23:13:23] bruno-: has joined #RubyOnRails
[23:17:24] pushpak: has joined #RubyOnRails
[23:19:21] EvilEpoch_: has joined #RubyOnRails
[23:20:00] EvilEpoch_: has left #RubyOnRails: ()
[23:20:09] EvilEpoch: has joined #RubyOnRails
[23:20:58] simkessy: Hey, when using delayed_jobs when I do run rake jobs:work ...is that just something that's suppose to be running in the background constantly...I'm looking at my logs and it's taken over the terminal unless I ctrl-c out of it
[23:22:14] simkessy: this is what I'm seeing http://i.imgur.com/gZ6m2wQ.jpeg
[23:22:59] smathy: simkessy, https://github.com/collectiveidea/delayed_job#running-jobs
[23:25:08] petricore: has joined #RubyOnRails
[23:26:56] simkessy: smathy, yea I was reading that but not really getting it. Like this line here: "RAILS_ENV=production script/delayed_job start" is that something I have to put in the delayed_job file or a command I can run manually
[23:27:42] Pupeno: has joined #RubyOnRails
[23:27:42] Pupeno: has joined #RubyOnRails
[23:29:21] tejasmanohar: has joined #RubyOnRails
[23:29:29] smathy: They're all just example commands to run in order to start the daemon.
[23:29:57] jersingh: has left #RubyOnRails: ()
[23:33:11] simkessy: ah okay, should I not through that above command in the Profile so that it runs automatically on Heroku?
[23:33:33] ziggurat81: has joined #RubyOnRails
[23:33:56] baweaver: has joined #RubyOnRails
[23:37:40] baweaver: has joined #RubyOnRails
[23:38:51] smathy: simkessy, no idea I don't use heroku.
[23:39:22] simkessy: ah, okay. Thanks for the help. I guess what I was looking at was normal. Cheers
[23:39:24] smathy: simkessy, I believe they have good help files for many things, I recommend googling: heroku delayed_job
[23:39:30] TheFloyd: has joined #RubyOnRails
[23:40:02] simkessy: yea I found this: https://devcenter.heroku.com/articles/delayed-job
[23:40:13] simkessy: that helped set it up properly
[23:40:15] smathy: simkessy, side question, which version of Rails are you using?
[23:40:24] simkessy: Version 4.2.X
[23:40:59] cajone: has joined #RubyOnRails
[23:41:20] smathy: simkessy, do you know about ActiveJob?
[23:41:20] NBarnes: has joined #RubyOnRails
[23:41:38] simkessy: Yea, I'm using it with delayed_jobs
[23:41:45] smathy: simkessy, oh ok, cool.
[23:41:52] EminenceHC: has joined #RubyOnRails
[23:41:53] simkessy: I think they work together somehow, I'm not entirely sure
[23:41:59] simkessy: just started looking at jobs today
[23:42:26] smathy: simkessy, I don't know anyone who's still using delayed_job (who doesn't have to because they're stuck in an old app and can't switch to sidekiq)
[23:42:54] simkessy: wow really, I thought they were both still pretty popular
[23:43:11] simkessy: I'm only using it because I read an old tutorial that related to what I was doing
[23:43:24] simkessy: I'll look into sidekiq and see if I can make the switch
[23:43:37] WillAmes: has joined #RubyOnRails
[23:46:23] smathy: Especially now that sidekiq is the ActiveJob default, it's very unusual for someone to switch from the default to delayed_job.
[23:46:42] smathy: Sidekiq is a better piece of software.
[23:48:12] annlewis: has joined #RubyOnRails
[23:49:38] FailBit: ACTION googles sidekiq
[23:50:02] FailBit: so it's like resque
[23:50:45] FailBit: >it's licensed like passenger
[23:50:48] FailBit: nah fuck that
[23:56:02] baweaver: has joined #RubyOnRails