« Back to channel list

#RubyOnRails - 03 March 2016

« Back 1 day Forward 1 day »
[00:01:54] rlf: has joined #RubyOnRails
[00:02:04] nullwarp: has joined #RubyOnRails
[00:02:39] rlf: hello, anyone here used nginx and puma behind? i'm having an issue with a bad gateway with the nginx reverse proxy and can't seem to figure out why it doesn't work
[00:03:21] Guest34101: has joined #RubyOnRails
[00:04:41] baweaver: has joined #RubyOnRails
[00:05:46] bronson: flip_digits: what do you mean? queueing background jobs, or the job itself?
[00:06:46] bronson: flip_digits: you saw http://edgeguides.rubyonrails.org/testing.html#testing-jobs right?
[00:07:20] n008f4g_: has joined #RubyOnRails
[00:08:00] defsdoor: has joined #RubyOnRails
[00:08:37] bronson: rlf: probably not puma related... you can connect to puma directly, right?
[00:12:26] chouhoulis: has joined #RubyOnRails
[00:14:56] deuxcliq_: has joined #RubyOnRails
[00:16:46] deuxcliq_: has joined #RubyOnRails
[00:17:39] IrishGringo: has joined #RubyOnRails
[00:17:45] baweaver: has joined #RubyOnRails
[00:18:45] trinaldi: has joined #RubyOnRails
[00:23:15] sevenseacat: has joined #RubyOnRails
[00:24:56] trosborn: has joined #RubyOnRails
[00:25:44] deuxclique: has joined #RubyOnRails
[00:26:31] baweaver: has joined #RubyOnRails
[00:27:49] rlf: bronson: lol you were so correct, it was nginx related :D
[00:28:04] hahuang61: has joined #RubyOnRails
[00:30:13] bronson: rlf: right on. I'm all too familiar with wrestling with nginx proxies.
[00:30:59] baweaver: has joined #RubyOnRails
[00:31:22] jstransky: has joined #RubyOnRails
[00:31:56] DLSteve: has joined #RubyOnRails
[00:33:41] Uber|Dragon: has joined #RubyOnRails
[00:35:56] duderonomy: has joined #RubyOnRails
[00:35:57] slash_nick: i'd still prefer a gist... a tab in my browser is easy to keep up with than a line scrolling through my irc client
[00:36:36] atomical_: has joined #RubyOnRails
[00:37:10] slash_nick: plus, may have more questions... and you can add files or lines to the gist easier than you can to a line that's scrolled a bit
[00:38:31] Spami: has joined #RubyOnRails
[00:38:50] Uber|Dragon: has left #RubyOnRails: ()
[00:38:50] Uber|Dragon: has joined #RubyOnRails
[00:39:01] jstransky: Hi guys, just got added to a rails project to write the scss and I’m having trouble getting my environment setup.
[00:39:03] Rodya_: has joined #RubyOnRails
[00:39:21] Uber|Dragon: jstransky: what kind of development system are you on?
[00:39:24] jstransky: question 1: Where will I see scss compilation errors
[00:39:27] jstransky: Uber|Dragon: Vagrant
[00:40:12] Uber|Dragon: hmm ok.. don't have any experience using that.. I dev on a mac these days
[00:40:33] slash_nick: jstransky: you should see them in your dev environment, but also when you attempt to precompile assets
[00:40:34] jstransky: I’m on a mac as well, just using Vagrant/VirtualBox as the VM
[00:40:46] atomical_: has joined #RubyOnRails
[00:40:58] jstransky: slash_nick: like in rails console?
[00:41:00] Uber|Dragon: copy. what os on the VM?
[00:41:27] jstransky: Uber|Dragon: Ubuntu 14.04.3 LTS
[00:41:34] slash_nick: jstransky: wherever your server is running... or logs/development.log ... let me check real quick, i'll cause an error in my env
[00:42:32] Uber|Dragon: if you precompile the assets on the command line it should spit out any errors right there.. otherwise what slash_nick said, the development.log should also contain the errors
[00:42:54] Uber|Dragon: do you have rails up and runnin in general? Just trying to write the scss?
[00:42:59] jstransky: Ok, I can tail the log then
[00:43:12] Uber|Dragon: ACTION nods
[00:43:13] jstransky: yep, rails app is up and running just fine
[00:43:38] atomical: has joined #RubyOnRails
[00:43:38] mices: never mind i found it
[00:43:43] jstransky: I’ve been told though that my scss will recompile upon refreshing the page. Does that sound correct?
[00:44:01] Uber|Dragon: in development mode yes
[00:44:09] Uber|Dragon: the assets are compiled on the fly
[00:44:13] jstransky: interesting.
[00:44:14] slash_nick: which is awesome :)
[00:44:44] rickmasta: has joined #RubyOnRails
[00:44:51] pvertenten: has joined #RubyOnRails
[00:45:05] jstransky: Ok, lets get down to the more immediate issue. I’m using bootstrap/bootstrap-sockets which claims I’ll have access to bootstraps mixins, but when I try it’s not working and no errors.
[00:45:18] sevenseacat: define 'not working'
[00:45:49] jstransky: So for instance I should be able to write in admin.scss: .col-special{ @include make-sm-column(6); }
[00:46:00] jstransky: which should make an element fill half the screen width
[00:46:31] kies^: has joined #RubyOnRails
[00:46:32] sevenseacat: bootstrap defines mixins now?
[00:46:33] jstransky: But it’s filling the whole width and chrome dev tools doesn’t detect that class ever got written
[00:46:53] jstransky: bootstrap is built with bootstrap mixins :)
[00:47:12] Uber|Dragon: not as far as I know ^^ you gotta write what you are mixing in
[00:47:15] slash_nick: jstransky: wait you're using what? are you using a gem, or something else?
[00:47:22] Uber|Dragon: it doesn't define it
[00:47:28] jstransky: Probably the last project I’ll use it for but since I’m just laying out a dashboard, doesn’t really have to be special
[00:47:39] rubyonrailed: has joined #RubyOnRails
[00:48:02] jstransky: slash_nick: gem ‘bootstrap-sass’
[00:48:10] blackmesa: has joined #RubyOnRails
[00:48:26] jstransky: following the docs for the bootstrap sass port
[00:48:39] slash_nick: ok jstransky did you add "@import 'bootstrap-sprockets'" and 'bootstrap' to your application.css file?
[00:48:41] jstransky: https://github.com/twbs/bootstrap-sass
[00:48:45] codepete: has joined #RubyOnRails
[00:48:46] jstransky: slash_nick: yes
[00:48:56] sevenseacat: i didnt think the mixins were public
[00:49:10] jstransky: default bootstrap styles ie. .container, .row .col-xs-12 etc all work
[00:49:42] sevenseacat: so what css does that .col-special declaration generate
[00:49:45] slash_nick: jstransky: that's good news... so bootstrap to some degree is on the page?
[00:49:47] atomical: has joined #RubyOnRails
[00:49:51] dalbusch1t: has joined #RubyOnRails
[00:49:56] jstransky: sevenseacat: they are if you are importing the bootstrap source vs just adding their .css to your page
[00:50:25] sevenseacat: i'd argue thats not true given that using them isnt documented anywhere so they're probably not meant to be public
[00:50:32] jstransky: slash_nick: yes, bootstrap is indeed being rolled into the view’s .css
[00:50:51] jstransky: bootstrap docs are sh*t
[00:51:12] jstransky: Imo, its the real inteded way to use bootstrap
[00:51:41] slash_nick: jstransky: the file where you're using the mixin, is it also rendered by application.css? (is admin.css rendered by application.css? or did you import bootstrap in admin.css as well?)
[00:52:01] jstransky: way eaiser to roll your own theme vs. overriding a ton of defaults… anyway
[00:52:19] jstransky: slash_nick: let me verify that
[00:52:27] slash_nick: one of those things needs to be yes :)
[00:52:51] sevenseacat: then maybe my question will get answered too :)
[00:52:57] jstransky: ok, it appears admin.scss is not being included
[00:53:20] slash_nick: jstransky: dont have to include it in application.css if you don't want to... but you would need to add your imports to admin.css at a min
[00:53:41] jenrzzz: has joined #RubyOnRails
[00:53:41] jstransky: but since my route is mysite.com/admin, isn’t that suppsed to be included?
[00:53:55] sevenseacat: the route is irrelevant to the stylesheets
[00:54:02] slash_nick: jstransky: application.css only includes what you tell it to... and i don't know what you've got in yours
[00:54:10] slash_nick: ^^ what sevenseacat said
[00:54:55] jstransky: so how do I tell admin/index.html.erb to use admin.scss?
[00:55:15] slash_nick: jstransky: i'd specify which layout index.html.erb should be rendered into
[00:55:40] sevenseacat: page-specific CSS isn't really a desired thing in rails
[00:55:44] jstransky: layouts… sorta remember that from the Lynda rails course
[00:56:09] jstransky: sevenseacat: agreed 100%, but for some reason that’s how they’re going about it.
[00:56:22] slash_nick: jstransky: check out your application_layout ... you can create another one and call it admin_layout... then tell your admin controllers to use that
[00:56:24] sevenseacat: you have the power to change this :)
[00:56:26] jstransky: As soon as I have a better grip on how/why, I’ll suggest changing that.
[00:57:29] Uber|Dragon: it's because of the whole precompile for production concept
[00:57:51] Uber|Dragon: it wouldn't be precompiled on an application level if you had page specific styles or javascript
[00:58:32] slash_nick: jstransky: http://guides.rubyonrails.org/layouts_and_rendering.html ... see "Specifying Layouts for Controllers"
[00:58:42] Uber|Dragon: idea is.. you download one minified style sheet and javascript file.. which is faster than multiple files being downloaded with the same amount of lines of code
[00:59:53] slash_nick: jstransky: the direction we're heading in won't have you rendering admin.css on non admin pages...
[01:00:07] jstransky: yah I’m familiar with the benefits, but typically my sites result in 1 to 4 .css files tops. Not… 1 for each view!?
[01:00:19] slash_nick: jstransky: why would you have one for each view?
[01:00:22] emachnic: has joined #RubyOnRails
[01:00:59] Uber|Dragon: heh well you can always include it in your view that is specific to your controller method to get around it. but if you do that you need to put the style sheet in the public folder
[01:01:01] jstransky: slash_nick: thats exactly my question. When I clones the project there were all these empty .scss files matching the names of views
[01:01:15] jstransky: not my question for you guys, for my team
[01:01:25] Uber|Dragon: ACTION nods
[01:01:43] slash_nick: jstransky: those would get created by rails generators... and they'd likely be included by application.css by something like "require_tree ."
[01:01:55] Uber|Dragon: sounsd like someone didn't know about or understand the asset pipeline when they setup the project :P
[01:02:08] jstransky: Uber|Dragon: bingo
[01:02:15] slash_nick: lol... it's not that.
[01:02:41] jstransky: btw, there’s no require_tree statements in application.css.scss
[01:02:43] Uber|Dragon: forgot about the generators.. that's probably the case (I never use them because I found I deleted more stuff than I saved lol)
[01:02:58] Diabolik: has joined #RubyOnRails
[01:03:01] Uber|Dragon: then you have to explicitly include each css file
[01:03:12] slash_nick: jstransky: so they ripped it out because it's a bad idea in general to use that...
[01:03:17] slash_nick: (http://guides.rubyonrails.org/asset_pipeline.html#controller-specific-assets)
[01:03:42] slash_nick: jstransky: i rip require_tree out because i only want to include by default in my layout the files that i need one every page.
[01:03:44] jstransky: Ok, I gotta grok this real quick and talk to the team. brb
[01:03:55] jstransky: Thanks for the great info so far.
[01:04:36] jscheel: has joined #RubyOnRails
[01:04:42] slash_nick: jstransky: no problem... if they're not using those generated .css.scss files, they should absolutely `git rm` them...
[01:04:55] benlieb: has joined #RubyOnRails
[01:05:21] jstransky: slash_nick: I’ll suggest that, gotta double check what the plan was.
[01:05:48] Uber|Dragon: the separation of the files is for organization rather than the css only be used in a particular view
[01:06:10] nettoweb: has joined #RubyOnRails
[01:07:51] slash_nick: Uber|Dragon: that's right... and by default they'd all be precompiled right along with application.css.scss
[01:07:58] Uber|Dragon: ACTION nods
[01:08:10] jstransky: Uber|Dragon: if I understand then, one solution would be for admin.scss to @import all of the admin view .scss files?
[01:08:35] jstransky: and then create an Admin layout?
[01:08:37] slash_nick: ACTION nods
[01:08:43] Uber|Dragon: that again helps you keep track of what is being used where.. but asset pipeline is going to combine all the files
[01:08:52] jstransky: yes yes, that’s what I want
[01:09:05] Uber|Dragon: then yes that's exactly what I would do
[01:09:06] baweaver: has joined #RubyOnRails
[01:09:10] jstransky: ok ok /cracks knuckles
[01:09:32] slash_nick: godspeed you
[01:10:50] Uber|Dragon: man I wish Rails came packaged with the whole interactor and presenter concept
[01:11:09] Uber|Dragon: it amazes me people stuff all the logic into controllers or models lol
[01:12:01] jscheel: has joined #RubyOnRails
[01:12:19] Uber|Dragon: just got a jr dev at work... lol gotta show in the ways of real software development with rails.. ah code review fun fun
[01:12:28] slash_nick: Uber|Dragon: i've recently tried something for the first time... doing all authorization with custom routing constraints... i found i could require certain roles to provide certain kinds of params for certain routes, all at the route level... it takes a lot of if/else and whatnot out of my controllers
[01:13:14] Uber|Dragon: slash_nick: nice. yeah man the name of the game is code separation.. I challenge my team to think long and hard on every if/else statement I come across in their code
[01:13:37] slash_nick: Uber|Dragon: https://gist.github.com/rthbound/1b4a7073569f4b50e7bb
[01:13:42] chouhoulis: has joined #RubyOnRails
[01:14:07] slash_nick: reading about ineractor/presenter stuffs now... they're news to me
[01:14:57] slash_nick: oh... yeah i'm a huge fan of service objects
[01:15:51] slash_nick: Uber|Dragon: this is how i usually handle those... https://github.com/rthbound/pay_dirt
[01:16:41] slash_nick: there's lots of cool gems for SOs... https://github.com/robyurkowski/skywalker
[01:16:58] Uber|Dragon: slash_nick: hmm glowworm that's first I'm seeing that gem.. I definitely like the concept
[01:17:20] slash_nick: Uber|Dragon: glowworm is the name of an api i'm building...
[01:17:22] Spami: has joined #RubyOnRails
[01:17:39] slash_nick: but maybe i should package that solution up and call it glowworm
[01:17:43] kirillzh: has joined #RubyOnRails
[01:17:44] Uber|Dragon: slash_nick : ah I see
[01:19:23] Uber|Dragon: slash_nick : yeah I completely agree SO's ftw! regardless of the gem implementation.. it's all about making single purpose objects with simple public interface
[01:19:40] Uber|Dragon: which also facilitates good tests
[01:20:45] slash_nick: Uber|Dragon: absolutely. honestly i really prefer the SO instances have only one public method
[01:20:46] emachnic: has joined #RubyOnRails
[01:21:42] kirillzh: has joined #RubyOnRails
[01:21:45] Uber|Dragon: sometimes that makes sense.. that's basically how the interactor gem makes you organize your code. othertimes you need more out of your object
[01:22:23] jenrzzz: has joined #RubyOnRails
[01:22:35] manfrin: has joined #RubyOnRails
[01:22:46] slash_nick: (and may it always be #call, taking no arguments)... you basically want to know that if you can initialize it, it'll succeed when called. then your SOs can be used interchangeably with other SOs or procs
[01:23:03] Uber|Dragon: slash_nick : ex; I wrote a better_uri class that parses a string with URI.parse but then gives you methods like sortable_url (which removes www and lowercases everything.. basically producing a url you can alphabetically sort with easy.. there are some other transformations that use other public interfaces
[01:23:22] Uber|Dragon: ACTION nods
[01:23:52] slash_nick: Uber|Dragon: yeah, but once you start adding more public methods it feels less like an SO.. to me those are the smallest units. You can still have poros that basically are swiss army knives, where each blade or corkscrew is one SO (or one SO that calls several more)
[01:23:56] Uber|Dragon: yeah we are definitely on the same page.. I just wish that concept was beat into rails developers from the start.. people that start with ruby tend to grasp that more often
[01:24:36] slash_nick: Uber|Dragon: i actually got rejected for a job i interviewed before because i was too enthusiastic about them lol
[01:24:51] Uber|Dragon: people that move from like php to rails.. tho.. ALL the business logic is in the controllers or model.. which makes refactoring a shit show later
[01:25:03] jenrzzz: has joined #RubyOnRails
[01:25:35] Uber|Dragon: likely not interviewed by a software engineer then.. lol.. or they just couldn't turn away from their code base
[01:26:05] slash_nick: Uber|Dragon: sadly, it was a day long interview... given by 7 or 8 software engineers
[01:27:20] _3by8: has joined #RubyOnRails
[01:28:06] slash_nick: i'll admit that wasn't their only criticism, but i definitely remembered it... thinking "okay, but i'm going to keep thinking these are a great answer for a lot of problems"
[01:28:11] Uber|Dragon: one of the reasons I got my job is because I advocated for simple single purpose SOs.. many of which we've now packaged up into useful gems to share across projects lol
[01:28:55] Pandorian: has joined #RubyOnRails
[01:29:08] Uber|Dragon: ACTION is all about DRY code too lol (Don't Repeat Yourself)
[01:30:10] dirtibirdi: has joined #RubyOnRails
[01:30:44] smathy: slash_nick, the right answer was "The Majestic Monolith"
[01:30:46] _3by8: I'm trying to validate that all of the nested objects added up have a quantity of at least one, anyone know of a way to do that?
[01:31:11] smathy: _3by8, custom validation, just do it.
[01:31:35] _3by8: smathy: mkay
[01:32:00] dnewkerk: has joined #RubyOnRails
[01:32:01] slash_nick: nested_objects.all?(&:have_quantity)
[01:32:05] smathy: _3by8, you'll need it in the parent, in order to do the sum across the collection.
[01:33:07] _3by8: slash_nick: yeah, like I don't want the object to be valid if all of the nested objects have a total quantity of zero.
[01:33:15] _3by8: slash_nick: but I'll just write a custom validation
[01:33:22] smathy: slash_nick, well added up to at least 1 :) So you could still do that as long as have_quantity is > 0 :)
[01:33:46] smathy: slash_nick, oh, sorry, you'd want any? :)
[01:33:58] smathy: ACTION focused on the wrong thing
[01:34:07] allcentury: has joined #RubyOnRails
[01:35:26] _3by8: smathy: do I put custom validation classes in the model's folder? I know it doesn't really matter a lot but is that the Rails way?
[01:36:52] smathy: _3by8, I don't think you need a class for this, just a method.
[01:37:08] _3by8: smathy: okay!
[01:38:11] Uber|Dragon: rails way would be in /app/validators
[01:38:13] Uber|Dragon: http://www.rails-dev.com/custom-validators-in-ruby-on-rails-4
[01:38:20] TBAA: has joined #RubyOnRails
[01:38:22] Uber|Dragon: ACTION goes back to code review :P
[01:39:22] kpwarr: smathy: re: what I was asking earlier about giving rails a postgres superuser account... I found that superuser was required because it would try to bypass foreign key constraints when it was clearing the db or something... (http://blog.endpoint.com/2012/10/postgres-system-triggers-error.html)
[01:42:57] smathy: kpwarr, huh, weird - I've never seen that issue.
[01:43:06] htmldrum: has joined #RubyOnRails
[01:43:32] superlou: has joined #RubyOnRails
[01:44:27] flip_digits: Question: Does anyone know if there is Cucumber syntax for the following functionality: And show me the step
[01:45:04] mostlybadfly: has joined #RubyOnRails
[01:46:15] _bogus_: please, i'm trying to get a page using ajax (remote: true), i have a link but when i click it, there's a lot of requests to the server, some errors, and i get no content from this request, can i have a help on this? https://gist.github.com/anonymous/f3a32745a06c5ce040a7
[01:46:20] flip_digits: I'm hoping that such a thing exists. Sometimes it's difficult to find the underlying step_definition
[01:47:06] dnewkerk: I upgraded an app I’m working on to Rails 5 beta3 and for some reason all of my tests (minitest) are running twice… anyone else run into this?
[01:47:44] slash_nick: dnewkerk: i haven't upgraded an existing app... i have not noticed that starting fresh
[01:48:29] _bogus_: just have a plain text on _new.js.erb to identify it
[01:48:46] DLSteve: has joined #RubyOnRails
[01:49:08] dnewkerk: slash_nick: yeah it must be something with my current config then
[01:49:44] slash_nick: dnewkerk: how do you run them, btw? rake test?
[01:50:43] dnewkerk: rails test (whole suite) or rails test test/models/something_test.rb (specific file)… it even happens if I run just a specific test by line number
[01:52:33] dnewkerk: I guess I can temporarily revert my test_helper.rb to Rails 5 default and disable any test related gems, then add things back in until the problem returns… oh so fun :P
[01:52:44] dopamean_: has joined #RubyOnRails
[01:52:54] slash_nick: did you make all your upgrade changes in one commit?
[01:53:08] jstransky: Ok, re: my issue with getting admin.scss to compile, I wanted to just see it work at all so I figured adding it to the stylesheet_link_tag in application.html.erb would do it.
[01:53:28] jstransky: like this: <%= stylesheet_link_tag 'application', 'admin', media: 'all' %>
[01:53:37] slash_nick: jstransky: did you add import statments to admin?
[01:53:58] slash_nick: you'll still need to do it, that way... those are two separate style tags in your html
[01:54:00] jstransky: slash_nick: yes but I have to deal with this error first: Asset was not declared to be precompiled in production.
[01:54:17] jstransky: Add `Rails.application.config.assets.precompile += %w( admin.css )` to `config/initializers/assets.rb` and restart your server
[01:54:22] dnewkerk: slash_nick: yes, though I upgraded to beta1, 2 and 3 in sequence as they came out, each time I installed a separate plain Rails 5 app to diff the previous version against and observe exactly what files changed
[01:54:27] jstransky: that feels… wrong
[01:54:31] slash_nick: jstransky: config.assets.precompile
[01:55:14] jstransky: why does my assets.rb file include lines for .js files?
[01:55:32] slash_nick: jstransky: well by default rails will only looks for application.css to precompile (concatenating all the things it "require"s before compiling)
[01:55:34] jstransky: why arent any .css files listed?
[01:55:47] slash_nick: you want rails to handle admin.css.scss the same way... so you have to tell it to
[01:56:17] Devalo: has joined #RubyOnRails
[01:56:19] jstransky: slash_nick: ok, just leary of editing files that are modified by rails
[01:56:31] slash_nick: jstransky: rails won't modify it
[01:56:37] jstransky: like, weren’t those .js lines added as part of the view generator?
[01:56:47] jstransky: just guessing
[01:56:56] slash_nick: it was created by rails, but it's very common for them to change as you implement the things you need
[01:57:02] jstransky: fair enough
[01:57:58] matthewd: jstransky: No, any .js files mentioned there were added by hand -- though blame should tell you that anyway
[01:57:59] slash_nick: basically if you're using javascript_include_tag or stylesheet_link_tag and the file isn't application.js or application.css... you need to tell rails to precompile it for you so it'll be available
[01:59:02] slash_nick: dnewkerk: i was thinking bisecting your upgrade changes might shed light... but if they all happened in one commit then bisect wouldn't tell you much you don't already know
[01:59:58] slash_nick: dnewkerk: did you implement your own test tasks in your app?... another question, you don't get the same behavior in a generated app, do you?
[02:02:11] dnewkerk: slash_nick: yeah at the time I was fairly confident that I had correctly modified all Rails 4 files with their Rails 5 updates (and added/removed files as required), and same with beta2 and beta3. No I don’t have custom test tasks, and no doesn’t do it in a new generated app (well haven’t tried since beta1 actually, though I recall a simple test there worked as expected)
[02:03:17] slash_nick: a wild-ass-guess... what if you stop spring before running tests?
[02:04:23] dnewkerk: slash_nick: yep I often stop spring when anything weird is happening (it’s often to blame haha)
[02:05:06] jstransky: Thanks for all the info guys. very helpful
[02:06:16] slash_nick: dnewkerk: what's the difference between your test helper and the generated app's test helper?
[02:06:19] kpwarr: when testing with rails, is the database cleared and reseeded/re-populated with fixtures between every file? between every test?
[02:07:04] slash_nick: are you requiring minitest/autorun in your upgraded app? and what happens if you don't?
[02:07:24] slash_nick: kpwarr: well maybe none of those things
[02:07:34] stannard: has joined #RubyOnRails
[02:07:57] braincra-: has joined #RubyOnRails
[02:08:08] dnewkerk: slash_nick: lots, though nothing I’d call unusual… requiring things like capybara, various extracted helper methods, etc
[02:08:44] emachnic: has joined #RubyOnRails
[02:09:19] alistairtweed: has joined #RubyOnRails
[02:09:26] dnewkerk: slash_nick: no not requiring minitext/autorun
[02:09:35] slash_nick: kpwarr: what problem are you having? maybe i can help you get the behavior you want
[02:09:36] dnewkerk: minitest/autorun
[02:10:59] slash_nick: dnewkerk: not sure it'll give any more info, but... do you think we might learn anything from you copying test gems to the generated app's gemfile, requiring the same gems in the generated test helper?
[02:12:38] twilling: has joined #RubyOnRails
[02:12:48] norfumpit: has joined #RubyOnRails
[02:12:55] dnewkerk: slash_nick: yeah that’s probably a good bet… I just now confirmed it is not due to any customization in test_helper.rb so it very well may be some gem. I reset test_helper to Rails 5 default, stopped spring, and still get the same issue
[02:14:28] chouhoulis: has joined #RubyOnRails
[02:14:40] fcser_: has joined #RubyOnRails
[02:14:41] baweaver: has joined #RubyOnRails
[02:14:46] c0defeed_away: has joined #RubyOnRails
[02:15:03] workmad3_: has joined #RubyOnRails
[02:15:08] slash_nick: dnewkerk: did you say this happened with beta1, 2, and 3?
[02:16:05] douglasc_: has joined #RubyOnRails
[02:16:07] mattp_: has joined #RubyOnRails
[02:16:15] monoprotic: has joined #RubyOnRails
[02:16:26] dnewkerk: slash_nick: yeah it began happening as soon as I upgraded to beta1 and has continued. I’ve been working around it and tolerating it since I couldn’t figure it out, but ahhhh I really want to fix it haha
[02:17:12] SloggerKhan1: has joined #RubyOnRails
[02:17:16] TheNet: has joined #RubyOnRails
[02:17:17] dnewkerk: right now I’m disabling lots of gems and their associated configs, will see what happens… love version control :P
[02:17:32] slash_nick: the hard part is getting it recreated in a way we can share
[02:17:39] slash_nick: well... the first hard part
[02:18:17] slash_nick: dnewkerk: does it run twice or report twice?
[02:18:32] slash_nick: (through binding.pry or byebug or whatever into one of the tests)
[02:18:34] jstransky: how would I choose a certain layout for all views under a certain route
[02:18:45] ikarius_: has joined #RubyOnRails
[02:18:51] slash_nick: jstransky: at the controller level... in your controller call "layout 'whatever'"
[02:18:54] Pro|_: has joined #RubyOnRails
[02:19:00] jstransky: for example I have mysite.com/admin, mysite.com/admin/events, mysite/admin/claims etc.
[02:19:10] jstransky: I want all admin/ views to use my admin layout
[02:19:11] dnewkerk: runs twice, has a different seed, and yeah whenever I use binding.pry, if I “continue” which would usually complete the test, it runs again and brings me back to pry again
[02:19:14] BaNzoune1: has joined #RubyOnRails
[02:19:29] speaking1ode: has joined #RubyOnRails
[02:19:29] Shapeshi1ter: has joined #RubyOnRails
[02:19:37] jstransky: slash_nick: doesn’t seem like I should have to set that for every single controller
[02:19:51] benlieb: has joined #RubyOnRails
[02:19:52] crankhar1er: has joined #RubyOnRails
[02:19:55] jstransky: not very DRY imo
[02:20:03] MuffinPimp_: has joined #RubyOnRails
[02:20:11] slash_nick: jstransky: well, i'd normally have an admin_controller.rb that my admin controllers would inherit from
[02:20:16] slash_nick: and i'd place the thing in that...
[02:20:50] Graphettion: has joined #RubyOnRails
[02:21:56] slash_nick: jstransky: also, admin_controller.rb usually inherits from ApplicationController...
[02:22:19] slash_nick: class AdminController < ApplicationController, ya know
[02:22:31] beingjohnm_: has joined #RubyOnRails
[02:22:33] wethu: has joined #RubyOnRails
[02:22:33] jstransky: it does, they all do
[02:22:34] vedu_: has joined #RubyOnRails
[02:22:45] agent008_: has joined #RubyOnRails
[02:23:05] meekohi_: has joined #RubyOnRails
[02:23:19] jstransky: I’ll have to talk to the team, not sure if exams_controller also has front end views or not
[02:23:21] slash_nick: well, your admin ones will start inheriting from this new AdminController... so something like Admin::ClaimsController < AdminController... AdminController < ApplicationController...
[02:23:42] djellemah_: has joined #RubyOnRails
[02:23:42] dnewkerk: slash_nick: “good” news… I slashed and burned everything and now the problem is not occuring… so now have to put it back together piece by piece until I determine the culprit
[02:23:54] wkoszek: has joined #RubyOnRails
[02:23:55] zmd: has joined #RubyOnRails
[02:23:56] Denarii: has joined #RubyOnRails
[02:23:56] cydrobolt_: has joined #RubyOnRails
[02:24:14] slash_nick: dnewkerk: great news!
[02:24:17] gremly: has joined #RubyOnRails
[02:24:31] EdwardIII: has joined #RubyOnRails
[02:24:59] Brando753: has joined #RubyOnRails
[02:25:32] zmd: has left #RubyOnRails: ()
[02:25:49] cgfbee: has joined #RubyOnRails
[02:26:11] DoctorMonocular: has joined #RubyOnRails
[02:27:14] dmz: has joined #RubyOnRails
[02:28:01] beingjohnm_: has joined #RubyOnRails
[02:28:22] lessless: has joined #RubyOnRails
[02:29:03] chagel: has joined #RubyOnRails
[02:29:40] codesoda: has joined #RubyOnRails
[02:32:06] DoctorMo_: has joined #RubyOnRails
[02:33:57] chagel: has joined #RubyOnRails
[02:34:01] slash_nick: jstransky: well, for controllers where you can't change it globally, you can specify it in the individual action... or if the action might render multiple things, override it when you call render
[02:35:11] jstransky: Yah I’m sure we can work out a logical solution.
[02:35:25] jstransky: Next up is getting BrowserSync to work with Rails
[02:35:47] jstransky: not sure gulp and assetpipline are going to get along
[02:36:14] DoctorMonocular: has joined #RubyOnRails
[02:36:15] jstransky: but that’s for another day. Gotta take off for the day. Thanks again
[02:36:26] jfelchner_: has joined #RubyOnRails
[02:37:59] alistairtweed: has left #RubyOnRails: ()
[02:38:17] DoctorMonocular: has joined #RubyOnRails
[02:42:18] codesoda: has joined #RubyOnRails
[02:42:33] Rodya_: has joined #RubyOnRails
[02:43:29] DoctorMo_: has joined #RubyOnRails
[02:44:17] maxdoubt: has joined #RubyOnRails
[02:48:37] chagel: has joined #RubyOnRails
[02:49:52] renegadeandy: has joined #RubyOnRails
[02:50:29] renegadeandy: hey guys, when i go to http://localhost:3000/welcome - the page renders fine, but it always renders with the url : http://localhost:3000/welcome#_=_ - how can I find out what is responsible for adding the #_=_ to the end of the welcome url!?
[02:51:24] zave: has joined #RubyOnRails
[02:52:50] blackmesa: has joined #RubyOnRails
[02:53:12] cassioscabral: has joined #RubyOnRails
[02:53:36] DoctorMonocular: has joined #RubyOnRails
[02:53:37] kpwarr: slash_nick: re database being cleared between tests? I'm just wondering why rails 5 randomizes test order. how could the outcome vary depending on order if the database is always fresh?
[02:54:07] DragonPunch: has joined #RubyOnRails
[02:54:43] matthewd: kpwarr: Because there are a lot of other places to accidentally store global state
[02:54:58] maxdoubt: has joined #RubyOnRails
[02:56:20] queequeg1: has joined #RubyOnRails
[02:56:58] Uber|Dragon: interesting read on The Majestic Monolith https://m.signalvnoise.com/the-majestic-monolith-29166d022228#.vqwhyaqlw didn't really sway my opinion but interesting non the less
[02:58:30] chagel: has joined #RubyOnRails
[02:59:02] Uber|Dragon: renegadeandy : I believe that's a devise issue
[02:59:42] DoctorMonocular: has joined #RubyOnRails
[02:59:51] renegadeandy: Uber|Dragon: oh ok, any ideas how to fix?
[03:00:49] Uber|Dragon: renegadeandy : I have never dealt with it directly tbh. I use a cas authentication model due to working with multiple apps for a single org
[03:01:26] uglybandersnatch: has joined #RubyOnRails
[03:03:32] Uber|Dragon: renegadeandy: are you using facebook oauth?
[03:04:21] Uber|Dragon: seems like that is a really old issue actually as I google it
[03:05:46] chagel: has joined #RubyOnRails
[03:05:46] dopamean_: has joined #RubyOnRails
[03:05:46] DoctorMonocular: has joined #RubyOnRails
[03:06:39] DoctorMo_: has joined #RubyOnRails
[03:08:03] jscheel: has joined #RubyOnRails
[03:09:08] maxdoubt: has joined #RubyOnRails
[03:09:22] DmitryBochkarev: has joined #RubyOnRails
[03:11:11] rubyonra_: has joined #RubyOnRails
[03:11:59] DmitryBochkarev: has joined #RubyOnRails
[03:13:18] benlieb: has left #RubyOnRails: ()
[03:14:00] DoctorMonocular: has joined #RubyOnRails
[03:14:19] wkoszek_: has joined #RubyOnRails
[03:14:31] deuxclique: has joined #RubyOnRails
[03:15:12] chouhoulis: has joined #RubyOnRails
[03:15:22] norfumpit: has joined #RubyOnRails
[03:17:29] sleungcy: has joined #RubyOnRails
[03:20:23] smathy: has joined #RubyOnRails
[03:20:29] fedexo: has joined #RubyOnRails
[03:21:12] cydrobolt: has joined #RubyOnRails
[03:21:12] cydrobolt: has joined #RubyOnRails
[03:21:18] FLeiXiuS`: has joined #RubyOnRails
[03:21:27] pwnd_nsfw`: has joined #RubyOnRails
[03:22:00] nertzy2: has joined #RubyOnRails
[03:22:27] Regulati_: has joined #RubyOnRails
[03:22:48] twilling_: has joined #RubyOnRails
[03:22:50] uxp: has joined #RubyOnRails
[03:22:57] DoctorMo_: has joined #RubyOnRails
[03:24:04] havenn: has joined #RubyOnRails
[03:24:39] fn2187___: has joined #RubyOnRails
[03:24:57] Dreamer3_: has joined #RubyOnRails
[03:25:15] DoctorMo_: has joined #RubyOnRails
[03:25:24] ale: has joined #RubyOnRails
[03:25:27] jbermudes_: has joined #RubyOnRails
[03:25:27] jbermudes_: has joined #RubyOnRails
[03:25:30] uglybandersnatc-: has joined #RubyOnRails
[03:25:35] \13k_: has joined #RubyOnRails
[03:25:40] samuelkadolph1: has joined #RubyOnRails
[03:25:40] fourq_: has joined #RubyOnRails
[03:25:43] Kuukunen-: has joined #RubyOnRails
[03:25:45] maxmanders_: has joined #RubyOnRails
[03:25:48] mhenrixon_: has joined #RubyOnRails
[03:25:49] sungji: has joined #RubyOnRails
[03:25:52] Olipro_: has joined #RubyOnRails
[03:25:55] DefV: has joined #RubyOnRails
[03:25:56] queequeg2: has joined #RubyOnRails
[03:25:57] Olipro-: has joined #RubyOnRails
[03:25:59] Prira: has joined #RubyOnRails
[03:25:59] Wobni: has joined #RubyOnRails
[03:26:05] hendrici1s: has joined #RubyOnRails
[03:26:11] raenk_: has joined #RubyOnRails
[03:26:22] Radar_: has joined #RubyOnRails
[03:26:36] BtcBen: has joined #RubyOnRails
[03:26:39] jtdowney: has joined #RubyOnRails
[03:26:39] voker57: has joined #RubyOnRails
[03:26:42] joeytwiddle_: has joined #RubyOnRails
[03:26:42] voker57: has joined #RubyOnRails
[03:26:43] jtdowney: has joined #RubyOnRails
[03:26:44] greenhat-: has joined #RubyOnRails
[03:26:44] funnel_: has joined #RubyOnRails
[03:26:44] Fire-Dragon-DoL: has joined #RubyOnRails
[03:26:46] Isthar_: has joined #RubyOnRails
[03:26:51] thejoecarroll: has joined #RubyOnRails
[03:27:00] smathy: has joined #RubyOnRails
[03:27:01] kp666: has joined #RubyOnRails
[03:27:02] Shidash: has joined #RubyOnRails
[03:27:05] spion_: has joined #RubyOnRails
[03:27:09] coffeejunk: has joined #RubyOnRails
[03:27:29] matthewd: has joined #RubyOnRails
[03:28:01] royvandermeij: has joined #RubyOnRails
[03:28:07] sevenseacat: has joined #RubyOnRails
[03:28:13] uxp: has joined #RubyOnRails
[03:29:05] Pandorian: has joined #RubyOnRails
[03:30:04] spectra: has joined #RubyOnRails
[03:32:03] callumacrae: has joined #RubyOnRails
[03:32:07] xhoy: has joined #RubyOnRails
[03:32:46] davidcelis: has joined #RubyOnRails
[03:32:46] davidcelis: has joined #RubyOnRails
[03:32:56] hightower: has left #RubyOnRails: ()
[03:33:11] Guest123456666: has joined #RubyOnRails
[03:33:23] renegadeandy: Uber|Dragon: yep, facbeook oauth :)
[03:33:23] fluxsource: has joined #RubyOnRails
[03:33:55] Mission-Critical: has joined #RubyOnRails
[03:34:24] pawnbox: has joined #RubyOnRails
[03:35:27] clamstar: has joined #RubyOnRails
[03:36:56] jetpack_joe: has joined #RubyOnRails
[03:37:49] maxdoubt: has joined #RubyOnRails
[03:38:55] deuxcliq_: has joined #RubyOnRails
[03:40:21] sunya7a: has joined #RubyOnRails
[03:41:40] trosborn: has joined #RubyOnRails
[03:45:18] livcd: has joined #RubyOnRails
[03:45:38] renegadeandy: has joined #RubyOnRails
[03:45:49] Rodya_: has joined #RubyOnRails
[03:45:51] makenoise: has joined #RubyOnRails
[03:45:54] douglascorrea: has joined #RubyOnRails
[03:46:26] mclee: has joined #RubyOnRails
[03:47:04] Denarii: has joined #RubyOnRails
[03:52:08] AntiSpamMeta: has joined #RubyOnRails
[03:52:54] epitron: has joined #RubyOnRails
[03:53:10] duncannz: has joined #RubyOnRails
[03:53:26] DmitryBochkarev: has joined #RubyOnRails
[03:53:47] blackmesa: has joined #RubyOnRails
[03:54:01] duncannz: has joined #RubyOnRails
[03:54:33] wethu: has joined #RubyOnRails
[03:55:02] chagel: has joined #RubyOnRails
[03:56:09] bronson: has joined #RubyOnRails
[03:57:29] krz: has joined #RubyOnRails
[03:57:50] Devalo: has joined #RubyOnRails
[03:58:46] smoitra: has joined #RubyOnRails
[04:08:22] baweaver: has joined #RubyOnRails
[04:09:36] pawnbox: has joined #RubyOnRails
[04:10:55] bphogan: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[04:11:46] makenoise: has joined #RubyOnRails
[04:12:30] puff: has joined #RubyOnRails
[04:12:42] crystal77: has joined #RubyOnRails
[04:12:56] crystal77: If I wanted to create a new rails project from scratch, what the de-facto guide on doing so?
[04:13:13] djbkd: has joined #RubyOnRails
[04:13:39] sevenseacat: `rails new my_app_name` ? :)
[04:13:52] sevenseacat: what would the guide cover?
[04:15:07] bphogan: has joined #RubyOnRails
[04:15:22] Cache_Money: has joined #RubyOnRails
[04:15:56] chouhoulis: has joined #RubyOnRails
[04:16:20] duncannz: has joined #RubyOnRails
[04:16:44] braincrash: has joined #RubyOnRails
[04:18:28] Radar_: has left #RubyOnRails: ()
[04:18:45] Radar: has joined #RubyOnRails
[04:19:09] bphogan_afk: has joined #RubyOnRails
[04:19:16] rubyonrailed: has joined #RubyOnRails
[04:20:21] bphogan_afk: has left #RubyOnRails: ()
[04:21:24] dirtibirdi: has joined #RubyOnRails
[04:22:21] hashtd: has joined #RubyOnRails
[04:24:01] y2mq37: has joined #RubyOnRails
[04:25:44] timmmaaaayyy: has joined #RubyOnRails
[04:27:13] dopie: has joined #RubyOnRails
[04:27:58] dnewkerk: slash_nick: turned out the issue with tests running twice in Rails 5 was coming from minitest-rails gem… https://github.com/blowmage/minitest-rails/issues/185#issuecomment-126718418
[04:28:06] dopie: has joined #RubyOnRails
[04:28:31] htmldrum: has joined #RubyOnRails
[04:28:32] dnewkerk: adding the suggested ENV["MT_RAILS_NO_AUTORUN"] = "true" did the trick for now
[04:28:55] timmmaaaayyy: i'm helping a friend with a rails app and on large uploads we get failures. its just a pop up dialog box that says <file> failed to upload. the uploads are going to s3. nginx is proxying to unicorn. i'm not sure which timeouts i should be looking at? are the any prime candidates to look into that anyone can think of?
[04:29:34] slash_nick: dnewkerk: nice :)
[04:29:42] dnewkerk: timmmaaaayyy: how large are the uploads?
[04:29:47] hashtd: has joined #RubyOnRails
[04:29:58] timmmaaaayyy: it just failed on 130MB for me
[04:30:38] Contigi: has joined #RubyOnRails
[04:30:42] dnewkerk: are you uploading to the server and then pushing the file to s3 after?
[04:31:04] timmmaaaayyy: i'm probably going to have to ask the developer that one. i honestly don't know
[04:31:20] Cache_Money: For those using GoogleAnalytics, do you usually disable Turbolinks or keep Turbolinks and find away around it?
[04:33:37] dnewkerk: timmmaaaayyy: yeah there are two common ways (I know of) for uploading, either you’re uploading the file to the server running Rails, and then a background job might push the file to cloud storage like S3, or you can upload directly to S3 using ajax, bypassing sending the file to the Rails server at all
[04:33:49] tomoyuki28jp: has joined #RubyOnRails
[04:34:18] tomoyuki28jp: Is there a direct way to force update counter cache column with specific value?
[04:35:54] tomoyuki28jp: ah, update_column just works fine. thanks.
[04:36:01] timmmaaaayyy: ok so i'm going to say im 99% sure i'm uploading to my server then to AWS. so is there a way to fix this with that being the case?
[04:36:29] makenoise: has joined #RubyOnRails
[04:36:49] timmmaaaayyy: my aws instance only has 78 Mb of free RAM, so that's definitely not very helpful since i assume thats where my upload is being stored during the upload
[04:37:43] crystal77: sevenseacat: use of rbenv, installing gems, knowing new rails 5.0 stuff (I come from rails 2)
[04:37:44] dnewkerk: timmmaaaayyy: are you running on heroku, or something else?
[04:38:10] sevenseacat: crystal77: none of that really relates to 'create a new app from scratch'
[04:39:05] matthewd: crystal77: If you're that far "behind", I'd suggest starting with a relevant book and/or the Getting Started guide
[04:39:45] crystal77: http://guides.rubyonrails.org/getting_started.html
[04:39:48] crystal77: That one? :)
[04:40:04] chagel: has joined #RubyOnRails
[04:40:46] sevenseacat: give it a read
[04:40:46] pawnbox: has joined #RubyOnRails
[04:41:09] DmitryBochkarev: has joined #RubyOnRails
[04:41:29] timmmaaaayyy: dnewkerk: not heroku. it's on our aws instance
[04:41:43] emachnic: has joined #RubyOnRails
[04:43:11] timmmaaaayyy: ok my RAM theory is wrong. i can upload a 90Mb file without issue even though theres only 78Mb free RAM
[04:43:55] dnewkerk: timmmaaaayyy: ok, definitely with heroku that would happen no matter what, though likely the same on your own aws server (a bit less strict but still will happen on large files). For starters here is a SO post that’s probably relevant http://stackoverflow.com/questions/19035817/timeout-error-from-unicorn-while-uploading-a-file
[04:44:39] dnewkerk: essentially you’re running a long single process while the upload is going, and the app server says “nope too long, bye!"
[04:44:53] timmmaaaayyy: thanks dnewkerk! looking into that article now
[04:45:53] dnewkerk: a workaround is to let processes stay alive longer, but that may bite you down the line so probably not a good idea
[04:47:29] timmmaaaayyy: even the timeout seems like a horrible idea
[04:47:49] timmmaaaayyy: we need to make this go striaght to s3
[04:49:32] sneakerhax: has joined #RubyOnRails
[04:50:09] dnewkerk: timmmaaaayyy: yeah there are several upload gems that can help. One newer popular one is https://github.com/refile/refile
[04:50:11] timmmaaaayyy: hmmm. i set my unicorn timeout to 300 and it still errors out on a 105MB file which only takes about 40 second to upload
[04:50:17] makenoise: has joined #RubyOnRails
[04:50:40] timmmaaaayyy: you know anything about https://github.com/mperham/sidekiq?
[04:50:47] pawnbox: has joined #RubyOnRails
[04:51:03] douglascorrea: has joined #RubyOnRails
[04:51:19] dnewkerk: there could be other config options getting in the way… same as back in my php days, there were like 3+ options that had to be set correctly in php.ini in order for moderately large file uploads to work
[04:51:39] timmmaaaayyy: ahhhhh i wasn't sure how that kind of thing works in rails land
[04:52:00] DragonPunch: has joined #RubyOnRails
[04:52:10] timmmaaaayyy: i wish something would spit out an error for me to work with
[04:52:20] timmmaaaayyy: i get absolutely nothing in my logs
[04:53:24] bronson: has joined #RubyOnRails
[04:54:00] djbkd: has joined #RubyOnRails
[04:54:03] dnewkerk: timmmaaaayyy: yep I use sidekiq in my app for background jobs, love it… it’s powerful and might be a bit complex to set up, so if you’re just starting out with background jobs there are a few you may prefer that don’t require setting up Redis. If you write your background jobs with ActiveJob then you can easily switch to sidekiq or whatever when you’re ready
[04:54:43] timmmaaaayyy: with these background jobs, would my timeout issue go away? is that going straight to s3 at that point?
[04:55:31] timmmaaaayyy: if so, i'll tell them they need to implement this now rather than wasting time trying to fix this timeout
[04:55:36] Eswar: has joined #RubyOnRails
[04:55:41] dnewkerk: no, the background job is what would take over pushing the file to s3 “after” your Rails server receives it
[04:56:09] dnewkerk: you still have to get it to the server first, so it’s not really a solution to what you’re experiencing
[04:56:40] dnewkerk: I’d recommend trying refile or another upload helper gem that has direct to s3 capability
[04:56:47] blackmesa: has joined #RubyOnRails
[04:57:04] timmmaaaayyy: thank you very much
[04:57:29] bphogan: has joined #RubyOnRails
[04:58:00] dnewkerk: or there may be gems that can get a “chunked” upload to your server and reassemble the small parts once the upload is done… that’s the only way I’d say you could stick with uploading to the app server first and avoid the timeout issues
[04:58:04] Chagel_: has joined #RubyOnRails
[05:00:14] dnewkerk: also for background jobs, https://github.com/brandonhilkert/sucker_punch is a good option to get your feet wet with before going all out with sidekiq, again using the ActiveJob API to write the jobs so you can switch adapters later
[05:05:41] sp1rs: has joined #RubyOnRails
[05:05:58] timmmaaaayyy: shoot. we already have this gem: s3_direct_upload so i think we're already doing direct to s3
[05:07:26] timmmaaaayyy: ah man. tcpdump confirms it. my upload is going to AWS and not my webserver
[05:07:32] hackerkid: has joined #RubyOnRails
[05:07:36] timmmaaaayyy: so what on earth could be breaking here?
[05:08:12] hackerkid: has left #RubyOnRails: ()
[05:08:52] Arcaire: timmmaaaayyy: what actual error
[05:08:54] rubyman: has joined #RubyOnRails
[05:09:00] Arcaire: you said it's errorring then you said "but i get nothing in my logs"
[05:09:06] Arcaire: there's far too many r's in that "erroring"
[05:09:16] Arcaire: logs logs logslogslogslogs
[05:09:27] timmmaaaayyy: i jsut get a popup that says <filename> failed to upload
[05:09:42] nattyPablo: has joined #RubyOnRails
[05:09:42] Arcaire: What makes you think it's a timeout issue?
[05:10:01] timmmaaaayyy: on the serverside i don't see any indication of an error. i only see it fail when i try uploading something
[05:10:13] timmmaaaayyy: i'm not positive its a timeout issue at all
[05:11:20] Arcaire: Do you get *any* error code at all?
[05:12:29] srinidhi: has joined #RubyOnRails
[05:12:46] shanemcd: has joined #RubyOnRails
[05:12:54] timmmaaaayyy: no error code
[05:13:07] trosborn: has joined #RubyOnRails
[05:13:21] dnewkerk: timmmaaaayyy: open the network pane of your browser’s dev tools, reload the page, and then try the upload… tell what you see
[05:13:33] Uber|Dragon: has left #RubyOnRails: ()
[05:13:36] Arcaire: To clarify, you're uploading a file from your PC, to an nginx proxy backing onto a rails app, and the app is uploading to S3?
[05:13:38] Uber|Dragon: has joined #RubyOnRails
[05:14:16] bmalum: has joined #RubyOnRails
[05:15:40] timmmaaaayyy: haha. you are my hero
[05:15:40] timmmaaaayyy: <Error><Code>EntityTooLarge</Code><Message>Your proposed upload exceeds the maximum allowed size</Message><ProposedSize>104859978</ProposedSize><MaxSizeAllowed>104857600</MaxSizeAllowed><RequestId>5C6C90A8CE78B763</RequestId><HostId>5qw34p+iaX2IQxup9HY7tj14NPTEhQqp9kIdBxSoXJUtWrJq5h62KXam/rdbQ1kU4mkuEsG2uyE=</HostId></Error>
[05:16:09] Arcaire: This is why you should always be producing the error code to the user in dev/test environments
[05:16:39] chouhoulis: has joined #RubyOnRails
[05:17:31] moeabdol: has joined #RubyOnRails
[05:19:28] jetpack_joe: has joined #RubyOnRails
[05:21:36] timmmaaaayyy: is that error coming from s3? s3 says their limit is 5TB
[05:22:04] Megamos: has joined #RubyOnRails
[05:22:16] Contigi: has joined #RubyOnRails
[05:22:26] dubalubdub: has joined #RubyOnRails
[05:22:51] dnewkerk: timmmaaaayyy: it is odd… 5TB limit is for multipart uploads, though I think even non-multipart can do 5GB or something
[05:23:21] dnewkerk: what is the URL of the request?
[05:24:11] Arcaire: but for you, the max size is 100MB
[05:24:18] Arcaire: Why? Not sure.
[05:24:22] Arcaire: <ProposedSize>104859978</ProposedSize><MaxSizeAllowed>104857600</MaxSizeAllowed>
[05:24:58] timmmaaaayyy: http://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html
[05:25:06] Eswar: has joined #RubyOnRails
[05:25:12] timmmaaaayyy: i wonder if thats a hard limit. it sounds kind of like it's just recommended
[05:25:30] Arcaire: It's evidently a hard limit.
[05:25:35] Arcaire: In this case, anywaya.
[05:26:19] dnewkerk: timmmaaaayyy: when you try the upload, in the network pane where you found that error message, what is the URL that got called when you started the upload?
[05:26:20] Arcaire: It probably doesn't help that you have almost no memory, by the way.
[05:26:25] dnewkerk: it should show there in the network pane
[05:26:39] Arcaire: It may well be part of the issue, the maxsizeallowed is roughly the amount of free memory you said you had left.
[05:26:57] Arcaire: yay for chaining apps together
[05:27:05] neshmi: has joined #RubyOnRails
[05:27:27] timmmaaaayyy: the request URL for the post is Request URL:https://s3.amazonaws.com/<mybucket>
[05:28:12] timmmaaaayyy: Arcaire: i did determine that we're going straight to s3, so i don't think the memory is an issue. i'm going to keep looking for a filesize limit, and if i cant find one i'll try the multipart thing
[05:28:26] nickjj_: has joined #RubyOnRails
[05:28:42] timmmaaaayyy: its just annoying becuase amazon suggests you use it rather than saying you have to use it. so that leads me to believe i COULD upload 200Mb without doing multipart. lol
[05:29:19] htmldrum: has joined #RubyOnRails
[05:29:57] Pandorian: has joined #RubyOnRails
[05:30:22] matthewd: You can set a limit in the S3 policy configuration using content-length-range
[05:30:26] pawnbox: has joined #RubyOnRails
[05:30:35] dnewkerk: timmmaaaayyy: you said you’re using this gem already right? https://github.com/waynehoover/s3_direct_upload
[05:30:45] dnewkerk: it has a max_file_size option, so I’d check into that
[05:31:04] timmmaaaayyy: and i verified with tcp dump that during the uploading i'm not hitting my own server at all. so it's definiteily going straight to s3
[05:31:23] timmmaaaayyy: OH! shit. no wonder i can't find it in AWS. thanks!
[05:32:27] machuga: has joined #RubyOnRails
[05:32:47] Arcaire: The default for the form is 500MB I believe, so it may have been set manually.
[05:33:33] dnewkerk: yeah check the view that contains the upload/form and I suspect you may find it says max_file_size: 100.megabytes
[05:33:34] timmmaaaayyy: i owe you many beers!
[05:33:35] timmmaaaayyy: max_file_size: 100.megabytes,
[05:33:41] timmmaaaayyy: all over the place
[05:34:04] timmmaaaayyy: thank you thank you thank you
[05:34:12] dnewkerk: no problemo
[05:34:47] DmitryBochkarev: has joined #RubyOnRails
[05:35:41] dnewkerk: I’ve worked a lot with uploading large files, so always happy to help :D My own custom direct to S3 uploader regularly handles files 300GB+ each
[05:36:05] dnewkerk: (raw HD video files)
[05:36:31] xm: has joined #RubyOnRails
[05:39:19] sypheren: has joined #RubyOnRails
[05:41:20] chagel: has joined #RubyOnRails
[05:43:00] DragonPunch: has joined #RubyOnRails
[05:49:18] Rodya_: has joined #RubyOnRails
[05:51:58] ikarius: has joined #RubyOnRails
[05:54:07] baweaver: has joined #RubyOnRails
[05:56:34] defsdoor: has joined #RubyOnRails
[05:59:23] Devalo: has joined #RubyOnRails
[05:59:50] blackmesa: has joined #RubyOnRails
[06:03:02] techsethi: has joined #RubyOnRails
[06:04:37] fox_mulder_cp: has joined #RubyOnRails
[06:05:08] trosborn: has joined #RubyOnRails
[06:06:38] dionysus69: has joined #RubyOnRails
[06:11:49] techsethi_: has joined #RubyOnRails
[06:12:54] Cache_Money: has joined #RubyOnRails
[06:12:57] moeabdol: has joined #RubyOnRails
[06:13:04] Ropeney: has joined #RubyOnRails
[06:17:53] moeabdol: has joined #RubyOnRails
[06:18:33] kirillzh: has joined #RubyOnRails
[06:19:06] chouhoulis: has joined #RubyOnRails
[06:20:05] rvanlieshout: has joined #RubyOnRails
[06:20:58] tjbiddle: has joined #RubyOnRails
[06:21:20] tjbiddle: Could someone take a look at this? For some reason my model is getting prefixed with another module. https://gist.github.com/thomasbiddle/71f3fee90d17f113cba2
[06:22:38] rvanlieshout: so use ::Company
[06:22:51] tjbiddle: rvanlieshout: Seems like a hacky work around. I'd like to understand what's happening
[06:23:26] rvanlieshout: your clatt itself is in Api::Company
[06:23:51] rvanlieshout: so Company refers to the module named Company of your controller
[06:23:55] tjbiddle: rvanlieshout: I have other controllers with a very similar setup where this doesn't happen
[06:24:03] rvanlieshout: also in Company?
[06:25:16] tjbiddle: Okay, I get what you're saying
[06:25:21] Devalo: has joined #RubyOnRails
[06:31:37] elmhouse: has joined #RubyOnRails
[06:31:39] chagel: has joined #RubyOnRails
[06:32:21] kies^: has joined #RubyOnRails
[06:36:39] srinidhi: has joined #RubyOnRails
[06:39:17] norc: has joined #RubyOnRails
[06:39:30] whyldfire: has joined #RubyOnRails
[06:43:24] bronson: has joined #RubyOnRails
[06:43:28] blindsight: has joined #RubyOnRails
[06:43:58] arup_r: has joined #RubyOnRails
[06:44:32] arup_r: Hey there, I am back. Sorry for the late. :p
[06:44:34] sevenseacat: has joined #RubyOnRails
[06:46:54] Eswar: has joined #RubyOnRails
[06:47:58] arup_r: hi whyldfire...
[06:50:25] whyldfire: I have a project management app, where user has many projects & project has many tasks. I want the user to auto generate tasks based on the category selected. How do i go about it?
[06:50:41] rvanlieshout: you'll need a project
[06:51:12] alex88: has joined #RubyOnRails
[06:51:38] whyldfire: can elaborate?
[06:51:38] arup_r: whyldfire: what is category, btw ?
[06:51:56] rvanlieshout: there is no direct relationship between a user and a task
[06:52:07] rvanlieshout: so if you want to create a task for the user, you'll need to find a path to it
[06:52:13] whyldfire: the type of project, project can be of different types
[06:52:43] moeabdol: has joined #RubyOnRails
[06:53:04] whyldfire: http://vodd.in/ this is the app
[06:53:13] douglascorrea: has joined #RubyOnRails
[06:53:42] intrigueD: has joined #RubyOnRails
[06:55:21] whyldfire: To rephrase: I want the admin to generate the tasks based on category. I have setup authentication, authorisation and admin user
[06:56:20] rvanlieshout: and you still need a project
[06:56:30] rvanlieshout: that's by your database design
[06:56:48] codesoda: has joined #RubyOnRails
[06:57:08] quazimodo: has joined #RubyOnRails
[06:57:27] whyldfire: I have the project resource
[06:57:39] whyldfire: tasks belongs to project
[06:58:33] rvanlieshout: project.tasks.create?
[06:58:37] rvanlieshout: need to go. back this afternoon
[06:59:04] whyldfire: sure. thank you
[06:59:27] Irikos: has joined #RubyOnRails
[07:00:46] rubyonrailed: has joined #RubyOnRails
[07:01:39] zave: has joined #RubyOnRails
[07:02:07] ensyde_: has joined #RubyOnRails
[07:04:50] blackmesa: has joined #RubyOnRails
[07:04:52] jstransky: has joined #RubyOnRails
[07:06:23] tambet: has joined #RubyOnRails
[07:06:33] wethu: has joined #RubyOnRails
[07:07:04] tambet: has left #RubyOnRails: ()
[07:07:27] tambet: has joined #RubyOnRails
[07:07:35] _bogus_: has joined #RubyOnRails
[07:08:10] tambet: has left #RubyOnRails: ()
[07:08:21] tambet: has joined #RubyOnRails
[07:10:52] Eswar: has joined #RubyOnRails
[07:11:35] pawnbox: has joined #RubyOnRails
[07:12:31] chipotle: has joined #RubyOnRails
[07:13:56] scepticulous: has joined #RubyOnRails
[07:16:47] ikarius: has joined #RubyOnRails
[07:17:10] bronson: has joined #RubyOnRails
[07:17:31] Pazician: has joined #RubyOnRails
[07:17:40] trosborn: has joined #RubyOnRails
[07:17:59] tvw: has joined #RubyOnRails
[07:18:41] JohnBat26: has joined #RubyOnRails
[07:19:52] chouhoulis: has joined #RubyOnRails
[07:20:03] trosborn: has joined #RubyOnRails
[07:20:47] trosborn: has joined #RubyOnRails
[07:24:38] sp1rs: has joined #RubyOnRails
[07:24:55] tjbiddle: has joined #RubyOnRails
[07:26:48] DoctorMonocular: has joined #RubyOnRails
[07:31:06] Pandorian: has joined #RubyOnRails
[07:31:18] htmldrum: has joined #RubyOnRails
[07:34:26] sp1rs: has joined #RubyOnRails
[07:36:03] voker57: has joined #RubyOnRails
[07:36:03] voker57: has joined #RubyOnRails
[07:36:06] darutoko: has joined #RubyOnRails
[07:40:07] czerasz: has joined #RubyOnRails
[07:40:53] arup_r: has joined #RubyOnRails
[07:43:36] jenrzzz: has joined #RubyOnRails
[07:49:29] ferr: has joined #RubyOnRails
[07:52:12] emachnic: has joined #RubyOnRails
[07:52:46] comrad: has joined #RubyOnRails
[07:57:02] Spami: has joined #RubyOnRails
[08:00:40] mfaeh: has joined #RubyOnRails
[08:01:01] Palsson: has joined #RubyOnRails
[08:01:03] pawnbox: has joined #RubyOnRails
[08:01:20] defsdoor: has joined #RubyOnRails
[08:04:38] uglybandersnatch: has joined #RubyOnRails
[08:04:59] PC-K_: has joined #RubyOnRails
[08:07:04] baweaver: has joined #RubyOnRails
[08:07:50] blackmesa: has joined #RubyOnRails
[08:08:31] Bloomer: has joined #RubyOnRails
[08:12:12] msyvich: has joined #RubyOnRails
[08:17:41] Megamos: has joined #RubyOnRails
[08:19:42] PC-K_: has joined #RubyOnRails
[08:19:52] antgel: has joined #RubyOnRails
[08:20:37] chouhoulis: has joined #RubyOnRails
[08:21:30] emilkarl: has joined #RubyOnRails
[08:22:40] banister: has joined #RubyOnRails
[08:22:51] djbkd_: has joined #RubyOnRails
[08:23:11] artto: has joined #RubyOnRails
[08:23:15] sp1rs: has joined #RubyOnRails
[08:23:16] Mr-Done: has joined #RubyOnRails
[08:24:14] DmitryBochkarev: has joined #RubyOnRails
[08:27:19] tambet: has joined #RubyOnRails
[08:28:17] Olipro: has joined #RubyOnRails
[08:30:37] yxejamir: has joined #RubyOnRails
[08:30:50] errakeshpd: has joined #RubyOnRails
[08:31:30] grn: has joined #RubyOnRails
[08:32:38] emilkarl: has joined #RubyOnRails
[08:32:46] Mr-Done: has joined #RubyOnRails
[08:33:00] pawnbox: has joined #RubyOnRails
[08:33:24] artto: has joined #RubyOnRails
[08:35:36] errakeshpd: Got a new requirement from a client,
[08:35:36] errakeshpd: There are many modules, all modules is consider as separate services.
[08:35:36] errakeshpd: all should communicate together. How to architect this ?
[08:36:01] errakeshpd: seems like separate instances.
[08:36:12] gousuto: has joined #RubyOnRails
[08:37:23] errakeshpd: what way should follow
[08:38:48] qejk: has joined #RubyOnRails
[08:39:02] JulienITARD: has joined #RubyOnRails
[08:39:13] dalbuschat: has joined #RubyOnRails
[08:39:45] ikarius: has joined #RubyOnRails
[08:40:10] ur5us: has joined #RubyOnRails
[08:41:54] n008f4g_: has joined #RubyOnRails
[08:47:43] msyvich: has joined #RubyOnRails
[08:48:50] herpless: has joined #RubyOnRails
[08:49:36] djbkd: has joined #RubyOnRails
[08:50:05] jeanlinux: has joined #RubyOnRails
[08:50:28] chagel: has joined #RubyOnRails
[08:55:01] srinidhi: has joined #RubyOnRails
[08:55:09] douglascorrea: has joined #RubyOnRails
[08:57:09] smoitra: has joined #RubyOnRails
[09:02:23] jsrn: has joined #RubyOnRails
[09:02:44] rubyonrailed: has joined #RubyOnRails
[09:04:44] mfaeh: has joined #RubyOnRails
[09:06:50] mdw: has joined #RubyOnRails
[09:07:07] hayden_: has joined #RubyOnRails
[09:07:34] emachnic: has joined #RubyOnRails
[09:09:09] antgel: has joined #RubyOnRails
[09:09:37] blackmesa: has joined #RubyOnRails
[09:12:40] techsethi: has joined #RubyOnRails
[09:13:50] ayoros: has joined #RubyOnRails
[09:15:42] msyvich: has joined #RubyOnRails
[09:18:12] htmldrum: has joined #RubyOnRails
[09:18:32] jstransky: has joined #RubyOnRails
[09:20:37] yxejamir: has joined #RubyOnRails
[09:20:59] sp1rs: has joined #RubyOnRails
[09:21:07] arup_r: has joined #RubyOnRails
[09:21:19] chouhoulis: has joined #RubyOnRails
[09:22:29] chagel: has joined #RubyOnRails
[09:22:43] bronson: has joined #RubyOnRails
[09:23:12] htmldrum_: has joined #RubyOnRails
[09:23:56] mark2: has joined #RubyOnRails
[09:28:36] Devalo: has joined #RubyOnRails
[09:28:52] syf-revk: has joined #RubyOnRails
[09:29:03] bronson: has joined #RubyOnRails
[09:29:23] zz_timnovinger: has joined #RubyOnRails
[09:29:41] blackmesa: has joined #RubyOnRails
[09:30:26] Pandorian: has joined #RubyOnRails
[09:30:42] dopie: is using begin rescue end ok for control flow?
[09:33:10] snowy: has joined #RubyOnRails
[09:33:28] Bloomer: has joined #RubyOnRails
[09:33:30] nettoweb: has joined #RubyOnRails
[09:34:49] futilegames: has joined #RubyOnRails
[09:37:12] srinidhi: has joined #RubyOnRails
[09:38:05] defsdoor: has joined #RubyOnRails
[09:39:44] sandstrom: has joined #RubyOnRails
[09:41:38] Bloomer: has joined #RubyOnRails
[09:43:40] sp1rs: has joined #RubyOnRails
[09:45:06] ErhardtMundt: has joined #RubyOnRails
[09:45:10] sandstrom: has joined #RubyOnRails
[09:45:51] RTG`: dopie: Check throw/catch
[09:46:41] marr: has joined #RubyOnRails
[09:47:29] konsolebox: has joined #RubyOnRails
[09:47:58] sandstrom: has joined #RubyOnRails
[09:48:06] arBmind: has joined #RubyOnRails
[09:49:00] sp1rs: has joined #RubyOnRails
[09:49:06] rodfersou: has joined #RubyOnRails
[09:49:20] ql6wlld: has joined #RubyOnRails
[09:50:07] sandstrom: has joined #RubyOnRails
[09:50:34] mrbubbles: has joined #RubyOnRails
[09:50:56] Bloomer: has joined #RubyOnRails
[09:51:06] levifig: has joined #RubyOnRails
[09:52:34] jeanlinux: has joined #RubyOnRails
[09:52:57] tambet: has joined #RubyOnRails
[09:53:03] FooMunki: has joined #RubyOnRails
[09:56:18] sandstrom: has joined #RubyOnRails
[09:57:23] AzaToth: has joined #RubyOnRails
[09:57:43] mfaeh: has joined #RubyOnRails
[09:57:45] pawnbox: has joined #RubyOnRails
[09:58:07] FooMunki: has joined #RubyOnRails
[09:59:35] trosborn: has joined #RubyOnRails
[10:01:20] dopie: https://gist.github.com/staycreativedesign/12eca03b664685a49573
[10:01:33] dopie: so i would use the throw/catch combo instead?
[10:01:49] dopie: NoMethodError: undefined method `is_approved' for nil:NilClass
[10:01:50] dopie: from /Users/mindblownkaboom/Projects/gwhite/app/models/user.rb:72:in `block (2 levels) in check_all_steps'
[10:04:22] wethu: has joined #RubyOnRails
[10:04:51] livcd: has joined #RubyOnRails
[10:06:16] emachnic: has joined #RubyOnRails
[10:08:29] douglascorrea: has joined #RubyOnRails
[10:14:44] hamed_r: has joined #RubyOnRails
[10:15:35] nerium: has joined #RubyOnRails
[10:16:59] mfaeh: has joined #RubyOnRails
[10:17:45] gregf: has joined #RubyOnRails
[10:19:02] uglybandersnatch: has joined #RubyOnRails
[10:19:35] dev-mrp: has joined #RubyOnRails
[10:19:44] Bloomer: has joined #RubyOnRails
[10:20:05] gregf: has joined #RubyOnRails
[10:21:13] pawnbox: has joined #RubyOnRails
[10:22:06] chouhoulis: has joined #RubyOnRails
[10:22:39] dev-mrp: has joined #RubyOnRails
[10:26:01] dirtibirdi: has joined #RubyOnRails
[10:27:22] jeanlinux: has joined #RubyOnRails
[10:30:31] leksster: has joined #RubyOnRails
[10:31:40] cassioscabral: has joined #RubyOnRails
[10:32:20] trosborn: has joined #RubyOnRails
[10:32:35] arup_r: has joined #RubyOnRails
[10:33:24] Ergo: has joined #RubyOnRails
[10:33:36] errakeshpd: <dopie> 'self.send(doc)' is nil
[10:34:17] Snowy_: has joined #RubyOnRails
[10:35:54] defsdoor: has joined #RubyOnRails
[10:38:12] tambet: has joined #RubyOnRails
[10:38:40] jeanlinux: has joined #RubyOnRails
[10:40:46] bronson: has joined #RubyOnRails
[10:41:01] snowy: has joined #RubyOnRails
[10:42:05] sevenseacat: do not use exceptions for control flow.
[10:42:14] sevenseacat: write sensible defensive code.
[10:42:18] Rodya_: has joined #RubyOnRails
[10:42:24] sevenseacat: exceptions are for exceptional and unexpected circumstances.
[10:44:10] artto: has joined #RubyOnRails
[10:48:33] pawnbox: has joined #RubyOnRails
[10:49:12] Detch: has joined #RubyOnRails
[10:50:27] chagel: has joined #RubyOnRails
[10:51:27] pavan__: has joined #RubyOnRails
[10:51:34] wethu: has joined #RubyOnRails
[10:52:25] blackmesa: has joined #RubyOnRails
[10:53:35] barajasfab: has joined #RubyOnRails
[10:54:37] Eswar: has joined #RubyOnRails
[10:54:54] pawnbox: has joined #RubyOnRails
[10:56:30] quazimodo: has joined #RubyOnRails
[10:58:09] chagel: has joined #RubyOnRails
[10:58:30] cassioscabral: has joined #RubyOnRails
[10:59:10] pawnbox: has joined #RubyOnRails
[11:00:48] pawnbox: has joined #RubyOnRails
[11:02:24] cassioscabral: has joined #RubyOnRails
[11:04:11] rubyonrailed: has joined #RubyOnRails
[11:04:20] trinaldi: has joined #RubyOnRails
[11:04:34] matthias_: has joined #RubyOnRails
[11:05:07] DEA7TH: has joined #RubyOnRails
[11:06:50] Tempesta: has joined #RubyOnRails
[11:07:14] vedu_: has left #RubyOnRails: ()
[11:07:36] vedu: has joined #RubyOnRails
[11:09:25] Irikos: has joined #RubyOnRails
[11:11:53] chagel: has joined #RubyOnRails
[11:12:27] n008f4g_: has joined #RubyOnRails
[11:14:26] arup_r1: has joined #RubyOnRails
[11:22:49] chouhoulis: has joined #RubyOnRails
[11:23:35] dionysus69: has joined #RubyOnRails
[11:23:56] blackmesa: Hi all. In an association, how can I say a 'Contract' has one 'Contract Partner' ? 'has_one' is just plain stupid to use for this
[11:24:37] blackmesa: I mean I have to put 'has_one' into ContractPartner, because Contract has the foreign key.
[11:24:49] blackmesa: the 'has_one' has never made sense to me
[11:25:10] hello9: has joined #RubyOnRails
[11:25:38] hello9: is it bad practice to use nested resources for a has_one relationship?
[11:26:11] hello9: it seems weird having the child's id in the url on the show/edit paths
[11:27:57] mfaeh: has joined #RubyOnRails
[11:30:20] matthewd: blackmesa: Sounds like you're looking for belongs_to
[11:30:57] Pandorian: has joined #RubyOnRails
[11:32:34] blackmesa: matthewd: hey. yes ContractPartner 'belongs_to' Contract. but then I cant use '@contract.contract_partner'
[11:33:29] matthewd: > Contract has the foreign key
[11:33:42] blackmesa: I know if you use 'has_one' it assumes the foreign key in the other Model. But I want to treat it as 'Contract has one ContractPartner' not 'ContractPartner has one Contract'
[11:33:46] matthewd: One side had the foreign key. That's the belongs_to. The other side doesn't. That's the has_one.
[11:34:48] chipotle: has joined #RubyOnRails
[11:34:50] blackmesa: matthewd: undefined method `contract_partner'
[11:35:47] errakeshpd: I am checking this resource http://blog.carbonfive.com/2014/05/29/an-incremental-migration-from-rails-monolithic-to-microservices/ under 'Step Three: Independently-Deployable Microservices' title mentioned like 'single Heroku application into several, independently-deployable Heroku applications.' what actual it means (separate rails application)?
[11:35:58] blackmesa: matthewd: Contract has_one :contract_partner leads to 'ERROR: column contract_partners.contract_id does not exist'
[11:36:22] matthewd: So contracts.contract_parter_id exists?
[11:36:57] blackmesa: matthewd: t.integer "contract_partner_id"
[11:37:01] blackmesa: exists on Contract
[11:37:20] matthewd: class Contract; belongs_to :contract_partner; class ContractPartner; has_one :contract
[11:39:02] blackmesa: matthewd: yes that works. I had it like this once. But when I read this it doesnt sound right
[11:39:14] blackmesa: I guess thats the way then
[11:39:31] matthewd: Yeah, I'm gonna go with Works > Sounds right
[11:40:55] blackmesa: From the guides there is an example: Supplier has_one Account. Sounds reasonable
[11:41:00] blackmesa: not Account has_one supplier
[11:41:28] blackmesa: so in my case Contract has_one ContractPartner should be it ;/
[11:41:45] matthewd: Then your FK is on the wrong table
[11:42:39] blackmesa: matthewd: thanks for your help! will go with it then ;D
[11:42:39] jeanlinux: has joined #RubyOnRails
[11:42:56] bronson: has joined #RubyOnRails
[11:44:03] Sephyros: has joined #RubyOnRails
[11:44:20] matthewd: No worries :)
[11:45:39] errakeshpd: any one have idea in building independent micro service based app ? please help me to understand the real architecture in building app. Please find the above question I askeed.
[11:47:17] FooMunki: has joined #RubyOnRails
[11:47:26] sp1rs: has joined #RubyOnRails
[11:50:12] bensarz: has joined #RubyOnRails
[11:51:53] arup_r: has joined #RubyOnRails
[11:52:26] srinidhi: has joined #RubyOnRails
[11:59:38] krz: has joined #RubyOnRails
[12:00:29] jeanlinux: has joined #RubyOnRails
[12:02:13] ldnunes: has joined #RubyOnRails
[12:04:36] Eswar: has joined #RubyOnRails
[12:04:59] rubyonrailed: has joined #RubyOnRails
[12:07:28] flip_digits: has joined #RubyOnRails
[12:11:27] anagha_: has joined #RubyOnRails
[12:11:42] kies: has joined #RubyOnRails
[12:12:42] blackmesa: has joined #RubyOnRails
[12:13:33] hello9: is it bad practice to use nested resources for a has_one relationship?
[12:13:35] msyvich: has joined #RubyOnRails
[12:15:19] shwoodard____: has joined #RubyOnRails
[12:16:18] nerium: has joined #RubyOnRails
[12:19:30] AntiSpamMeta: has joined #RubyOnRails
[12:23:37] chouhoulis: has joined #RubyOnRails
[12:23:50] tambet: has joined #RubyOnRails
[12:27:23] pipework: hello9: I don't even understand why that might even possibly be a thing.
[12:27:51] hello9: pipework, theres this has_many, but it seems like it's rarely more than one
[12:28:04] hello9: so when routing it i figured i might as well nest it, but now im thinking thats overkill
[12:28:09] pipework: hello9: What does it have to do with it though?
[12:28:29] hello9: you mean the objects, or the relationship vs the routing?
[12:28:54] pipework: I mean, at the end of the day you get http endpoint(s) and you can handle payloads (of varying sorts). On the rails end, if you need/want/desire separate models that can accept nested attributes for each other, that's exactly the feature inside rails.
[12:29:01] pipework: It's not a 'anti-pattern' feature.
[12:29:13] Devalo: has joined #RubyOnRails
[12:30:06] hello9: there are 'some' actions that are updating the parent, and almost all have the parent as a parma
[12:30:29] sandstrom: has joined #RubyOnRails
[12:35:55] jeanlinux: has joined #RubyOnRails
[12:39:32] msyvich: has joined #RubyOnRails
[12:39:50] openstruct: has joined #RubyOnRails
[12:40:54] openstruct: has joined #RubyOnRails
[12:43:15] pawnbox: has joined #RubyOnRails
[12:45:34] Rodya_: has joined #RubyOnRails
[12:47:10] Pazician: has joined #RubyOnRails
[12:49:53] artto: has joined #RubyOnRails
[12:53:06] dirtibirdi: has joined #RubyOnRails
[12:53:42] tambet: has joined #RubyOnRails
[12:54:24] allcentury: has joined #RubyOnRails
[12:56:27] flip_digits: has joined #RubyOnRails
[12:59:48] adac: has joined #RubyOnRails
[13:00:49] adac: Can I somehow turn off that "rake assets:precompile" does call the database? I
[13:01:16] adac: I think this makes not much sense at all, or is there a reason why this is happening?
[13:03:45] adac: it seems in rails 3.x there was:
[13:03:48] adac: config.assets.initialize_on_precompile = false
[13:03:58] adac: but with Rails 4.x there is no such thing anymore
[13:05:40] rubyonrailed: has joined #RubyOnRails
[13:06:29] Guest34101: has joined #RubyOnRails
[13:06:40] makenoise: has joined #RubyOnRails
[13:07:00] arup_r: adac: never know the fact that asset precompile makes DB call. How do you notice it ?
[13:08:28] pawnbox: has joined #RubyOnRails
[13:09:01] jeanlinux: has joined #RubyOnRails
[13:09:14] mercwithamouth: has joined #RubyOnRails
[13:09:33] mercwithamouth: can someone point me in the right direction for override devise's registration controller
[13:10:09] mercwithamouth: hmm...fail. nevermind. i thought i pushed it to git before leaving home. i'll show the code later
[13:10:53] arup_r: mercwithamouth: They have a nice wiki for the same.. You can check that out..
[13:11:02] adac: arup_r, actually since I introduced docker containers. So then the postgres server is a own docker container. And if this container is not up, well uhmmm .... no assets ;)
[13:11:34] arup_r: ACTION one day wants to use docker too
[13:11:50] BradenBraden: has joined #RubyOnRails
[13:12:04] adac: arup_r, you should. I don't think I have seen something more powerful in the last years
[13:12:12] adac: well there was rails, but still :P
[13:12:57] rickmasta: has joined #RubyOnRails
[13:14:08] BradenBraden: hows it hanging?
[13:14:24] myntcake: has joined #RubyOnRails
[13:14:42] virtusplow_: has joined #RubyOnRails
[13:19:20] chagel: has joined #RubyOnRails
[13:23:05] IrishGringo: has joined #RubyOnRails
[13:24:09] blackmesa: has joined #RubyOnRails
[13:24:15] djbkd: has joined #RubyOnRails
[13:24:21] chouhoulis: has joined #RubyOnRails
[13:24:26] ayoros: has joined #RubyOnRails
[13:27:07] tvw: has joined #RubyOnRails
[13:29:34] Pandorian: has joined #RubyOnRails
[13:30:26] msyvich: has joined #RubyOnRails
[13:31:54] jeanlinux: has joined #RubyOnRails
[13:37:52] pvertenten: has joined #RubyOnRails
[13:38:48] pawnbox: has joined #RubyOnRails
[13:38:56] myntcake: has joined #RubyOnRails
[13:40:22] arup_r: in my app, I save all created_at and updated_at in UTC zone, but while displaying them to views, I want to show them in their local time zone.. I used .in_time_zone, but the result is still same. https://gist.github.com/aruprakshit/9a7070096b9de23ba835 .. How to fix it while viewing ?
[13:40:56] mfaeh: has joined #RubyOnRails
[13:40:56] bobol: has joined #RubyOnRails
[13:41:49] BradenBraden: imo you are asking the server for its timezone. that wont change based on where the user is
[13:42:06] rzsd: has joined #RubyOnRails
[13:42:14] bronson: has joined #RubyOnRails
[13:42:32] BradenBraden: you'd prob need some JS magic to change that
[13:43:13] rzsd: I am using nginx and passenger to deploy my rails 4 app. In my config/environments/staging.rb i have defined some confifg variables like config.x = value. Now when i try to read these values like Rails.configuration.x, i get undefined method
[13:43:23] Jasaka: has joined #RubyOnRails
[13:43:31] rzsd: i think my app is running under the correct environment, which is staging
[13:43:57] adre: has joined #RubyOnRails
[13:45:04] jeanlinux: has joined #RubyOnRails
[13:45:08] rzsd: i even tried doing Rails.configuration.inspect and the variables dont show up there
[13:45:59] arup_r: BradenBraden: yes, that is exactly people are saying http://stackoverflow.com/a/16207833/2767755 . thanks :D
[13:46:37] rzsd: what could be the issue ?
[13:49:56] konsolebox: has joined #RubyOnRails
[13:54:17] makenoise: has joined #RubyOnRails
[13:54:27] sp1rs: has joined #RubyOnRails
[13:54:57] adre: has joined #RubyOnRails
[13:57:30] ramortegui: has joined #RubyOnRails
[13:58:39] IrishGringo: has joined #RubyOnRails
[14:00:44] BradenBraden: im working on a little example project which aims to completely decouple a rails project from any frontend or backend (db) using various patterns which Uncle Bob talks about. The whole Clean Architecture thing.
[14:01:07] BradenBraden: i have gotten some progress done. but its getting tough now when trying to deal with associations.
[14:01:31] msyvich: has joined #RubyOnRails
[14:01:50] dopamean_: has joined #RubyOnRails
[14:02:08] BradenBraden: i have custom Entity objects which represent the data for the datasource, custom Validators, Repositories (using the Repository Pattern mostly here), UseCases etc
[14:02:09] tambet_: has joined #RubyOnRails
[14:03:14] anagha_: has joined #RubyOnRails
[14:03:21] timmmaaaayyy: can anyone help me figure out why i can't start my rails app with just 'service unicorn-dev start'? i get this: https://gist.github.com/kornface13/8d8c3afa10c66d77a3c8
[14:03:38] BradenBraden: anyone interested in taking a look at the project as it is so far? (still got a long way to go) https://github.com/brazenbraden/twitter-repository-example
[14:03:46] gregf: has joined #RubyOnRails
[14:05:20] atomical: has joined #RubyOnRails
[14:05:37] mcr-credil: has joined #RubyOnRails
[14:06:26] rubyonrailed: has joined #RubyOnRails
[14:06:48] BradenBraden: timmmaaaayyy, looks like unicorn gem isnt installed in your working environment
[14:06:50] allcentury: has joined #RubyOnRails
[14:07:26] shanemcd: has joined #RubyOnRails
[14:07:39] timmmaaaayyy: how would i go about fixing that? i also can't restart unicorn via a cron job due to a similar error, so maybe fixing that will fix all my issues
[14:07:42] BradenBraden: why are you starting unicorn like that anyway?
[14:08:00] BradenBraden: cd into the directory where the project is and run something along the lines of
[14:08:00] BradenBraden: unicorn -c /app/config/unicorn.rb -p 3000 -E development
[14:08:05] shanemcd: has joined #RubyOnRails
[14:08:55] timmmaaaayyy: i don't know. :) i just wanted it to be a service like every normal app
[14:09:05] timmmaaaayyy: so i could start/stop/restart
[14:09:15] timmmaaaayyy: how do oyu stop unicorn using your example?
[14:09:40] BradenBraden: timmmaaaayyy, you should take a look at the "god" gem. its been a life safer for me (and you can use those commands with it too)
[14:10:37] BradenBraden: timmmaaaayyy, i dont restart unicorn lol. if something goes wrong, i let god look after it :P
[14:10:45] drbayer: has joined #RubyOnRails
[14:10:51] workmad3: has joined #RubyOnRails
[14:11:10] timmmaaaayyy: :P you must have more faith than i
[14:11:18] havenwood: timmmaaaayyy: http://www.mikeperham.com/2014/09/22/dont-daemonize-your-daemons/
[14:11:19] BradenBraden: timmmaaaayyy, https://gist.github.com/brazenbraden/f278739009d304b71016
[14:12:46] hamed_r: has joined #RubyOnRails
[14:13:16] sp1rs: has joined #RubyOnRails
[14:13:47] bmalum: has joined #RubyOnRails
[14:14:06] timmmaaaayyy: havenwood: i thought i was doing it correctly with this script: https://gist.github.com/kornface13/07ca58af92dd06f6e4a1
[14:14:12] havenwood: BradenBraden: I got some really odd looks at a restaurant a while back when I was saying a little too loud "I know if we kill a Unicorn, God will bring it back, but I'd like to kill *all the unicorns* after lunch to make sure." My coworker responded something about how he prefers Bluepill to my God. Vey strange looks from the table nearby.
[14:15:01] BradenBraden: you gotta love gem names
[14:16:12] dirtibirdi: has joined #RubyOnRails
[14:18:07] DenysLins: has joined #RubyOnRails
[14:19:11] DenysLins: has left #RubyOnRails: ()
[14:19:15] aegis3121: has joined #RubyOnRails
[14:19:19] msyvich: has joined #RubyOnRails
[14:19:36] rafaelfranca: has joined #RubyOnRails
[14:19:56] Rodya_: has joined #RubyOnRails
[14:22:25] flashpoint9: has joined #RubyOnRails
[14:24:03] emachnic: has joined #RubyOnRails
[14:24:15] emachnic: has joined #RubyOnRails
[14:25:04] chouhoulis: has joined #RubyOnRails
[14:26:21] rdavila: has joined #RubyOnRails
[14:26:50] mikecmpbll: has joined #RubyOnRails
[14:30:25] User458764: has joined #RubyOnRails
[14:30:30] ddv: God is just a stupid name for a gem
[14:31:27] msyvich: has joined #RubyOnRails
[14:31:41] syf-revk: has joined #RubyOnRails
[14:32:00] BradenBraden: why? its brings life to things, and when they die, it resurrects them.
[14:32:03] nocontrol: has joined #RubyOnRails
[14:32:29] Guest34101: has joined #RubyOnRails
[14:32:54] bmalum: has joined #RubyOnRails
[14:33:20] adac: Goddess would be nice name :D
[14:34:00] ddv: FactoryGirl
[14:34:06] BradenBraden: goddess implies female. what happens when a female tries to do something as simple as reverse park? xD
[14:34:15] BradenBraden: factorygirl is taken
[14:34:40] ddv: lucky sevenseacat is not here
[14:35:12] BradenBraden: not saying all, just thats the stereotype :P
[14:35:29] BradenBraden: Overseer would be a good alternative
[14:36:04] ddv: why not using something like systemd
[14:36:15] BradenBraden: cos that would just be confusing
[14:36:19] nocontrol: can I scaffold a test with a rails generator after creating a model/controller ?
[14:36:21] nocontrol: just to create a file/folder with the basics to begin with
[14:36:22] mikecmpbll: (to using systemd)
[14:37:21] msyvich: has joined #RubyOnRails
[14:37:57] BradenBraden: nocontrol, it should ignore the files if they already exist
[14:38:18] norc: nocontrol: There should not be any basics. Write the tests yourself.
[14:38:20] nocontrol: BradenBraden: I am going from RSpec to MiniTest actually
[14:38:30] nocontrol: just a tree to begin with
[14:38:38] BradenBraden: oh wait, missed the word "test" lol
[14:38:40] norc: There is nothing to be gained from automatically generated tests.
[14:41:13] DragonPunch: has joined #RubyOnRails
[14:44:00] hayden_: has joined #RubyOnRails
[14:44:38] jscheel: has joined #RubyOnRails
[14:44:46] voker57: has joined #RubyOnRails
[14:44:46] voker57: has joined #RubyOnRails
[14:45:35] ferr: I need update model values before it is presented to the user, how would I do that with active record?
[14:45:53] bmalum: has joined #RubyOnRails
[14:46:00] ikarius: has joined #RubyOnRails
[14:46:15] IrishGringo: has joined #RubyOnRails
[14:47:25] BradenBraden: ferr, you can manipulate them in your controller (not very good) or you can use a decorator
[14:48:49] msyvich: has joined #RubyOnRails
[14:49:09] jeanlinux: has joined #RubyOnRails
[14:50:02] sandstrom: has joined #RubyOnRails
[14:50:20] adavia: has joined #RubyOnRails
[14:51:55] ferr: I tried after_initialize method
[14:52:03] ferr: But this does not work if I call it through association
[14:52:41] polishdub: has joined #RubyOnRails
[14:52:46] BradenBraden: throw us a gist?
[14:52:58] nfk: has joined #RubyOnRails
[14:53:50] Dbugger: has joined #RubyOnRails
[14:53:54] Dbugger: good morning everyone
[14:54:14] Dbugger: I was looking though the Rails source code for fun, and I saw something that caught my eye: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/attribute.rb#L138
[14:54:43] Dbugger: That is class that inherits from "Attribute" and yet lives inside the class Attribute. Is that even possible??
[14:55:06] Dbugger: Well, of course it is possible... It is there, but isnt that weird?
[14:56:46] ferr: BradenBraden: https://gist.github.com/Fercell/30c08ff770357317e608
[14:56:55] ferr: I've attached the rails c commands as wel
[14:56:57] brendan-: has joined #RubyOnRails
[14:58:29] BradenBraden: ferr, so this is meant to be used when retrieving a record?
[14:59:06] ferr: Because accessing record directly retrieves good information, but doing it through association, does not
[14:59:40] drbayer: has joined #RubyOnRails
[14:59:56] BradenBraden: ferr, would 'after_find' be more appropriate?
[15:00:11] ferr: Let me check
[15:00:40] Uber|Dragon: has joined #RubyOnRails
[15:01:19] ferr: Nop, it does not work
[15:02:46] BradenBraden: dunno.. could it be a problem with lazy loading?
[15:02:47] public_class: has joined #RubyOnRails
[15:03:20] ferr: What do you mean? I'm accessing these records on rails console
[15:04:28] BradenBraden: honestly i cant make heads or tails of your query lol
[15:05:17] shanemcd: has joined #RubyOnRails
[15:05:23] BradenBraden: never seen anything like *_assoceable before
[15:06:51] ferr: I would love to rewrite everything, lol
[15:07:03] ferr: I just need to find a bug
[15:07:14] rubyonrailed: has joined #RubyOnRails
[15:07:15] ferr: Cause wages are not calculated properly
[15:07:36] BradenBraden: that could be a problem (unless they getting more than they should, then thats a win :P)
[15:08:08] mikecmpbll: dbugger: it's unusual in that you don't see it that often
[15:08:11] sp1rs1: has joined #RubyOnRails
[15:08:32] uglybandersnatch: has joined #RubyOnRails
[15:08:43] ferr: I found something interesting
[15:08:46] mikecmpbll: even nested classes isn't terribly common, although more so in large projects.
[15:08:52] ferr: When sum method is used, it is not loaded properly
[15:08:54] yellow5: has joined #RubyOnRails
[15:10:26] Uber|Dragon: has joined #RubyOnRails
[15:12:35] jape: has joined #RubyOnRails
[15:12:41] dopamean_: has joined #RubyOnRails
[15:13:15] Sigfrid: has joined #RubyOnRails
[15:13:58] veloutin: has joined #RubyOnRails
[15:14:50] rubyonrailed: has joined #RubyOnRails
[15:16:03] shanemcd: has joined #RubyOnRails
[15:19:27] yos7ph: has joined #RubyOnRails
[15:23:29] momomomomo: has joined #RubyOnRails
[15:24:29] joe: has joined #RubyOnRails
[15:24:29] yellow5: has joined #RubyOnRails
[15:24:34] msyvich: has joined #RubyOnRails
[15:27:00] djbkd: has joined #RubyOnRails
[15:29:40] Pandorian: has joined #RubyOnRails
[15:31:41] darkxploit: has joined #RubyOnRails
[15:33:41] mary5030: has joined #RubyOnRails
[15:34:48] ferr: Why this could be? https://gist.github.com/Fercell/8ca19008648187826f5c
[15:34:52] n008f4g_: has joined #RubyOnRails
[15:35:10] mary5030: has joined #RubyOnRails
[15:36:30] Scient: because they apparently do different things
[15:36:35] Scient: idk what are you expecting here
[15:36:40] Scient: especially if we cant see the schema
[15:37:56] msyvich: has joined #RubyOnRails
[15:38:14] momomomomo: has joined #RubyOnRails
[15:39:45] public_class: has joined #RubyOnRails
[15:41:35] ferr: Scient: I'm expecting the same result from sum and the method, since it is only 1 record
[15:43:46] scope: has joined #RubyOnRails
[15:43:47] epochwolf: ferr: are you sure there is only 1 record in that last query?
[15:44:44] ferr: epochwolf: let me prove, second
[15:45:09] EdwardIII: hey guys, i'm trying to figure out why my multi-lingual-switching doesn't work. if i hit /en/valid/route, it always seems to be in dutch: https://gist.github.com/EdwardIII/7ad02b50d37c42a234fb
[15:45:14] makenoise: has joined #RubyOnRails
[15:45:36] scope: hey guys when i try to make a javascript running code background alli get is a black page anyone knowwhat scipti would need touse
[15:46:00] mrgreenfur: has joined #RubyOnRails
[15:46:44] ferr: epochwolf: https://gist.github.com/Fercell/4138925b25864543d424
[15:47:26] momomomomo: has joined #RubyOnRails
[15:48:15] EdwardIII: all the defaults config/application.rb says make sense for my app, but i tried uncommenting them just to be sure, however no change, everything is still dutch
[15:49:56] epochwolf: EdwardIII: What happens when you do I18n.available_locales.include? "en" in the console?
[15:50:32] EdwardIII: epochwolf: i get false
[15:50:53] epochwolf: whoops, :en not "en"
[15:51:36] EdwardIII: that's saying true
[15:52:10] rickmasta: has joined #RubyOnRails
[15:52:40] EdwardIII: when i run extract_locale_from_path manually, it also says :en. this bit: https://gist.github.com/EdwardIII/7ad02b50d37c42a234fb#file-application_controller-rb-L14
[15:52:56] EdwardIII: and I18n.default_locale also says :en too
[15:53:00] EdwardIII: all signs point to en hehe
[15:54:05] EdwardIII: before_action :set_locale # is the correct event to hook into? that's what i got from the docs
[15:54:13] EdwardIII: all my controllers inherit from ApplicationController
[15:54:20] epochwolf: EdwardIII: should be correct
[15:54:28] pvertenten: has joined #RubyOnRails
[15:54:56] EdwardIII: i did this to make my routes a bit more managable: https://gist.github.com/EdwardIII/7ad02b50d37c42a234fb#file-routes-rb-L5
[15:55:03] EdwardIII: but that is also pretty much taken verbatim from the i18n page
[15:55:11] diegoviola: has joined #RubyOnRails
[15:55:37] IrishGringo: has joined #RubyOnRails
[15:58:10] ayoros_: has joined #RubyOnRails
[15:58:50] msyvich: has joined #RubyOnRails
[15:59:31] EdwardIII: hrm am i going nuts or does the RoR site not make it immediately obvious what the version num of the latest stable is?
[16:00:40] baweaver: has joined #RubyOnRails
[16:03:06] nettoweb: has joined #RubyOnRails
[16:03:54] EdwardIII: when i look inside the controller itself, I18n.locale shows :en too
[16:04:15] rickmasta: has joined #RubyOnRails
[16:05:33] shinnya: has joined #RubyOnRails
[16:05:35] jape: has joined #RubyOnRails
[16:06:06] momomomomo_: has joined #RubyOnRails
[16:07:06] kitsuneyo: has joined #RubyOnRails
[16:07:39] kitsuneyo: can i use || to fall back on a default if an instance var is nil? like @val || 'default' ?
[16:07:47] epochwolf: kitsuneyo: yes
[16:07:55] kitsuneyo: great, thanks epochwolf
[16:08:04] epochwolf: EdwardIII: no idea.
[16:08:17] EdwardIII: seems like a pretty simple thing
[16:08:24] EdwardIII: maybe the docs are out of date? rails bug?
[16:08:25] sp1rs: has joined #RubyOnRails
[16:08:31] scope: kitsuneyo the way || work is like this x= a | b | default
[16:08:32] Devalo: has joined #RubyOnRails
[16:08:39] tjohnson: has joined #RubyOnRails
[16:08:39] scope: is x = a then do command
[16:08:45] scope: if not move to b
[16:08:46] dirtibirdi: has joined #RubyOnRails
[16:08:52] scope: if this is also false then defualt
[16:09:03] scope: if im wrong could someone correct meplease
[16:09:09] epochwolf: scope: you're wrong.
[16:09:11] kitsuneyo: thanks scope
[16:09:19] bronson: has joined #RubyOnRails
[16:09:25] ryanRT: has joined #RubyOnRails
[16:09:30] epochwolf: "||" and "or" are the same.
[16:09:39] hannelita: has joined #RubyOnRails
[16:09:54] epochwolf: They just have different wieghts when it comes to which is processed first when reading the code.
[16:10:12] matthewd: EdwardIII: The canonical answer for latest stable version is https://rubygems.org/gems/rails
[16:10:16] scope: ithought || was better than or as it reduce dry code
[16:10:32] EdwardIII: matthewd: neat, thanks
[16:10:33] epochwolf: `false` and `nil` will both cause the second value to be returned from the expression.
[16:10:36] EdwardIII: i'm running 4.2.5.2 so i guess i'm all up to date
[16:10:42] EdwardIII: this seems like such a weird issue
[16:10:59] EdwardIII: i thought i'd just try making sure i was on the latest version in case i was out of sync with the docs/ran into a bug or something
[16:11:10] epochwolf: EdwardIII: always a good idea.
[16:12:24] epochwolf: scope: you should generally stick to || for simplicity. Ruby's operator precedence can cause some fun bugs unless you know what you're doing.
[16:12:42] scope: yer ive experianced this already hahahah
[16:12:43] EdwardIII: but it had no effect
[16:12:59] scope: right now though imreally stuck ongetting this damn running code background to work
[16:13:02] epochwolf: EdwardIII: if you set the default locale to :en, does it show english?
[16:13:05] scope: i know i need a script
[16:13:11] scope: but noidea which
[16:13:12] epochwolf: scope: your spacebar has problems.
[16:13:17] scope: yer i know
[16:13:29] scope: i need to clean it so i appologise
[16:13:48] epochwolf: ACTION is in bad kerning hell...
[16:13:55] rickmasta: has joined #RubyOnRails
[16:14:00] matthewd: EdwardIII: Try removing nl.yml ?
[16:14:02] scope: but cant at the minute as im in malaysia in a public place and i think its a bit of weed stuck undernath
[16:14:28] EdwardIII: epochwolf: set the default locale? like I18n.default_locale = :en ?
[16:14:36] epochwolf: EdwardIII: yes, in the configuration
[16:14:43] epochwolf: And restart the server.
[16:14:46] EdwardIII: epochwolf: the thing is, the output of I18n.default_locale is already :en
[16:14:57] akshat: has joined #RubyOnRails
[16:14:59] epochwolf: EdwardIII: and it's showing dutch with that?
[16:15:23] workmad3: EdwardIII: what's the value of `I18n.locale`?
[16:15:35] rickmasta: has joined #RubyOnRails
[16:15:35] EdwardIII: epochwolf: it is
[16:15:38] EdwardIII: workmad3: :en
[16:15:45] EdwardIII: matthewd: if i do that, it does switch to english
[16:15:51] epochwolf: EdwardIII: sanity check, does en.yml contain dutch?
[16:16:07] matthewd: epochwolf: That's where I was heading :)
[16:16:08] workmad3: EdwardIII: or, more sanity check... does nl.yml start with a top-level key of `en:`?
[16:16:28] epochwolf: workmad3: That was my next question. :D
[16:16:41] EdwardIII: yes it does
[16:16:46] epochwolf: ACTION cheers
[16:17:12] EdwardIII: that was phenomenally stupid
[16:17:21] epochwolf: EdwardIII: happens to all of us.
[16:17:24] EdwardIII: it kind of didn't occur to me that it was key & filename, not just filename
[16:17:34] EdwardIII: and i forgot all about that tiny weeny 2 char declaration
[16:17:40] workmad3: filename has zero bearing on what locale a file is loaded as
[16:17:42] epochwolf: I don't think rails looks at the file names at all for locale.
[16:17:57] workmad3: the filename is purely for your own organisation :)
[16:18:15] chouhoulis: has joined #RubyOnRails
[16:18:29] epochwolf: ACTION puts his english ones in config/locales/blackspeech.yml
[16:18:40] B1n4r10: has joined #RubyOnRails
[16:18:57] rubyonrails903: has joined #RubyOnRails
[16:18:57] EdwardIII: heh blackspeech? because the way you speak is dark?
[16:19:07] epochwolf: EdwardIII: I'm a fan of Lord of the Rings.
[16:19:12] bmw0679: has joined #RubyOnRails
[16:19:24] workmad3: EdwardIII: that also means you can split your i18n yaml files down into smaller segments if you want... e.g. config/locales/forms.en.yml config/locales/alerts.en.yml etc
[16:19:39] EdwardIII: ok well, you guys are my hero(s?)
[16:19:45] workmad3: or even have multiple sets of translations in the one file, by having two top-level keys :)
[16:19:54] epochwolf: Just put a question mark on the whole word. ;)
[16:20:10] Guest34101: has joined #RubyOnRails
[16:20:37] codepete: has joined #RubyOnRails
[16:20:49] DaniG2k: has joined #RubyOnRails
[16:21:08] Rodya_: has joined #RubyOnRails
[16:21:08] yellow5: has joined #RubyOnRails
[16:22:09] EdwardIII: heh hmm odd, when it thought nl was en, it was fine. now it's really using nl it's saying undefined method `map' for "translation missing: nl.date.order":String
[16:22:18] EdwardIII: when it's trying to do <%= form.input :arrival_date %>
[16:23:37] xm32x: has joined #RubyOnRails
[16:23:47] c0defeed: Is there a way to use the :except/:only directives in the routes.rb file while also passing a do block for collection/member routes
[16:23:58] nettoweb: has joined #RubyOnRails
[16:24:04] Dbugger: mikecmpbll, but you know
[16:24:16] Dbugger: mikecmpbll, what is weird is that the nested class inherits from the parent class
[16:24:23] Dbugger: isnt that like a infinite loop or something?
[16:24:51] chipotle: has joined #RubyOnRails
[16:25:38] mikecmpbll: dbugger : naw.
[16:26:06] mikecmpbll: it's just a class that inherits from another class, only it's definition happens to be defined inside that other class.
[16:26:12] msyvich: has joined #RubyOnRails
[16:28:34] msyvich: has joined #RubyOnRails
[16:29:29] pawnbox: has joined #RubyOnRails
[16:29:59] EdwardIII: en.yml and nl.yml have the same keys
[16:30:59] EdwardIII: whaddya on about rails...
[16:31:45] EdwardIII: like, why is it looking for a translation for en.date.order
[16:32:28] EdwardIII: also, where is it loading that from when locale is :en? not anything i've put in config/locales/*
[16:32:50] shanemcd: has joined #RubyOnRails
[16:32:55] Dbugger: mikecmpbll, for some reason, it makes my head spin
[16:33:10] jetpack_joe: has joined #RubyOnRails
[16:33:59] rubyonrailed: Can anyone help me with this error? I'm pretty sure the test is setup properly. https://gist.github.com/JasonMannon/fa41e93490d7f400dec3
[16:34:43] mauro1254: has joined #RubyOnRails
[16:35:15] smathy: has joined #RubyOnRails
[16:35:35] EdwardIII: hrm if i add an entry for date.order, then rails starts saying undefined method `map' for "order DUTCH":String
[16:35:50] EdwardIII: this is pretty confusing, why would switching locale totally change what :arrival_date means in that context?
[16:35:51] DaniG2k_: has joined #RubyOnRails
[16:35:59] EdwardIII: when i'm in english :en it works fine
[16:36:00] Eswar: has joined #RubyOnRails
[16:36:03] mauro1254: Hi guys, which is the best approach for REST API and Polymorphism? Would you create 1 endpoint or N?
[16:38:09] disgrntld: has joined #RubyOnRails
[16:39:39] apeiros: has left #RubyOnRails: ()
[16:39:40] coe: has joined #RubyOnRails
[16:39:49] apeiros: has joined #RubyOnRails
[16:40:26] rbt01: has joined #RubyOnRails
[16:40:27] n008f4g_: has joined #RubyOnRails
[16:41:30] momomomomo: has joined #RubyOnRails
[16:41:39] nyandoge: has joined #RubyOnRails
[16:41:40] EdwardIII: ah, found the relevant bit. not sure where's it getting it from, but rails is doing this and expecting an array back with 'year', 'month', 'day'
[16:42:20] diegoviola: has joined #RubyOnRails
[16:42:26] EdwardIII: ah, it's getting it from ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/locale/en.yml. neat, i'm gonna fix this like a boss
[16:42:59] shanemcd: has joined #RubyOnRails
[16:43:12] sypheren: has joined #RubyOnRails
[16:44:41] EdwardIII: by installing rails-i18n
[16:45:41] yellow5: has joined #RubyOnRails
[16:46:48] siaW: has joined #RubyOnRails
[16:47:08] kitsuneyo: has joined #RubyOnRails
[16:47:36] siaW: what’s a good practice; comments or no comments in my ruby code
[16:47:42] nettoweb: has joined #RubyOnRails
[16:47:58] siaW: i’m in poland and i have had a couple of interviews involving ruby
[16:48:15] EdwardIII: heh it's kind of a viewpoint question isn't it?
[16:48:19] EdwardIII: what do you think?
[16:48:21] User458764: has joined #RubyOnRails
[16:48:30] siaW: some of them rejected me, so i asked if i could know what i did wrong, to polish firms said my code is good, but “dirty” with comments
[16:48:42] siaW: i have read mixed opinions on this matter
[16:48:45] EdwardIII: well it kind of depends on your reason for commenting doesn't it
[16:48:50] siaW: and i don’t really know what style to go by
[16:48:59] siaW: depends on reason
[16:49:11] siaW: so what’ll be a good reason to comment?
[16:49:15] stardiviner: has joined #RubyOnRails
[16:50:02] jape: isnt comment or no comment kind of black and white?
[16:50:09] jape: how can it be one or the other
[16:50:09] havenwood: siaw: I prefer comments only where there's' something worth commenting on that's not straightforward from the code.
[16:50:21] jape: theres always SOME reason for a comment
[16:50:23] EdwardIII: my personal opinion is that if you're writing a comment because the code is hard to understand, it might need refactoring. however if something seems kinda strange but had to be that way for a good reason (e.g. upstream vendor/api stupidity) then i put a comment against it so someone in my team knows why the hell it's like that and doesn't try and fiddle with it without all the facts
[16:50:42] havenwood: siaw: Some folk comment everything, some nothing, some just right. :P
[16:51:01] DoctorMonocular: has joined #RubyOnRails
[16:51:03] havenwood: siaw: But opinions vary starkly, no doubt.
[16:51:11] EdwardIII: i think a comment above every single line describing what the line of code does is kind of annoying, a lot of brand-new devs do this
[16:51:29] alphaatom: has joined #RubyOnRails
[16:52:11] flashpoint9: has joined #RubyOnRails
[16:52:38] siaW: EdwardIII: well i’m brand new, i’m trying to learn the best practices. i don’t comment often only a few times that cost me chance for an internship, but year, your opinion makes sense
[16:52:53] siaW: havenwood: opinions vary, yeah, true
[16:53:21] siaW: so i’m going to stick to this, no comments. if i have to write a comment then it means i could refactor. so i do it and then avoid the comment altogether
[16:53:42] Uber|Dragon: jape: in my opinion your code should be written in a way that is self documenting. Most of the time if code requires comments for a future programmer to understand it should be broken up into smaller more digestable pieces.
[16:53:51] EdwardIII: a lot of folks think reading comments takes you out of the flow and shouldn't be included unless absolutely necessary
[16:54:19] havenwood: EdwardIII: Mmm, the sea of grey can overwhelm the poor code!
[16:54:22] mices: where do i set the path to certs for devise?
[16:54:27] Cache_Money: has joined #RubyOnRails
[16:54:34] siaW: interesting opinions here
[16:55:05] mices: can you even have comments in views?
[16:55:40] rafaelfranca: has joined #RubyOnRails
[16:55:43] Uber|Dragon: jape: if you can't determine a way to simplify the code, and sometimes that legitimate. then add a comment to add some clarity. I challenge my team every time they add a comment to the code.. in thousands of lines of code.. we may have 10 methods that have actual code comments.
[16:56:20] Uber|Dragon: mices: sure html comments lol <!-- comment here, but why would you do that lol -->
[16:56:32] The_Phoenix: has joined #RubyOnRails
[16:57:12] mices: Uber|Dragon: i didn't know that, it's great to know, many times i wanted to put comments in my html and though i couldn't
[16:57:20] jeanlinux: has joined #RubyOnRails
[16:58:07] jape: Uber|Dragon: I totally agree, the code should not be flooded in comments. Im just saying that the question 'should code have comments or not?' is just too b&w.. it depends on the situation. If I had to lean towards one Id say NO... but i dont think thats totally fair
[16:58:21] Uber|Dragon: mices: sometimes a add <!-- end of section name --> comments at the end of blocks in large views just so it's clear where that section ends..
[16:58:34] [Butch]: has joined #RubyOnRails
[16:59:07] Uber|Dragon: jape: that's an interview question? I agree it's not black and white and the answer should be accompanied with an explanation.
[17:00:02] jape: Uber|Dragon: well the guy asked whats a good practice.. comments or no comments in my ruby code? Not sure if its for an interview.. but that question is just generally too broad I think for anyone
[17:00:52] coe: has left #RubyOnRails: ()
[17:01:02] jape: Uber|Dragon: I think for an interview its unfair as well.. especially if you expect a y/n answer. Its more fair to ask about someones justification for commenting. Like given an example and asking if they think comments were justified
[17:01:09] EdwardIII: if i was looking to recruit a jr coder and they spammed the code with comments, that would not be an instant fail
[17:01:11] Uber|Dragon: jape: I see. I'd say good practice is to write self documenting code and only adding code comments when absolutely necessary for clarity.
[17:01:24] Uber|Dragon: ACTION nods at jape 
[17:01:28] jape: Uber|Dragon: agreed
[17:01:36] Uber|Dragon: EdwardIII: agreed.
[17:01:39] jape: look were all getting along!
[17:01:42] alfie_max15: has joined #RubyOnRails
[17:01:42] EdwardIII: so much consensus
[17:01:46] momomomomo: has joined #RubyOnRails
[17:01:51] BradenBraden: thats uncle bob's way
[17:01:57] norc: has joined #RubyOnRails
[17:02:09] jape: if this was reddit we would spam 'THIS ^'
[17:02:12] jape: god i hate that so much
[17:02:49] The_Phoenix1: has joined #RubyOnRails
[17:03:00] co3: has joined #RubyOnRails
[17:03:18] Rodya_: has joined #RubyOnRails
[17:04:05] co3: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[17:04:06] co3: has joined #RubyOnRails
[17:04:13] EdwardIII: how do you guys handle getting clients to do translation? do you hand 'em the raw yaml files and say "there you go, open those in notepad and hack away"?
[17:04:30] jape: EdwardIII: we use PhraseApp
[17:04:34] EdwardIII: it would be awesome if someone could make like a structured yaml editor for windows/mac osx where you'd just throw the yaml file at it and it would make all values editable, but not let them change the structure
[17:05:06] deur-: EdwardIII: we tried that a few times. you don't want to know how many formatted word documents we got in return...
[17:05:21] jape: EdwardIII: If we gave clients yml everything would prbably crash and burn
[17:05:39] EdwardIII: phraseapp seems a bit heavy
[17:05:44] EdwardIII: is there some kinda webapp that's like what i'm describing?
[17:06:05] deur-: EdwardIII: there's https://translation.io/
[17:06:06] kitsuneyo: has joined #RubyOnRails
[17:06:11] jape: EdwardIII: it is heavy, but we do a ton of translations and were tired of doing it ourselves.. now the non tech people can just go do it and leave us alone :)
[17:06:20] deur-: but that's also on the heavy side
[17:06:31] deur-: + a paid solution
[17:06:44] EdwardIII: both look interesting
[17:07:15] mDuff: has joined #RubyOnRails
[17:07:31] co3: has joined #RubyOnRails
[17:07:55] knoxyy: has joined #RubyOnRails
[17:08:05] zave: has joined #RubyOnRails
[17:08:12] baweaver: has joined #RubyOnRails
[17:08:13] IrishGringo: has joined #RubyOnRails
[17:08:21] djbkd: has joined #RubyOnRails
[17:09:02] trosborn: has joined #RubyOnRails
[17:09:11] yellow5: has joined #RubyOnRails
[17:09:38] Rodya_: has joined #RubyOnRails
[17:09:47] benlieb: has joined #RubyOnRails
[17:10:39] alfie_max15: has joined #RubyOnRails
[17:11:24] bronson: has joined #RubyOnRails
[17:11:31] null__: why does rails require a javascript interpreter?
[17:12:10] voker57: has joined #RubyOnRails
[17:12:10] voker57: has joined #RubyOnRails
[17:12:32] mikecmpbll: where's the rake assets:precompile task defined?
[17:12:44] bmw0679: has left #RubyOnRails: ()
[17:12:48] deur-: null__: do you mean therubyracer?
[17:13:10] null__: sure, that's one, but what part of rails requires it?
[17:13:12] smathy: null__, to compule coffeescript.
[17:13:33] null__: is that all?
[17:13:38] Uber|Dragon: null__: it's not "required"
[17:14:04] null__: it's in the rails gemfile though?
[17:14:14] bmw0679: has joined #RubyOnRails
[17:14:32] bmw0679: Hi all, I'm new to Ruby on Rails and having some problems with my changes not showing up in the production environment. I believe it has to do with caching but don't know where to clear or reset cache. Any pointers on where I would start looking?
[17:14:33] smathy: null__, yes it is, Rails decided to make coffeescript the default, many disagreed with this.
[17:15:00] smathy: bmw0679, you're restarting your app when you deploy?
[17:15:09] null__: thanks for the answers
[17:15:16] smathy: null__, you're welcome.
[17:15:19] EdwardIII: i was quite suprised by that too
[17:15:31] deur-: i'm really not fond of coffeescript tbh
[17:15:35] EdwardIII: seems to suggest sass-by-default too
[17:15:37] DmitryBochkarev: has joined #RubyOnRails
[17:15:40] yellow5: has joined #RubyOnRails
[17:15:42] smathy: EdwardIII, "surprised" was not the word we used at the time :)
[17:16:17] kdough: has joined #RubyOnRails
[17:16:19] EdwardIII: using coffeescript would have violated my one-new-tech-at-a-time principle
[17:16:23] smathy: You can probably google "rails coffeescript controversy" and read up on it.
[17:16:45] EdwardIII: plus it seems like with es6 maybe you wouldn't sort of need coffeescript so much?
[17:17:02] smathy: EdwardIII, well, the CS decision predated ES6 by a long margin.
[17:17:07] smathy: It was Rails 3 days.
[17:17:31] bmw0679: smathy, there should be in the deployment script. how do you restart the app manually?
[17:17:56] smathy: it was the biggest Rails controversy I can remember, although I think turbolinks and spring should have garnered more outrage.
[17:18:20] alfie_max15: what about spring?
[17:18:39] smathy: bmw0679, well, doing it manually doesn't solve your problem long term, but how to do so depends on what you're using as your app server in production?
[17:18:55] alfie_max15: turbolinks, yeah thats true, but what's the matter with spring if i may ask
[17:19:04] konsolebox: has joined #RubyOnRails
[17:19:51] smathy: alfie_max15, its silent, unannounced, inclusion in new Rails apps causes many very difficult to understand problems, even for the seasoned Rails dev.
[17:20:18] EdwardIII: haha no way!!!
[17:20:24] EdwardIII: i didn't realise that's what turbolinks was, and that's what it i was doing
[17:20:30] EdwardIII: i *thought* page transitions were insanely fast
[17:20:42] bmw0679: smathy, MRI Ruby on linux
[17:21:23] makenoise: has joined #RubyOnRails
[17:21:43] jmignault: has joined #RubyOnRails
[17:21:43] smathy: alfie_max15, unless you understand when it doesn't "just work" then it's a nightmare to work out what's going on in your app, and the fact that it has had (and still has) a critical bug in that if you create an app, spring starts, then you delete that directory and create the app again, the running spring never stops and never realizes the app/directory is a new one - that's a really terrible situation.
[17:22:00] smathy: bmw0679, no, like passenger, unicorn, puma, etc?
[17:22:50] smathy: EdwardIII, yeah, great technology, but to make it the default creates a very counter-intuitive situation for people who don't realize what it's doing.
[17:23:13] smathy: EdwardIII, which could easily be solved with a simple `puts` at the end of `rails new ...`
[17:23:21] EdwardIII: yes that would have potentially confused the hell out of me when trying to, for example, do something in jQuery with a particular dom element or whatever
[17:23:23] alfie_max15: smathy, i agree, i too have faced that
[17:23:36] smathy: EdwardIII, exactly, we solve those turbolinks problems all day long in here for people.
[17:23:41] EdwardIII: if i say 'rails server' am i using spring?
[17:23:50] smathy: EdwardIII, yep.
[17:24:15] smathy: EdwardIII, it's installed by default, and auto-starts any time you run rails server or console.
[17:24:17] EdwardIII: what did people do before spring? just stop & start their `rails server` manually?
[17:24:18] gr3yR0n1n: has joined #RubyOnRails
[17:24:48] smathy: EdwardIII, no, in dev the autoload always reloaded changed files.
[17:25:10] EdwardIII: so it would reload modules without restarting the dev webserver?
[17:25:16] smathy: EdwardIII, spring doesn't do the restarting, spring does the "stay resident between rails console/server process restarts to make the next startup quicker" thing.
[17:25:28] smathy: EdwardIII, same as now, spring hasn't changed that.
[17:25:37] EdwardIII: sounds futuristic
[17:25:40] EdwardIII: so spring just speeds it all up?
[17:26:28] smathy: EdwardIII, think of spring like an app server (like passenger, puma, unicorn etc) that just keeps your app in memory, so then running `rails console` doesn't have to load the whole app into memory, it just attaches to the already-in-memory app and presents the console to you.
[17:26:30] smathy: EdwardIII, yes.
[17:26:44] deur-: most notable if you run your rspec tests. instead of waiting a few years for your legacy rails 2-3 app to boot, they run immediately because rails is in memory
[17:27:08] smathy: ...but, when spring doesn't pick up new changes, you can imagine how confusing it is to stop your rails console and restart it and the behavior hasn't changed.
[17:27:50] null__: I remember my first time figuring out that i had to do "spring stop/start" to fix whatever crazy problem I was running into
[17:28:12] alfie_max15: just curious, are rails 2 apps still being maintained as it is? and not been upgraded yet?
[17:28:20] EdwardIII: yes i appreciate knowing that
[17:29:06] deur-: i don't remember mine, except that it was related to AR models
[17:29:11] deur-: tests failing that shouldn't etc
[17:29:57] deur-: it's like the rails dev equivalent of "have you tried turning it off, then on again?"
[17:30:03] deur-: "x isn't working"
[17:30:19] deur-: "have you restarted spring yet?"
[17:30:42] smathy: ...and OMG, if you create a new app, run anything in it, then delete the directory and create a new app with the same name, you can imagine how mind bending it is that `rails console` just hangs.
[17:30:56] EdwardIII: yes that would bend my mind
[17:31:13] djbkd: has joined #RubyOnRails
[17:31:21] rubyonrailed: has joined #RubyOnRails
[17:32:50] timdotrb: has joined #RubyOnRails
[17:32:56] timdotrb: morning, all
[17:33:29] czerasz: has joined #RubyOnRails
[17:33:43] jmignault: has joined #RubyOnRails
[17:34:04] borodin: has joined #RubyOnRails
[17:34:30] scope: is it normal for rails g controller <action> <page> to take morethan 5 mins to load
[17:35:25] smathy: EdwardIII, I got so sick of it I wrote a RM function to kill spring for any directory I was removing.
[17:35:32] smathy: scope, no.
[17:35:41] sandstrom: has joined #RubyOnRails
[17:36:24] zave: has joined #RubyOnRails
[17:36:26] srinidhi: has joined #RubyOnRails
[17:36:38] DragonPunch: has joined #RubyOnRails
[17:37:09] scope: anyway to speed it up or findoutwhy
[17:37:49] pixelhandler: has joined #RubyOnRails
[17:38:36] arup_r: has joined #RubyOnRails
[17:38:39] scope: its not just the rails g but a few other commands too
[17:38:50] scope: im still waiting for the cnnotroller to generate hahaha
[17:38:51] baweaver: has joined #RubyOnRails
[17:38:57] Jasaka: has joined #RubyOnRails
[17:39:17] mdw: has joined #RubyOnRails
[17:39:51] momomomomo: has joined #RubyOnRails
[17:39:57] alfie_max15: scope, still waiting?
[17:40:19] flashpoint9: has joined #RubyOnRails
[17:40:51] Sephyros: has joined #RubyOnRails
[17:41:24] alfie_max15: can you check how many rails processes are running on your machine at the moment?
[17:41:40] scope: ho do i do thatsorry never doneit before
[17:42:01] bmw0679: smathy, looks like it's using Thin
[17:42:22] scope: max osx el cap
[17:42:41] hive-mind: has joined #RubyOnRails
[17:42:54] Sephyros: How i can do a where query to find something like that WorkOrder.where(work_order_number: number) but number should be a regex like /20160001\d{1,}/
[17:43:38] timdotrb: I’m attempting to do a search for users based on multiple parameters and have setup scopes for most of them. The one I wasn’t sure how to do a scope for was searching based on location preferences, so I’m trying to use geocoder to do that portion of the search. The problem I’m having is when I append the location filter to the rest of my filters, it seems to be ignoring all of my scopes and just returning the results of the
[17:43:39] timdotrb: location search.
[17:43:54] alfie_max15: scope, do you have pstree ?
[17:43:56] timdotrb: Can anyone point me in the direction to go to accomplish what I’m attempting? https://gist.github.com/willc0de4food/efd852f10fe1c9d93ade
[17:44:24] Sephyros: i tried where("work_order_number ~* ?", /20160001\d{1,}/) without success (i use PG)
[17:44:36] alfie_max15: scope, else do `brew install pstree` and run `pstree` on the commandline
[17:45:13] workmad3: timdotrb: looks like you want to do something like: `where(id: Profile.select(:user_id).near(...))`
[17:46:15] scope: kkill try that now
[17:46:48] workmad3: timdotrb: the issue you currently have is that `near_me` is a class method that returns a new query built on Profile, rather than chaining onto an existing query on User... if you want something scopelike, you need your class method to use something like `where` to chain a query
[17:47:43] timdotrb: workmad3: I see
[17:48:40] workmad3: timdotrb: so, how long before you're challenging tindr? :)
[17:48:55] timdotrb: workmad3: haha hopefully not too long ;D
[17:48:59] DoctorMonocular: has joined #RubyOnRails
[17:49:04] shanemcd: has joined #RubyOnRails
[17:49:05] scope: wow that would be why over 30
[17:49:10] scope: timme for a reboot
[17:50:08] timdotrb: workmad3: this scope appears to be suffering from the same issue: https://gist.github.com/willc0de4food/efd852f10fe1c9d93ade
[17:51:31] smathy: bmw0679, so I think thin has a restart command, like `thin restart` - that needs to be in your deployment process.
[17:52:16] scope: timdotrb think that link was wrong as cant see any issues hahaha
[17:52:20] smathy: bmw0679, there's a capistrano-thin gem if you're deploying with cap.
[17:52:26] codesoda: has joined #RubyOnRails
[17:52:28] nettoweb: has joined #RubyOnRails
[17:53:43] ziyadb: has joined #RubyOnRails
[17:53:49] timdotrb: scope: When I perform the query, it returns a user that’s near me, but that doesn’t match any of the other scopes
[17:53:56] smathy: scope, did you have a rails app previous in the same directory, then deleted it, and created a new rails app in the same directory?
[17:54:29] drbayer: has joined #RubyOnRails
[17:54:33] scope: i did yer
[17:54:40] scope: is that not allowed
[17:54:43] smathy: scope, right, so that's why this happened.
[17:54:54] rakm: has joined #RubyOnRails
[17:55:05] syf-revk: has joined #RubyOnRails
[17:55:11] smathy: scope, it's allowed, but when you do that you need to kill the `spring` process running for that directory, otherwise spring fucks things up and your `rails` and `rake` processes hang forever.
[17:55:20] smathy: scope, we just finished talking about this actually :)
[17:55:46] bmw0679: smathy, i got it! thank you for your help. I'll redirect attention to the deployment process to make sure it's working well.
[17:55:48] smathy: EdwardIII, see, it happens ^
[17:55:54] scope: ah ok that would explainwhy all of a sudden everything is getting errors
[17:55:58] smathy: bmw0679, you're welcome.
[17:56:10] workmad3: timdotrb: it would be helpful if you included the query generated by your scopes in your gist
[17:56:16] smathy: scope, yeah, it's a long time bug in spring.
[17:56:23] EdwardIII: heh yep i see it
[17:56:31] scope: whats the best way tostop this then delete and create a new directory witha new name???
[17:58:51] jeanlinux: has joined #RubyOnRails
[17:58:56] hahuang65: has joined #RubyOnRails
[17:59:27] wldcordeiro: has joined #RubyOnRails
[17:59:32] fox_mulder_cp: has joined #RubyOnRails
[17:59:48] timdotrb: workmad3: updated gist
[18:00:20] timdotrb: workmad3: That’s all that’s being output in the console
[18:00:34] DragonPunch: has joined #RubyOnRails
[18:01:04] brendan-: has joined #RubyOnRails
[18:01:21] josephkokenge: has joined #RubyOnRails
[18:01:28] B1n4r10: has joined #RubyOnRails
[18:01:51] timdotrb: workmad3: updated gist again with query that doesn’t do the near_me scope
[18:02:10] scope: if your awake now i dont thinkyour near me hahaha
[18:02:30] timdotrb: scope: it’s only 11am :P
[18:02:50] workmad3: timdotrb: weird... you did remove the class method after adding a scope, right?
[18:02:59] scope: its 2:02am here
[18:02:59] timdotrb: workmad3: yes, sir
[18:03:15] timdotrb: workmad3: ….. >.>
[18:03:18] timdotrb: workmad3: no, sir. lol
[18:03:28] ModusPwnens: has joined #RubyOnRails
[18:03:36] timdotrb: ACTION headdesk
[18:03:37] srinidhi1: has joined #RubyOnRails
[18:03:50] workmad3: timdotrb: haha :) that could be it
[18:04:12] workmad3: scope, timdotrb: you're both wrong... it's 6pm
[18:04:20] smathy: scope, get pkill and then: pkill -f spring
[18:04:24] ModusPwnens: I have several services that my website talks too and they need several clients configured and setup. As part of that process, we have to make some external network calls. What is the appropriate place for something like that in rails? An initializer?
[18:04:44] workmad3: ModusPwnens: that sounds reasonable to me
[18:04:58] tbuehlmann: workmad3, you seem to be near my timezone. I'm afraid :o
[18:05:07] timdotrb: workmad3: yea, that was the problem. The server doesn’t like this new query, though :X lol
[18:05:28] workmad3: tbuehlmann: haha
[18:05:39] timdotrb: workmad3: updated gist
[18:05:44] ModusPwnens: workmad3: Hmm okay. That's what I'm currently doing. My problem though is that my build host is sandboxed and it fails to build because the build is making network calls (trying to setup the initializers).
[18:05:59] deuxclique: has joined #RubyOnRails
[18:06:01] voidDotClass: has joined #RubyOnRails
[18:06:21] workmad3: timdotrb: oh... it looks like the geolocation query is screwing up the `select` :/
[18:06:32] alfie_max15: has joined #RubyOnRails
[18:06:52] scope: ah ok seeing as though a few are replying now anyone know how to get a running code background working
[18:06:57] workmad3: timdotrb: the subquery is ending up with this as a SELECT clause: `(SELECT `profiles`.`user_id`, profiles.*, 3958.755864232 *...`)
[18:06:58] scope: what script i would need touse
[18:07:14] voidDotClass: has left #RubyOnRails: ("Leaving")
[18:07:46] timdotrb: workmad3: could I do a class method instead that returns the user IDs?
[18:07:47] workmad3: scope: background workers? Sidekiq, Sneakers... potentially SuckerPunch if you don't need much in the way of guarantees
[18:08:15] scope: 1 sec ill show you exactly what it is
[18:08:20] workmad3: timdotrb: you could probably change it from `select(:user_id)` at the start to `.pluck(:user_id)` at the end of the Profile... query
[18:08:41] workmad3: timdotrb: just that's annoying as it then executes 2 queries... was hoping to get you a nice, nested subquery that only needs to hit the db once :P
[18:08:47] scope: http://thecodeplayer.com/walkthrough/matrix-rain-animation-html5-canvas-javascript
[18:08:57] timdotrb: workmad3: yea, that would be nice lol
[18:09:05] Maletor: has joined #RubyOnRails
[18:09:17] kevinfagan: has joined #RubyOnRails
[18:09:18] scope: i want to have that as a permanent background and then build y site ontop of it
[18:09:22] sleungcy: has joined #RubyOnRails
[18:09:29] bronson: has joined #RubyOnRails
[18:09:43] workmad3: scope: ah, you mean in JS... so either webworkers, animated gif as a background, or a setInterval type thing that updates the background every few milliseconds
[18:10:19] scope: well the code its self is self repeating
[18:10:36] workmad3: with webworkers, you'd probably need to raise an event in the main page to handle the redraw, but you could potentially do a bunch of updating of state in the webworker
[18:10:44] baweaver: has joined #RubyOnRails
[18:11:01] scope: but when i place the css into assets/style sheet and js injavascipt i just get a bla k page
[18:11:09] scope: damni need to fix this keyboard
[18:12:07] stannard: has joined #RubyOnRails
[18:12:47] workmad3: scope: ah, that example uses a canvas for drawing... that could pose some difficulties with overlays (not sure how good browsers are with canvas and z-index stuff to overlay stuff on top)
[18:13:10] denc: has joined #RubyOnRails
[18:13:19] gregf: has left #RubyOnRails: ()
[18:13:20] ayoros: has joined #RubyOnRails
[18:13:48] scope: ah poo so really best and least complicated would be create a gif and add that to the background
[18:13:52] co3: has joined #RubyOnRails
[18:14:18] timdotrb: workmad3: with .pluck(:user_id) I was getting Unknown column 'user_id’, so I changed it to .pluck(“users.id”) and now I’m getting the original error that it needs to only have 1 select statement
[18:14:34] gregf_: has joined #RubyOnRails
[18:14:40] workmad3: timdotrb: ah, that sucks :(
[18:15:25] timdotrb: might just have to do 2 queries and get the cross section of the user IDs? bleh >:(
[18:16:00] workmad3: timdotrb: hmm... it's ugly, but you could try: `where(id: Profile.select(:user_id).from(Profile.near(...))`
[18:16:29] bronson: has joined #RubyOnRails
[18:16:44] gmas: has joined #RubyOnRails
[18:17:15] Rodya_: has joined #RubyOnRails
[18:17:32] adac: has joined #RubyOnRails
[18:18:20] aegis3121: has joined #RubyOnRails
[18:19:49] baweaver: has joined #RubyOnRails
[18:20:16] rlf: has joined #RubyOnRails
[18:20:16] rlf: has joined #RubyOnRails
[18:22:15] agent_white: has joined #RubyOnRails
[18:22:29] yellow5: has joined #RubyOnRails
[18:22:38] KensoDev: has joined #RubyOnRails
[18:22:48] c0defeed: I've put "render 'new'" at the end of an action. The new template is rendered, but submission of the form sends the request to the "update" action. Any ideas how I can get the request to "new" like I want?
[18:23:35] c0defeed: Sorry, I mean "create"
[18:24:24] smathy: c0defeed, assuming you're using something like: `form_for @foo` then the problem will be that the instance you're passing is already persisted in the DB, therefore the `update` URL is being created.
[18:25:11] c0defeed: smathy, I see. That appears to be the case
[18:25:18] timdotrb: workmad3: thanks, I will give that a try. gym time!
[18:26:16] c0defeed: It may be easiest for me to move this logic from the 'create' action into the 'update' action then, although I would prefer the button to read 'Create' rather than 'Update'
[18:26:38] aegis3121: Do people here, when dealing with RSpec/any rails tests, do you test that a helper - for example - returns a hard-coded string or that its return value matches a translation?
[18:26:56] smathy: c0defeed, you can override what the button says.
[18:27:06] KensoDev: has joined #RubyOnRails
[18:28:48] IrishGringo: has joined #RubyOnRails
[18:28:51] dionysus69: has joined #RubyOnRails
[18:29:32] smathy: aegis3121, I use the latter (and have raise_on_missing_translations set to true - which is the default).
[18:30:19] aegis3121: Agreed, I tend to go with that. I'm just trying to find some kind of documentation/support for that viewpoint heh. Are you aware of any blog posts, docs, etc... pertaining to that?
[18:30:57] jstransky: has joined #RubyOnRails
[18:32:37] tubbo: i only have anecdotal evidence to support my claim :)
[18:33:20] hnanon: has joined #RubyOnRails
[18:33:27] smathy: aegis3121, I also use https://github.com/glebm/i18n-tasks to both manage translations and I add the test to ensure I have no missing or extra keys.
[18:33:39] hnanon: I have: https://gist.github.com/anonymous/3495195d3125667ad8d9
[18:33:43] tubbo: our feature tests use hard-coded English strings. as a result, we developed an international app in English but it's in Spanish in production. this disconnect between what the end users eventually see and what we are developing against ended up uncovering some mistakes in our caching.
[18:33:52] kevinfagan: has joined #RubyOnRails
[18:33:53] hnanon: However, my puts statement is not being printed.
[18:34:15] hnanon: That method is called in a rake task if that matters.
[18:34:25] tubbo: had we used translated strings in the test, we could have easily used spanish everywhere and had greater parity between dev and prod, but that's long gone now.
[18:34:48] kirillzh: has joined #RubyOnRails
[18:35:08] tubbo: hnanon: can you throw a debugger in there and see if you're getting inside the each loop?
[18:35:30] aegis3121: Fantastic, thanks people.
[18:35:44] EdwardIII: hrm adding locales to my routes has broken all my controller tests
[18:35:50] smathy: aegis3121, I don't really understand the question, the presence of a blog post doesn't validate or invalidate an approach. The main risk with using the translations is that you're not actually checking whether the translation was done properly. So if I18n.t("statuses.accepted") returns "FUCK!" and both your view and your test use that translation then you won't have actually checked that the produced web page says what you want it to say,
[18:35:50] smathy: just that it says what you've coded it to present.
[18:36:36] aegis3121: smathy: I understand, but working with a team tends to go to "do you have anything to support that, because we like this way better?" And having support from a community-seen standard helps that
[18:36:41] Zggb: has joined #RubyOnRails
[18:36:44] aegis3121: Evidence > arguing opinions.
[18:36:49] tubbo: it's not really a community-seen standard
[18:37:06] sneakerhax: has joined #RubyOnRails
[18:37:08] tubbo: it's a solution to a problem that we have. but not everyone makes international sites and sometimes it's easier to see what you're doing in a feature test if you actually use hard-coded strings
[18:37:20] aegis3121: If only we had feature tests...
[18:37:22] tubbo: at the time we wrote our feature specs, we were not developing any international clients
[18:37:29] tubbo: so it didn't matter
[18:37:33] neohunter: has joined #RubyOnRails
[18:37:35] crystal77: has joined #RubyOnRails
[18:37:44] tubbo: basically what i'm saying is that it probably doesn't matter unless you use i18n extensively :D
[18:37:49] smathy: aegis3121, I've never been in a team where some random opinion on the internet carried more weight than a well reasoned argument, so good luck :)
[18:37:58] hnanon: tubbo: It's not getting inside the each loop.
[18:38:03] aegis3121: smathy: it's great, appreciate it!
[18:38:17] tubbo: hnanon: probably an empty set then
[18:38:29] aegis3121: tubbo: yea, we have a lot of i18n. Over 2k translation keys.
[18:38:44] smathy: aegis3121, definitely look at that gem then, it's very good.
[18:38:50] tubbo: oh cool, then yeah i'd want my translations tested as much as possible :D
[18:39:06] emachnic: has joined #RubyOnRails
[18:39:12] aegis3121: Meaning... test against hard-coded strings in unit tests?
[18:39:13] lorn: has joined #RubyOnRails
[18:39:20] hnanon: tubbo: It's not empty
[18:39:22] lorn: has joined #RubyOnRails
[18:39:35] aegis3121: i18n-tasks works...fairly well for us for missing keys. Unused not so much, because we have a bunch of dynamic keys it doesn't find as easily, I believe.
[18:39:45] sbarg: has joined #RubyOnRails
[18:40:08] sbarg: has left #RubyOnRails: ()
[18:40:27] makenoise: has joined #RubyOnRails
[18:40:31] neohunter: has joined #RubyOnRails
[18:40:48] tubbo: hnanon: *shrug*
[18:41:17] tubbo: might be clearing out or something by the time you get down there, but i've never seen behavior like that before
[18:41:43] tubbo: hnanon: so what would happen if you did `puts "hello from the rake task"` at the top of that method? do you see it?
[18:42:02] cnk: has joined #RubyOnRails
[18:42:41] emachnic: has joined #RubyOnRails
[18:42:42] hnanon: I do see it.
[18:42:57] djbkd: has joined #RubyOnRails
[18:43:22] hnanon: Is my each statement sytactically correct?
[18:45:33] baweaver: has joined #RubyOnRails
[18:47:21] tubbo: hnanon: looks like it
[18:47:48] tubbo: hnanon: ok so you can determine that `puts` works. the only possible solution is that `expired_tasks` is empty by the time it gets to `each`.
[18:48:55] hnanon: But nothing in that method makes it empty.
[18:49:35] hnanon: And when I stop through each line in the console I see the set.
[18:49:43] pixelhandler: has joined #RubyOnRails
[18:50:23] hnanon: I don't really even need it now, but It's bothering me that it's not working.
[18:51:26] smathy: aegis3121, unused is obviously less important then missing, do you use the test in your suite?
[18:51:57] netzfisch: has joined #RubyOnRails
[18:51:58] nettoweb: has joined #RubyOnRails
[18:52:15] aegis3121: It's not part of our RSpec test suite, no. However, we have a separate verification step for translations.
[18:52:45] smathy: aegis3121, we just use that combined with a QA process that reviews the wording itself in-place in all supported languages.
[18:54:01] aegis3121: smathy: Yea, that makes sense. We have a dependency that is showing up with a couple of missing translations in our locale, and we recently made a transition from using en to en-US as the base, which has caused a couple of hiccups. We've always used I18n, we're just now having to actually localize for a different locale so...hitting some growing pains.
[18:54:25] smathy: aegis3121, our theory is really that our tests are really not checking that the right words exist on the page, rather that the right "word concept" exists, which is why we use the I18n key instead of the words. The wording is beyond the scope of an automated test really, and so even if we were using the words - the idea of the test is really just: "Does the one element we just updated to "success" show the "success status" now?"
[18:54:29] blackmesa: has joined #RubyOnRails
[18:55:09] smathy: aegis3121, the right wording is impossible to check without a human actually looking at it, which for us is a QA phase thing.
[18:55:12] Papierkorb: has joined #RubyOnRails
[18:56:05] smathy: aegis3121, and actually, very few of our tests check actual content, mostly they use presence of classes, etc. to check for the things we're interested in.
[18:56:05] tubbo: hnanon: so if you did `raise "tubbo is a liar" if expired_jobs.empty?`, that raises an exception?
[18:56:12] smathy: (html class)
[18:56:32] baweaver: has joined #RubyOnRails
[18:56:40] tubbo: hnanon: i might not be privy to what happens when you update_all, like can you do more things on that collection?
[18:56:57] momomomomo: has joined #RubyOnRails
[18:57:01] aegis3121: smathy: I 100% agree with you. all we can do is guarantee that we've tried to put the right words there. Right words is for other types of testing. And we typically only check text when helpers are returning pieces of text or a link_to if that doesn't actually get a link, things like that.
[18:58:02] hnanon: "tubbo is a liar"
[18:58:16] tubbo: hnanon: so it is empty :)
[18:59:00] triangles: has joined #RubyOnRails
[18:59:27] _3by8: has joined #RubyOnRails
[18:59:57] nerium: has joined #RubyOnRails
[19:00:15] jeanlinux: has joined #RubyOnRails
[19:00:55] hnanon: tubbo: I don't understand.
[19:01:03] kirillzh: has joined #RubyOnRails
[19:01:04] rvanlieshout: has joined #RubyOnRails
[19:01:17] hnanon: tubbor: I'm taking all "active" jobs.
[19:02:02] hnanon: Then storing the ones that are within that date range into the "expired_jobs" variable.
[19:02:16] defsdoor: has joined #RubyOnRails
[19:02:31] hnanon: Then I'm updating their statuses to "expired."
[19:02:53] hnanon: Those jobs should still exist in the expired_jobs variable, right?
[19:03:45] tubbo: yeah, unless there are no active jobs to begin with
[19:04:00] tubbo: hnanon: ^
[19:04:51] hnanon: Setting all jobs to "active"...
[19:05:11] Pazician: has joined #RubyOnRails
[19:05:34] tubbo: hnanon: yeah but don't they need to be within a certain date range as well?
[19:05:37] tubbo: to be expired that is
[19:06:40] stannard: has joined #RubyOnRails
[19:06:58] mag42c: has joined #RubyOnRails
[19:06:59] hnanon: tubbo: That date range covers them all.
[19:07:11] hnanon: Oh, wait.
[19:07:26] mag42c: has left #RubyOnRails: ()
[19:08:13] hnanon: So, after running the task again, all jobs are now marked "expired" and till not puts statement.
[19:08:36] hnanon: Hmm...does the variable need to be overwritten?
[19:08:40] adre: has joined #RubyOnRails
[19:08:59] baweaver: has joined #RubyOnRails
[19:09:28] benlieb: has joined #RubyOnRails
[19:09:32] hnanon: So, it's probably using the initial array, that includes Job.where(status: 1)
[19:09:45] hnanon: That should be empty after updating.
[19:09:49] tubbo: yeah...i know you can use `model.reload` to get a model to get its data from the DB again
[19:10:03] tubbo: not sure how that works with collections though
[19:10:19] Surt_Q: has joined #RubyOnRails
[19:10:30] uglybandersnatch: has joined #RubyOnRails
[19:10:45] fernandomm: has joined #RubyOnRails
[19:12:01] solars_: has joined #RubyOnRails
[19:13:36] aegis3121: has joined #RubyOnRails
[19:13:37] hnanon: reload is not working
[19:13:53] hnanon: I should say, it's not reloading the values from the db.
[19:13:59] montyboy: has joined #RubyOnRails
[19:14:14] hnanon: That's gotta be it, though.
[19:15:00] emachnic_: has joined #RubyOnRails
[19:15:39] hnanon: Looks like reload is only for objects.
[19:15:52] hnanon: and not collections.
[19:17:15] scope: has joined #RubyOnRails
[19:17:50] djbkd: has joined #RubyOnRails
[19:18:08] kirillzh: has joined #RubyOnRails
[19:18:48] momomomomo: has joined #RubyOnRails
[19:21:58] pawnbox: has joined #RubyOnRails
[19:22:10] d0nn1e: has joined #RubyOnRails
[19:23:07] IFrank00: has joined #RubyOnRails
[19:23:24] rubyonrailed: has joined #RubyOnRails
[19:23:55] IFrank00: HI good day
[19:25:28] IrishGringo: has joined #RubyOnRails
[19:25:52] arBmind: has joined #RubyOnRails
[19:30:25] BtcBen: has joined #RubyOnRails
[19:31:22] Cache_Money: has joined #RubyOnRails
[19:32:09] diego2: has joined #RubyOnRails
[19:32:16] jsrn: has joined #RubyOnRails
[19:34:39] diego2: has joined #RubyOnRails
[19:36:02] sonofdirt: has joined #RubyOnRails
[19:36:26] yellow5: has joined #RubyOnRails
[19:36:43] hnanon: So, update_all doesn't touch "updated_at?"
[19:37:41] Darmani: has joined #RubyOnRails
[19:39:58] rafaelfranca: has joined #RubyOnRails
[19:40:22] slash_nick: hnanon: i haven't tested that... does it?
[19:41:01] yellow5: has joined #RubyOnRails
[19:41:01] benlieb: has joined #RubyOnRails
[19:42:33] snowy: has joined #RubyOnRails
[19:42:38] tim_s007: has joined #RubyOnRails
[19:44:52] hnanon: slash_nick: It does not.
[19:45:02] nerium: has joined #RubyOnRails
[19:45:11] hnanon: tubbo: It's now working with https://gist.github.com/anonymous/8082f46b741bec8ddada
[19:45:23] Cohedrin: has joined #RubyOnRails
[19:45:53] slash_nick: hnanon: looks like it's documented, at least... look at the comments here: http://apidock.com/rails/v4.0.2/ActiveRecord/Relation/update_all
[19:46:57] hnanon: slash_nick: I see. That took way too long for me to figure out.
[19:47:21] intrigueD: has joined #RubyOnRails
[19:47:43] ur5us: has joined #RubyOnRails
[19:48:13] zeknox: has joined #RubyOnRails
[19:48:43] zeknox: is there a driver i can leverage for rspec feature tests to load javascript on the request without opening a browser?
[19:49:44] allcentury: has joined #RubyOnRails
[19:49:54] slash_nick: zeknox: you want something like selenium but headless... capybara-webkit or phantomjs (poltergeist)
[19:50:28] zeknox: slash_nick: thanks, i was looking into capybara-webkit for my needs, just wanted to see what everyone is leveraging
[19:53:07] Radar: GOOD MORNING
[19:55:32] chouhoulis: has joined #RubyOnRails
[19:55:35] openstruct: has joined #RubyOnRails
[19:57:23] Papierkorb: Radar: OOOHHHAAAYYYOOOO Mr.
[20:00:25] B4daBing73: has joined #RubyOnRails
[20:00:25] B4daBing73: has joined #RubyOnRails
[20:00:40] tubbo: zeknox: poltergeist is a lot easier to work with, and both capybara-webkit and phantomjs implement a headless webkit browser
[20:00:45] baweaver: has joined #RubyOnRails
[20:02:07] pawnbox: has joined #RubyOnRails
[20:04:41] chouhoul_: has joined #RubyOnRails
[20:05:11] zeknox: tubbo: thanks for the advice, any particular reason you like poltergeist over the others?
[20:06:04] chouhoul_: has joined #RubyOnRails
[20:07:41] srinidhi: has joined #RubyOnRails
[20:07:56] futilegames: has joined #RubyOnRails
[20:08:02] dirtibirdi: has joined #RubyOnRails
[20:08:07] joe: has joined #RubyOnRails
[20:08:15] timdotrb: has joined #RubyOnRails
[20:11:38] treehug88: has joined #RubyOnRails
[20:13:11] sypheren: has joined #RubyOnRails
[20:13:13] DoctorMonocular: has joined #RubyOnRails
[20:13:17] yellow5: has joined #RubyOnRails
[20:13:46] Rodya_: has joined #RubyOnRails
[20:17:44] rubyistg123: has joined #RubyOnRails
[20:18:21] aegis3121: has joined #RubyOnRails
[20:19:22] Coldblackice: has joined #RubyOnRails
[20:19:24] slash_nick: zeknox: it just packages phantomjs up so it's easier to put to work in your app
[20:19:37] snowy: has joined #RubyOnRails
[20:20:55] netzfisch: has joined #RubyOnRails
[20:24:33] zeknox: thanks guys, i was able to get poltegeist setup and test is passing
[20:25:41] chouhoulis: has joined #RubyOnRails
[20:26:11] Rodya_: has joined #RubyOnRails
[20:26:24] antgel: has joined #RubyOnRails
[20:26:41] stannard: has joined #RubyOnRails
[20:27:02] dopie: `1I know using begin rescue end for control flow is bad
[20:27:12] dopie: what can i use other than begin end in my situation
[20:27:14] dopie: https://gist.github.com/staycreativedesign/12eca03b664685a49573
[20:27:26] intrigueD: has joined #RubyOnRails
[20:28:32] Z00t: has joined #RubyOnRails
[20:28:50] slash_nick: dopie: well, for a start, i'd try to rescue something more specific than StandardError... is that the actual exception you're seeing raised?
[20:28:55] syf-revk: has joined #RubyOnRails
[20:29:06] dopie: NoMethodError for nil class
[20:29:54] slash_nick: dopie: then change StandardError to that.
[20:30:28] Rodya_: has joined #RubyOnRails
[20:31:20] jayp: has joined #RubyOnRails
[20:31:55] mrgreenfur: has joined #RubyOnRails
[20:31:59] sandstrom: has joined #RubyOnRails
[20:33:13] slash_nick: dopie: something more like what i put in this comment: https://gist.github.com/staycreativedesign/12eca03b664685a49573#gistcomment-1714303
[20:33:45] chipotle: has joined #RubyOnRails
[20:34:05] trosborn: has joined #RubyOnRails
[20:34:44] nettoweb: has joined #RubyOnRails
[20:34:45] dopie: so next if??
[20:35:05] zeknox: next if object.nil?
[20:35:11] smathy: You can drop those `break` from slash_nick's code too, because it's all in the if/else block.
[20:35:20] kitsuneyo: has joined #RubyOnRails
[20:35:35] smathy: Oh sorry, forget me. Somehow I was reading 'break' as 'next' ;)
[20:36:12] dopie: slash_nick: i dope that if statement where the current if statement is?
[20:36:51] slash_nick: dopie: drop your begin/rescue/end entirely and put that if inside your #each
[20:37:51] trosborn_: has joined #RubyOnRails
[20:37:53] yxejamir: has joined #RubyOnRails
[20:37:53] yxejamir: has joined #RubyOnRails
[20:38:22] smathy: dopie, do you really have methods called User::STEP_ONE_DOCUMENTS and so forth?
[20:38:55] ayoros: has joined #RubyOnRails
[20:40:19] Rodya_: has joined #RubyOnRails
[20:40:27] voker57: has joined #RubyOnRails
[20:40:27] voker57: has joined #RubyOnRails
[20:41:19] dopie: smathy: yes its in my document concerns
[20:42:27] adac: has joined #RubyOnRails
[20:43:20] smathy: dopie, a method name with colons in it?
[20:44:29] dopie: https://github.com/staycreativedesign/officesofwhite/blob/master/app/models/concerns/documents.rb
[20:44:40] FooMunki: has joined #RubyOnRails
[20:45:12] smathy: dopie, so instead of self.send(doc) you probably want: doc.constantize
[20:45:57] Rodya_: has joined #RubyOnRails
[20:47:23] smathy: dopie, oh, stop reading everything I'm saying, I didn't notice you had two loops.
[20:47:51] godzillaenlacasa: has joined #RubyOnRails
[20:48:05] Limix: has joined #RubyOnRails
[20:49:59] baweaver: has joined #RubyOnRails
[20:52:09] pawnbox: has joined #RubyOnRails
[20:52:29] Rodya_: has joined #RubyOnRails
[20:53:19] nickjj: has joined #RubyOnRails
[20:54:19] mDuff: has joined #RubyOnRails
[20:56:59] Rodya_: has joined #RubyOnRails
[20:58:25] yorickpeterse: has joined #RubyOnRails
[20:58:50] qejk: has joined #RubyOnRails
[20:59:14] tomeara: has joined #RubyOnRails
[20:59:21] godzillaenlacasa: anyone direct me how to call my shared_path in a rubber config file? It should reference /mnt/my-app/shared
[20:59:22] yorickpeterse: When using the ActiveRecord "from" method with a String any subsequent select() calls no longer prefix column names. For example `User.from('cake').select(:id)` produces `SELECT id FROM cake`. Is there a way to have ActiveRecord still prefix column names in this case (with "cake" here)?
[21:00:10] yorickpeterse: The use case I have is basically something like `Project.from('(query1 union query2) projects').select(:id)` which I want to spit out `SELECT projects.id FROM (...) projects`
[21:00:34] yorickpeterse: I'm aware you can do something like `select('projects.id')` but I want it to work when only the column name is given
[21:00:44] rubyonrailed: has joined #RubyOnRails
[21:01:02] slash_nick: yorickpeterse: is that something that previously worked?
[21:01:15] stannard: has joined #RubyOnRails
[21:01:49] makenoise: has joined #RubyOnRails
[21:02:18] mices: has joined #RubyOnRails
[21:02:24] arup_r: yorickpeterse: you can do like User.from("User.select(:email, :name)", :a).select("a.name"); f
[21:02:27] n008f4g_: has joined #RubyOnRails
[21:02:38] arup_r: see how I gave the alias there..
[21:02:44] yorickpeterse: slash_nick: not that I know of
[21:02:59] yorickpeterse: You're passing Ruby as a String?
[21:03:01] yorickpeterse: Not sure if I follow
[21:03:13] yorickpeterse: Also, the argument for "from" is a String in my case that's not built using ActiveRecord itself
[21:03:23] yorickpeterse: at least it's not produced from an ActiveRecord::Relation directly
[21:03:29] yorickpeterse: (so I can't just pass said relation)
[21:03:47] yorickpeterse: Basically I have a bunch of queries that are UNION'd together, which I then want to select together
[21:03:52] yorickpeterse: So normally you'd do something like
[21:03:57] mices: i'm running different versions of rake on my desktop and laptop my desktop is 10.5.0 and my laptop is 10.4.2 i can't uninstall 10.4.2 on my laptop because it's a default rake, should i just leave it alone, is it unlikely this is the cause of any errors pertaining to openssl/faraday/devise
[21:04:00] yorickpeterse: SELECT * FROM (query1 UNION query2 UNION ...) alias_here;
[21:04:02] maxdoubt: has joined #RubyOnRails
[21:04:08] Rodya_: has joined #RubyOnRails
[21:04:15] slash_nick: arup_r: i've never seen that syntax either... are you sure that works?
[21:04:22] yorickpeterse: sub-queries work if they weren't god awful slow once you start nesting them
[21:04:23] arup_r: one min. string is not needed.. that's a mistake.. rest all is valid syntax
[21:04:36] deuxclique: has joined #RubyOnRails
[21:04:46] arup_r: slash_nick: that "..." was a mistake.. rest all works
[21:05:00] arup_r: http://api.rubyonrails.org/classes/ActiveRecord/QueryMethods.html#method-i-from
[21:05:34] mices: can i just specify a rake version in my gemfile and have both installed
[21:05:43] yorickpeterse: arup_r: the subquery name argument is something I've tried, it doesn't seem to do anything
[21:05:50] yorickpeterse: at least not when using a String as the first argument
[21:06:05] djbkd: has joined #RubyOnRails
[21:06:58] B1n4r10: has joined #RubyOnRails
[21:07:12] stannard_: has joined #RubyOnRails
[21:07:13] yorickpeterse: e.g. `Project.from('(x UNION y) butts').select(:id)` should produce `SELECT butts.id FROM (x UNION y) butts`, somehow
[21:07:16] arup_r: http://stackoverflow.com/a/30722756/2767755
[21:07:31] maxdoubt: in arel if i’m doing - select_manager = users.project(users[:id]).where(admins_vips.or(with_karma)).order(users[:id].desc) - is there a way i could pass in a variable to order like AR, or use a variable to specify sort direction?
[21:07:39] arup_r: yorickpeterse: your one is different. I think you should take Arel approach.
[21:07:45] arup_r: may be that will work
[21:08:01] Rodya_: has joined #RubyOnRails
[21:08:08] yorickpeterse: IIRC there's no way to do that
[21:08:28] yorickpeterse: There isn't something like `Project.create_relation_from_arel_or_something(whatever)` which then would return ActiveRecord::Relation
[21:08:37] yorickpeterse: find_by_sql isn't an option since I don't want to immediately load all rows into memory
[21:08:42] benlieb: has joined #RubyOnRails
[21:08:44] yorickpeterse: (stuff is chained onto this query later on)
[21:09:13] yorickpeterse: digging through the AR code I also can't seem to figure out why select(:id) in this case doesn't prefix the column automatically any more
[21:09:28] Scriptonaut: has joined #RubyOnRails
[21:09:45] lemur: has joined #RubyOnRails
[21:11:07] Scriptonaut: I have a person model, who has_many :details. There are email details, and I want to make sure there are no duplicate emails. When I save a person, I have a validate method that runs. I check if there are any people out there with an email detail that is the same as the one I want. The thing is, when I check my person's email, it's returning the old one, not the one I just assigned to them. I thin
[21:11:13] Scriptonaut: k this is because the person's email is stored in an association. How do I get the new email value from this validation on the person model?
[21:12:01] slash_nick: yorickpeterse: "any more"? if it used to do it, and doesn't now... it either was removed for a good reason (with or withour replacement), or it's not working is a bug... are you sure it once worked?
[21:12:19] Rodya_: has joined #RubyOnRails
[21:12:24] jayp: has joined #RubyOnRails
[21:13:15] matthewd: slash_nick: I believe that's "since adding the .from"
[21:14:21] SloggerKhan1: Is there a shortcut for selecting all the 1:1 children of a collection? For example if all my Dogs have a Collar is there a shortcut for getting all the collars when I'm filtering on the dogs? Or do I just manually use joins?
[21:14:51] Pumukel: has joined #RubyOnRails
[21:15:08] yorickpeterse: slash_nick: Read above, I'm not sure it ever worked like this
[21:15:13] Scriptonaut: basically, when I'm in a validation for Model A that has many model Bs, I want to get the updated model Bs from Model A. When I call model_bs from inside the validation, it is fetching it from the database. how do I get the ones in memeory
[21:15:34] Scriptonaut: it's almost like it is running the validation before it updates them
[21:15:46] yorickpeterse: slash_nick: Foo.select(:id) produces `SELECT foos.id .....`, Foo.from('butts').select(:id) produces `SELECT id ...`, I want the two to match somehow
[21:16:08] matthewd: SloggerKhan1: You can define a `has_many through:` association next to the :dogs association. If your dogs came from something other than an association, not so much.
[21:16:09] yorickpeterse: Though thus far this doesn't seem to be possible
[21:18:04] SloggerKhan1: matthewd: thanks, I think I've got a mess in the making. Oh well. :D
[21:18:56] smathy: yorickpeterse, use pluck instead of select
[21:20:10] futilegames: has joined #RubyOnRails
[21:21:05] hannelita: has joined #RubyOnRails
[21:22:50] blackmesa: has joined #RubyOnRails
[21:23:30] yorickpeterse: has left #RubyOnRails: ()
[21:26:23] hahuang65: has joined #RubyOnRails
[21:26:31] DmitryBochkarev: has joined #RubyOnRails
[21:27:15] jayp: has joined #RubyOnRails
[21:29:56] smathy: maxdoubt, use .send or just the methods with a ternary. Like: order( params[:desc].present? ? users[:id].desc : users[:id] )
[21:32:10] chipotle: has joined #RubyOnRails
[21:34:50] syf-revk: has joined #RubyOnRails
[21:37:40] futilegames: has joined #RubyOnRails
[21:41:08] FernandoBasso: has joined #RubyOnRails
[21:41:56] pawnbox: has joined #RubyOnRails
[21:43:23] kdough: has joined #RubyOnRails
[21:47:48] IrishGringo: has joined #RubyOnRails
[21:48:45] nogic: has joined #RubyOnRails
[21:49:23] ayoros: has joined #RubyOnRails
[21:50:54] antgel: has joined #RubyOnRails
[21:52:39] cjk101010_: has left #RubyOnRails: ()
[21:52:51] cjk101010: has joined #RubyOnRails
[21:53:01] andrew-l: Hi, I have a rails app (4.2) that is using stripe gem 1.11.0 and stripe-ruby-mock 1.10.1.7.
[21:53:02] andrew-l: I want to update to a more recent version of stripe-ruby-mock so I can test partial refunds better.
[21:53:03] andrew-l: I got things working with stripe gem 1.15.0 and stripe-ruby-mock 2.0.5. Is this a recommended configuration? Is there a better combo?
[21:53:32] n008f4g_: has joined #RubyOnRails
[21:55:27] jscheel: has joined #RubyOnRails
[21:56:00] smathy: andrew-l, is there a reason you're not using the latest?
[21:56:24] andrew-l: smathy: the latest stripe-ruby-mock or latest stripe?
[21:56:31] Ropeney: has joined #RubyOnRails
[21:57:07] andrew-l: latest stripe breaks latest stripe-ruby-mock: https://github.com/rebelidealist/stripe-ruby-mock/issues/209
[21:57:08] smathy: andrew-l, well both, although more important would be stripe than the mock.
[21:57:18] quazimodo: has joined #RubyOnRails
[21:57:39] smathy: Latest stripe is 1.36.0 not 1.20.4
[21:58:00] andrew-l: yeah, i've tried that with stripe-ruby-mock... not a fun time.
[21:58:09] snowy: has joined #RubyOnRails
[21:58:37] andrew-l: smathy: how are you testing stripe in your apps?
[21:58:56] smathy: Latest stripe-ruby-mock lists 1.31.0 as its stripe dependency.
[21:59:18] smathy: I'm not using either, just asking questions I'd ask of anyone using any gem
[21:59:30] htmldrum: has joined #RubyOnRails
[22:00:03] andrew-l: you do bring up a good point
[22:00:21] uglybandersnatch: has joined #RubyOnRails
[22:00:26] smathy: https://github.com/rebelidealist/stripe-ruby-mock/issues/209#issuecomment-152534929 mentions a workaround that others using 1.31.0 and 2.2.x are having success with.
[22:01:33] andrew-l: hmmm... i'll try this out a bit more. since i've done one upgrade, might as well keep going as far as i can
[22:01:37] voker57: has joined #RubyOnRails
[22:01:37] voker57: has joined #RubyOnRails
[22:02:04] smathy: Yep, at least taking the mock to its latest, so stripe would be at 1.31.0 - which is a lot newer than 1.15
[22:02:29] smathy: 1.15.0 - July 30, 2014
[22:02:33] andrew-l: good point.
[22:02:36] smathy: ...that'd really scare me for a payment lib.
[22:02:57] jeanlinux: has joined #RubyOnRails
[22:02:59] andrew-l: trust me, i've been pretty antsy for this whole feature. :-D
[22:07:10] kitsuneyo: i'm using the meta-tags gems but my metatags aren't updating from page to page, i guess because of turbolinks
[22:07:14] DmitryBochkarev: has joined #RubyOnRails
[22:07:16] rickmasta: has joined #RubyOnRails
[22:08:59] emachnic: has joined #RubyOnRails
[22:09:47] antgel: has joined #RubyOnRails
[22:10:49] nettoweb: has joined #RubyOnRails
[22:10:53] BtcBen: has joined #RubyOnRails
[22:12:04] hahuang65: has joined #RubyOnRails
[22:12:26] Devalo: has joined #RubyOnRails
[22:14:14] baweaver: has joined #RubyOnRails
[22:15:23] hannelita: has joined #RubyOnRails
[22:19:56] Aherin_: has joined #RubyOnRails
[22:21:48] jenrzzz: has joined #RubyOnRails
[22:22:17] agent_white: has joined #RubyOnRails
[22:22:27] pawnbox: has joined #RubyOnRails
[22:25:38] workmad3: has joined #RubyOnRails
[22:25:52] wethu: has joined #RubyOnRails
[22:26:15] slash_nick: i usually use tubbolinks instead
[22:26:35] flashpoint9: has joined #RubyOnRails
[22:27:56] Sigfrid: has joined #RubyOnRails
[22:29:02] shanemcd: has joined #RubyOnRails
[22:29:17] lalalaaa: has joined #RubyOnRails
[22:31:51] kirillzh: has joined #RubyOnRails
[22:33:03] antgel: has joined #RubyOnRails
[22:33:30] DmitryBochkarev: has joined #RubyOnRails
[22:33:36] xnp70: has joined #RubyOnRails
[22:33:42] smathy: kitsuneyo, which tags are you worried about?
[22:34:14] kitsuneyo: smathy, keywords and description, but i just read that search engines will do a full page request so it's not an issue
[22:35:03] smathy: kitsuneyo, cool :) I was about ti say.
[22:35:13] xnp70: has left #RubyOnRails: ()
[22:35:31] kitsuneyo: thanks smathy
[22:36:04] smathy: kitsuneyo, np, glad you worked it out.
[22:36:20] Pazician: has joined #RubyOnRails
[22:37:49] renegadeandy: has joined #RubyOnRails
[22:38:02] capin: hello guys and gals, I'm trying to pass a size attribute to a shopping cart class i created, but for some reason I'm not seeing the size when viewing the cart. https://gist.github.com/ipatch/03d8db11ce348f0304eb
[22:39:06] antgel: has joined #RubyOnRails
[22:39:53] IFrank00: has joined #RubyOnRails
[22:41:30] jgpawletko: has joined #RubyOnRails
[22:41:58] Ropeney: capin: maybe its early morning, but how is this persisting through each page?
[22:42:14] machinewar: has joined #RubyOnRails
[22:42:23] Ropeney: nvm i see your session now
[22:42:55] quazimodo: has joined #RubyOnRails
[22:46:01] hazelux: has joined #RubyOnRails
[22:47:48] kirillzh: has joined #RubyOnRails
[22:49:10] Ropeney: capin: when you add_item to your cart, your just adding the product items id, your never passing size anywhere.
[22:49:40] Ropeney: so it looks like your just adding the persisted product, not with your size setting
[22:50:30] Ropeney: car_item initializer needs a param for size then in `cart.add_item params[:id] params[:size]` then in add_item u need to pass the size too
[22:53:43] renegadeandy: hi all, i have the following form : https://gist.github.com/renegadeandy/2fbdcac55b53174876fa - it is for an @event, which has_one :venue. In this instance the venue exists, yet when I render the form, the form fields are not populated with the current venue fields, its all empty, why would that be?
[22:53:56] diegoviola: has joined #RubyOnRails
[22:54:19] sonofdirt: has joined #RubyOnRails
[22:54:39] capin: Ropeney: thank you, I'll try what you suggested
[22:55:29] wldcordeiro: has joined #RubyOnRails
[22:56:51] lalalaaa: Anybody still use Spree or everybody switched to Solidus?
[22:57:35] sypheren: has joined #RubyOnRails
[22:58:11] n008f4g_: has joined #RubyOnRails
[22:59:36] kitsuneyo: how do i get an array to be available everywhere?
[23:00:01] FooMunki: has joined #RubyOnRails
[23:00:13] Ropeney: kitsuneyo @@ ?
[23:00:24] Ropeney: kitsuneyo, or a constant? or more context?
[23:00:38] branchini: has joined #RubyOnRails
[23:00:39] kitsuneyo: oh yeah i forgot about the @@
[23:00:54] kitsuneyo: i was going to do EVERYWHERE_ARRAY = %w(foo bar)
[23:01:07] Ropeney: whats wrong with that?
[23:01:50] renegadeandy: Pretty please can somebody smart help me ^^
[23:01:56] mary5030: has joined #RubyOnRails
[23:02:04] kitsuneyo: i dunno Ropeney, Rubocop tells me to use freeze
[23:02:57] Hates_: lalalaaa: still using Spree :)
[23:03:09] lalalaaa: Hates_: psh..
[23:03:12] Ropeney: I don't even know what that means, I'd use a constant in an initializer if i NEEDED an array everywhere
[23:03:22] lalalaaa: Hates_: I still use Substruct :)
[23:03:33] mary5030_: has joined #RubyOnRails
[23:03:42] Hates_: lalalaaa: :)
[23:04:15] Ropeney: renegadeandy: did you try do <% p @event.venue%> under form_for then <% p venue.object %> under fields_for and check console for results?
[23:04:16] Pazician: has joined #RubyOnRails
[23:04:36] kitsuneyo: Ropeney, that's what I'm doing. Rubocop is this programming style checker
[23:04:38] renegadeandy: yeah Ropeney i just figured it out, my fields_for, should have been f.fields_for
[23:06:06] dirtibirdi: has joined #RubyOnRails
[23:06:24] Ropeney: renegadeandy, yes that'd do it too
[23:07:16] Ropeney: kitsuneyo, i think it means because you have left it mutable
[23:07:42] Ropeney: kitsuneyo, its saying to do `THIS_CONSTANT = ['this', 'that'].freeze`
[23:07:50] Palsson: has joined #RubyOnRails
[23:07:56] kitsuneyo: Ropeney, it does mention that yeah, i'll try your solution thanks
[23:08:01] makenoise: has joined #RubyOnRails
[23:08:26] uglybandersnatch: has joined #RubyOnRails
[23:10:05] benlieb: has joined #RubyOnRails
[23:10:13] one_zero: has joined #RubyOnRails
[23:13:50] Devalo: has joined #RubyOnRails
[23:15:01] sypheren: When Rails says it supposes theres a "best way to do things", is that in respect to a default website layout, or with the code that routes things, or both?
[23:15:03] baweaver: has joined #RubyOnRails
[23:15:25] sypheren: I guess what I'm saying is, how much is automatically set up by default and what parts are left for me to code from scratch?
[23:15:38] abolishme: has joined #RubyOnRails
[23:16:17] bronson: Sypheren: have you gone through a quick Rails tutorial? Seems like that would answer your question...?
[23:16:45] renegadeandy: Sypheren: a lof rails is based upon convention over configuration, if you do it all ur own way, then rails wont be able to help you much!
[23:16:46] bronson: If you lean on scaffolding then you might only need to write some models and views.
[23:17:04] renegadeandy: But you can override things if you have a decent reason for not following the convention but really there shouldnt be a need to do that
[23:17:45] sypheren: The tutorials didn't sepcify what exactly the extent of the scaffolding can do
[23:17:50] sypheren: But I will continue to look :)
[23:18:06] renegadeandy: Sypheren: use scaffolding to learn the way stuff works
[23:18:24] renegadeandy: then do it all yourself manually, scaffolding really isnt very useful for real business applications once you have learnt how to use it
[23:18:56] renegadeandy: Sypheren: I asked these same questions when I started! and I did everything with scaffolding until i realised it couldnt do what I wanted it to
[23:18:57] sypheren: I'll do that! The last time I made an attempt to work with rails was in high school, I've got a bit of programming knowledge under my belt now and I was hoping to work with it again and actually understand whats going on
[23:18:59] renegadeandy: so then i did it myself
[23:19:02] FLeiXiuS: has joined #RubyOnRails
[23:19:08] Hates_: !botsnack
[23:19:08] helpa: Nom nom. Thanks, Hates_!
[23:19:25] renegadeandy: i wanna feed the bot :(
[23:19:52] sypheren: Why is scaffolding not useful for business applications?
[23:20:05] sypheren: Isn't it simply used to get started quickly and then modify what you have to fit your needs?
[23:20:09] Hates_: Sypheren: because it's a lot of boilerplate that normally don't need
[23:20:19] Ropeney: Sypheren, it is if you configure it to do alot of things that you repeat :)
[23:20:26] Hates_: Sypheren: it's quicker to build it up rather than tear down what you don't need
[23:20:40] sypheren: I suppose I'll be learning how to do that
[23:20:53] renegadeandy: Sypheren: cos scaffolding basically gives you create read update for every single resource you ask it to
[23:21:05] renegadeandy: but really, you don’t want that for every single model in your app usually
[23:21:18] renegadeandy: especially once you bolt on things like users and authentication etc
[23:21:42] sypheren: And it takes more time to remove all the things added by default than to build those parts from scratch?
[23:22:02] sypheren: Rails itself doesn't handle actual website design and layout though, such as raw html and css, does it?
[23:22:19] Hates_: Sypheren: nope
[23:22:35] sypheren: Just how data actually interacts with them
[23:22:42] Hates_: Sypheren: if you're getting started then using something like Bootstrap can be be handy for that though
[23:22:50] Hates_: Sypheren: yeah :)
[23:23:15] Ropeney: what does handle mean? You have view helpers and the rest, it just doesnt chose your layout for you.
[23:23:29] syf-revk: has joined #RubyOnRails
[23:23:30] sypheren: So, to think of this in a node-like fashion, it'd be html -> css -> database... and Rails comes in on the database portion
[23:23:58] Hates_: Sypheren: Rails is like Express for node.js
[23:24:02] FooMunki: has joined #RubyOnRails
[23:24:44] Hates_: Sypheren: Rails encapsulates your CRUD and business logic
[23:25:51] jeanlinux: has joined #RubyOnRails
[23:26:23] dopamean1: has joined #RubyOnRails
[23:26:42] smathy: I still use scaffolding in every app I build.
[23:27:46] mices: has joined #RubyOnRails
[23:28:05] dopie: an updated gist with what I'm having troible with
[23:28:06] dopie: https://gist.github.com/staycreativedesign/0a5ea72dd919fe40fc6c
[23:28:49] kitsuneyo: has joined #RubyOnRails
[23:29:08] smathy: dopie, return ?
[23:29:30] diegoviola: has joined #RubyOnRails
[23:29:52] sypheren: I was under the impression it had the ability to also implement scaffolding for style sheets and more graphical oriented aspects to your webapp
[23:30:03] sypheren: I think I see now, though
[23:30:41] deuxclique: has joined #RubyOnRails
[23:31:34] Ropeney: Sypheren, google the 15 minute rails blog and you'll see what scaffolding does.
[23:32:02] stannard: has joined #RubyOnRails
[23:32:10] dopie: smathy: so the 2nd loop would return nil ?
[23:32:10] flashpoint9: has joined #RubyOnRails
[23:32:11] sypheren: The rails install fest?
[23:32:39] smathy: Sypheren, not sure what "implement" means, Rails serves CSS and HTML, and has a system built in for managing templating languages for both of those.
[23:32:50] mices: i migrated to my laptop and devise is raising this error https://gist.github.com/mices/16096a90c3b5183bc898
[23:32:59] sevenseacat: has joined #RubyOnRails
[23:32:59] sypheren: So there are templates for css designs?
[23:33:08] trosborn: has joined #RubyOnRails
[23:33:12] dopie: I think he is mis-understanding the word template
[23:33:19] Arcaire: I think he's misunderstanding CSS.
[23:33:20] sypheren: smathy, I'm certain I'm just not usi- yeah
[23:33:20] dopie: misunderstanding
[23:33:25] sypheren: Definitely.
[23:33:25] smathy: dopie, well the return would return from the method.
[23:33:32] Arcaire: Sypheren: How familiar are you with any web development at all?
[23:33:56] sypheren: I'm familiar with programming and robotics (ROS), but very little or no web development
[23:34:02] Arcaire: Ah okay, that explains your confusion.
[23:34:14] sypheren: I get the code side of it, not the conventions used in web development.
[23:34:25] Arcaire: Put simply, templates are for views: The bits the user sees.
[23:34:52] Arcaire: CSS (again, put simply) is the language you use to describe various elements in those views, but not to define those elements (the definitions go in the views).
[23:35:13] Arcaire: you can "template" CSS, kind of, using SASS. A lot of people don't, though. There's little need in most cases.
[23:35:28] Arcaire: I don't, for instance. I only use it for some edge-case personal preference stuff.
[23:35:42] Arcaire: Make sense?
[23:35:56] dopie: smathy: errr seriously i think return solves it
[23:36:12] smathy: dopie, :nod:
[23:36:28] dopie: smathy: not sure what that nod is for
[23:36:31] sypheren: What are the templates written in?
[23:36:33] Rodya_: has joined #RubyOnRails
[23:36:40] smathy: dopie, that return solves it.
[23:37:12] dopie: is that nodding in agreement?
[23:37:17] smathy: Sypheren, a number of templating languages are supported, for HTML: ERB out of the box, haml and slim are two other common ones.
[23:37:19] Arcaire: The views are written in HTML. The templates are too, but can also include rudimentary Ruby logic in a language called erb (embedded ruby). Rails parses that erb before it returns the view.
[23:37:45] trosborn: sypheren: I feel like Rails is a lot harder for new web devs than people say, because it covers so much ground. Depending on how you learn and your experience, you might have an easier time starting with something like Sinatra, or just making a simple HTML doc, and then work your way into Rails. Otherwise a lot of new devs find it overwhelming and cryptic.
[23:37:48] smathy: dopie, well I've said a few times to use return, so I took your "seriously, I think return solves it" as you realizing that I was right and return is the answer.
[23:38:04] smathy: dopie, so really I was just acknowledging your agreement.
[23:38:28] trosborn: though this is not always true, I have had friends dive straight into Rails with no web dev experience and very little coding experience.
[23:38:42] aegis3121: trosborn: I dunno. I had a fairly easy time of it and had never done web dev in my life, short of writing the msot static of web pages that linked nowhere
[23:38:55] htmldrum: has joined #RubyOnRails
[23:39:06] aegis3121: My coding experience was all C and C++ with a hint of Java.
[23:39:09] sypheren: Arcaire, When you say rudimentary, what parts of ruby aren't available?
[23:39:23] sypheren: I'm mostly in java and python
[23:39:29] trosborn: aegis3121: for sure, it varies from person to person.
[23:39:57] Arcaire: Sypheren: To be honest I've never run into a situation where I can't use Ruby logic inside a template.
[23:39:58] dopie: So since return, returns nil in this case it breaks the 1st loop?
[23:40:02] Arcaire: I'm not even sure if there's anything you can't use.
[23:40:10] smathy: Sypheren, let me ask, do you know what each of these things are and how they participate in any interaction with a "website": http, html, css, request, response, asset. ?
[23:40:13] Arcaire: It just starts to look messy after sixty five lines of embedded ruby code.
[23:40:48] sypheren: Http is just an application layer
[23:41:19] lalalaaa: Arcaire: It starts looking messy after five lines of coke, let me tell you that.
[23:41:46] sypheren: Html, i believe, is the raw information the browser takes apart to display
[23:41:54] lalalaaa: You can't focus for shit, you just want more coke. And girls.
[23:42:35] Arcaire: lalalaaa: From my experience (which is limited to watching movies) of the substance, you're doing it wrong.
[23:42:41] Arcaire: You're supposed to be awesome on it.
[23:42:44] sypheren: My understanding of what things do in theory becomes fairly fuzzy and uncertain at CSS
[23:42:57] Arcaire: You were right about HTML
[23:43:04] Arcaire: think the CSS as the adjectives to describe each HTML element.
[23:43:09] Brando753: has joined #RubyOnRails
[23:43:13] Arcaire: e.g., a heading's font size, thickness, line spacing, color
[23:43:17] lalalaaa: Arcaire: haha
[23:43:19] sypheren: What is an element in HTML? just a tag that defines something?
[23:43:20] Arcaire: a section's background color, width, height
[23:43:25] Arcaire: <p> - a paragraph
[23:43:28] Arcaire: <h1> - a level-1 heading
[23:43:30] sypheren: I see, things contained in tags
[23:43:35] Arcaire: they have attributes, an ID and a class.
[23:43:41] Arcaire: IDs are unique, classes are not.
[23:43:45] lalalaaa: I work best when I'm in love
[23:43:56] lalalaaa: Or when something really cool has happened in my life
[23:44:06] lalalaaa: Or when I realize how much benefit completing this app is gonna give me lol
[23:44:14] Arcaire: You define things in CSS by tag type ("p"), ID ("#paragraph-one"), or class (".left-paragraphs").
[23:44:17] Maletor: has joined #RubyOnRails
[23:44:29] Arcaire: <p id="paragraph-one" class="left-paragraphs">
[23:44:45] sypheren: So you can distribute different CSS files to users and the same content will be formatted differently?
[23:45:02] sypheren: With the guarentee that the contect itself will all still be there
[23:45:24] Arcaire: Not sure why you'd want to do that other than to offer theme support or something, but yeah.
[23:45:25] sypheren: Okay, I understand that! Rails handles none of CSS/HTML except for embedded code, though?
[23:45:28] sevenseacat: HTML is for content. CSS is for look and feel of that content.
[23:45:31] dopie: so return , returns the value of the method , ignoring any loops
[23:45:32] Arcaire: Rails handles all of it.
[23:45:39] Arcaire: It handles the CSS/HTML too.
[23:45:45] lalalaaa: <p class="paragraph"> is better no?
[23:45:47] Arcaire: By handles, I mean you write it, and then it distributes it appropriately.
[23:45:48] trosborn: Sypheren: I like to think of HTML as just making boxes with text in them. Craigslist is an example of a website that is mostly HTML, with very little else. CSS styles and moves the boxes around – makes the text pink, makes the box position differently, changes the font, as a few examples.
[23:45:52] Arcaire: lalalaaa: It was for that specific example.
[23:45:53] ur5us: has joined #RubyOnRails
[23:45:55] lalalaaa: then you target with nth etc.
[23:46:11] lalalaaa: I'm just so used to cleaning up bad erb lol
[23:46:14] Arcaire: But yes, as a general rule you're correct.
[23:46:19] Arcaire: I do like IDs though.
[23:46:26] lalalaaa: Yeah I have to use them a lot too
[23:46:30] kirillzh: has joined #RubyOnRails
[23:46:32] lalalaaa: jquery mobile :(
[23:46:45] lalalaaa: but it's getting better. a lot in fact.
[23:47:10] Arcaire: But seriously if you call a CSS class "paragraph" I will print out your source code, fashion it into a papier mâché axe, and bludgeon you with it.
[23:47:25] sevenseacat: harsh, but deserved.
[23:47:41] sypheren: Arcaire, " I mean you write it, and then it distributes it appropriately" clears a lot up for me :) I was being really terrible at asking it though
[23:47:56] lalalaaa: i will find a more befitting name.
[23:47:57] Arcaire: Sypheren: Let's talk about the lifetime of a HTTP request at a high level so you get the idea.
[23:48:11] Arcaire: You want to access the 'profile' page of your web app, which is "yoursite.com/profile".
[23:48:12] sypheren: Rails doesnt give templates or scaffold for CSS or HTML
[23:48:33] Arcaire: You click the link or type it in or whatever, and rails sees "/profile".
[23:48:33] smathy: Sypheren, a static web page is just an HTML file (and optionally CSS, images, etc.) stored on a disk drive and when a browser requests it the web server just sends the content of that HTML file, and any other assets referred to from within that HTML file.
[23:48:38] sypheren: Not the *.com?
[23:48:48] Arcaire: Not really.
[23:48:49] smathy: Sypheren, Rails produces any amount of the above files dynamically.
[23:49:05] sevenseacat: ACTION thinks something about cooks and broth
[23:49:17] Arcaire: Yeah this would've worked until we went back to talk about HTML. B)
[23:49:18] smathy: Sypheren, it can produce the HTML file and/or the CSS and/or the images, or any other asset requested by the browser dynamically.
[23:49:19] Arcaire: It's ok I'll wait.
[23:49:19] lalalaaa: makes me think of crooks in brothels
[23:49:46] lalalaaa: i don't know where that came from, carry on
[23:50:41] uglybandersnatch: has joined #RubyOnRails
[23:51:05] sypheren: So the html is modified where the ERB is according to the content in some database it has?
[23:51:29] smathy: Sypheren, not modified, produced.
[23:51:52] sypheren: As well as CSS?
[23:52:22] smathy: Sypheren, there's some ERB (a template) sitting on the disk, and Rails grabs data from elsewhere, like a database, and uses that data in combination with the template to produce some HTML and then it sends that back to the browser.
[23:53:09] smathy: Sypheren, well, once a browser receives the HTML, if that HTML refers to a CSS URL then the browser requests that file as well and yes, that can also be either static, stored on the hard drive, or dynamic, produced by Rails.
[23:53:39] smathy: Sypheren, that's what I meant when I said: Rails produces any amount of the above files dynamically.
[23:54:06] smathy: Sypheren, Rails can produce any of the HTML, CSS, images, whatever dynamically.
[23:54:10] sonofdirt: has joined #RubyOnRails
[23:54:26] sypheren: So the erb file is 'compiled' to html/css and sent as requested
[23:54:42] sypheren: Images, too? How so?
[23:54:43] B4daBing73: has joined #RubyOnRails
[23:54:56] sypheren: As in, requesting images from a database, or literally generating images?
[23:54:57] Arcaire: Images and CSS I wouldn't recommend generating dynamically in almost all cases unless you *know* you need exactly that.
[23:55:01] maxdoubt: has joined #RubyOnRails
[23:55:01] Arcaire: You could do both.
[23:55:12] smathy: Sypheren, sure, you can call it compilation if you like.
[23:55:13] Arcaire: The best way though is to reference them as a file on disk, and return them that way. It's less work for Rails.
[23:55:23] smathy: Sypheren, anything you can do in a programming language, including both of those options.
[23:55:28] B4daBing73: has joined #RubyOnRails
[23:55:31] deuxclique: has joined #RubyOnRails
[23:55:57] sypheren: Can content be changed in realtime on the screen of the user, or would you still need something like the (very insecure) java app?
[23:56:09] Arcaire: Yeah you can do that.
[23:56:24] smathy: Sypheren, you can change things with client-side scripting, using Javascript that is sent to the browser and executed there.
[23:56:24] sypheren: But the html files are static when they get sent, aren't they:?
[23:56:46] Arcaire: Sypheren: The wonders of the following things for you to read up on: AJAX, WebSockets, and CRUD APIs.
[23:56:49] smathy: Sypheren, no, they can be changed by Javascript.
[23:57:03] sypheren: I think it's very unfortunately confusing that client side scripting has the same acronym as cascading style sheets
[23:57:19] smathy: Arcaire, even without any of those things, JS can change the HTML after they're sent.
[23:57:24] Arcaire: client-side scripting was just smathy's nomenclature tbh
[23:57:28] sevenseacat: not really, because if you say CSS, no-one is going to think 'client side scripting'
[23:57:57] Arcaire: 99% of the time it'll be JS in some way, shape, or form.
[23:57:57] smathy: Arcaire, not really "just smathy's": https://en.wikipedia.org/wiki/Client-side_scripting
[23:58:06] sypheren: I'll write those three things down and do some reading, Arcaire
[23:58:12] Arcaire: Is now really the appropriate time to get really pedantic, smathy?
[23:58:27] sypheren: Isn't JS horribly insecure?
[23:58:31] smathy: Arcaire, heh, pot, kettle.
[23:59:07] sypheren: API meaning tools to create graphical content>
[23:59:17] Scripore: has joined #RubyOnRails
[23:59:26] Arcaire: Not really, I mean I guess you could work it that way.