« Back to channel list

#RubyOnRails - 09 February 2016

« Back 1 day Forward 1 day »
[00:00:26] tildes: has joined #RubyOnRails
[00:02:50] ornerymoose: has joined #RubyOnRails
[00:03:29] lindii_: has joined #RubyOnRails
[00:08:06] JoshGlzBrk: has joined #RubyOnRails
[00:10:34] _Tariq: has joined #RubyOnRails
[00:11:28] pyemkey: has joined #RubyOnRails
[00:11:49] _Tariq: has joined #RubyOnRails
[00:13:39] ravster: has joined #RubyOnRails
[00:15:04] Conflict: has joined #RubyOnRails
[00:19:33] hfp: Hi, does anyone else encounter this issue when running bundle install? Gem::RemoteFetcher::FetchError: bad response Forbidden 403 (https://rubygems.global.ssl.fastly.net/gems/rb-inotify-0.9.6.gem)
[00:20:09] hfp: Does anyone else get this too? I can install 0.9.7 just fine with `gem install rb-inotify` but not 0.9.6 with bundle install.
[00:21:10] hfp: rubygems website says the gem has been yanked
[00:21:23] askhat: has joined #RubyOnRails
[00:23:21] hfp: sorry if this is a stupid question, it just never happened to me before :)
[00:25:52] quazimodo: has joined #RubyOnRails
[00:26:46] safety_cut: has joined #RubyOnRails
[00:28:27] ur5us: has joined #RubyOnRails
[00:28:33] maesitos: has joined #RubyOnRails
[00:28:34] yfeldblum: has joined #RubyOnRails
[00:29:21] ur5us_: has joined #RubyOnRails
[00:31:31] ferr: I have polymorphic associations, how do I make this form to work? https://gist.github.com/Fercell/1a913680bda29c17d24c
[00:32:04] chadhs: has joined #RubyOnRails
[00:36:23] _Tariq: has joined #RubyOnRails
[00:36:56] rubyonrailed: has joined #RubyOnRails
[00:43:20] baweaver: has joined #RubyOnRails
[00:43:58] DLSteve: has joined #RubyOnRails
[00:46:03] chadhs: has joined #RubyOnRails
[00:46:55] smathy: ferr, examples here http://devdocs.io/rails/actionview/helpers/formbuilder#method-i-fields_for
[00:48:03] DmitryBochkarev: has joined #RubyOnRails
[00:50:13] rubyonrailed: has joined #RubyOnRails
[00:50:23] ferr: smathy: thanks, just to clarify, shall I use grouped_collection_select for this?
[00:50:37] exadeci: has joined #RubyOnRails
[00:51:21] smathy: ferr, if you want, there are many options.
[00:51:21] _Tariq: has joined #RubyOnRails
[00:51:38] ferr: How would you do that, smathy?
[00:54:41] Graphettion: has joined #RubyOnRails
[00:55:47] rubyonra_: has joined #RubyOnRails
[00:57:36] chadhs: has joined #RubyOnRails
[00:58:10] ewnd9: has joined #RubyOnRails
[00:59:13] macsteps: has joined #RubyOnRails
[00:59:39] chadhs: has joined #RubyOnRails
[01:00:40] maesitos: has joined #RubyOnRails
[01:01:02] ornerymoose: has joined #RubyOnRails
[01:02:30] maesitos: has joined #RubyOnRails
[01:03:11] chadhs: has joined #RubyOnRails
[01:03:41] dopamean_: has joined #RubyOnRails
[01:04:21] maesitos: has joined #RubyOnRails
[01:05:57] Jon30: has joined #RubyOnRails
[01:06:16] maesitos: has joined #RubyOnRails
[01:06:47] jtdowney_: has left #RubyOnRails: ()
[01:07:18] jtdowney: has joined #RubyOnRails
[01:08:08] maesitos: has joined #RubyOnRails
[01:10:02] maesitos: has joined #RubyOnRails
[01:10:36] safetypin: has joined #RubyOnRails
[01:11:53] maesitos: has joined #RubyOnRails
[01:12:23] smathy: I don't know ferr, I don't know your app, UI, etc.
[01:13:50] maesitos_: has joined #RubyOnRails
[01:14:44] rhizome: holy crap that looks like one of my more experimental data models
[01:15:42] maesitos: has joined #RubyOnRails
[01:15:43] rhizome: ferr: can you maybe use the 'erd' gem and post an image? i think you can limit what is rendered
[01:16:11] rhizome: can also just paint over with white in gimp or ps or whatever
[01:16:48] rhizome: i think i understand now
[01:16:50] ferr: rhizome: a second
[01:17:15] Devalo: has joined #RubyOnRails
[01:17:31] maesitos_: has joined #RubyOnRails
[01:17:40] KnownSyntax: has joined #RubyOnRails
[01:17:47] rubyonrailed: has joined #RubyOnRails
[01:19:11] askhat: has joined #RubyOnRails
[01:19:21] KnownSyntax: has joined #RubyOnRails
[01:19:25] maesitos: has joined #RubyOnRails
[01:19:37] rhizome: i think i get it
[01:20:10] ferr: rhizome: here you go http://i.imgur.com/uo6NNso.png
[01:20:31] KnownSyntax: has joined #RubyOnRails
[01:20:38] rhizome: try Program.all+Procedure.all+Bath.all
[01:20:55] ferr: rhizome: that works, but I cannot get it to be saved
[01:21:03] ferr: through the request
[01:21:19] maesitos: has joined #RubyOnRails
[01:22:01] ferr: It sends these params: {"name":"asdads","email":"rwarwa","phone_number":"adsasd","orderable_id":"gid://spa-levanda/Procedure/9"}
[01:22:15] Nucky: has joined #RubyOnRails
[01:23:11] maesitos_: has joined #RubyOnRails
[01:23:12] rhizome: Order.pluck(:orderable_type).collect{|m| m.constantize.all}.flatten
[01:23:38] rhizome: well something isn't snatching that 9, huh?
[01:24:00] rhizome: unless that's actually the orderable_id in Order
[01:24:10] ferr: That's program id
[01:24:43] ferr: so I believe I need to send the program_id/procedure_id/bath_id and class name to the Order?
[01:25:06] maesitos: has joined #RubyOnRails
[01:25:59] rhizome: get it showing orderable_id in the form
[01:26:33] rhizome: i feel like this is a funky use case
[01:27:20] maesitos: has joined #RubyOnRails
[01:27:24] tego101: has joined #RubyOnRails
[01:27:36] devdazed: has joined #RubyOnRails
[01:27:58] rhizome: read this http://stackoverflow.com/questions/22190718/rails-polymorphic-association-with-form-collection-select-without-nesting
[01:28:48] ferr: I assigned orderable_id fine, just need to pass the orderable_type now
[01:28:55] maesitos: has joined #RubyOnRails
[01:30:02] ferr: thanks rhizome
[01:30:47] maesitos: has joined #RubyOnRails
[01:31:22] benlieb: has joined #RubyOnRails
[01:32:39] maesitos: has joined #RubyOnRails
[01:34:33] maesitos_: has joined #RubyOnRails
[01:34:45] phroa`: has left #RubyOnRails: ()
[01:36:02] chadhs: has joined #RubyOnRails
[01:36:25] maesitos: has joined #RubyOnRails
[01:38:19] maesitos_: has joined #RubyOnRails
[01:40:12] maesitos: has joined #RubyOnRails
[01:41:51] sankaber: has joined #RubyOnRails
[01:42:05] maesitos: has joined #RubyOnRails
[01:43:56] maesitos_: has joined #RubyOnRails
[01:44:07] hfp: How do I test that a Job runs another job in the after_perform callback?
[01:44:28] hfp: I tried ` expect { ScrapConcertsJob.perform_later }.to have_enqueued_job(GetArtistSampleJob)
[01:44:49] hfp: ` as per the RSpec docs but it says ActiveJob doesn't ahve an `enqueued_job` method
[01:45:51] maesitos: has joined #RubyOnRails
[01:47:29] SteenJobs: hey everyone! question: has the chat???s stance on admin interface libraries changed since let???s say like a year ago (the last time i was privileged to spend time here)?
[01:47:44] maesitos: has joined #RubyOnRails
[01:49:29] griffindy: has joined #RubyOnRails
[01:49:37] maesitos: has joined #RubyOnRails
[01:51:25] DonOtreply: has joined #RubyOnRails
[01:51:28] maesitos: has joined #RubyOnRails
[01:53:22] maesitos_: has joined #RubyOnRails
[01:53:31] chadhs: has joined #RubyOnRails
[01:55:16] maesitos: has joined #RubyOnRails
[01:56:36] lemur: has joined #RubyOnRails
[01:57:05] maesitos_: has joined #RubyOnRails
[01:59:02] maesitos: has joined #RubyOnRails
[02:00:16] JoshGlzBrk: has joined #RubyOnRails
[02:00:55] maesitos: has joined #RubyOnRails
[02:03:08] rubyonrailed: has joined #RubyOnRails
[02:04:15] tildes: has joined #RubyOnRails
[02:04:41] maesitos: has joined #RubyOnRails
[02:05:02] Cervajz: has joined #RubyOnRails
[02:05:45] DonOtreply: has joined #RubyOnRails
[02:06:32] maesitos_: has joined #RubyOnRails
[02:07:59] FooMunki: has joined #RubyOnRails
[02:08:26] maesitos: has joined #RubyOnRails
[02:10:20] maesitos: has joined #RubyOnRails
[02:10:42] aloneintheworld: has joined #RubyOnRails
[02:10:51] floror: has joined #RubyOnRails
[02:12:11] maesitos: has joined #RubyOnRails
[02:12:39] dyce: has joined #RubyOnRails
[02:12:39] rhizome: SteenJobs: there's a newer one called administrate
[02:14:04] maesitos: has joined #RubyOnRails
[02:14:39] ravster: has joined #RubyOnRails
[02:15:55] maesitos: has joined #RubyOnRails
[02:16:02] SteenJobs: rhizome: nice! and is the community accepting of it for the most part? (about a year ago when I was still doing Rails dev, I brought up ActiveAdmin and Radar wasn???t terribly happy with me)
[02:17:04] askhat: has joined #RubyOnRails
[02:17:15] tego101: has joined #RubyOnRails
[02:19:42] maesitos: has joined #RubyOnRails
[02:20:21] dyce: i am trying to run spree, developer environment works great but once i try to run in production i onyl get html with no images/css
[02:20:37] dyce: i tried rake assets:precompile
[02:20:59] dyce: and RAILS_ENV=production rake assets:precompile
[02:21:36] maesitos: has joined #RubyOnRails
[02:23:25] maesitos_: has joined #RubyOnRails
[02:23:28] gambl0re: has joined #RubyOnRails
[02:25:04] djbkd: has joined #RubyOnRails
[02:25:22] maesitos: has joined #RubyOnRails
[02:27:15] maesitos_: has joined #RubyOnRails
[02:29:04] maesitos: has joined #RubyOnRails
[02:30:06] rhizome: SteenJobs: i don't mind activeadmin, but anti's are more vocal. yeah, people seem to like it.
[02:30:35] rhizome: dyce: do you have to add anything to your asset pipeline?
[02:30:57] maesitos: has joined #RubyOnRails
[02:31:54] SteenJobs: rhizome: i simply need to quickly put together an interface to allow for clients to upload image assets, for us to download those images and do fancy stuff to them, and then upload the new asset so the clients can access it. obvs most of this is dependent on an admin interface, and not having to swing one from scratch would really be huge.
[02:32:52] maesitos: has joined #RubyOnRails
[02:32:55] quazimodo: has joined #RubyOnRails
[02:34:45] maesitos: has joined #RubyOnRails
[02:36:21] kirillzh: has joined #RubyOnRails
[02:36:38] maesitos: has joined #RubyOnRails
[02:37:54] celly: has joined #RubyOnRails
[02:38:33] maesitos: has joined #RubyOnRails
[02:40:26] maesitos: has joined #RubyOnRails
[02:40:34] bahar: has joined #RubyOnRails
[02:42:16] maesitos_: has joined #RubyOnRails
[02:44:26] maesitos: has joined #RubyOnRails
[02:44:35] jmfurlott: has joined #RubyOnRails
[02:45:57] djbkd: has joined #RubyOnRails
[02:46:04] maesitos: has joined #RubyOnRails
[02:47:41] macsteps: has joined #RubyOnRails
[02:48:01] dyce: rhizome: no
[02:49:46] maesitos_: has joined #RubyOnRails
[02:50:50] Pazician: has joined #RubyOnRails
[02:51:42] maesitos: has joined #RubyOnRails
[02:51:43] macsteps_: has joined #RubyOnRails
[02:53:33] maesitos: has joined #RubyOnRails
[02:55:27] maesitos_: has joined #RubyOnRails
[02:57:22] maesitos: has joined #RubyOnRails
[03:00:16] SteenJobs: has joined #RubyOnRails
[03:01:08] maesitos: has joined #RubyOnRails
[03:02:58] maesitos: has joined #RubyOnRails
[03:04:50] maesitos_: has joined #RubyOnRails
[03:06:45] maesitos: has joined #RubyOnRails
[03:07:31] konsolebox: has joined #RubyOnRails
[03:08:37] maesitos: has joined #RubyOnRails
[03:08:55] chadhs: has joined #RubyOnRails
[03:09:38] kknight: has joined #RubyOnRails
[03:10:27] maesitos: has joined #RubyOnRails
[03:10:47] kknight: hey help me to fix this https://gist.github.com/aj07/e4c9a4001207309be51f
[03:11:20] kknight: i think there is something to be done in route.rb https://gist.github.com/aj07/9e22ffb87bd9444bc8b9
[03:12:20] maesitos: has joined #RubyOnRails
[03:12:42] rubyonrailed: has joined #RubyOnRails
[03:12:50] jtong: has joined #RubyOnRails
[03:13:43] dexter-tzu: has joined #RubyOnRails
[03:14:17] maesitos: has joined #RubyOnRails
[03:14:24] askhat: has joined #RubyOnRails
[03:15:08] moeabdol: has joined #RubyOnRails
[03:16:08] maesitos: has joined #RubyOnRails
[03:18:01] maesitos: has joined #RubyOnRails
[03:18:46] Devalo: has joined #RubyOnRails
[03:19:10] mib_mib: has joined #RubyOnRails
[03:19:23] stannard: has joined #RubyOnRails
[03:19:53] maesitos: has joined #RubyOnRails
[03:19:55] mib_mib: hi - I would like to use activerecord models with Vertica database, but i dont see any well supported projects like this - would it be a lot of work to create activrecord-vertica t adapter?
[03:20:27] IrishGringo: has joined #RubyOnRails
[03:21:34] bronson_: has joined #RubyOnRails
[03:22:31] Pharaoh2: has joined #RubyOnRails
[03:23:37] maesitos: has joined #RubyOnRails
[03:24:24] peeja: has joined #RubyOnRails
[03:24:26] brycesenz: has joined #RubyOnRails
[03:25:14] benlieb: has joined #RubyOnRails
[03:25:35] maesitos: has joined #RubyOnRails
[03:26:01] mib_mib: How would i see the 'generated sql' for a query that is a 'count', i.e. MyModel.where(some: 'thing').to_sql works, but not MyModel.where(some: 'thing').count.to_sql doesnt (since its evaluuated)
[03:27:26] maesitos: has joined #RubyOnRails
[03:28:43] raidiant: has joined #RubyOnRails
[03:29:17] maesitos: has joined #RubyOnRails
[03:30:00] Janno: has joined #RubyOnRails
[03:30:09] braian: has joined #RubyOnRails
[03:31:14] maesitos: has joined #RubyOnRails
[03:31:20] arup_r: has joined #RubyOnRails
[03:32:40] sankaber: has joined #RubyOnRails
[03:33:39] braian: Hi guys! I'm using Rails 4.2 and I have a problem with this link: link_to "Delete", product, method: :delete
[03:34:01] arup_r: braian: what is the issue ?
[03:34:04] lessless: has joined #RubyOnRails
[03:34:09] zerg_lurker: has joined #RubyOnRails
[03:35:08] braian: arup_r: This is the line: <%= link_to "Delete", product, method: :delete, { class: "btn btn-sm btn-danger" } do %> with a span for the icon
[03:35:40] bahar: has joined #RubyOnRails
[03:35:41] arup_r: ok. what is not working ?
[03:35:52] braian: the error says: syntax error, unexpected keyword_ensure, expecting end-of-input
[03:36:22] arup_r: ok show the full code in gist
[03:36:25] safetypin: has joined #RubyOnRails
[03:37:06] code2Learn: has joined #RubyOnRails
[03:37:38] pwnd_nsfw: ye probably has nothing to do with that line of code
[03:38:35] braian: heres the code: https://gist.github.com/braiandickson/eb4b59ae7ff839b164ee
[03:39:11] braian: I have the "products" as a resource
[03:39:23] braian: all of my routes are okay
[03:41:43] SteenJobs: rhizome: are people more accepting of administrate than they are of ActiveAdmin?
[03:42:35] arup_r: braian: you can't have 'delete' text when using link_to with block
[03:43:15] baweaver: has joined #RubyOnRails
[03:43:18] arup_r: the first argument will be the url, then all html options.. ans inside the do..end block will go anchor text with any other nested html as you have the <span>
[03:44:25] pwnd_nsfw: SteenJobs, AA is pretty dongs from my impression of it
[03:44:32] pwnd_nsfw: It's nice for something simple, but
[03:44:37] pwnd_nsfw: I'd hoenstly rather just generate my own code
[03:44:59] braian: arup_r: I have this now: <%= link_to product, method: :delete, { class: "btn btn-sm btn-danger" } do %> and the same error
[03:45:05] SteenJobs: pwnd_nsfw: yea, in general i???m with you???i tend to prefer writing things myself
[03:45:17] SteenJobs: pwnd_nsfw: but this is pretty standard..i simply need to quickly put together an interface to allow for clients to upload image assets, for us to download those images and do fancy stuff to them, and then upload the new asset so the clients can access it. obvs most of this is dependent on an admin interface, and not having to swing one from scratch would really be huge.
[03:46:08] DmitryBochkarev: has joined #RubyOnRails
[03:46:42] ensyde: has joined #RubyOnRails
[03:47:36] arup_r: braian: <%= link_to product, method: :delete, class: "btn btn-sm btn-danger" do %>
[03:47:57] djbkd: has joined #RubyOnRails
[03:48:26] braian: arup_r: Thanks! Was that!
[03:50:46] pwnd_nsfw: SteenJobs, I don't have exp with administrate, but you'd probably be writing similar amounts of code
[03:50:51] pwnd_nsfw: doing scratch of with AA
[03:50:57] pwnd_nsfw: for that instance
[03:51:04] smoitra: has joined #RubyOnRails
[03:51:42] SteenJobs: pwnd_nsfw: i guess i???m less concerned with the backend code???using a library will save me from having to write the frontend
[03:54:44] rubyonrailed: has joined #RubyOnRails
[03:55:55] nodejunkie: has joined #RubyOnRails
[03:57:25] braian: Wich gem can I use for implemend a search form?
[03:57:31] speakingcode: has joined #RubyOnRails
[03:58:23] Radar: Ransack if you like fighting gems all the time or elasticsearch if you don't.
[03:59:05] pwnd_nsfw: SteenJobs, then AA will be great lol
[03:59:12] pwnd_nsfw: I still think it's dongs
[03:59:23] speakingcode: has joined #RubyOnRails
[03:59:55] SteenJobs: pwnd_nsfw: ha aright cool. i honestly don???t mind doing the backend from scratch???just don???t have the time or the proficiency to do the frontend work from scratch if i can avoid it.
[04:00:12] arup_r: braian: Ransack gem is nice
[04:00:16] SteenJobs: pwnd_nsfw: i guess i was mostly wondering if there was an alternative library held in higher esteem, like administrate which was mentioned earlier.
[04:00:45] stardiviner: has joined #RubyOnRails
[04:00:50] SteenJobs: pwnd_nsfw: been out of the game for some time doing iOS dev, so haven???t stayed up to date
[04:02:17] Radar: !activeadmin
[04:02:17] helpa: *makes a cross with fingers and says a prayer*
[04:02:19] baweaver: has joined #RubyOnRails
[04:03:57] SteenJobs: Radar: i know i know???hence why i opened up asking if there are any admin interface libraries that have gained popularity in the past year or so since people here were quite anti and Radar wasn???t terribly happy with me for asking ha
[04:04:12] arup_r: Radar: rails-admin is better than activeadmin ? Just asking. I know how complex activeadmin when it comes to customization..
[04:04:18] Radar: You'll spend all your time fighting rails admin, active admin, etc.
[04:04:20] helpa: Please do not use active_admin, rails_admin or any other gems to build your admin interfaces. Instead, build it yourself. This will lead you to a safe path of understanding of the code, rather than to the Hell that is those gems.
[04:04:24] Radar: this is why ^ this tip exists
[04:04:27] arup_r: ohh.. I see :)
[04:04:44] Radar: Because you'll come in here asking all the questions about how to make it bend in a certain way and we'll get frustrated because there's no easy answer to give you.
[04:04:56] Radar: If you build it following standard rails conventions then we CAN help you.
[04:05:02] pwnd_nsfw: I don't like doing front end either
[04:05:06] SteenJobs: hence why i asked if any libraries have been released in the past year that people here ARE accepting of
[04:05:09] pwnd_nsfw: that's what bootstrap and simpleform are for
[04:05:15] SteenJobs: simple question, with a simple answer: no
[04:05:24] Radar: SteenJobs: Administrate is close enough but I haven't tried it myself.
[04:05:33] celly: has joined #RubyOnRails
[04:05:52] SteenJobs: Radar: exactly what i needed. I???ll check it out, look at the source code, and make my own judgment. but that helps, thanks!
[04:06:11] pwnd_nsfw: I didn't knwo about those triggers though haha
[04:06:36] Radar: pwnd_nsfw: !tips
[04:06:36] helpa: pwnd_nsfw: Just the tips: http://logs.ryanbigg.com/tips
[04:06:41] pwnd_nsfw: just the tips
[04:06:50] Radar: Yes, nothing else. Just the tips.
[04:06:57] Radar: No ads, no extra content. Tips only.
[04:07:07] SteenJobs: pwnd_nsfw: for sure - but still, i???m far from proficient with html/css, in the sense that i can build anything???it just takes me a bit of time - and considering i need to be working on 1) writing automated image processing scripts and finishing an iOS app, i just dont have the time to spend trudging through html/css
[04:07:37] SteenJobs: * there was supposed to be a 2) in there haha
[04:07:41] pwnd_nsfw: but you'll read the docs for a mostly annoying admin panel
[04:07:58] pwnd_nsfw: ye there's no 2 hahaha
[04:07:58] SteenJobs: would still take me less time than writing the html/css myself ha
[04:08:10] pwnd_nsfw: WEll, like, the best part is
[04:08:19] pwnd_nsfw: bootstrap has default layouts you can use
[04:08:26] smurf: has joined #RubyOnRails
[04:08:27] pwnd_nsfw: and then you just put simpleform in there
[04:08:37] SteenJobs: word. i???ll take a look.
[04:08:55] pwnd_nsfw: if you can get the base html down, simpleform will write the forms for you
[04:09:08] SteenJobs: thankfully iOS dev doesn???t involve html/css, and most of the frontend work is really backend stuff anyway, so i haven???t had to touch html/css in quite some time.
[04:09:09] pwnd_nsfw: bootstrap class here, class there
[04:09:25] SteenJobs: ya..just much easier when you???ve been immersed in bootstrap and don???t need to look up every single class in the docs.
[04:09:32] pwnd_nsfw: luckily it doesn't have anything to do with JS.....
[04:09:37] SteenJobs: all of this is within my capabilities, it???s just a matter of time efficiency
[04:10:11] SteenJobs: eh, JS doesn???t bother me. i tend to actually like jQuery a bunch, and i just had to rewrite a lot of code in an angularJS app and it wasn???t nearly as bad as html/css.
[04:10:13] SteenJobs: for me at least
[04:10:18] SteenJobs: i just have this crazy aversion to it ha
[04:10:41] askhat: has joined #RubyOnRails
[04:10:42] pwnd_nsfw: You're contradicting yourself, but I'll leave it at that
[04:10:43] treaki_: has joined #RubyOnRails
[04:10:48] SteenJobs: could be because my exposure was also mostly during my early coding days, so the aversion i have may no longer be applicable.
[04:10:55] SteenJobs: please tell me how???
[04:11:15] SteenJobs: for my own benefit. can't possibly contradict myself and not learn from the mistake.
[04:11:26] pwnd_nsfw: Well, considering angular and jquery wouldn't exist without html/css existing in the first place
[04:11:47] SteenJobs: for sure???but using angular and jquery didn???t involve my having to write the html/css
[04:11:57] SteenJobs: the angular app???s html/css was already written
[04:12:02] pwnd_nsfw: rifk gotcha
[04:12:13] braincrash: has joined #RubyOnRails
[04:12:51] celly_: has joined #RubyOnRails
[04:13:03] SteenJobs: i merely have vague memories of spending the same amount of time getting a damn image to move 30 px to the left that it would???ve taken me to write 10x the amount of backend code ha.
[04:13:11] Radar: imo !angular should be something like "THE POWER OF REACT COMPELS YOU"
[04:13:20] SteenJobs: but i???ll take a look at my options and decide, thanks for the advice!
[04:13:51] SteenJobs: Radar: i very much found angular trying to be unique and different???but without actually adding anything substantive/worthwhile to make the uniqueness/difference worth the trouble.
[04:14:09] pwnd_nsfw: https://static.webshopapp.com/shops/001679/files/000562771/file.jpg
[04:14:13] pwnd_nsfw: basically what angular is for code
[04:14:16] Radar: SteenJobs: That is my opinion also, but you expressed it with much less shouting
[04:15:01] SteenJobs: Radar: was just incredibly annoying to spend a ton of time learning the architecture of angular, only to come out wondering what you???ve gained???which was pretty much nothing.
[04:15:02] pyemkey: has joined #RubyOnRails
[04:15:25] Radar: SteenJobs: Yuuuuup. We have quite a few thousand lines of Angular in our app with a ton of tech regret around it.
[04:15:34] ravster: has joined #RubyOnRails
[04:15:41] Radar: Little things like... THE SEARCH BAR for our site.
[04:15:54] Radar: The Refine box on the LHS here: https://www.bikeexchange.com.au/s
[04:16:16] Radar: Things that will take weeks to rewrite in React but we don't have time because ... well, for reasons that we're working on fixing.
[04:16:58] SteenJobs: Radar: i guess it kind of affords some peeps to be able to feel exclusive???when exclusivity should be a function of skill level (e.g. building some advanced feature, advanced architecture, etc.) and not a function of just being different
[04:17:28] pwnd_nsfw: Do you mean like... how enterprise java devs exist?
[04:18:10] SteenJobs: Radar: have you personally been using react?
[04:18:20] dcunit3d: has joined #RubyOnRails
[04:18:24] Radar: SteenJobs: Yes, we use it in our frontend along with Angular.
[04:18:24] creyes: has joined #RubyOnRails
[04:18:31] kp666: has joined #RubyOnRails
[04:18:48] Radar: SteenJobs: Very rarely together though. Our React stuff is all React+Redux (I think) and other JS that I can't recall.
[04:18:58] Radar: Our cart + checkout is all React
[04:19:28] Radar: i.e. add an item to your cart and then go to checkout.
[04:19:29] SteenJobs: Radar: nice! it???s high on my to do list???i prefer doing any mobile dev natively, but since i haven???t done any Android dev, knowing React could be huge if a gig requires cross-platform compatibility
[04:19:36] SteenJobs: React is as close to native mobile as you???ll get
[04:19:40] Radar: SteenJobs: React Native might fit your needs.
[04:19:58] krzkrz: has joined #RubyOnRails
[04:20:07] SteenJobs: yep. haven???t needed it yet, since my work has been native iOS, but i???m sure it???ll come in handy in the near future. I???ve only heard good things.
[04:20:48] ensyde: has joined #RubyOnRails
[04:22:24] kies^: has joined #RubyOnRails
[04:22:42] Pharaoh2: has joined #RubyOnRails
[04:24:36] SteenJobs_: has joined #RubyOnRails
[04:24:54] ornerymoose: has joined #RubyOnRails
[04:25:54] dublinan: has joined #RubyOnRails
[04:26:16] tego101: has joined #RubyOnRails
[04:26:18] barhum2013: has joined #RubyOnRails
[04:32:52] tildes: has joined #RubyOnRails
[04:36:30] code2Learn: has joined #RubyOnRails
[04:39:53] dublinan: has left #RubyOnRails: ()
[04:40:40] NBarnes: has joined #RubyOnRails
[04:40:51] DmitryBochkarev: has joined #RubyOnRails
[04:40:56] yogeshrt: has joined #RubyOnRails
[04:43:34] srinidhi: has joined #RubyOnRails
[04:44:03] mickey_mouse: has joined #RubyOnRails
[04:44:04] Eswar: has joined #RubyOnRails
[04:44:36] DmitryBochkarev: has joined #RubyOnRails
[04:46:18] pawnbox: has joined #RubyOnRails
[04:47:32] rafaelfranca: has joined #RubyOnRails
[04:50:43] FCser: has joined #RubyOnRails
[04:52:14] Pazician: has joined #RubyOnRails
[04:56:25] HenriettaSalt: has joined #RubyOnRails
[04:59:10] stardiviner: has joined #RubyOnRails
[05:01:05] yogeshrt: has joined #RubyOnRails
[05:06:54] srinidhi: has joined #RubyOnRails
[05:08:51] pawnbox: has joined #RubyOnRails
[05:09:18] askhat: has joined #RubyOnRails
[05:17:26] Eswar: has joined #RubyOnRails
[05:17:49] speakingcode: has joined #RubyOnRails
[05:19:09] HenriettaSalt: has joined #RubyOnRails
[05:20:16] Devalo: has joined #RubyOnRails
[05:26:21] diego1: has joined #RubyOnRails
[05:26:50] konsolebox: has joined #RubyOnRails
[05:28:30] diego1: has joined #RubyOnRails
[05:29:31] JoshGlzBrk: has joined #RubyOnRails
[05:29:48] pawnbox: has joined #RubyOnRails
[05:30:48] eGGsha: has joined #RubyOnRails
[05:31:04] EMCHAMP_: has joined #RubyOnRails
[05:31:08] yoongkang: has joined #RubyOnRails
[05:34:42] RegulationD: has joined #RubyOnRails
[05:36:09] HenriettaSalt: has joined #RubyOnRails
[05:36:42] tego101: has joined #RubyOnRails
[05:39:55] stardiviner: has joined #RubyOnRails
[05:42:30] rails690: has joined #RubyOnRails
[05:43:23] SteenJobs: has joined #RubyOnRails
[05:44:34] rails690: I want to change my Rails app to run on JRuby, because I feel like there are two benefits which I must absolutely have: 1. Speed/Performance, 2. Portable Distribution (.war). Do you think this is a good idea? And is there any gem incompatability list for JRuby? I'm afraid of some of my gems not working
[05:54:42] stardiviner: has joined #RubyOnRails
[05:55:25] stardiviner: has joined #RubyOnRails
[05:56:23] rhizome: if you already have an app, test it by running it under jruby
[05:58:22] nertzy: has joined #RubyOnRails
[05:58:23] bronson_: lots of gems are incompatible with jruby: anything that relies on native code and doesn't have a jruby equivalent.
[05:58:38] bronson_: but nothing is impossible.
[05:58:51] bronson_: replacing incompatible gems shouldn't be too bad.
[05:59:35] moei: has joined #RubyOnRails
[06:00:18] bronson_: hmmmmmm... not sure I agree with switching to jruby for performance.
[06:00:43] bronson_: you sure your site's bottleneck is the Ruby interpreter?
[06:03:26] rails690: its not exactly the ruby interpreter
[06:03:47] rails690: here's the issue: i see a java application written to do the same thing as my rails app (e.g. export things from the DB)
[06:04:02] rails690: the java app completes the entire table in like 5 seconds
[06:04:18] rails690: while my ruby app takes around 30 seconds
[06:04:32] bronson_: using the same export mechanism?
[06:04:43] rails690: exporting the same stuff, not the same code im sure
[06:05:08] Ropeney: rails690: What ruby version?
[06:05:32] bronson_: I mean, is the Java app using a bulk export while you're row-by-row? That's a really big difference.
[06:05:47] rails690: how could you do bulk export in rails using Roo?
[06:05:59] rails690: i dont know what its using as I havent seen the source code
[06:06:21] rails690: im sorry using Axlsx not roo
[06:06:48] speakingcode: has joined #RubyOnRails
[06:07:00] rails690: and becuz of that i want to switch to JRuby (benchmarks here: https://pragtob.wordpress.com/2015/11/30/benchmarking-a-go-ai-in-ruby-cruby-vs-rubinius-vs-jruby-vs-trufflegraal/) , along with the portable deployment
[06:07:04] Ropeney: rails690: paste some code and we can see :)
[06:09:14] bronson_: an AI is CPU bound and your DB export probably isn't.
[06:09:38] bronson_: Bet you'll find that it runs in 27 seconds in jRuby.
[06:09:46] Devalo: has joined #RubyOnRails
[06:10:32] bronson_: I bet you're operating row-by-row and the java app is doing a bulk dump or CSV export or something.
[06:10:43] rails690: no its exporting the same xlsx file as mine
[06:10:50] rails690: exact same output
[06:10:59] rails690: and yes i am operating row by row
[06:11:05] rails690: because thats how axlsx is
[06:11:08] rails690: u cant do bulk
[06:11:15] agoldboi: has joined #RubyOnRails
[06:11:15] Ropeney: paste some code rails690 of your export function and we may be able to help
[06:11:17] bronson_: jruby ain't going to fix that.
[06:12:05] BradenBraden: has joined #RubyOnRails
[06:12:26] bronson_: if you're outputting a super complex spreadsheet then maybe you're cpu bound.
[06:12:34] sandstrom: has joined #RubyOnRails
[06:12:54] ur5us: has joined #RubyOnRails
[06:13:21] griffindy: has joined #RubyOnRails
[06:14:40] bronson_: normally the bottleneck is on the db->Ruby side, not on the Ruby->client side.
[06:14:45] ensyde: has joined #RubyOnRails
[06:14:49] rails690: this is basically the code im using, with actual fields surpressed --> https://gist.github.com/anonymous/3120ef739aca07d20c73
[06:15:26] bronson_: but it's definitely worth an investigation. I agree there's a chance jRuby could speed you up a lot... just not a very big one. :)
[06:16:04] Puffball: has joined #RubyOnRails
[06:16:06] bronson_: where does @ms come from and how big is it?
[06:17:03] ferr: has joined #RubyOnRails
[06:17:05] ur5us: has joined #RubyOnRails
[06:17:15] rails690: the controller: https://gist.github.com/anonymous/6491e0ea3711d349a961
[06:17:36] prgmmr: has joined #RubyOnRails
[06:17:54] yogeshrt: has joined #RubyOnRails
[06:18:15] _lazarevsky: has joined #RubyOnRails
[06:18:34] _lazarevsky: when I try and destroy a model I get the following error
[06:19:04] prgmmr: Hello, if I'm using Rails as a Api to communicate with my iOS application. Then can I not use that same rails project for a website?
[06:19:11] _lazarevsky: Mysql2::Error: Table 'app.scenarios' doesn't exist: SHOW FULL FIELDS FROM `scenarios` ActiveRecord::StatementInvalid: Mysql2::Error: Table 'app.scenarios' doesn't exist: SHOW FULL FIELDS FROM `scenarios`
[06:19:33] _lazarevsky: now I've been working on scenarios for the past 2-3 weeks but this code I've not yet pushed to production or beta for that matter
[06:19:49] _lazarevsky: I'm trying to nuke a Team object
[06:20:04] _lazarevsky: how can I go about finding where the code is which ties a team to a scenario ?
[06:21:50] bronson_: rails690: yea, seems ok. curious to see what jruby gets you. I'm thinking 2X tops but who knows! maybe there's a bottleneck that it'll just crush.
[06:22:31] fedexo: has joined #RubyOnRails
[06:23:31] bronson_: prgmmr: certainly. how easy it is depends on your website & client code.
[06:24:20] ayonkhan: has joined #RubyOnRails
[06:24:21] prgmmr: Just want a log in screen and when logged in only a few options available really. Pretty simple.
[06:24:31] Ropeney: rails690: are all the eg's properly eager_loaded?
[06:26:12] Ropeney: rails690: Using axlsx and ruby 1.9.3 i have ~150,000 rows and about 20 columns being dumped to csv in ~8s (a benchmark for you to gauge against)
[06:26:18] rails690: Ropeney: yes, i dont get any N+1 queries
[06:26:41] rails690: Ropeney: that's pretty good
[06:27:18] rails690: Ropeney: however, what type of computer was this benchmark done on
[06:27:31] rails690: Ropeney: i'm dealing with low-resource computers here
[06:28:02] Ropeney: macbook pro 13" last years model
[06:29:39] rails690: Ropeney: last years model had different types, different specs, what's the Ram, Cpu, etc?
[06:32:40] Ropeney: 3ghz i7, think the 2 core with 16gb ram
[06:33:16] rails690: Ropeney: ahh i see
[06:33:35] rvanlieshout: has joined #RubyOnRails
[06:33:38] Ropeney: rails690: Im off though, goodluck!
[06:33:44] rails690: Ropeney: thanks
[06:33:58] srinidhi: has joined #RubyOnRails
[06:35:22] yfeldblum: has joined #RubyOnRails
[06:36:38] HenriettaSalt: has joined #RubyOnRails
[06:36:51] yfeldblum: has joined #RubyOnRails
[06:37:08] chouhoul_: has joined #RubyOnRails
[06:37:31] yogeshrt: has joined #RubyOnRails
[06:38:26] AntiSpamMeta: has joined #RubyOnRails
[06:38:40] techsethi: has joined #RubyOnRails
[06:42:16] greg: has joined #RubyOnRails
[06:43:40] techsethi: has joined #RubyOnRails
[06:44:41] greg: hello i want to add another column for blog post do i need to rollback?
[06:44:58] greg: then once again i have to do it?
[06:45:04] rvanlieshout: add a second migration
[06:45:06] rvanlieshout: to add that column
[06:46:14] greg: how i want another sub author for ecah auther
[06:47:05] tego101: has joined #RubyOnRails
[06:47:12] jeanre: has joined #RubyOnRails
[06:48:40] rvanlieshout: you want wat?
[06:48:50] ferr: it took me 2 days to make a simple form with polymorphic associations and dynamic select boxes, lol
[06:50:40] ziyadb: has joined #RubyOnRails
[06:51:07] deweysdecimal: has joined #RubyOnRails
[06:51:24] Radar: greg: agree with rvanlieshout. add another migration
[06:52:17] deweysdecimal: I'm trying to use a factory in my spec to post :create, but can't get an associated attributes from a has_many through association to work
[06:52:21] deweysdecimal: gist here: https://gist.github.com/goronfreeman/c7653b8e8f54397e65e9#file-challenges_controller_spec-rb-L11
[06:52:40] Radar: deweysdecimal: what happens when you try?
[06:53:11] Radar: deweysdecimal: oh, the before(:create) callback won't be triggered at all.
[06:53:18] AntiSpamMeta: has joined #RubyOnRails
[06:53:21] Radar: deweysdecimal: you're better off using attributes_for and then manually adding in the tag attributes with a call to merge.
[06:53:25] deweysdecimal: Radar: I get "expected #count to have changed by 1, but was changed by 0"
[06:53:47] deweysdecimal: oh, I figured that's what what happening
[06:54:01] deweysdecimal: what would the syntax look like to accomplish that?
[06:54:22] deweysdecimal: I've been messing with it for quite a while
[06:54:35] deweysdecimal: Just started using factory_girl too, so trying to take it all in
[06:54:56] netzfisch: has joined #RubyOnRails
[06:55:23] benlieb: has joined #RubyOnRails
[06:56:17] Radar: attributes_for(:challenge).merge(tags_attributes: [...])
[06:56:30] Bloomer: has joined #RubyOnRails
[06:56:33] deweysdecimal: Radar: thanks for the help!
[06:56:34] Radar: You might want to look at what your form is submitting to that action already and mimic that.
[06:58:13] deweysdecimal: Radar: that fixed it! thanks again
[06:58:13] hcnewsom: has joined #RubyOnRails
[06:59:08] jahbrewski: has joined #RubyOnRails
[06:59:35] greg: i want to add another scaffold as sub_author
[06:59:56] Radar: greg: that is not making any sense
[07:00:00] Radar: greg: sub author of what?
[07:00:11] greg: for that rails g scaffold sub_author:string doesn't work?
[07:00:17] Radar: greg: !didntwork
[07:00:17] helpa: greg: 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.
[07:01:04] greg: Radar: i want to add aothoer coloumn of sub author
[07:01:25] Radar: greg: rails g migration add_sub_author_to_posts sub_author:string
[07:01:38] Radar: greg: I recommend you read a Rails book to learn these types of things.
[07:01:48] Radar: greg: Seems like you're just struggling without having done any reading first.
[07:01:51] Radar: greg: !r4ia is the book I wrote
[07:01:51] helpa: greg: 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
[07:03:34] fedexo_: has joined #RubyOnRails
[07:03:54] yoongkang: has joined #RubyOnRails
[07:03:57] fedexo__: has joined #RubyOnRails
[07:04:18] solars: has joined #RubyOnRails
[07:08:23] kknight: has joined #RubyOnRails
[07:08:56] kknight: and that column should be in one to one relation with author
[07:10:14] Radar: kknight: should it? Who said there was ever a table for authors?
[07:10:15] scepticulous: has joined #RubyOnRails
[07:11:30] celly: has joined #RubyOnRails
[07:11:39] atmosx: has joined #RubyOnRails
[07:13:39] JohnBat26: has joined #RubyOnRails
[07:13:40] DonOtreply: has joined #RubyOnRails
[07:13:58] kknight: actually i want to add another sub-author part in app
[07:14:12] jahbrewski: has joined #RubyOnRails
[07:14:29] lxsameer: has joined #RubyOnRails
[07:14:32] Radar: oh you're greg. I didn't see the nick change
[07:14:41] Radar: kknight: !gettingstarted
[07:14:42] helpa: kknight: http://guides.rubyonrails.org/getting_started.html - Getting started with Ruby on Rails guide written by Mike Gunderloy and Ryan Bigg
[07:16:47] lexileo: has joined #RubyOnRails
[07:17:32] JohnBat26: has joined #RubyOnRails
[07:18:00] pyemkey: has joined #RubyOnRails
[07:18:57] moeabdol1: has joined #RubyOnRails
[07:20:39] kknight: has left #RubyOnRails: ("Leaving")
[07:20:58] stannard: has joined #RubyOnRails
[07:22:03] remyg: has joined #RubyOnRails
[07:23:56] konsolebox: has joined #RubyOnRails
[07:26:17] hello9: has joined #RubyOnRails
[07:26:55] Pazician: has joined #RubyOnRails
[07:27:34] ur5us: has joined #RubyOnRails
[07:30:01] gingray: has joined #RubyOnRails
[07:30:43] kknight: has joined #RubyOnRails
[07:30:52] kknight: https://gist.github.com/aj07/293cd11d2ff3f3f57460
[07:31:26] Radar: kknight: Did you read the error message?
[07:31:37] Radar: You don't have an authors table.
[07:31:56] hello9: hey all, Im using ajax to reload a div that has a click event so I binded it to document, but it seems to be causing a problem with Internet Explorer GIST: https://gist.github.com/anonymous/274adac4af0a00f19028
[07:32:13] hello9: anyone know a good work around where I can keep the div fresh after ajax and have it work on IE?
[07:32:21] Radar: hello9: $(".class-name").click(function (e) { ... ?
[07:32:33] Grundell: has joined #RubyOnRails
[07:32:46] hello9: Radar, after the ajax call on the containing div the click event wont work
[07:32:46] apotry: has joined #RubyOnRails
[07:32:50] hello9: thats why i have it on document
[07:32:52] konsolebox: has joined #RubyOnRails
[07:32:54] maesitos: has joined #RubyOnRails
[07:33:07] hello9: but i think ".on" is causing the problem
[07:33:12] Radar: hello9: Small reproducible example please. I'm not understanding what's going wrong
[07:33:30] hello9: Radar, let me pull the ajax part
[07:33:35] kknight: Radar: how can author table can be ctreated
[07:33:49] Radar: kknight: Please read the getting started guide. It will teach you how to create tables.
[07:33:56] Radar: hello9: An app which reproduces this issue would be great.
[07:34:38] arup_r: has joined #RubyOnRails
[07:37:35] hello9: Radar, https://gist.github.com/anonymous/2b760745652143d0534c
[07:37:42] hello9: right now im on localhost
[07:37:47] HenriettaSalt: has joined #RubyOnRails
[07:38:20] Radar: hello9: I'm not sure how to fix that. I haven't used RJS in quite a while.
[07:38:48] hello9: yeh old school
[07:39:15] DoubleMalt: has joined #RubyOnRails
[07:40:49] hello9: i mean IE bro
[07:41:11] hello9: that js vendetta!
[07:41:34] srinidhi: has joined #RubyOnRails
[07:43:10] MaDErroR123: has joined #RubyOnRails
[07:43:29] duncannz: has joined #RubyOnRails
[07:44:12] jahbrewski: has joined #RubyOnRails
[07:45:51] aganov: has joined #RubyOnRails
[07:48:47] sandstrom: has joined #RubyOnRails
[07:50:39] raunicolae: has joined #RubyOnRails
[07:50:48] raunicolae: has left #RubyOnRails: ()
[07:51:54] pyemkey: has joined #RubyOnRails
[07:53:26] bronson_: has joined #RubyOnRails
[07:57:06] kvsari: has joined #RubyOnRails
[07:58:28] askhat: has joined #RubyOnRails
[07:59:06] dionysus69: has joined #RubyOnRails
[08:00:03] _3by8: has joined #RubyOnRails
[08:00:26] arBmind: has joined #RubyOnRails
[08:01:41] diegoviola: has joined #RubyOnRails
[08:02:10] sandstrom: has joined #RubyOnRails
[08:03:43] _3by8: I'm trying to clean up some code that is currently just a ginormous list of if statements--each if/elsif statement checks to see if params has a key and then checks to see whether or not that key is true. Here's what I have so far: https://gist.github.com/threebyeight/90c3eac979c5465bba69
[08:04:22] _3by8: I guess my next step is to iterate over each key in that array I passed to any and see if it is equal to true, then set that attribute to true in the model object.
[08:04:28] _3by8: Does that seem right?
[08:05:15] freezevee: has joined #RubyOnRails
[08:05:37] freezevee: Can I scaffold some specific actions in a controller after I have already scaffolded in the past ?
[08:06:43] freezevee: For example I have scaffolded the show action only and I want to add new create. If I try rails g scaffold user new create, I get a duplicate denied message for migration. If I use --force it replaces the whole file. Any ideas ?
[08:08:12] Silox|: has joined #RubyOnRails
[08:09:23] [GeekNerd]: has joined #RubyOnRails
[08:09:26] yoongkang: has joined #RubyOnRails
[08:09:31] [GeekNerd]: has left #RubyOnRails: ()
[08:10:54] sandstrom: has joined #RubyOnRails
[08:11:16] jxs_: has joined #RubyOnRails
[08:11:50] darutoko: has joined #RubyOnRails
[08:11:59] fox_mulder_cp: Grundell: rails delete scaffold $name && rails g sacffold $name $options
[08:13:01] artto: has joined #RubyOnRails
[08:13:12] fox_mulder_cp: but scaffold generate morre code, than needed. it good for quick testing, but in production may be add untested blackholes with security issues
[08:14:11] jahbrewski: has joined #RubyOnRails
[08:17:26] Spami: has joined #RubyOnRails
[08:18:34] comrad: has joined #RubyOnRails
[08:20:02] Devalo: has joined #RubyOnRails
[08:23:13] sandstrom: has joined #RubyOnRails
[08:24:09] lexiMon: has joined #RubyOnRails
[08:25:58] lexileo: has joined #RubyOnRails
[08:27:04] tvw: has joined #RubyOnRails
[08:27:47] neilfse: has joined #RubyOnRails
[08:31:05] _3by8: How can I compare keys in a hash to an array so that it returns a hash with only the keys in that array?
[08:31:12] MaDErroR123: has joined #RubyOnRails
[08:31:28] kenndel: has joined #RubyOnRails
[08:32:27] arBmind1: has joined #RubyOnRails
[08:32:44] AimlessRAven: has joined #RubyOnRails
[08:32:57] AimlessRAven: how to test carrierview rspec test for create/edit ..
[08:33:03] sandstrom: has joined #RubyOnRails
[08:33:07] AimlessRAven: how can i pass img object
[08:33:26] rvanlieshout: see the carrierwave documentation
[08:33:30] rvanlieshout: they have a section about testing
[08:33:35] lexileo: has joined #RubyOnRails
[08:35:55] jeanre: has joined #RubyOnRails
[08:36:16] RegulationD: has joined #RubyOnRails
[08:36:33] jeanre: has joined #RubyOnRails
[08:36:33] jeanre: has joined #RubyOnRails
[08:36:38] jeanre: hmm why is there no ruby in $HOME/.rbenv/shims/ruby
[08:36:59] SanguineAnomaly: has joined #RubyOnRails
[08:38:27] HenriettaSalt: has joined #RubyOnRails
[08:39:43] supergeek: has joined #RubyOnRails
[08:41:39] _3by8: Will this work? MailerName.send(k).deliver_now
[08:42:14] comrad: has joined #RubyOnRails
[08:43:05] bahar: has joined #RubyOnRails
[08:43:46] darkxploit: has joined #RubyOnRails
[08:43:48] rubyonrailed: has joined #RubyOnRails
[08:43:48] mark4: has joined #RubyOnRails
[08:44:09] jeanre: is anyone here still using textmate 2?
[08:44:09] jahbrewski: has joined #RubyOnRails
[08:44:22] jeanre: with rbenv
[08:44:26] sandstrom: has joined #RubyOnRails
[08:44:56] msyvich: has joined #RubyOnRails
[08:45:14] chouhoulis: has joined #RubyOnRails
[08:46:25] tbuehlmann: _3by8, have you tried?
[08:47:55] _3by8: tbuehlmann: no, I'm still writing other bits of code that it depends on.
[08:48:34] _3by8: tbuehlmann: I'm not sure if you saw my earlier statement but I'm trying to DRY up a huge block of conditional statements.
[08:48:42] tbuehlmann: nope, didn't
[08:48:49] pawnbox: has joined #RubyOnRails
[08:49:48] yogeshrt: has joined #RubyOnRails
[08:50:32] _3by8: Here's a Ruby question: if a param is set but not equal to true, will param[:key] == true evaluate to true?
[08:51:13] helpa: _3by8: Why don't you try it and find out for yourself?
[08:51:19] _3by8: rvanlieshout: haha
[08:52:32] mdw: has joined #RubyOnRails
[08:53:06] sandstrom: has joined #RubyOnRails
[08:53:09] lipoqil: has joined #RubyOnRails
[08:53:31] ferr: has joined #RubyOnRails
[08:56:50] eyck: has joined #RubyOnRails
[08:56:59] baweaver: has joined #RubyOnRails
[08:57:10] _3by8: rvanlieshout: I think I'm doing something inelegantly, how would I compare a hash against an array of key values and return only a hash with those key values from that array? Here's what I'm trying to do currently but I'm iterating over each key in that array instead of only the ones that exist: https://gist.github.com/threebyeight/cd3a462dc7593b6791b9
[09:00:20] pawnbox_: has joined #RubyOnRails
[09:03:09] rvanlieshout: http://api.rubyonrails.org/classes/Hash.html#method-i-extract-21
[09:03:16] sandstrom: has joined #RubyOnRails
[09:03:28] ur5us: has joined #RubyOnRails
[09:03:35] defsdoor: has joined #RubyOnRails
[09:03:45] rvanlieshout: it's an in place replacement though
[09:03:54] _3by8: rvanlieshout: thank you
[09:06:12] _3by8: rvanlieshout: what's an in-place replacement?
[09:06:48] rvanlieshout: try this in a console:
[09:07:21] _3by8: Oh, that's right, the bang operator means that it changes the object it's operating on.
[09:07:46] _3by8: rvanlieshout: you're a god, thank you
[09:08:01] kitsuneyo: has joined #RubyOnRails
[09:08:21] rvanlieshout: it doesn't really 'mean' that
[09:08:31] rvanlieshout: the ? and ! are just part of the method name
[09:08:43] rvanlieshout: the community tries to give that a meaning
[09:08:47] rvanlieshout: like ? returns a boolean
[09:08:56] rvanlieshout: and ! changes something
[09:09:09] rvanlieshout: or fails hard
[09:09:17] rvanlieshout: i don't know if there is a proper explanation given somewhere
[09:09:46] sandstrom: has joined #RubyOnRails
[09:10:31] kitsuneyo: in a pundit policy, i want to do this: if controller.controller_path == 'admin/people'; false unless user.admin? ... but 'controller' isn't recognised here. how can i access the current controller in a pundit policy?
[09:10:41] jsrn_: has joined #RubyOnRails
[09:10:51] rvanlieshout: kitsuneyo: you shouldn't
[09:11:02] rvanlieshout: you should pass data needed from the controller to the policy
[09:11:14] kitsuneyo: rvanlieshout hmm ok
[09:11:55] lubekpl: has joined #RubyOnRails
[09:11:57] lubekpl_: has joined #RubyOnRails
[09:12:20] celly: has joined #RubyOnRails
[09:13:54] sandstrom: has joined #RubyOnRails
[09:14:08] jahbrewski: has joined #RubyOnRails
[09:14:40] kitsuneyo: thanks rvanlieshout, i can see i was overcomplicating things now
[09:14:41] lubekpl: has joined #RubyOnRails
[09:15:00] rvanlieshout: could happen :)
[09:15:24] fwaokda: has joined #RubyOnRails
[09:19:00] benlieb: has joined #RubyOnRails
[09:20:36] Devalo: has joined #RubyOnRails
[09:21:19] tetraktys: has joined #RubyOnRails
[09:22:52] atmosx: has joined #RubyOnRails
[09:24:35] sandstrom: has joined #RubyOnRails
[09:24:57] moeabdol2: has joined #RubyOnRails
[09:26:07] Ergo: has joined #RubyOnRails
[09:29:54] udiudi: has joined #RubyOnRails
[09:30:35] AntiSpamMeta: has joined #RubyOnRails
[09:32:00] udiudi: Hi, any good way to switch from cookie store to redis store for sessions, and keep everyone logged in?
[09:32:11] udiudi: or should I copy sessions over one by one of logged in users?
[09:33:48] maesitos: has joined #RubyOnRails
[09:39:13] HenriettaSalt: has joined #RubyOnRails
[09:40:26] arBmind: has joined #RubyOnRails
[09:42:20] rvanlieshout: udiudi: i would expect that last one
[09:42:50] udiudi: rvanlieshout: didn't entirely understood you
[09:43:07] kitsuneyo: has joined #RubyOnRails
[09:43:12] udiudi: The options I see is either sync cookie sessions to redis for a day +- and then switch, which should keep most users logged in
[09:43:20] udiudi: Or some other magic I'm not aware of?
[09:43:29] rvanlieshout: i'm not aware of a different method
[09:43:46] udiudi: I hoped for some automagic migration
[09:44:07] udiudi: having both "active", new sessions created in Redis, and cookie store is just as backup
[09:44:11] jahbrewski: has joined #RubyOnRails
[09:44:14] udiudi: if session doesn't exist in Redis.
[09:44:39] rubyonrailed: has joined #RubyOnRails
[09:44:56] rvanlieshout: seems a valid use case, but how bad would it to have your users sign in again?
[09:46:07] udiudi: very bad, sadly.
[09:46:12] chouhoulis: has joined #RubyOnRails
[09:46:16] udiudi: The management takes these things seriously
[09:46:20] sandstrom: has joined #RubyOnRails
[09:50:09] wethu: has joined #RubyOnRails
[09:52:43] yogeshrt: has joined #RubyOnRails
[09:53:21] worknick: has joined #RubyOnRails
[09:53:33] worknick: How can i concatenate params[:user_id] + "mystring"
[09:54:10] rvanlieshout: "foo".constantize
[09:54:23] rvanlieshout: "#{params[:user_id]}mystring".constantize
[09:54:34] tbuehlmann: concatenate, not constantize, right?
[09:54:38] rvanlieshout: or better: http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html#method-i-safe_constantize
[09:54:41] worknick: Concatenate.
[09:54:49] rvanlieshout: "#{params[:user_id]}mystring"
[09:55:08] rvanlieshout: or even better: http://api.rubyonrails.org/classes/ActionView/Helpers/OutputSafetyHelper.html#method-i-safe_join
[09:55:37] worknick: i already did that. the fault was the last " were '' and i was seeing them as "
[09:55:48] worknick: whats the better font to avoid this?
[09:56:32] rvanlieshout: https://github.com/adobe-fonts/source-code-pro
[09:57:02] worknick: thanks rvanlieshout
[09:57:13] rvanlieshout: distinct difference between l1IL
[09:58:27] worknick: yeah that too required.
[09:58:47] pawnbox: has joined #RubyOnRails
[10:02:51] mlitwiniuk: has joined #RubyOnRails
[10:03:14] blackmesa: has joined #RubyOnRails
[10:04:26] lexiMon: has joined #RubyOnRails
[10:04:34] mlitwiniuk: has joined #RubyOnRails
[10:05:09] sandstrom: has joined #RubyOnRails
[10:09:10] msyvich: has joined #RubyOnRails
[10:09:23] yardenbar: has joined #RubyOnRails
[10:11:26] FooMunki: has joined #RubyOnRails
[10:12:32] moeabdol: has joined #RubyOnRails
[10:14:31] sandstrom: has joined #RubyOnRails
[10:15:30] moeabdol1: has joined #RubyOnRails
[10:17:56] ElFerna: has joined #RubyOnRails
[10:20:27] AzaToth: has joined #RubyOnRails
[10:21:39] marr: has joined #RubyOnRails
[10:22:40] kitsuneyo: what is the best way to return a 404 error for records that don't exist?
[10:23:34] stardiviner: has joined #RubyOnRails
[10:26:37] PedramT: has joined #RubyOnRails
[10:27:13] blackhuey: has joined #RubyOnRails
[10:28:18] tvw: has joined #RubyOnRails
[10:28:59] pawnbox_: has joined #RubyOnRails
[10:29:03] kitsuneyo: has joined #RubyOnRails
[10:29:11] jahbrewski: has joined #RubyOnRails
[10:29:28] msyvich: has joined #RubyOnRails
[10:32:41] sandstrom: has joined #RubyOnRails
[10:33:12] mdw: has joined #RubyOnRails
[10:33:14] rvanlieshout: kitsuneyo: use a .find
[10:33:24] greg: has joined #RubyOnRails
[10:33:25] rvanlieshout: it'll raise an ActiveRecord::RecordNotFound-ish
[10:33:29] rvanlieshout: which by default renders a 404
[10:34:46] kitsuneyo: i see rvanlieshout... what about Post.find_by_slug ?
[10:35:14] quazimodo: has joined #RubyOnRails
[10:36:26] sevenseacat: has joined #RubyOnRails
[10:36:49] atmosx_: has joined #RubyOnRails
[10:38:22] PedramT: has joined #RubyOnRails
[10:39:20] rvanlieshout: kitsuneyo: that'll return nil
[10:39:23] rvanlieshout: so you have to do it yourself
[10:39:31] rvanlieshout: you might want to read about that find_by though
[10:39:58] HenriettaSalt: has joined #RubyOnRails
[10:40:22] maesitos: has joined #RubyOnRails
[10:40:32] kitsuneyo: thanks rvanlieshout... where should i raise the exception? should i do it action by action?
[10:40:46] rvanlieshout: or use a before_action
[10:40:48] PedramT_: has joined #RubyOnRails
[10:41:34] kitsuneyo: it does return nil, yeah
[10:41:38] kitsuneyo: ok, i'm gonna try it, thanks
[10:43:13] yogeshrt: has joined #RubyOnRails
[10:43:28] adre: has joined #RubyOnRails
[10:44:23] itsgokul: has joined #RubyOnRails
[10:47:12] chouhoulis: has joined #RubyOnRails
[10:51:22] roshanavand: has joined #RubyOnRails
[10:54:53] bronson_: has joined #RubyOnRails
[10:55:57] techsethi: has joined #RubyOnRails
[10:57:38] existensil: has joined #RubyOnRails
[10:58:16] baweaver: has joined #RubyOnRails
[10:58:59] ferr: has joined #RubyOnRails
[10:59:12] jahbrewski: has joined #RubyOnRails
[11:00:24] PedramT: has joined #RubyOnRails
[11:01:13] worknick: custome controller actions automatically connects itself to customaction.html.erb or i have to manually tell it?
[11:05:16] DEA7TH: has joined #RubyOnRails
[11:08:23] vedu: worknick: it does :)
[11:09:19] rvanlieshout: worknick: it's not really how it goes
[11:09:29] kerunaru: has joined #RubyOnRails
[11:09:32] rvanlieshout: the default is triggered when you don't render or related in the controller
[11:09:38] rvanlieshout: the default will look for a view
[11:09:46] rvanlieshout: given the action name, format and builders
[11:10:47] PedramT: has joined #RubyOnRails
[11:13:14] celly: has joined #RubyOnRails
[11:14:10] dextertzu: has joined #RubyOnRails
[11:20:45] PedramT: has joined #RubyOnRails
[11:21:12] Jasaka: has joined #RubyOnRails
[11:21:54] mikecmpbll: has joined #RubyOnRails
[11:22:03] Devalo: has joined #RubyOnRails
[11:23:33] stannard: has joined #RubyOnRails
[11:26:05] y2mq37: has joined #RubyOnRails
[11:26:44] krzkrz: has joined #RubyOnRails
[11:29:10] jahbrewski: has joined #RubyOnRails
[11:29:31] PedramT: has joined #RubyOnRails
[11:29:59] worknick: vedu: rvanlieshout ok
[11:34:23] MaDErroR123: has joined #RubyOnRails
[11:35:52] chipotle: has joined #RubyOnRails
[11:36:35] lxsameer: has joined #RubyOnRails
[11:37:29] Pazician_: has joined #RubyOnRails
[11:37:58] kpwarr: has joined #RubyOnRails
[11:40:42] HenriettaSalt: has joined #RubyOnRails
[11:40:55] Skelz0r: has joined #RubyOnRails
[11:44:24] maesitos: has joined #RubyOnRails
[11:45:47] sandstrom: has joined #RubyOnRails
[11:47:22] dtordable: has joined #RubyOnRails
[11:47:54] Axilla: has joined #RubyOnRails
[11:47:55] chouhoulis: has joined #RubyOnRails
[11:48:03] tetraktys: has joined #RubyOnRails
[11:48:06] Ergo__: has joined #RubyOnRails
[11:48:33] artto: has joined #RubyOnRails
[11:49:01] Axilla: morning all, I have an issue where I'm requireing a tree of JS files. However when I call one of the functions from one file i'm getting an error that function doesn't exist.. i've tried requreing just that file and doing it before all the rest, but no joy. Why is the asset pipeline behaving this way?
[11:49:06] Axilla: i'm a bit miffed on this one.
[11:49:09] kpwarr: has joined #RubyOnRails
[11:51:11] codedmart: has joined #RubyOnRails
[11:52:13] Ergo: has joined #RubyOnRails
[11:53:25] fox_mulder_cp: hm. where is diegov*la?
[11:53:36] rvanlieshout: axilla: it's not in your combined file?
[11:53:56] fox_mulder_cp: some weeks ago has a problem with it's cray client
[11:55:04] Danielpk: has joined #RubyOnRails
[11:55:44] MaDErroR123: has joined #RubyOnRails
[11:56:56] tetraktys: has joined #RubyOnRails
[11:57:25] DEA7TH: has joined #RubyOnRails
[11:58:59] Axilla: let me look rvanlieshout
[11:59:09] Axilla: but its saying the function doesn't exist so i'm assuming not.
[11:59:11] jahbrewski: has joined #RubyOnRails
[11:59:44] blackmesa: has joined #RubyOnRails
[12:05:58] smoitra: has joined #RubyOnRails
[12:06:37] sandstrom: has joined #RubyOnRails
[12:09:57] Axilla: rvanlieshout: nope, it's there
[12:10:05] braian: has joined #RubyOnRails
[12:10:09] Axilla: it's being compiled into the applciation.js file
[12:10:51] Bugson: has joined #RubyOnRails
[12:11:28] jottr: has joined #RubyOnRails
[12:13:26] andrew9184: has joined #RubyOnRails
[12:16:15] sandstrom: has joined #RubyOnRails
[12:16:36] kpwarr: has joined #RubyOnRails
[12:24:56] stannard: has joined #RubyOnRails
[12:25:57] pawnbox: has joined #RubyOnRails
[12:26:04] blackmesa: has joined #RubyOnRails
[12:28:02] krzkrz: has joined #RubyOnRails
[12:29:12] jahbrewski: has joined #RubyOnRails
[12:29:17] arup_r: has joined #RubyOnRails
[12:29:32] IrishGringo: has joined #RubyOnRails
[12:33:38] ElFerna: has joined #RubyOnRails
[12:34:00] techsethi: has joined #RubyOnRails
[12:35:52] DoubleMalt: has joined #RubyOnRails
[12:37:45] RegulationD: has joined #RubyOnRails
[12:41:36] mottel: has joined #RubyOnRails
[12:42:04] bahar: has joined #RubyOnRails
[12:42:10] rvanlieshout: axilla: then it could be caused by invalid js before it
[12:42:45] HenriettaSalt: has joined #RubyOnRails
[12:43:36] AntiSpamMeta: has joined #RubyOnRails
[12:44:00] mottel: ddv: cheers
[12:45:29] dionysus69: has joined #RubyOnRails
[12:45:52] msyvich: has joined #RubyOnRails
[12:47:17] Nucky: has joined #RubyOnRails
[12:48:26] rodfersou: has joined #RubyOnRails
[12:48:40] chouhoulis: has joined #RubyOnRails
[12:50:10] sandstrom: has joined #RubyOnRails
[12:50:33] nfk: has joined #RubyOnRails
[12:51:00] pawnbox: has joined #RubyOnRails
[12:52:05] mottel: has left #RubyOnRails: ()
[12:53:29] mdw: has joined #RubyOnRails
[12:54:07] eGGsha: has joined #RubyOnRails
[12:56:47] bronson_: has joined #RubyOnRails
[12:57:33] lexileo: has joined #RubyOnRails
[12:59:09] jahbrewski: has joined #RubyOnRails
[12:59:14] blackmesa: has joined #RubyOnRails
[13:00:09] mercwithamouth: has joined #RubyOnRails
[13:01:38] lexileo: has joined #RubyOnRails
[13:04:41] hcnewsom: has joined #RubyOnRails
[13:04:41] quazimodo: has joined #RubyOnRails
[13:06:59] maesitos: has joined #RubyOnRails
[13:10:49] rickmasta: has joined #RubyOnRails
[13:11:18] ferr: has joined #RubyOnRails
[13:11:46] rickmasta: has joined #RubyOnRails
[13:11:55] yogeshrt: has joined #RubyOnRails
[13:13:55] sandstrom: has joined #RubyOnRails
[13:14:03] celly: has joined #RubyOnRails
[13:16:11] msyvich: has joined #RubyOnRails
[13:18:25] jottr: has joined #RubyOnRails
[13:19:39] askhat: has joined #RubyOnRails
[13:21:58] askhat: has joined #RubyOnRails
[13:24:36] Devalo: has joined #RubyOnRails
[13:27:58] ornerymoose: has joined #RubyOnRails
[13:28:13] artto: has joined #RubyOnRails
[13:28:43] yoongkang: has joined #RubyOnRails
[13:29:10] jahbrewski: has joined #RubyOnRails
[13:30:32] sandstrom: has joined #RubyOnRails
[13:33:13] ql6wlld: has joined #RubyOnRails
[13:34:01] Jasaka: has joined #RubyOnRails
[13:34:29] roshanavand: has joined #RubyOnRails
[13:35:38] yogeshrt: has joined #RubyOnRails
[13:37:37] askhat: has joined #RubyOnRails
[13:38:15] AntiSpamMeta: has joined #RubyOnRails
[13:38:43] kitsuneyo: has joined #RubyOnRails
[13:39:12] msyvich: has joined #RubyOnRails
[13:40:53] AntiSpamMeta: has joined #RubyOnRails
[13:41:07] yogeshrt: has joined #RubyOnRails
[13:42:57] askhat: has joined #RubyOnRails
[13:43:31] HenriettaSalt: has joined #RubyOnRails
[13:43:48] jxs_: has joined #RubyOnRails
[13:44:25] jxs_: has joined #RubyOnRails
[13:47:48] ornerymoose_: has joined #RubyOnRails
[13:49:26] chouhoulis: has joined #RubyOnRails
[13:49:34] sandstrom: has joined #RubyOnRails
[13:50:48] sankaber: has joined #RubyOnRails
[13:50:52] Ergo^: has joined #RubyOnRails
[13:51:58] pawnbox_: has joined #RubyOnRails
[13:53:10] nocontrol: has joined #RubyOnRails
[13:54:01] stannard: has joined #RubyOnRails
[13:55:26] thezanke: has joined #RubyOnRails
[13:59:08] jahbrewski: has joined #RubyOnRails
[13:59:46] blackmesa: has joined #RubyOnRails
[14:00:10] yottanami: has joined #RubyOnRails
[14:00:57] yottanami: I am using https://github.com/chaps-io/public_activity Is anyway to just render create activities?
[14:01:32] f3ttX]: has joined #RubyOnRails
[14:01:37] ElFerna: has joined #RubyOnRails
[14:03:37] kitsuneyo: has joined #RubyOnRails
[14:06:31] maesitos: has joined #RubyOnRails
[14:08:35] sandstrom: has joined #RubyOnRails
[14:10:09] yogeshrt: has joined #RubyOnRails
[14:10:28] maesitos: has joined #RubyOnRails
[14:10:53] bruce_lee: has joined #RubyOnRails
[14:11:29] bruce_lee: has joined #RubyOnRails
[14:11:37] EdwardIII: hrm is there a way to pull enough of rails into a standalone script to get "hello_you".camelize?
[14:11:54] EdwardIII: just playing around with a separate script and wanted to try something out
[14:12:44] treehug88: has joined #RubyOnRails
[14:14:09] rvanlieshout: EdwardIII: find camelize on the api docs
[14:14:39] rvanlieshout: http://api.rubyonrails.org/classes/String.html#method-i-camelize
[14:14:49] PedramT: has joined #RubyOnRails
[14:14:54] rvanlieshout: defined in activesupport/lib/active_support/core_ext/string/inflections.rb
[14:15:07] rvanlieshout: it requires ActiveSupport::Inflector
[14:15:14] rvanlieshout: so you'll need at least ActiveSupport::Inflector
[14:15:26] rvanlieshout: and that core ext if you want it to be available directly on string
[14:15:29] PedramT: has joined #RubyOnRails
[14:17:55] drbayer: has joined #RubyOnRails
[14:20:25] EdwardIII: ok cool, thanks
[14:22:38] IrishGringo: has joined #RubyOnRails
[14:23:31] msyvich: has joined #RubyOnRails
[14:24:21] sandstrom: has joined #RubyOnRails
[14:26:35] VeryBewitching: has joined #RubyOnRails
[14:26:52] VeryBewitching: Good morning folks.
[14:29:06] jahbrewski: has joined #RubyOnRails
[14:30:02] godzillaenlacasa: Anyone have insight on how to go about creating an API that would update remote devices checking into a rails server? Like, how NEST updates the firmware and UI for their thermostats from time to time?
[14:30:09] centrx: has joined #RubyOnRails
[14:30:19] devdazed: has joined #RubyOnRails
[14:31:12] msyvich: has joined #RubyOnRails
[14:31:37] mary5030: has joined #RubyOnRails
[14:31:44] HenriettaSalt: has joined #RubyOnRails
[14:31:47] tvw: has joined #RubyOnRails
[14:32:56] pwnd_nsfw: godzillaenlacasa, the api sounds like the easy part
[14:33:21] ramortegui: has joined #RubyOnRails
[14:33:41] godzillaenlacasa: @pwnd_nsfw That's good to know... maybe I'm more curious about the backend process then. Any insight there?
[14:34:11] pwnd_nsfw: I don't really know much about NEST
[14:34:18] pwnd_nsfw: With that context I could better help you, but
[14:35:32] godzillaenlacasa: @pwnd_nsfw NEST was just an example. I do know the device does RESTful API calls to the servers every few seconds, and does a call to the server to check for updates once a day. Was curious what the process would look like from a Rails/Ruby perspective on remote nodes
[14:36:06] pwnd_nsfw: does it sync up with mobile or something?
[14:36:08] fox_mulder_cp: godzillaenlacasa: u want write your own nagios + zabbix + firmware updater fow hardwsare nodes? O_O
[14:36:43] godzillaenlacasa: @fox_mulder_cp eww, that doesn't sound friendly at all. haha
[14:36:49] pwnd_nsfw: https://twitter.com/DivineOmega/status/695744177557106688
[14:36:50] n1lo: has joined #RubyOnRails
[14:36:51] pwnd_nsfw: WOW AMAZING
[14:37:04] fox_mulder_cp: godzillaenlacasa: i think - it is a bad idea - enterprise use already tested iLO, IPMI iDRAC, and HP/DELL Cisco/Huawei formwares
[14:37:30] fox_mulder_cp: for a blade runners
[14:38:01] godzillaenlacasa: @fox_mulder_cp yeah, but that's the problem... it's for their devices. I'm looking to write something for my infrastructure
[14:38:33] fox_mulder_cp: godzillaenlacasa: now i see a big trand to migrate to amazon/azure/ohv etc
[14:38:56] stannard: has joined #RubyOnRails
[14:39:29] godzillaenlacasa: @fox_mulder_cp but the API calls still need to take place, no matter where the server/nodes are, yeah?
[14:40:10] fox_mulder_cp: and think that no more time for write your own bike, when may use already tested solutions
[14:40:35] rubyonrailed: has joined #RubyOnRails
[14:40:55] godzillaenlacasa: @fox_mulder_cp I'm ok with a 'tested' solution as long as it works with what I'm doing... any gems or something out there that act as a starting point?
[14:41:11] fox_mulder_cp: godzillaenlacasa: i uses smart datacenter from hp, which can do upgrade firmwares automatically, when it needed by h-w server
[14:41:33] fox_mulder_cp: i don't know it
[14:41:37] stannard: has joined #RubyOnRails
[14:41:45] askhat: has joined #RubyOnRails
[14:42:38] fox_mulder_cp: i have a ansible/puppet/chef for deploy and control software and some hw-support engineers, which plug hw into datacanter, storages and change a disks
[14:42:45] godzillaenlacasa: @fox_mulder_cp hmm, ok. I'm looking for something a little more Ruby friendly, since ideally, I'd have my remote nodes call in to find out if they need to update, then if so, run a Ruby script to do so
[14:42:49] sandstrom: has joined #RubyOnRails
[14:42:58] stannard: has joined #RubyOnRails
[14:43:21] fox_mulder_cp: godzillaenlacasa: i think. that your task have a very big horizont
[14:43:35] godzillaenlacasa: @fox_mulder_cp dream big ;)
[14:43:52] fox_mulder_cp: and in question we have a 60-80% of answer
[14:44:11] greg: has joined #RubyOnRails
[14:44:26] fox_mulder_cp: i said u about ansible/chef/puppet, about iLO, iDRAC, Ipmi
[14:44:34] fox_mulder_cp: google for it now
[14:44:56] greg: how to change vhost local app server
[14:45:08] greg: i mean from where can i change it?
[14:45:11] fox_mulder_cp: godzillaenlacasa: my big dream - connection of my brain to world datacenter
[14:45:14] godzillaenlacasa: @fox_mulder_cp yeah, I started there... not sure on what to google though. "upgrade through RESTful API" isn't too revealing
[14:45:30] godzillaenlacasa: @fox_mulder_cp haha... totally lawnmower man
[14:45:37] fox_mulder_cp: godzillaenlacasa: open your eyes, bro )
[14:45:59] godzillaenlacasa: @fox_mulder_cp I didn't say that was my *only* big dream ;)
[14:46:03] fox_mulder_cp: greg: i think /etc/apache | /etc/nginx it node?
[14:47:06] fox_mulder_cp: godzillaenlacasa: i knows, that my life is small, and i select write my small app, which can be writed at small time (yeaf from life - not a big time)
[14:47:44] greg: fox_mulder_cp: it should be run in app folder or another terminal
[14:47:47] fox_mulder_cp: godzillaenlacasa: at 80-90th i knows ~10 tech and hardware, and i was cool IT pro
[14:48:20] fox_mulder_cp: now i know that i don't know anything
[14:49:17] roshanav_: has joined #RubyOnRails
[14:49:26] fox_mulder_cp: my knowledges of win 9x, os/2, dos, freebsd can be dropped at trash
[14:49:39] godzillaenlacasa: @fox_mulder_cp I'll be the first to tell you I don't know sh**
[14:50:10] chouhoulis: has joined #RubyOnRails
[14:50:11] godzillaenlacasa: @fox_mulder_cp haha, I powered up my old Win7 machine last week and just stared at it...
[14:50:40] godzillaenlacasa: @fox_mulder_cp sat there, like uhhhh.... what do I do now?
[14:50:45] pwnd_nsfw: win7 master race
[14:50:51] fox_mulder_cp: godzillaenlacasa: i drop win 8.x when my note upgraded to win10
[14:51:19] fox_mulder_cp: but now i says about use your life more, than write idiotic specific bikes. really
[14:51:52] fox_mulder_cp: now i control shared hosting based on freebsd 6 with bitrix and php ~10 years old
[14:52:21] greg: fox_mulder_cp: it should be run in app folder or another terminal
[14:52:29] fox_mulder_cp: bitrix-bases soft author now don't know, how this stuff is works properly
[14:52:59] noob_: has joined #RubyOnRails
[14:53:03] fox_mulder_cp: greg: hm. i can't know u, sory. i want run app server in other terminal shell?
[14:53:48] fox_mulder_cp: so u can start tmux session and switch to 2 or more virtual terminals with ruuning app server, vim with code and shell with tests
[14:55:24] jtong: has joined #RubyOnRails
[14:57:25] noob_: has left #RubyOnRails: ()
[14:58:06] daganev: has joined #RubyOnRails
[14:59:11] jahbrewski: has joined #RubyOnRails
[15:00:07] lacrymol1gy: has joined #RubyOnRails
[15:00:20] daganev: Hello, I'm trying to display errors on a page based on sub properties throwing errors. Anybody have some time to help me with this?
[15:00:43] daganev: Its not really a form, so my googlefu is failing me. :(
[15:00:53] sandstrom: has joined #RubyOnRails
[15:01:03] baweaver: has joined #RubyOnRails
[15:01:09] momomomomo: has joined #RubyOnRails
[15:02:40] hcnewsom: has joined #RubyOnRails
[15:02:50] blackmesa: has joined #RubyOnRails
[15:05:02] yoongkang: has joined #RubyOnRails
[15:13:35] B1n4r10: has joined #RubyOnRails
[15:14:27] macsteps: has joined #RubyOnRails
[15:14:49] fox_mulder_cp: hm. u can use flash, as exampl
[15:15:15] sankaber: has joined #RubyOnRails
[15:15:27] DoubleMalt: has joined #RubyOnRails
[15:15:34] fox_mulder_cp: or @some = { ex1 => 'your very looooong exeption' } and show it where u want
[15:15:53] fox_mulder_cp: or @some = sometext|somelist|somehash
[15:16:44] daganev: I've added everything to "errors"
[15:16:51] arthropododo: has joined #RubyOnRails
[15:16:51] daganev: my problem is getting the angular js to see it
[15:17:06] daganev: right now I do render json: @app.save
[15:17:24] fox_mulder_cp: daganev: get /api/json/myerrorhash and show it?
[15:17:47] daganev: and the angular controls doesn't have any error propery on the app
[15:18:23] daganev: Sorry, I'm not undestanding what get /api/json/myerrorhash is or where it would get populated
[15:18:30] lacrymology: has joined #RubyOnRails
[15:19:03] konsolebox: has joined #RubyOnRails
[15:19:07] daganev: I'm working on somebody else rails + angular app, and they left the company and I'm the only one here who knows the tiny bit about rails, so please excuse my cluselessness
[15:19:10] fox_mulder_cp: u must provide your $/api/json/myerrorhash and take error from it for showing?
[15:19:39] daganev: Ok, let me show you what I have .. one second
[15:19:57] fox_mulder_cp: i don't know angular so i can't help u(
[15:20:21] gremly: has joined #RubyOnRails
[15:21:04] daganev: ctrls.controller 'AppsController', ($scope, $location, AppsService) -> AppsService.get_apps().then (data) -> $scope.apps = data then later... $location.path("/apps/#{app.id}"
[15:21:50] sandstrom: has joined #RubyOnRails
[15:21:50] daganev: I think the errors are missing from the "data"
[15:22:05] daganev: because I'm only doing render json: @app.save!
[15:22:15] daganev: is there a way to add the errors to the data that gets received?
[15:22:19] Conflict: has joined #RubyOnRails
[15:22:45] daganev: something like render json: @app.save_with_errors!
[15:23:09] artto: has joined #RubyOnRails
[15:23:46] daganev: @fox_mulder Ok, I'll assume the angular part of this isn't so important, and that I just need to get the errors to be rendered as part of the json
[15:25:41] kitsuneyo: has joined #RubyOnRails
[15:26:29] jgt4: has joined #RubyOnRails
[15:26:48] Danielpk: has joined #RubyOnRails
[15:26:55] callumacrae: has joined #RubyOnRails
[15:27:44] callumacrae: Yo. What browsers are supported by the rails front-end?
[15:28:02] callumacrae: Or is that a bad question?
[15:28:44] s2013: has joined #RubyOnRails
[15:29:12] jahbrewski: has joined #RubyOnRails
[15:29:23] tubbo: callumacrae: all of them.
[15:29:44] callumacrae: well, not IE5, because jQuery is only tested down to IE 5.5
[15:29:56] tubbo: callumacrae: it's a little bit of a misinformed question...as rails is a framework for server-side web development, the browser shouldn't matter. jQuery isn't part of rails, it can be interchanged for anything you want.
[15:30:25] tubbo: callumacrae: in theory, i can browse a rails app with NCSA Mosaic as long as i made my HTML complaint to the version it supports.
[15:30:35] daganev: Anyone have any idea on how I can send errors in my json, where the current line is : render json: @app.save! ?
[15:30:36] msyvich: has joined #RubyOnRails
[15:30:54] macsteps: has joined #RubyOnRails
[15:31:31] sandstrom: has joined #RubyOnRails
[15:31:46] adavia: has joined #RubyOnRails
[15:34:31] ravster: has joined #RubyOnRails
[15:37:17] fox_mulder_cp: daganev: make method in controller with json result and error list hash array
[15:37:34] DmitryBochkarev: has joined #RubyOnRails
[15:37:36] chipotle: has joined #RubyOnRails
[15:37:39] fox_mulder_cp: make a websockets and push error directly to client
[15:37:55] jmfurlott: has joined #RubyOnRails
[15:38:11] rogue_koder: has joined #RubyOnRails
[15:38:22] daganev: so like render json: @app.save! , errors: @app.errors ?
[15:38:44] arup_r: has left #RubyOnRails: ()
[15:38:52] reckoner: has joined #RubyOnRails
[15:38:56] fox_mulder_cp: hm. see a default scaffolds.
[15:39:03] tubbo: that's not what default scaffolds do
[15:39:37] tubbo: why not render json: @app.errors if @app.errors.any?
[15:39:47] tubbo: render json: @app.errors and return if @app.errors.any?
[15:39:59] askhat: has joined #RubyOnRails
[15:40:13] daganev: Ok, I want to return both the results of the app save AND the errors
[15:40:18] daganev: That will do that?
[15:40:37] daganev: Sorry, I find ruby syntax very confusing
[15:41:07] IrishGringo: has joined #RubyOnRails
[15:42:42] daganev: should this work? render :json => @app.save!, :include => @app.errors
[15:43:04] Nikke: has joined #RubyOnRails
[15:43:51] daganev: cause its not working, and I need to know where to figure out its not working :)
[15:44:02] msyvich: has joined #RubyOnRails
[15:44:11] jahbrewski: has joined #RubyOnRails
[15:44:35] KnownSyntax: has joined #RubyOnRails
[15:45:31] dopamean_: has joined #RubyOnRails
[15:45:43] fox_mulder_cp: https://http.cat/
[15:45:49] rogue_koder: has joined #RubyOnRails
[15:45:59] fox_mulder_cp: daganev: use flash
[15:46:40] silverdust: What'd be the relationship b/w a cart and product model? cart has_many products will require cart_id for products which I don't want
[15:47:19] daganev: fox_mulder_cp: where do I use the flash?
[15:47:20] tubbo: silverdust: cart has_many items
[15:47:28] tubbo: item belongs_to product
[15:47:34] daganev: fox_mulder_cp: I'm not seeing the flash property when its outputed to json
[15:47:57] tubbo: daganev: no
[15:48:09] silverdust: Means I have to make an item model just for carts
[15:48:31] tubbo: daganev: that `render` call serving json will also render a hash into json, like this... `render json: { foo: 'bar' }`
[15:48:32] silverdust: I was storing cart items in Cart model
[15:49:03] daganev: tubbo: Ok thanks, I'll try that.
[15:49:09] silverdust: if I follow what you're saying tubbo what'll be in the carts table?
[15:49:15] tubbo: daganev: but you won't be able to get the errors that way
[15:49:35] msyvich: has joined #RubyOnRails
[15:49:47] tubbo: daganev: you'll have to do `result = @app.save`, then `render json: { result: result, errors: @app.errors }`, otherwise @app.errors won't be populated.
[15:50:06] daganev: tubbo: Oh.. Can I create a property in my model like def myerrors end , and then add json {errors: @app.myerrors } to the hash?
[15:50:09] tubbo: daganev: since you find ruby syntax confusing, i'm going to link a couple places for you to get started on learning you some ruby. since you clearly have to do it
[15:50:20] tubbo: daganev: you can but that's a stupid idea, since @app.errors is already a thing.
[15:50:25] tubbo: i mean you can do whatever you want
[15:50:51] tubbo: silverdust: in most ecom systems, cart is just a "view" for an order. so there would be an 'orders' table, but Cart wouldn't necessarily be a model.
[15:50:57] fox_mulder_cp: daganev: ooh, your angular make me cry
[15:51:07] tubbo: silverdust: a user's "cart" is simply the latest order they've started that they haven't placed yet.
[15:51:07] chouhoulis: has joined #RubyOnRails
[15:51:34] daganev: tubbo: Ok... the errors are generated before I call @app.save! because they are created by my "sync_app" function call before it.
[15:51:38] tubbo: daganev: what kind of json is angular expecting you to send?
[15:51:51] AntiSpamMeta: has joined #RubyOnRails
[15:51:59] rickmasta: has joined #RubyOnRails
[15:52:08] daganev: tubbo: I'm not sure the sort of json.. It just has the "data" property which I then pull out into various vars
[15:52:20] kies^: has joined #RubyOnRails
[15:52:22] fox_mulder_cp: silverdust: hm. i read about cart idea in Radar's Rails in actions book
[15:52:34] Pumukel: has joined #RubyOnRails
[15:52:53] tubbo: daganev: not sure i can help you any further until you know exactly what angularjs wants you to send it. you're building an api call for angular to consume, so we're just guessing here until we know the specifications of the response that angular expects.
[15:52:56] daganev: tubbo: But I'll take your word for it and try it :)
[15:53:21] silverdust: I still haven't read that unfortunately. Spoke with Radar about reading it as soon as I can
[15:54:07] daganev: tubbo: angular receives the json as "data", I then extract the vars based on the structure of the active record and pass them to the relevant controllers.
[15:55:04] srinidhi: has joined #RubyOnRails
[15:55:22] eGGsha: has joined #RubyOnRails
[15:55:28] tubbo: daganev: i see. so what you really want here is to be able to access it in the JS as e.g. `data.errors` and `data.model`.
[15:55:40] tubbo: daganev: that way you can do if (data.errors) { showTheErrors(); } or something
[15:55:44] fox_mulder_cp: silverdust: book costs as some coffee cup. buy and read :)
[15:56:14] tubbo: daganev: if you want that, just do result = @app.save; render json: { errors: @app.errors, success: result, model: @app }
[15:56:26] dsimon: has joined #RubyOnRails
[15:56:37] daganev: tubbo: Ok great, thanks, trying that.
[15:56:42] tubbo: daganev: i put the semicolon in there because it's actually 2 lines :)
[15:56:48] silverdust: If I set a cart_items has_many products it'd give me the power to do cart.products which is what I want but then products need a cart_id
[15:57:04] tubbo: fox_mulder_cp: rails 3 in action costs the same as a coffee cup where you live??
[15:57:09] dsimon: is this the right place to discuss rails dev stuff? i've got a PR i wanted to ask about
[15:57:36] tubbo: dsimon: sure...there aren't always contributors here but we're happy to help
[15:57:42] tubbo: s/contributors/rails contributors
[15:58:10] dsimon: so i've got this pr that adds foreign key support to the sqlite AR adapter, https://github.com/rails/rails/pull/22236
[15:58:32] dsimon: it seems to be languishing, and i'm not sure why; i keep rebasing it on request, but then it just sits until it falls out of sync again :-(
[15:58:34] silverdust: fox_mulder_cp: been considering the time to read not the price. I'm still yet to complete a lot of others so I'm being patient
[15:59:11] jahbrewski: has joined #RubyOnRails
[15:59:21] dsimon: s/on request/on activity/
[15:59:37] podman: has joined #RubyOnRails
[16:01:21] bronson_: has joined #RubyOnRails
[16:01:25] cschneid_: has joined #RubyOnRails
[16:02:42] Sadin: has joined #RubyOnRails
[16:03:39] tubbo: dsimon: sometimes that happens. look at how long this one has been around https://github.com/redis-store/redis-rails/issues/30
[16:04:09] ElFerna: has joined #RubyOnRails
[16:05:09] griffindy: has joined #RubyOnRails
[16:05:50] blackmesa: has joined #RubyOnRails
[16:07:17] smathy: has joined #RubyOnRails
[16:10:02] macsteps: has joined #RubyOnRails
[16:10:35] baweaver: has joined #RubyOnRails
[16:11:19] maesitos: has joined #RubyOnRails
[16:11:27] neohunter: has joined #RubyOnRails
[16:11:32] neohunter: on rails 2.3 how i can know if I'm in the console?
[16:11:49] neohunter: ON rails 4 i have Rails::Console
[16:11:54] neohunter: is something like that for 2.3?
[16:12:21] fox_mulder_cp: tubbo: ~30usd on amazone... ok, one coffee and brekfast with wife :)
[16:12:53] fox_mulder_cp: oh. go for a wife's gift on 14th feb
[16:13:00] DmitryBochkarev: has joined #RubyOnRails
[16:13:11] fox_mulder_cp: time to go away from work
[16:13:21] Bloomer: has joined #RubyOnRails
[16:14:05] Smcdrc: has joined #RubyOnRails
[16:14:20] daganev: tubbo: Turns out my page is only getting results from the "show" and not the "update"... Anyideas come to mind while I search for how to get the update json?
[16:14:22] qejk: has joined #RubyOnRails
[16:14:59] universa1: neohunter: why would you want to know that?
[16:15:28] daganev: tubbo: Woo, got the results from update... now to fight with angular to display them
[16:16:15] neohunter: universa1: I have an application that has intensive console access and i want to monkey patch ActiveRecord to create some alias methods like ua for update_attribute, but want to do that only for console.
[16:17:04] RegulationD: has joined #RubyOnRails
[16:17:07] universa1: neohunter: you mgiht be able to do that using .irbrc or alike ;)
[16:17:38] universa1: neohunter: or set an env variable: USING_CONSOLE=YES script/console; and in your code check for that env var
[16:17:52] neohunter: universa1: yes I know, and I already using .pryrc for some global stuff, but this changes will be for only one project
[16:17:58] neohunter: universa1: oh, thats a great idea, thanks!
[16:18:26] universa1: neohunter: but then, even in rails 2.3 there should be something console related available ;) but haven't used 2.3 in years ;)
[16:19:17] curtis3000: has joined #RubyOnRails
[16:20:31] drbayer: has joined #RubyOnRails
[16:21:08] polishdub: has joined #RubyOnRails
[16:22:47] disgrntld: has joined #RubyOnRails
[16:24:30] sonofdirt: has joined #RubyOnRails
[16:24:35] dllama: has joined #RubyOnRails
[16:27:14] DoubleMalt: has joined #RubyOnRails
[16:27:54] reckoner: do you store 3rd party id's e.g. stripe_id as a string?
[16:28:59] smathy: reckoner, for a start, I don't use Rails convention field names for non-Rails things, so I wouldn't use "stripe_id", but rather something like: stripe_key or stripe_code
[16:29:08] jahbrewski: has joined #RubyOnRails
[16:29:27] reckoner: smathy, i fully agree.
[16:29:35] tubbo: reckoner: usually stripe_key, yeah. or credit_card_token. :)
[16:29:36] smathy: reckoner, and then I store it as whatever it is, so integer or string.
[16:29:41] reckoner: this application i'm working on isn't mine
[16:29:42] tubbo: afaik stripe keys are strings
[16:29:47] tubbo: stripe CC keys*
[16:30:01] reckoner: this experience is kinda unreal
[16:32:05] claytonzaugg: has joined #RubyOnRails
[16:32:50] jtong: has joined #RubyOnRails
[16:33:46] neohunter: universa1: you know... i did USING_CONSOLE=true but on the initalizer file the constant is not defined...
[16:34:05] snarkfest: has joined #RubyOnRails
[16:34:15] universa1: export USING_CONSOLE=true
[16:34:28] universa1: and then in the same terminal: script/console
[16:34:36] universa1: ENV['USING_CONSOLE'] should be set
[16:35:19] ElFerna: has joined #RubyOnRails
[16:38:23] c0defeed: has joined #RubyOnRails
[16:38:31] ElFerna: has joined #RubyOnRails
[16:39:05] askhat: has joined #RubyOnRails
[16:39:42] smathy: universa1, yes, script/console must mess with the environment.
[16:39:42] yos7ph: has joined #RubyOnRails
[16:40:57] pyemkey: has joined #RubyOnRails
[16:41:23] arup_r: has joined #RubyOnRails
[16:44:01] rafaelfranca: has joined #RubyOnRails
[16:45:03] hamed_r: has joined #RubyOnRails
[16:45:53] macsteps: has joined #RubyOnRails
[16:47:08] dsimon: neohunter, an alternative would be to patch into Rails::ConsoleMethods
[16:50:11] devdazed: has joined #RubyOnRails
[16:51:45] chouhoulis: has joined #RubyOnRails
[16:53:32] chipotle: has joined #RubyOnRails
[16:54:17] Spami: has joined #RubyOnRails
[16:54:33] diegoviola: has joined #RubyOnRails
[16:56:25] tvw: has joined #RubyOnRails
[16:57:30] msisk: has joined #RubyOnRails
[16:57:44] gmas: has joined #RubyOnRails
[16:58:05] ElFerna: has joined #RubyOnRails
[16:58:31] [Butch]: has joined #RubyOnRails
[16:58:54] rhizome: what is "intensive console access?"
[16:59:18] jahbrewski: has joined #RubyOnRails
[17:02:20] Bloomer_: has joined #RubyOnRails
[17:05:54] yoongkang: has joined #RubyOnRails
[17:06:02] mbd2: has joined #RubyOnRails
[17:07:13] Nikke: has joined #RubyOnRails
[17:07:50] devdazed: has joined #RubyOnRails
[17:07:54] Pumukel: has joined #RubyOnRails
[17:08:23] gambl0re: has joined #RubyOnRails
[17:08:30] ensyde: has joined #RubyOnRails
[17:10:39] askhat_: has joined #RubyOnRails
[17:13:22] askhat: has joined #RubyOnRails
[17:17:06] ElFerna: has joined #RubyOnRails
[17:18:29] arup_r: what could be the reason of this error ? https://gist.github.com/aruprakshit/fa9eb8715c74d4dfc93c
[17:21:28] tbuehlmann: arup_r, if it's this you owe me 25 internet points: https://stackoverflow.com/questions/26006496/sidekiq-does-not-generate-sidekiq-pid-file-on-heroku-using-with-redistogo
[17:22:51] Bloomer: has joined #RubyOnRails
[17:24:33] arup_r: tbuehlmann: 25 internet point means ? :)
[17:24:46] ql6wlld: has joined #RubyOnRails
[17:26:18] tildes: has joined #RubyOnRails
[17:26:42] tvw: has joined #RubyOnRails
[17:26:45] rakm: has joined #RubyOnRails
[17:28:12] pyemkey: Hello. Anyone have experience with not closed mysql connections. I often see error "Mysql2::Error: This connection is in use by: #<Thread:0x0000000b6200d8 sleep>" and I don't have idea how to start debugging.
[17:28:42] KensoDev: has joined #RubyOnRails
[17:33:57] JonasRothmann: has joined #RubyOnRails
[17:36:16] JonasRothmann: Hi. How do I join 2 tables? My current join doesn't work... It's:
[17:36:17] JonasRothmann: @posts.joins(:users).order('user.username ' + @sorting)
[17:38:22] diego2: has joined #RubyOnRails
[17:38:39] kknight: has joined #RubyOnRails
[17:39:13] kknight: help me to fix route error https://gist.github.com/aj07/3c1494653b442dfbd6ed
[17:39:42] ravster: jonasrothmann: does the first part work? without the .order
[17:39:44] smathy: jonasrothmann, the name of your variable @posts suggests that you're trying to do the join on a collection of Posts, that won't work.
[17:39:54] diego3: has joined #RubyOnRails
[17:40:01] JonasRothmann: Yeah I am a noob
[17:40:08] diego3: has joined #RubyOnRails
[17:40:15] Sadin: has joined #RubyOnRails
[17:40:48] JonasRothmann: Well I have my posts table, and it contains info about post like id, and user_id. Then I want to find the user_id equivilant in the users table
[17:42:14] ravster: jonasrothmann: does '@posts.joins(:users)' return anything?
[17:42:26] kknight: fix avhove issue
[17:44:09] stannard_: has joined #RubyOnRails
[17:44:49] jorrin: has joined #RubyOnRails
[17:44:55] ornerymoose: has joined #RubyOnRails
[17:45:00] Sadin: has joined #RubyOnRails
[17:46:20] kknight: i got three link regarding this on stack overflow all are diffrent
[17:46:51] fedexo: has joined #RubyOnRails
[17:46:56] fedexo_: has joined #RubyOnRails
[17:47:45] mdw: has joined #RubyOnRails
[17:47:47] rhizome: pyemkey: are you doing anything thready?
[17:48:42] pyemkey: I'm using ActionController::Live + Sidekiq
[17:49:37] rhizome: did it ever work?
[17:50:16] ElFerna: has joined #RubyOnRails
[17:51:17] tbuehlmann: pyemkey, do you release database connections when using streaming actions? if not, chances are your connection pool won't have enough connections for all your streaming connections
[17:52:01] baweaver: has joined #RubyOnRails
[17:52:29] chouhoulis: has joined #RubyOnRails
[17:53:09] JonasRothmann: Association named 'users' was not found on Post;
[17:53:11] lubekpl: has joined #RubyOnRails
[17:53:35] pyemkey: tbuehlmann: Actually this topic is new for me. I was not aware that I need to control database connections. I will be very grateful for any hints.
[17:53:53] pyemkey: rhizome: I'm not sure if this worked in 100% before, because I use UnionStation to monitoring application since December 2015.
[17:54:57] pyemkey: Here is example of some stats from mysql
[17:55:02] sleungcy: has joined #RubyOnRails
[17:55:03] pyemkey: https://gist.github.com/pyemkey/2829a087ae975552ec0b
[17:55:17] drale2k: I am building a chat to try out Rails 5 and Action Cable. I have a problem now that i have no access to "current_user" within my channel but this is where i create the message and need to build the relationship (current_user.messages.new is what i would need)
[17:55:38] drale2k: i wonder how this is supposed to work
[17:56:05] kknight: pyemkey: solve my issue https://gist.github.com/aj07/3c1494653b442dfbd6ed
[17:57:04] EdwardIII: i don't get it, i keep running this, but it's setting the fk field to a string, not an int in the migration? bin/rails generate migration AddBookingResponseToStayDetails booking_response:references -f
[17:57:06] tbuehlmann: pyemkey, every thread keeps one database connection until you release it (that's mostly done by a rack middleware after your response has been finished). every streaming action will be in a separate thread, so each streaming connection has its own connection. let's say you have 10 clients, that's 10 database connections taken
[17:57:33] EdwardIII: why is rails playing me this way? add_column :stay_details, :booking_response_id, :string
[17:57:50] tbuehlmann: so you either have a big pool of connections, or you manually release the connection from the thread
[17:59:53] drbayer: has joined #RubyOnRails
[18:00:27] pyemkey: tbuehlmann: I will share with you what I observed and I don't understand. If I'm right on this stats https://gist.github.com/pyemkey/4234d626d3173d681273 number of threads means that thay are opened. Am I right?
[18:00:48] pyemkey: I mean "Threads_connected"
[18:01:23] rhizome: that's just status, not limits
[18:01:24] tbuehlmann: don't know how mysql handles connections internally
[18:02:09] pyemkey: That's status of threads opened at now?
[18:02:20] tw1sted_: has left #RubyOnRails: ()
[18:02:27] tildes: has joined #RubyOnRails
[18:02:34] EdwardIII: ah, it should be BookingResponseId
[18:02:40] tw1sted: has joined #RubyOnRails
[18:02:41] tbuehlmann: I was talking about threads in ruby, not in mysql
[18:03:03] Frem: has joined #RubyOnRails
[18:04:31] Wolland: has joined #RubyOnRails
[18:04:57] askhat: has joined #RubyOnRails
[18:05:21] baweaver: has joined #RubyOnRails
[18:06:16] pyemkey: tbuehlmann: How do you control threads in ruby, because this error "Mysql2::Error: This connection is in use by: #<Thread:0x0000000b6200d8 sleep>:" is probably related to ruby
[18:06:41] tbuehlmann: you wouldn't deal with the threads directly
[18:07:15] tbuehlmann: you have several options
[18:07:34] tbuehlmann: increasing the database connection pool (in your config/database.yml file) is one
[18:07:59] tbuehlmann: another one is manually releasing database connections in your streaming actions if you don't need it anymore
[18:09:10] kknight: tbuehlmann
[18:09:19] pyemkey: What do you mean about writing "manually releasing database connections". Do you mean wrap code in block ActiveRecord::Base.connection_pool.with_connection
[18:09:22] kknight: https://gist.github.com/aj07/3c1494653b442dfbd6ed
[18:09:46] speakingcode: has joined #RubyOnRails
[18:11:09] tbuehlmann: pyemkey, I think with_connection only releases the connection if it weren't checked out yet. so no, I wouldn't use that
[18:11:47] tbuehlmann: try calling ActiveRecord::Base.clear_active_connections! when you want to release the connection
[18:12:08] maesitos: has joined #RubyOnRails
[18:12:14] pyemkey: so, can you give some example of manual releases of database connection?
[18:12:49] tbuehlmann: sure: ActiveRecord::Base.clear_active_connections!
[18:13:11] benlieb: has joined #RubyOnRails
[18:13:28] bePolite: has joined #RubyOnRails
[18:14:03] fedexo: has joined #RubyOnRails
[18:14:04] fedexo_: has joined #RubyOnRails
[18:14:21] corioliss: has joined #RubyOnRails
[18:15:06] mostlybadfly: has joined #RubyOnRails
[18:15:08] dangeranger: has joined #RubyOnRails
[18:15:54] pyemkey: thank you for this example. I have to read how it works
[18:16:22] tbuehlmann: wanna gist your usecase?
[18:17:18] pyemkey: would be great
[18:17:58] lexiMon: has joined #RubyOnRails
[18:18:00] kirillzh: has joined #RubyOnRails
[18:19:02] pyemkey: I read at api that "Returns any connections in use by the current thread back to the pool, and also returns connections to the pool cached by threads that are no longer alive.". How to understand current thread? How can I check state before and after clear_active_connection?
[18:20:13] astrofog: has joined #RubyOnRails
[18:20:18] artto: has joined #RubyOnRails
[18:20:22] intrigueD: has joined #RubyOnRails
[18:20:32] bronson_: has joined #RubyOnRails
[18:21:01] intrigueD: ACTION waves
[18:21:13] stannard: has joined #RubyOnRails
[18:22:42] Devalo: has joined #RubyOnRails
[18:22:48] tbuehlmann: you can check if you have an active connection with ActiveRecord::Base.connection_pool.active_connection? I guess
[18:25:14] drbayer: has joined #RubyOnRails
[18:25:29] JonasRothmann: I get Association named 'users' was not found on Post;
[18:25:40] shmilan: has joined #RubyOnRails
[18:26:04] floror: has joined #RubyOnRails
[18:26:15] meoblast001: has joined #RubyOnRails
[18:26:44] arup_r: has joined #RubyOnRails
[18:26:49] centrx: jonasrothmann, You have to define the association in the model - http://guides.rubyonrails.org/association_basics.html
[18:27:18] JonasRothmann: So has_many :users ?
[18:27:32] kies^: has joined #RubyOnRails
[18:27:46] hahuang61: has joined #RubyOnRails
[18:27:56] centrx: jonasrothmann, right
[18:28:03] JonasRothmann: in model or controller?
[18:28:22] centrx: jonasrothmann, The model defines data accessors and relationships
[18:29:44] kirillzh: has joined #RubyOnRails
[18:30:04] JonasRothmann: Ok its recognized. So how do I find user.username where user.id = post.user_id?
[18:30:19] chintanparikh: has joined #RubyOnRails
[18:32:04] centrx: jonasrothmann, The association handles using the right foreign keys
[18:33:36] ElFerna: has joined #RubyOnRails
[18:33:52] JonasRothmann: Im not at all sure how to translate that into code.
[18:36:00] fedexo: has joined #RubyOnRails
[18:36:20] fedexo_: has joined #RubyOnRails
[18:37:52] MaDErroR123: has joined #RubyOnRails
[18:38:41] cnk: has joined #RubyOnRails
[18:38:48] aarkerio: has joined #RubyOnRails
[18:39:32] patrick99e99: has joined #RubyOnRails
[18:39:51] fox_mulder_cp: hey, cortana, make me up!
[18:40:36] djbkd: has joined #RubyOnRails
[18:42:40] shmilan: has joined #RubyOnRails
[18:43:18] kknight: has joined #RubyOnRails
[18:43:41] benlieb: has joined #RubyOnRails
[18:45:40] dionysus69: has joined #RubyOnRails
[18:50:42] moeabdol1: has joined #RubyOnRails
[18:50:45] Sadin: has joined #RubyOnRails
[18:51:17] shmilan: has joined #RubyOnRails
[18:51:31] kknight: has joined #RubyOnRails
[18:51:35] kirillzh: has joined #RubyOnRails
[18:51:39] srinidhi: has joined #RubyOnRails
[18:52:03] macsteps: has joined #RubyOnRails
[18:52:13] gingray: has joined #RubyOnRails
[18:52:46] kknight: has joined #RubyOnRails
[18:52:47] msisk: has joined #RubyOnRails
[18:53:10] chouhoulis: has joined #RubyOnRails
[18:54:49] patrick99e99: hey everyone..so really weird thing.. if I hit my api endpoint with the browser, and sign in with basic auth (entering credentials into the browser's dialog box), and then I authenticate, hit my api endpoint... And then I sign out of my app.. and am no longer logged in... if I visit an api endpoint url, it will automatically log me back in.
[18:55:01] patrick99e99: has anyone seen that happen before?
[18:57:32] fox_mulder_cp: patrick99e99: api must authenticate and auuthorize by secret keys
[18:58:36] patrick99e99: fox_mulder_cp: huh? the api authenticates with devise...
[18:59:55] w0bni: has joined #RubyOnRails
[19:00:12] fox_mulder_cp: # Prevent CSRF attacks by raising an exception.
[19:00:12] fox_mulder_cp: # For APIs, you may want to use :null_session instead.
[19:00:12] fox_mulder_cp: protect_from_forgery with: :exception
[19:01:01] fox_mulder_cp: patrick99e99: http://edgeguides.rubyonrails.org/api_app.html
[19:01:33] fox_mulder_cp: Specifically, it will not include any middleware primarily useful for browser applications (like cookies support) by default.
[19:02:36] fox_mulder_cp: auth and logged_in based on 'tokens'
[19:03:35] mdw: has joined #RubyOnRails
[19:03:36] artto: has joined #RubyOnRails
[19:03:52] chintanparikh: has joined #RubyOnRails
[19:04:30] intrigueD: patrick99e99: can you post the ActionDispatch::Request from the action at 'api endpoint'?
[19:04:53] askhat: has joined #RubyOnRails
[19:05:31] darkxploit: has joined #RubyOnRails
[19:06:42] yoongkang: has joined #RubyOnRails
[19:07:30] beingjohnm: I'm getting an error "formal argument cannot be an instance variable" with this code: "def add_line_breaks(@text_array)". I don't understand why but it seems I cannot pass an array to a method?
[19:08:36] patrick99e99: intrigueD: i can.. but i just was looking through it, and I see "rack.session"=> {"warden.user.user.key"=>[[7], "$2a$10$YuiPsP5bFkLdbzLkaDzLkO"], "warden.user.user.session"=>{"last_request_at"=>2016-02-09 19:05:30 UTC}},
[19:08:37] Scriptonaut: I have a model, Person, and Person has_many details. When I am saving a person, I have it validate the details association as well. However, I don't want to validate email_details (a detail with name 'email') if I am changing my Person's status to 'archived'. However, inside the validating method, when I do (self == my person) status, it is not using the new status I assigned to him ('archived').
[19:08:43] Scriptonaut: It's like the association is loading up a new copy from the database
[19:08:58] Scriptonaut: my question is, how can I make the validating method in my Detail reference the same (unsaved) person model?
[19:09:02] patrick99e99: intrigueD: seems like I just need to get that removed from the rack session on logout.. how come devise isn't doing that automatically?
[19:09:35] Scriptonaut: I'm doing: person.status = 'archived' && person.saved. But when I checked the person's status in the detail validation, it is still the old value, not 'archived'
[19:09:46] roshanavand: has joined #RubyOnRails
[19:10:48] sankaber: has joined #RubyOnRails
[19:11:21] fox_mulder_cp: Scriptonaut: person.save_d_ or person.save?
[19:11:40] Scriptonaut: what's save_d_?
[19:11:42] Scriptonaut: just person.save
[19:11:49] s2013: has joined #RubyOnRails
[19:12:15] fox_mulder_cp: so, no person.saved method only .save
[19:12:42] Scriptonaut: I don't know what a person.saved method is
[19:12:45] Scriptonaut: there is person.saved?
[19:12:53] HenriettaSalt: has joined #RubyOnRails
[19:12:57] Scriptonaut: this code I'm talking about is happening inside the save, it's the validation
[19:13:09] roshanav_: has joined #RubyOnRails
[19:13:21] Scriptonaut: when I validate, my association has the old values before I set new ones, it's like it's loading a fresh copy of the association from the database
[19:13:39] fox_mulder_cp: model,controller and table description to gist plz
[19:13:46] Jet4Fire: has joined #RubyOnRails
[19:14:06] intrigueD: patrick99e99: you are calling sign_out?
[19:14:20] Felix444: has joined #RubyOnRails
[19:15:41] Coldblackice: has joined #RubyOnRails
[19:16:25] Scriptonaut: fox_mulder_cp: Here are the relevant pieces of text: https://gist.github.com/robins35/f896fa9560fb3aa5a279
[19:16:31] patrick99e99: intrigueD: yeah...
[19:16:43] Scriptonaut: the detail validation, the people controller destroy(archive) action, and the validations in the person model file
[19:17:01] Scriptonaut: inside the first file, email_format (the validation), is where I try to load the association
[19:17:11] dangeranger: has joined #RubyOnRails
[19:17:20] Scriptonaut: it's not in there now because I undid the changes, but I was just doing: detailable.status == 'archived'
[19:17:37] Scriptonaut: and it was returning false, even though I set it to archived on line 2 of the people_controller
[19:18:11] shmilan: has joined #RubyOnRails
[19:19:24] humd1ng3r: has joined #RubyOnRails
[19:20:34] Scriptonaut: fox_mulder_cp: don't worry about it, I went with update_attribute
[19:20:44] Scriptonaut: I don't need to validate the Person when archiving/destroying it
[19:20:55] patrick99e99: intrigueD: sorry- i think i was looking at a request when I had actually signed in........ i just tried it again and there definitely is no rack.session stuff having to do with users.. and yet it still logs me in.. hold on i will make a gist
[19:22:17] baweaver: has joined #RubyOnRails
[19:22:27] patrick99e99: intrigueD: https://gist.github.com/patrick99e99/6b0fff9821b2b27c2c2e
[19:24:15] hcnewsom: has joined #RubyOnRails
[19:25:52] benlieb: I'm trying to use are to get an 'or' clause, but the query doesn't seem to work in postgres: https://gist.github.com/benlieb/e69564155430c3a83004
[19:25:58] __butch__: has joined #RubyOnRails
[19:26:06] shmilan: has joined #RubyOnRails
[19:26:07] benlieb: Is this an adapter bug or an issue with me?
[19:28:01] arup_r: benlieb: one of your column is boolean datatype... that is the reason of the error
[19:28:06] s2013: has joined #RubyOnRails
[19:28:08] benlieb: just saw that
[19:28:11] arup_r: you are comparing a integer and boolean
[19:28:24] symbol: has joined #RubyOnRails
[19:28:29] benlieb: i'm porting a rails 3 / mysql app to rails 4 / pg
[19:28:32] intrigueD: patrick99e99: I think that auth header is the problem
[19:28:40] benlieb: so there are these little things everwhere
[19:28:42] __butch__: has joined #RubyOnRails
[19:28:51] arup_r: benlieb: I understand...
[19:29:38] patrick99e99: intrigueD: "HTTP_AUTHORIZATION"=>"Basic cGNvbGxpbnM6bG9sbGVyY29hc3Rlcg==", ?
[19:29:46] phon: has joined #RubyOnRails
[19:30:08] __butch__: has joined #RubyOnRails
[19:30:35] intrigueD: patrick99e99: Yeah
[19:30:56] intrigueD: patrick99e99: You are using a browser to hit the end point?
[19:31:05] patrick99e99: intrigueD: yeah...
[19:31:14] patrick99e99: intrigueD: so you think I should delete that header in my sign_out endpoint?
[19:31:34] ur5us: has joined #RubyOnRails
[19:31:52] ur5us: has joined #RubyOnRails
[19:32:38] solars: has joined #RubyOnRails
[19:33:23] intrigueD: patrick99e99: Browser is storing the Basic authentication details and providing them in the request
[19:33:47] humbledaisy: has joined #RubyOnRails
[19:34:03] patrick99e99: intrigueD: how can I stop this behavior?
[19:34:25] patrick99e99: intrigueD: its very insecure.. it means someone can log out, and then another person can go to their computer and access an endpoint and then magically be logged in... not good.
[19:34:26] intrigueD: use cURL :P
[19:34:48] adaedra: Restart the browser, these credentials are usually cleaned at quit, if not saved.
[19:34:50] fox_mulder_cp: somobody knows about small js calendar widget such as wordpress/livejournal arhives block?
[19:35:04] intrigueD: or use a private window
[19:35:08] patrick99e99: really? so there's no way to stop this behavior?
[19:35:18] sonofdirt: has joined #RubyOnRails
[19:35:25] adaedra: That's how browser works with HTTP authentication, yes.
[19:35:48] patrick99e99: im surprised.. seems like this could be a super huge security vulnerability.
[19:35:53] magically: patrick99e99: if you want to get super paranoid, you could grab the page out of the cache
[19:36:04] patrick99e99: magically: sorry? what?
[19:36:18] adaedra: If you want to be able to log out, don't use HTTP Authentication.
[19:36:21] magically: Like I mean a malicious actor could take your oh-so-precious HTML out of your cache.
[19:36:40] magically: How do you expect persistence to work within your own site, anyway?
[19:37:03] patrick99e99: magically: I expect that when you sign out, your session data is deleted and that includes browser cookies / session
[19:37:18] magically: patrick99e99: There's no such thing as that in HTTP auth
[19:37:24] adaedra: The cached HTTP Auth is out of reach.
[19:37:34] magically: adaedra: Oh, I meant just the HTML
[19:37:39] magically: Like there's no "session" and no cookies AFAIK
[19:37:48] sonofdirt: has joined #RubyOnRails
[19:37:57] adaedra: If you do ask the browser to clean them, it will clean cookies, yes.
[19:37:58] shmilan: has joined #RubyOnRails
[19:38:18] adaedra: HTTP Auth credentials are no cookies.
[19:39:05] intrigueD: patrick99e99: People aren't going to be consuming your API using a browser anyway. Start testing it using curl or postman or something
[19:39:50] patrick99e99: intrigueD: people do use a browser all the time.. using json viewers
[19:40:45] magically: Use somethingmore paranoid if you're more paranoid :p
[19:40:48] patrick99e99: and this is a security vulnerability.. if someone thinks they logged out but they can be re-logged in by someone else visiting an endpoint.. that's a problem
[19:40:58] adaedra: "Someone else"
[19:41:00] shilon: has joined #RubyOnRails
[19:41:07] adaedra: Same computer, same browser, browser has to stay open.
[19:41:31] adaedra: Yeah, security flaw. They also have access to many other open accounts.
[19:41:46] adaedra: You're imo worrying for nothing.
[19:42:06] adaedra: But if that's really bothers you, go ahead and use something else.
[19:42:11] PedramT: has joined #RubyOnRails
[19:42:19] adaedra: Like a GET Param / Ah no, stored in history.
[19:42:36] adaedra: Or a POST Param or Custom Header, so you throw out all people using a browser.
[19:43:34] adaedra: The case you put is physical access to a computer by a 3rd party: it's a case I think no one bothers about
[19:43:55] adaedra: Because it's responsibility of the user, at this point
[19:44:53] Cervajz: has joined #RubyOnRails
[19:45:22] adaedra: I see you're using devise; implement something not HTTP Auth using it?
[19:45:27] MaDErroR123: has joined #RubyOnRails
[19:45:43] benlieb: arup_r: care for another one?
[19:45:45] benlieb: https://gist.github.com/benlieb/0ef260ec2ea0e0d03cc2
[19:46:08] benlieb: This arel query doesn't put parens around the second compound condition
[19:46:31] benlieb: or anyone :) ^
[19:46:57] benlieb: It seems I want the parens there, or is this because the sql is unambiguous to the parser?
[19:47:04] Cervajz_: has joined #RubyOnRails
[19:47:27] s2013: has joined #RubyOnRails
[19:47:49] benlieb: By hand I think I would have written something like: WHERE ("purchases"."gateway_code" > 1) OR ("purchases"."successful" != 't' AND "purchases"."gateway_code" IS NULL)
[19:48:00] benlieb: but it's been so long since I've written much sql by hand, lol
[19:48:26] benlieb: not WHERE ("purchases"."gateway_code" > 1) OR ("purchases"."successful" != 't' AND "purchases"."gateway_code" IS NULL)
[19:48:49] jscheel: has joined #RubyOnRails
[19:49:00] benlieb: this is what are wrote: WHERE ("purchases"."gateway_code" > 1 OR "purchases"."successful" != 't' AND "purchases"."gateway_code" IS NULL)
[19:51:09] takokat: has joined #RubyOnRails
[19:51:39] lindii_: has joined #RubyOnRails
[19:52:51] blackmesa: has joined #RubyOnRails
[19:53:29] pawnbox: has joined #RubyOnRails
[19:53:59] chouhoulis: has joined #RubyOnRails
[19:55:31] dopamean_: has joined #RubyOnRails
[19:57:44] arBmind: has joined #RubyOnRails
[19:58:47] kpwarr: has joined #RubyOnRails
[19:58:52] lacrymology: has joined #RubyOnRails
[19:58:52] Surt_Q: has joined #RubyOnRails
[19:59:28] Kallis: has joined #RubyOnRails
[19:59:37] safety_cut: has joined #RubyOnRails
[20:00:45] kpwarr: Hi, I am having an issue related to my 'RAILS_ENV'. It is set to the desired value in environment.rb using ||= and the console reports the desired value, and yet it does not evaluate the the desired value in my application_controller, and rails seems to be using the wrong environment config file. Any ideas?
[20:02:19] armyriad: has joined #RubyOnRails
[20:02:23] RegulationD: has joined #RubyOnRails
[20:03:34] ss_much: has joined #RubyOnRails
[20:04:32] Grundell_: has joined #RubyOnRails
[20:05:04] askhat_: has joined #RubyOnRails
[20:07:15] godzillaenlacasa: @kpwarr are you setting it anywhere else?
[20:07:17] yoongkang: has joined #RubyOnRails
[20:07:49] moeabdol: has joined #RubyOnRails
[20:09:19] ravster: kpwarr: is this even after a restart of the server?
[20:11:27] safety_cut: has joined #RubyOnRails
[20:12:16] smathy: ...and restart of spring.
[20:13:03] maesitos: has joined #RubyOnRails
[20:14:55] intuxicated: has joined #RubyOnRails
[20:15:23] hcnewsom: has joined #RubyOnRails
[20:16:13] PedramT: has joined #RubyOnRails
[20:18:53] diegoviola: has joined #RubyOnRails
[20:21:28] mcr-credil: kpwarr, is there a reason you are setting it explicitely in your code at all? I'm guessing you need it to have a value other than "production" on your production system? or are you tracking an error that only shows up in production on a devel server?
[20:21:53] BhavyaM: has joined #RubyOnRails
[20:21:56] manfrin: has joined #RubyOnRails
[20:22:08] macsteps: has joined #RubyOnRails
[20:22:30] phon: has joined #RubyOnRails
[20:23:10] kpwarr: godzillaenlacasa: not AFAIK
[20:23:17] kpwarr: ravster: yes
[20:23:26] msyvich: has joined #RubyOnRails
[20:23:27] kpwarr: smathy: we don't use spring AFAIK
[20:24:15] kpwarr: mcr-credil: not setting it explicitly. just with ||=; also this is for our staging server
[20:24:49] godzillaenlacasa: @kpwarr what's the actual code you're using?
[20:25:02] mcr-credil: why are you doing even that? I stick RAILS_ENV=production in the script that starts uwsgi, or in the apache2 conf that starts mod_passenger....
[20:25:56] godzillaenlacasa: ideally, you'd want it to be an actual environment variable on the server instead of hardcoded anywhere
[20:26:47] pramsky: has joined #RubyOnRails
[20:27:40] smathy: kpwarr, are you restarting your app in your staging env?
[20:27:56] chouhoulis: has joined #RubyOnRails
[20:28:14] tetraktys: has joined #RubyOnRails
[20:28:21] AnomalousBit: has joined #RubyOnRails
[20:29:04] liamonade: has joined #RubyOnRails
[20:30:03] AnomalousBit: Hello, seeking some opinions on overlapping controller and integration testing... do you typically test views with assert_select()? Do you prefer it in the controller or integration test?
[20:31:42] stannard: has joined #RubyOnRails
[20:32:21] mary5030: has joined #RubyOnRails
[20:32:54] phon: has joined #RubyOnRails
[20:35:07] jscheel: has joined #RubyOnRails
[20:35:24] kpwarr: uh, so I'm basically trying to do some refactoring on a really messy code base that I don't really understand
[20:36:43] godzillaenlacasa: @kpwarr ugh, that's the worst. I'd recommend taking some serious time just to get familiar with it. If none of what we offered up as possible issues exists, then you'll know ;)
[20:36:47] kpwarr: in config/environment.rb we have `ENV['RAILS_ENV'] ||= 'staging'` which is the only place where it's explicitly set
[20:37:05] AnomalousBit: kpwarr: Your first action should be to get things under testing then. I suggest you read this -> http://amzn.to/1Kane0I
[20:37:17] kpwarr: I'm not really sure what the ideal state of affairs for managing env vars is actually
[20:37:38] kpwarr: AnomalousBit: as much as i agree... that's just not an option... :P
[20:37:46] godzillaenlacasa: @kpwarr what's the environment that it's showing for you?
[20:37:58] Scriptonaut: has left #RubyOnRails: ()
[20:38:07] tvw: has joined #RubyOnRails
[20:38:10] kpwarr: well, what's the 'standard' way of determining this? like I said, the console shows the desired value
[20:38:31] godzillaenlacasa: @kpwarr what's the desired value? production? development?
[20:38:43] kpwarr: 'staging'
[20:39:10] kpwarr: but in application_controller ENV['RAILS_ENV'] == 'staging' => false
[20:39:30] godzillaenlacasa: @kpwarr so, either 'rails_env' is set somewhere, or it's defaulting to staging since your ||= will handle that
[20:39:47] AnomalousBit: kwparr: the ideal state of affairs from my knowledge is to set RAILS_ENV via your ~/.bashrc or other profile scripts
[20:39:56] kpwarr: AnomalousBit: I see
[20:40:33] AnomalousBit: if you run a rails console and type Rails.env what comes out?
[20:41:14] kpwarr: => "staging"
[20:41:34] drbayer: has joined #RubyOnRails
[20:42:24] AnomalousBit: you can also take a look at the ENV array, for me this is literally a dump of my shell environment variables (which is what I was mentioning about ~/.bash_rc, ~/.bash_profile, /etc/profile.d/*)
[20:42:25] godzillaenlacasa: @kpwarr so, ENV['RAILS_ENV'] is going to attempt to find an actual environment variable on your server... which doesn't exist
[20:42:56] yfeldblum: has joined #RubyOnRails
[20:43:16] a1fa: can you pass more than 1 parameter with link_to via post method?
[20:43:34] godzillaenlacasa: however Rails.env == 'staging' should be true
[20:43:37] a1fa: does it require a route?
[20:45:37] AnomalousBit: a1fa: the first answer describes multiple arguments to the *_path method, which yes, requires your route to have the named arguments http://bit.ly/1O1NchR
[20:47:10] kpwarr: godzillaenlacasa: just trying to make sure we're on the same page. Note that in bash `echo $RAILS_ENV` does in fact yield nothing, but in the rails console BOTH `Rails.env` AND `ENV['RAILS_ENV']` yield 'staging'
[20:47:14] kpwarr: is this consistent?
[20:47:41] PedramT: has joined #RubyOnRails
[20:48:02] AnomalousBit: kpwarr, I believe that bit of code you described in application.rb is setting the staging environment. comment it out and see :)
[20:48:18] godzillaenlacasa: @kpwarr @AnomalousBit is right...
[20:48:23] kpwarr: ohh, does environment.rb get evaluated AFTER application_controller? if so, that would explain my issue
[20:48:53] godzillaenlacasa: @kpwarr no, i believe the config files come first...
[20:49:22] godzillaenlacasa: but you're also saying in your application controller that if RAILS_ENV doesn't exist, it should equal staging
[20:49:30] AnomalousBit: kpwarr: if you want to see the order of execution, set a breakpoint in both your environment.rb and controller, then see which one pops first
[20:49:36] dopamean_: has joined #RubyOnRails
[20:49:46] AnomalousBit: (hint: the methods debugger or byebug will set your breakpoint)
[20:49:57] djellemah_: has joined #RubyOnRails
[20:50:06] a1fa: AnomalousBit: thanks
[20:50:12] a1fa: i had a feeling it will be like that
[20:51:03] kpwarr: AnomalousBit: ok thx. also, strangely, when I commented out the line that sets RAILS_ENV in environment.rb, then in the console `Rails.env` => 'development and `ENV['RAILS_ENV']` => nil
[20:51:06] prgmmr: has joined #RubyOnRails
[20:51:24] AnomalousBit: @godzillaenclacasa is right, the code is just setting staging when rails_env doesn't exist, which is your case it appears
[20:51:44] Cohedrin: has joined #RubyOnRails
[20:52:04] godzillaenlacasa: @kpwarr you can export an environment variable and RAILS_ENV should then be what you exported
[20:52:08] AnomalousBit: yep, development is the default environment when none is set, I am in the same boat, RAILS_ENV is not set, and my Rails.env when run in a console is development. This is the normal state of things.
[20:52:31] kpwarr: ok great. Thanks guys, I think I understand
[20:52:42] braian: has joined #RubyOnRails
[20:53:02] AnomalousBit: I imagine someone either was lazy and didn't setup your staging environment correctly or for some reason couldn't. This allowed them to set the environment without having to deal with any changes to the configuration of the server.
[20:53:21] easyecho: has joined #RubyOnRails
[20:53:44] PedramT_: has joined #RubyOnRails
[20:53:44] prgmmr: What is a good way to authenticate when a user of the app say presses a button and it does a get to my rails api. Basically I only want my users to be able to do requests, and not be able to go in the browser and do it
[20:54:14] NBarnes: *headdesk* I just bombed a technical interview so hard the impact crater is visible from the ISS.
[20:54:23] pawnbox: has joined #RubyOnRails
[20:54:48] baweaver: has joined #RubyOnRails
[20:55:09] devFrederick: has joined #RubyOnRails
[20:55:47] Jasaka: has joined #RubyOnRails
[20:56:00] celly: has joined #RubyOnRails
[20:56:16] AnomalousBit: prgmmr, a simple way is just to validate the user-agent. Maybe your app can have a custom user-agent set in the http request? Also, you could encrypt your traffic or setup a key exchange for requests?
[20:56:42] a1fa: so this is oodd. i have a specfic route
[20:56:50] baweaver: has joined #RubyOnRails
[20:56:59] Radar: ACTION looks for code, sees no code
[20:57:23] ferr: has joined #RubyOnRails
[20:57:40] a1fa: ^ hi Radar
[20:58:30] fox_mulder_cp: Radar: wow, wow. how your trip?
[20:58:43] a1fa: i think method: :post does not work well with link_to
[20:58:52] a1fa: i think thats effing me up every time, and i need to stop doing it
[20:58:55] braian: Hello, guys! I have a issue with my app. I'm sending a search request with a form. I use "remote: true" but can get it as a format.js for my view: index.js.erb
[20:59:05] kirillzh: has joined #RubyOnRails
[20:59:13] Radar: fox_mulder_cp: hello :) Trip was nice
[20:59:14] Radar: a1fa: !rule0
[20:59:14] helpa: a1fa: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[20:59:54] ElFerna: has joined #RubyOnRails
[21:00:49] treehug88: has joined #RubyOnRails
[21:01:07] fox_mulder_cp: Radar: i improve my blogapp, and now add a comment style. think, that is a pretty and light - but admin-side only edit/destroy posts ) http://dev.blog.mulder.kiev.ua/
[21:01:52] AnomalousBit: a1fa: just submit a form instead? forms hold data and are far easier to manipulate client side with javascript, if you're into that kind of thing.
[21:02:18] hahuang61: has joined #RubyOnRails
[21:02:44] a1fa: ditto.. i just keep forgetting you cant to post method with link_to
[21:02:51] kpwarr: is it possible to use byebug to debug an app that is running in nginx?
[21:02:51] bauruine: has joined #RubyOnRails
[21:02:58] a1fa: i got it working with a get method, and its nice and cleam
[21:03:02] a1fa: clean - even
[21:03:29] fox_mulder_cp: eehe. my tweet about my blog is retwitted by some bot.. wait for wave effect
[21:04:14] urbanmonk: has joined #RubyOnRails
[21:04:47] AnomalousBit: kpwarr, why not just use 'rails server' if you're debugging something? I understand wanting to get as close to the production environment as possible but it's not very practical (at least in my experience) to run nginx in development
[21:05:05] kpwarr: hmm good point
[21:05:46] AnomalousBit: kpwarr, it looks as though phusion passenger will allow you to wind up a debugging session, not sure what you're using with nginx to serve up your app though
[21:05:47] fox_mulder_cp: AnomalousBit: nginx as front + puma as backend - very pretty pair
[21:06:07] AnomalousBit: fox_mulder_cp: in development?
[21:06:33] fox_mulder_cp: AnomalousBit: puma? ad dev, at prod, if i test prod - i start in at prod
[21:06:55] fox_mulder_cp: if i want debug - i start in dev mode
[21:06:58] AnomalousBit: I use nginx/passenger for production, but typically dev in rails server. Can you comment on the benefits on nginx/puma in dev?
[21:07:20] fox_mulder_cp: i have a to oneliner sripts for start my app in required mode
[21:08:01] AnomalousBit: well, I don't really have to do more than one line to start a server in dev or production either. 'rails s' or 'sudo service nginx restart' usually gets me there
[21:08:03] celly: has joined #RubyOnRails
[21:08:31] yoongkang: has joined #RubyOnRails
[21:09:37] prgmmr: AnomalousBit: could you elaborate
[21:10:01] kpwarr: this is so frustrating. there is somehow a difference in terms of my env vars between hitting my server via chrome via nginx, and doing app.get in the console
[21:11:40] dllama: has left #RubyOnRails: ()
[21:12:00] AnomalousBit: prgmmr: elaborate on custom user-agents? key exchange? encryption? I think any of them would accomplish your goal of limiting access to your app only (user-agent would be easily spoofed though, might be nice for development though)
[21:13:21] AnomalousBit: kpwarr: is your web server running as a different user than your console?
[21:13:24] prgmmr: AnomalousBit: couldn't I just pass the user name and password in the request?
[21:13:48] intuxicated: has joined #RubyOnRails
[21:14:22] AnomalousBit: kpwarr: you could use 'ps -eF | grep -i web_server_process_name_goes_here' to see who the web server is running as
[21:15:15] kpwarr: AnomalousBit: will try that, thx
[21:17:48] AnomalousBit: fox_mulder_cp: what if he's using virtual hosts with the same ip? I don't think that would show each virtual host's owner
[21:19:01] baweaver: has joined #RubyOnRails
[21:19:08] s2013: has joined #RubyOnRails
[21:19:13] hello9: has joined #RubyOnRails
[21:19:51] hello9: Hey all, do trailing if statements execute before the subject (e.g nil_object.sort if nil_object.present?)
[21:20:02] hello9: will sort get called if nil_object is in fact nil?
[21:20:12] akshat: has joined #RubyOnRails
[21:20:51] fox_mulder_cp: AnomalousBit: i have a nginx on node with tonn of docker/lxc VM's $)
[21:21:10] fox_mulder_cp: some docker containers with php, some with perl, some with rails
[21:21:27] fox_mulder_cp: i'm a hostmaster ^)
[21:21:53] AnomalousBit: fox_mulder_cp: gotcha, i just tried it on my prod box with virtual hosts and it does show the virtual hosts listening on various ports. cool command! thanks :)
[21:22:23] rickmasta: has joined #RubyOnRails
[21:22:33] fox_mulder_cp: AnomalousBit: nginx. top 1 for frontend proxy. made by crazy russians :)
[21:25:43] dsimon: lsof & strace ftw
[21:27:38] kpwarr: AnomalousBit: nginx and passenger are being run by root (and also a user called 'nobody') 1) should I set env var in the root bashrc? 2) it seems like 'RAILS_ENV' defaults to nil for my user but 'development' for root. what's up with that?
[21:28:26] fox_mulder_cp: kpwarr: i usr rbenv for non-privileged user, and puma starts under this username.
[21:28:56] fox_mulder_cp: nginx downgrade privileges to non-root and use puma at upstream
[21:29:34] kpwarr: fox_mulder_cp: not really sure I have to time to reconfigure everything :P
[21:29:51] AnomalousBit: kpwarr: it's as we said before, RAILS_ENV is set via the console/shell scripts, but development is the fallback when RAILS_ENV is not set. so either root's RAILS_ENV is being set somewhere, or it's falling back to development because it's not set
[21:30:21] fox_mulder_cp: kpwarr: rbenv configured for some commands :) i write small how to in readme for my blog engine
[21:31:14] AnomalousBit: fox_mulder_cp and dsimon: great, great session done at linuxcon a couple years ago by the Senior Performance Architect at Netflix, shows dozens of commands for picking through your server -> http://www.slideshare.net/brendangregg/linux-performance-tools
[21:31:18] roddutra: has joined #RubyOnRails
[21:32:23] kpwarr: AnomalousBit: well before, it was Rails.env that defaulted, but ENV['RAILS_ENV'] was not set. Now both are set, and I'm not sure why
[21:33:35] MaDErroR123: has joined #RubyOnRails
[21:33:57] fox_mulder_cp: kpwarr: bash# EXPORT RAILS_ENV=test && rails s
[21:34:25] jsrn_: has joined #RubyOnRails
[21:34:27] fox_mulder_cp: of without export id dropped in rails scripts
[21:34:30] AnomalousBit: kpwarr, looks like you just became a detective! haha, it is most likely set in /root/.bashrc, /root/.bash_profile, /root/.profile, /etc/profile.d/*, or in your web servers configuration files. grep is your friend.
[21:34:45] askhat: has joined #RubyOnRails
[21:35:20] fox_mulder_cp: bash # bla=bla && env bla
[21:36:38] fox_mulder_cp: bash # bla=bla != export env=bla
[21:36:49] fox_mulder_cp: first fails, second - true
[21:37:22] AnomalousBit: Any opinions on overlapping controller and integration testing... do you typically test views with assert_select()? Do you prefer it in the controller or integration test?
[21:37:26] srinidhi: has joined #RubyOnRails
[21:38:08] AnomalousBit: also curious about the widespread use of RSpec and not minitest in most of the open source rails projects I've seen, do you identify with this? is RSpec superior? I've not used it
[21:38:30] Jon30: has joined #RubyOnRails
[21:39:12] chouhoulis: has joined #RubyOnRails
[21:40:07] intrigueD: has joined #RubyOnRails
[21:41:11] Jon30: Hey guys, I have 3 apps running on a 512mb RAM 2core VPS using Puma (latest version) and Nginx, 1 app is running at 0-5%, while the other apps are at constant 80-100%. And none of these apps are being accessed by anybody. I am trying to figure out why these 2 apps are going crazy. Here are the Gemfiles: https://gist.github.com/slavajacobson/79bac765db68eebc058a and https://gist.github.com/slavajacobson/8c2533af02d492519e39
[21:42:55] AnomalousBit: Jon30, do the apps work in development without killing your CPU? are you sure there's not some kind of startup issue and it's the server only?
[21:43:29] blackmesa: has joined #RubyOnRails
[21:44:13] fox_mulder_cp: Jon30: do u read this app logs?
[21:44:25] jgt4: has joined #RubyOnRails
[21:44:30] tetraktys: has joined #RubyOnRails
[21:44:50] AnomalousBit: Jon30 -> fox_mulder_cp's suggestion is a great place to start
[21:44:54] Jon30: AnomalousBit, hmmm, good thinking, I am not using puma to run the server in development. 1 app is a very basic refinerycms site, and the 2nd one is a basic locomotivecms site, and again, they are not being accessed, so it's strange that the CPU would go so high.
[21:45:36] nunchuck: has joined #RubyOnRails
[21:45:41] macsteps: has joined #RubyOnRails
[21:45:56] AnomalousBit: Jon30, if the problem persists on your dev box you know it's the code / gems and not the server configuration.
[21:46:44] AnomalousBit: Jon30, also, are there any scheduled tasks (like scheduling gem or whenever?) these might trigger on startup if they haven't ran in a while
[21:47:08] epistrephein: has joined #RubyOnRails
[21:47:17] ElFerna: has joined #RubyOnRails
[21:48:42] glennfu: has joined #RubyOnRails
[21:48:59] celly: has joined #RubyOnRails
[21:49:40] Jon30: there's nothing unusual in production.log, it just sits there, it was last written 2 hours ago
[21:49:59] Jon30: it's been at 90-100% for the last 2 days
[21:50:17] FCser: has joined #RubyOnRails
[21:52:47] AnomalousBit: Jon30, does the rails console on the server also consume so much CPU? it should be loading all the same gems and code base
[21:53:01] defsdoor: has joined #RubyOnRails
[21:53:35] Jon30: you suggesting to shutdown the server and run it with rails c?
[21:53:48] AnomalousBit: you don't have to shutdown the server to run rails c
[21:54:03] jottr: has joined #RubyOnRails
[21:54:07] ornerymoose: has joined #RubyOnRails
[21:54:13] AnomalousBit: rails s may be what you're thinking of, but rails c is just a console with the application loaded in
[21:54:46] fox_mulder_cp: i think about stop all rails scripts - spring, tests, rails server. really - stop
[21:54:54] fox_mulder_cp: clean log, tmp and cache
[21:55:01] fox_mulder_cp: and restart rails server
[21:55:24] FCser: has joined #RubyOnRails
[21:56:24] cbaus: has joined #RubyOnRails
[21:56:46] kpwarr: AnomalousBit: I poked around and couldn't find anything setting RAILS_ENV for my root user. furthermore, when I added a line to /root/.bashrc to set it myself, the problem still persists
[21:57:55] maxx88: has joined #RubyOnRails
[21:58:04] floror: has joined #RubyOnRails
[21:58:18] AnomalousBit: kpwarr, did you check your web server's .conf file and sites-available files?
[21:58:23] AnomalousBit: I've seen it set there before
[21:58:34] AnomalousBit: especially if it's not a production-only server
[21:58:37] kpwarr: AnomalousBit: yes I did
[21:59:16] AnomalousBit: kpwarr, so when you do sudo su root and then run 'echo $RAILS_ENV' as root, it says development?
[21:59:25] fox_mulder_cp: kpwarr: try "EXPORT RAILS_ENV=.. && rails server"
[21:59:38] Jon30: AnomalousBit, I ran rails c, it consumes 13% RAM but no CPU usage.
[21:59:55] fox_mulder_cp: please, read about EXPORTING variables
[22:00:34] fox_mulder_cp: i said about difference between 'BLABLA=BLABLA' and 'EXPORT BLABLA=BLABLA' some hours earlier
[22:00:41] kpwarr: AnomalousBit: no, it says staging. yet when I set a debugger in my controller the value of both Rails.env and RAILS_ENV are development
[22:01:01] kpwarr: fox_mulder_cp: it exports correctly, the issue is somewhere between there and rials
[22:01:39] fox_mulder_cp: kpwarr: ruby -v, rails -v, osname & version... etc
[22:03:35] rhizome: don't capitalize EXPORT
[22:03:38] kzsh: has joined #RubyOnRails
[22:03:51] blackmesa: has joined #RubyOnRails
[22:04:10] AnomalousBit: Jon30, have you ever used strace? you could peek at what the process ID is doing using 'strace -p process_id_goes_here' be prepared though, you're going to be flooded with information, it may show you the loop it's stuck in though
[22:04:28] kzsh: has left #RubyOnRails: ()
[22:05:27] glennfu: Jon30: I just read an interesting idea today here: https://tenderlovemaking.com/2016/02/05/i-am-a-puts-debuggerer.html . Search for "I have a deadlock, but I don???t know where" on that article
[22:06:24] AnomalousBit: kpwarr: are you running the rails console as root? I don't see how it could be setting back to development if RAILS_ENV is staging for the root user unless you are running rails console as a different user
[22:07:24] DoubleMalt: has joined #RubyOnRails
[22:08:29] Jon30: AnomalousBit, awesome I will try that.
[22:08:42] TinkerTyper: has joined #RubyOnRails
[22:09:26] sonofdirt: has joined #RubyOnRails
[22:10:43] jscheel: has joined #RubyOnRails
[22:11:55] kpwarr: fox_mulder_cp: Ubuntu 14.04.3 LTS; Rails 4.0.0; ruby 2.2.3p173; nginx/1.8.0
[22:13:53] maesitos: has joined #RubyOnRails
[22:14:07] Jon30: AnomalousBit, I can't catch the PID, it keeps on changing... lol
[22:15:12] eGGsha: has joined #RubyOnRails
[22:15:28] AnomalousBit: Jon30 haha yikes! are you sure you aren't getting DDOS'd or something?? ;)
[22:16:19] TinkerTyper: has joined #RubyOnRails
[22:16:21] Jon30: definitely not cause nginx-access log is very boring lol
[22:16:37] Jon30: AKA lacks acitvity
[22:17:26] AnomalousBit: Jon30 are you using phusion passenger? you could see your number of requests processed and general info about the passenger process using 'sudo passenger-status'
[22:17:49] fox_mulder_cp: kpwarr: ubuntu 15.04, ruby 2.3.0, rails 5.0.0.beta2 %)
[22:18:11] fox_mulder_cp: i think, that u must upgrade versions $)
[22:20:56] Jon30: AnomalousBit, I am using Nginx and Puma. Here's the output of strace: https://gist.github.com/slavajacobson/849a9f017e1bbc764aef
[22:22:55] SteenJobs: has joined #RubyOnRails
[22:24:06] AnomalousBit: Jon30, this sure looks a lot like requests to me. Calling Controllers, models, views and associated gems?
[22:25:12] Jon30: AnomalousBit, and this is of the other app: https://gist.github.com/slavajacobson/c607453fb1d0b89b3284
[22:25:23] dcunit3d: has joined #RubyOnRails
[22:25:27] Jon30: it's mainly complaining that files can't be found... but I am able to load the site.... strange?...
[22:26:29] AnomalousBit: Jon30, are you sure you haven't had a hard drive die? I've seen applications run on in linux for over a year (::facepalm::) with no operational hard drive, what is needed is loaded into memory and cached, the server just keeps moving along
[22:27:38] fox_mulder_cp: AnomalousBit: i have a master dns which works with ~800 domain zones two years with dropped raid )
[22:27:39] Jon30: i am using a VPS, i tried updating the gems (including puma) of both apps and redeploying with capistrano. Would it let me redeploy if the HDD was dying?
[22:27:39] benlieb: anyone know how to check if a person knows the current password they're logged in with when using devise?
[22:27:54] roddutra: has joined #RubyOnRails
[22:28:04] benlieb: for certain profile edit info I want them to supply their current pw as a security measure
[22:28:29] fox_mulder_cp: benlieb: oh. u can decrypt one-way stored passwrd ... ))))
[22:28:31] AnomalousBit: hahahah fox_mulder_cp, you beat my record
[22:28:32] Jon30: yet the other app is running fine without throwing any errors and at 5% CPU or less.
[22:28:50] rattatmatt: has joined #RubyOnRails
[22:28:53] benlieb: fox_mulder_cp: ?
[22:29:07] fox_mulder_cp: Jon30: if u have a 100% resources of vps - i think about upgrade uor vps
[22:29:13] roddutra: has joined #RubyOnRails
[22:29:21] AnomalousBit: benlieb, just do a User.password == params[:recheck_password]?
[22:29:38] fox_mulder_cp: wheen i try compile perl in my very small azure inctance - i can walk in a park for ~30 minutes
[22:29:58] djbkd: has joined #RubyOnRails
[22:30:03] Jon30: open("/home/deployer/apps/loco-engine/shared/bundle/ruby/2.2.0/gems/therubyracer-0.12.2/ext/sprockets/helpers.rb", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) --------- this line for example... why would it even be looking for a gem inside shared folder? that's not where the gem is..
[22:30:12] benlieb: AnomalousBit: I'll try that, but devise would have to write the == function, no?
[22:30:13] djbkd: has joined #RubyOnRails
[22:30:20] AnomalousBit: benlieb, it's actually User.valid_password?()
[22:30:27] fox_mulder_cp: AnomalousBit: it was a orphaned server by 3th gen of admins :)_
[22:30:32] AnomalousBit: was just off-the-cuff
[22:30:33] benlieb: AnomalousBit: ok, that's what I was expecting
[22:30:40] benlieb: something like that
[22:30:58] Radar: Jon30: because .bundle/config is telling it to do that
[22:31:35] fox_mulder_cp: oh, my jekyll can't works with collections ((
[22:31:36] Jon30: so somehow capistrano isn't deploying it correctly?
[22:31:37] benlieb: AnomalousBit: that works
[22:31:52] benlieb: AnomalousBit: did you get that from docs?
[22:32:04] Jon30: and yet i am able to load the site.... odd
[22:32:19] jgpawletko: has joined #RubyOnRails
[22:33:21] smathy: Jon30, it's common for cap deployments to put things that are meant to survive between deploys inside shared folders. Your installed gems fit squarely in that category.
[22:33:29] Radar: Jon30: !shrug
[22:33:29] helpa: Jon30: ¯\_(ツ)_/¯ Sorry, Radar is not able to help you any further as they do not know.
[22:33:35] djbkd: has joined #RubyOnRails
[22:34:32] Jon30: so is that what causing the 99% cpu usage? incorrect path for gems was specified?
[22:34:54] askhat: has joined #RubyOnRails
[22:34:54] djbkd: has joined #RubyOnRails
[22:34:56] smathy: Sorry, I didn't read back enough to be answering your underlying question, just explaining why gems are in a shared folder.
[22:36:21] kpwarr: AnomalousBit: ok so, discovered that some idiot actually pointed passenger to look for config files in our app/views folder....
[22:36:22] Jon30: smathy: nginx+puma is using 99% for 2 of my apps, while the 3rd app is running quietly 5% or less. I ran strace on the PIDs of the two apps that are running at 99% and this is what I got: https://gist.github.com/slavajacobson/849a9f017e1bbc764aef
[22:36:55] Jon30: 2nd app: https://gist.github.com/slavajacobson/c607453fb1d0b89b3284
[22:36:57] zerg_lurker: Hey folks, i'm going off a book which gets pretty vague, and i'm having some trouble with unit testing
[22:37:03] smathy: tl;dr is that it's looping trying to find/open gem files?
[22:37:41] zerg_lurker: I'm running rake test:functionals, and not only does the output look like digital diahhrea, I also don't understand why its different than rake test
[22:38:14] peterevjan: has joined #RubyOnRails
[22:38:22] smathy: Jon30, those dirs for the server could very well be on a network connected device, or something else at arms length from the CPU, it looks like maybe that's not working right. Try on a new host.
[22:38:30] smathy: Jon30, or talk to the hosting company.
[22:39:02] Jon30: smathy, the 3rd app is running fine though? it doesn't keep on restarting like the other 2 apps.
[22:39:13] smathy: Jon30, oh, on the same host?
[22:39:39] mwlang: has joined #RubyOnRails
[22:39:41] AnomalousBit: kpwarr, congratulations! you solved the mystery detective :)
[22:39:42] DEA7TH: has joined #RubyOnRails
[22:39:49] smathy: Jon30, those dirs aren't on different volumes are they?
[22:39:57] chouhoulis: has joined #RubyOnRails
[22:40:15] Jon30: smathy, nope
[22:40:15] kzsh: has joined #RubyOnRails
[22:40:49] Jon30: strace of the 3rd app.. it doesn't keep on restarting and running under 5%. https://gist.github.com/slavajacobson/44faec10b0d967c856a0
[22:41:34] AnomalousBit: benlieb, I did something similar before so I knew you could just do a password comparison, if you would like the documentation on it -> http://www.rubydoc.info/github/plataformatec/devise/Devise/Models/DatabaseAuthenticatable#valid_password%3F-instance_method
[22:42:18] dopie: has joined #RubyOnRails
[22:42:25] kzsh: has left #RubyOnRails: ()
[22:43:02] yoongkang: has joined #RubyOnRails
[22:43:26] dopie: has joined #RubyOnRails
[22:44:13] pawnbox: has joined #RubyOnRails
[22:44:19] smathy: Jon30, have you removed the whole directory of the broken app and started again?
[22:44:49] mwlang: has joined #RubyOnRails
[22:45:04] rubyonrailed: has joined #RubyOnRails
[22:45:08] Jon30: smathy, I will try that. it looks like shared/bundle/ruby/2.2.0/gems got all the new version of the gems, while for whatever reason, it's trying to load older gems...
[22:46:03] smathy: Jon30, not running `bundle update` instead of `bundle install` are you?
[22:46:19] smathy: ...well, even that should update the .lock anyway.
[22:46:29] smathy: ...unless you're not restarting your app (properly)
[22:47:02] mwlang: Is there a particularly good tutorial or book (paid or free) for working with AngularJS and Rails 4.2? So far, what I???ve found is Rails 4.0 and AngularJS beta and 1.0.x and same techniques that worked with those aren???t transcribing to 4.2 apps.
[22:47:37] Devalo: has joined #RubyOnRails
[22:48:05] mwlang: in particular, authentications via AngularJS through Device, which removed the tokenizable login feature some time after most of these tutorials were written.
[22:48:59] AnomalousBit: mwlang -> https://www.airpair.com/ruby-on-rails/posts/authentication-with-angularjs-and-ruby-on-rails
[22:50:00] AnomalousBit: mwlang, also it appears they just split the devise token authentication into a separate gem, called 'devise_token_auth' looking at the tutorial I linked
[22:50:30] mwlang: hmmm???that might be enough to get me over my current bump
[22:51:24] mwlang: Is that a bunch of typos in that article? (looks a little too regular and always ???{}???)
[22:51:49] K_r3aPeR: has joined #RubyOnRails
[22:51:56] bratsche: has joined #RubyOnRails
[22:52:49] hahuang61: has joined #RubyOnRails
[22:53:14] Jon30: smathy, I ran bundle update on development before deploying. I guess capistrano is not running bundle update.. or something?
[22:53:18] mwlang: creating an account and logging in cleared up the mess.
[22:53:44] smathy: Jon30, it shouldn't be, just `bundle install`
[22:53:46] Jon30: smathy, I am using puma, I am just restarting the puma manager
[22:53:54] smathy: Jon30, copy-paste the output from your `cap deploy` command.
[22:54:22] Jon30: smathy, bundle install locally before deploying and let capistrano take care of the rest?
[22:54:28] Synthead: Is key 561F9B9CAC40B2F7 not available on keyserver.ubuntu.com? (https://www.phusionpassenger.com/library/install/nginx/install/oss/trusty/)
[22:54:35] symbol: has joined #RubyOnRails
[22:55:00] djbkd: has joined #RubyOnRails
[22:55:07] quazimodo: has joined #RubyOnRails
[22:55:44] smathy: Jon30, the only thing the local bundle install does is makes sure your Gemfile.lock is up to date, as long as that's already the case then no need for that. The capistrano rails plugin should handle the `bundle install` on the remote machine.
[22:56:54] Jon30: smathy, it should... yet some how i ended up with older gems under /shared/bundle/ruby/2.2.0/gems/
[22:58:42] macsteps: has joined #RubyOnRails
[22:59:06] rubyonrailed: has joined #RubyOnRails
[22:59:16] smathy: Jon30, you're the only one looking at the cap output - so is it running?
[22:59:33] ni291187: has joined #RubyOnRails
[22:59:57] Jon30: I will post the output in 45 mins. I hope somebody will still be around to save me :) :(
[23:00:25] benlieb: has joined #RubyOnRails
[23:04:14] one_zero: has joined #RubyOnRails
[23:04:44] ss_much: has joined #RubyOnRails
[23:04:51] pawnbox: has joined #RubyOnRails
[23:04:57] mercwithamouth: has joined #RubyOnRails
[23:05:54] fox_mulder_cp: i setup jekyll for a my stories collection, so can go sleep
[23:06:32] nettoweb: has joined #RubyOnRails
[23:08:05] AnomalousBit: rspec vs minitest, any quick opinions on your preference?
[23:08:52] rhizome: i use minitest; a lot of people use rspec
[23:09:04] smathy: ACTION is a minitester too
[23:09:26] rhizome: hartl uses rspec, so that's what, a few tens of thousands
[23:09:30] AnomalousBit: this is also my situation, I've reading more and more open source code and am finding tons of rspec and very little minitest
[23:09:57] kpwarr: so I switched the Rails.env of my app from development to staging, and now a 'no route matches' for all of my css files only. any ideas what could cause that? If I set my environments/staging.rb to be equal to development.rb, then the page just doesn't load
[23:10:03] smathy: AnomalousBit, rails programmers are a zealous bunch.
[23:10:20] rhizome: kpwarr: do you have a staging.rb in environments?
[23:10:26] smathy: kpwarr, no precompile/
[23:10:38] djbkd: has joined #RubyOnRails
[23:11:03] IrishGringo: has joined #RubyOnRails
[23:11:52] AnomalousBit: anyone have a favorite rails project on github? I'm looking for great examples of real-world code, not a style guide. Mine at the moment is https://github.com/assemblymade/coderwall
[23:13:37] yfeldblum: has joined #RubyOnRails
[23:14:15] yfeldblum: has joined #RubyOnRails
[23:16:17] kpwarr: smathy: my staging.rb had: "config.assets.precompile = ['*.js', '*.css', '*.css.erb']". when I commented that out, the problem persisted
[23:16:18] havenwood: AnomalousBit: https://github.com/discourse/discourse
[23:17:01] K_r3aPeR: has joined #RubyOnRails
[23:17:08] rakm: has joined #RubyOnRails
[23:17:30] TinkerTy_: has joined #RubyOnRails
[23:18:03] smathy: kpwarr, I meant that it's probably because you didn't run the precompile task.
[23:18:16] AnomalousBit: thanks havenwood, I've read over discourse a bit, I prefer coderwall's style and cleanliness. don't like sql littered through methods in my models. Plus Jeff Atwood ruffles my feathers
[23:18:33] smathy: kpwarr, you seem like you're fairly new, you should just use heroku until/unless you become more knowledgable about deploying Rails. This really isn't a simple task.
[23:18:45] Sadin: has joined #RubyOnRails
[23:19:45] AnomalousBit: kwparr, did you use rake to precompile your assets?
[23:19:54] havenwood: AnomalousBit: Here's the code I like the best ;) https://github.com/jeremyevans/roda
[23:20:24] ivanr1325: has joined #RubyOnRails
[23:21:18] AnomalousBit: lol havenwood, you might kicked out of here pushing another framework! ;)
[23:22:43] arthropododo: has joined #RubyOnRails
[23:23:50] havenwood: AnomalousBit: Buy two Rodas and get a Phoenix free. Special offer ends soon.
[23:24:16] smathy: havenwood, are you watching what Solnic is doing with rodakase?
[23:25:12] TinkerTyper: has joined #RubyOnRails
[23:25:28] havenwood: smathy: No, I didn't know about it. I'd seen the repo exploring ROM with Roda but this looks interesting, thanks!
[23:25:45] smathy: havenwood, y/w
[23:29:06] B1n4r10: has joined #RubyOnRails
[23:29:53] djbkd: has joined #RubyOnRails
[23:31:10] rattatmatt: has joined #RubyOnRails
[23:32:04] askhat: has joined #RubyOnRails
[23:32:28] TinkerTyper: has joined #RubyOnRails
[23:32:37] jottr: When setting up the database connection in database.yml, is it possible to use DATABASE_URL if the environment variable has been set, and otherwise use the TCP_ADDRESS and TCP_PORT?
[23:33:17] macsteps: has joined #RubyOnRails
[23:33:53] smathy: jottr, database.yml is processed via ERB, so whatever you can do in ERB you can do in there (so yes).
[23:34:54] pawnbox: has joined #RubyOnRails
[23:35:49] bauerbob: has joined #RubyOnRails
[23:36:48] IrishGringo: has joined #RubyOnRails
[23:37:18] jottr: smathy: ok thx
[23:40:15] DmitryBochkarev: has joined #RubyOnRails
[23:41:58] chouhoulis: has joined #RubyOnRails
[23:43:00] kirillzh: has joined #RubyOnRails
[23:44:58] revvy: has joined #RubyOnRails
[23:46:33] passick: has joined #RubyOnRails
[23:47:37] bauerbob: i???ve got the following model: a has many b (b belongs to a) and b belongs_to c (c has many b). so a has many c through b. Now when I call ???@q=A.eager_load(:c)??? rails automatically generated LEFT OUTER JOIN b LEFT OUTER JOIN c. Everything???s fine ???except that I want to use @q.b in my view, but i can???t. Only @q.c is available. So now I call ???@q=A.eager_load(:b, :c)???. But now the resulting sql is wrong, there are 3 joins,
[23:47:38] bauerbob: because LEFT OUTER JOIN b is created twice! how can i solve that?
[23:47:59] Ropeney: has joined #RubyOnRails
[23:48:15] itscj: has joined #RubyOnRails
[23:48:18] helpa: Please do not use fake variables for your name such as "foo", "bar" or "x". Use the real names, as if it makes sense to you it probably will make sense to the people helping you.
[23:49:00] itscj: has joined #RubyOnRails
[23:50:01] Devalo: has joined #RubyOnRails
[23:52:11] bauerbob: alright, once more with real variables: Student has_many Grades through GradeClimbs. Student.eager_load(:grades) creates students LEFT OUTER JOIN grade_climbs and grade_climbs LEFT OUTER JOIN grades. that???s fine
[23:52:48] NeoHamled: has joined #RubyOnRails
[23:52:57] bauerbob: but Student.eager_load(:grade_climbs, :grades) produces 2 LEFT OUTER JOIN grade_climbs
[23:54:27] matthewd: bauerbob: Is there a particular reason you're using eager_load instead of includes/preload?
[23:54:53] bauerbob: includes results in multiple sql statements
[23:55:24] NeoHamled: If I have an ActiveRecord model (called Foo) that hooks up to a database view which is essentially the same as the table for a different model, and I want to have polymorphic route/url helpers work for the Foo model, is there a better way to do that
[23:56:02] NeoHamled: than defining a model_name method that returns ActiveModel::Name.new(ActualModel)
[23:56:09] bauerbob: and i haven???t used preload ???well, actually http://blog.arkency.com/2013/12/rails4-preloading/ convinced me to use eager_load
[23:56:35] kzsh: has joined #RubyOnRails
[23:56:53] matthewd: bauerbob: What's bad about multiple SQL statements?
[23:57:22] jscheel: has joined #RubyOnRails
[23:57:32] bauerbob: uhm??? i thought they are slower that a single one with joins
[23:58:21] fourq: has joined #RubyOnRails