« Back to channel list

#RubyOnRails - 09 December 2015

« Back 1 day Forward 1 day »
[00:00:25] sevenseacat: it adds a little bit of indirection and magic - some people would prefer to (in my scenario) call load_form_options directly from every action its required in
[00:00:35] proboszcz: has joined #RubyOnRails
[00:00:57] Cervajz: has joined #RubyOnRails
[00:03:13] sevenseacat: but i am lazyprogrammer
[00:04:14] pipework: sevenseacat: http://i.imgur.com/vN4LN3z.gif
[00:04:29] diegoviola: has joined #RubyOnRails
[00:04:33] helpa: nope nope nope
[00:06:43] diegoviola: has joined #RubyOnRails
[00:10:02] shanemcd: has joined #RubyOnRails
[00:10:14] Tokenizer: has joined #RubyOnRails
[00:14:54] teclator: has joined #RubyOnRails
[00:16:30] Rodya_: has joined #RubyOnRails
[00:16:41] nettoweb: has joined #RubyOnRails
[00:16:47] hadees: has joined #RubyOnRails
[00:17:18] lacuna: has joined #RubyOnRails
[00:17:19] lacuna: has joined #RubyOnRails
[00:17:47] hadees: I need to make a rather complicated html component, basically a table of Users and i'm feeling like a helper class isn't really the best option, I want to make a class I create but I'm not sure what pattern that is. Is it a decorator? where should I store this class?
[00:18:53] sevenseacat: why do you need a class to render a table of users?
[00:18:55] hahuang65: has joined #RubyOnRails
[00:19:04] Axy: has joined #RubyOnRails
[00:19:04] Axy: has joined #RubyOnRails
[00:19:15] Scriptonaut: ActiveRecord order can take an argument of the form: .order(first_name: :desc). How do I store and pass in that pair of symbols? Simply writing: order_by = name: :desc results in a syntax error. Can I do: order_by = "name: :desc".to_sym? I'm not sure the best way to store that pair as a value
[00:19:45] sevenseacat: {first_name: :desc} is a hash
[00:19:46] fcser_: has joined #RubyOnRails
[00:19:59] sevenseacat: its not a 'pair of symbols'
[00:20:14] hardtail: has joined #RubyOnRails
[00:20:29] Scriptonaut: ah ,so just pass it {first_name: :desc}
[00:20:38] Scriptonaut: why don't they make you pass in the curly brackets?
[00:20:47] sevenseacat: because theyre not required
[00:20:57] Scriptonaut: ok, so it's the same as if you were passing in a hash?
[00:21:08] Pazician: has joined #RubyOnRails
[00:21:11] sevenseacat: its not 'as if', you *are* passing in a hash
[00:21:13] wildlander: has joined #RubyOnRails
[00:21:34] slash_away: Scriptonaut: you don't need it when it's the last argument
[00:21:49] sloggerkhan: has joined #RubyOnRails
[00:22:30] shibabu: has joined #RubyOnRails
[00:23:04] annlewis: has joined #RubyOnRails
[00:23:14] ascarter: has joined #RubyOnRails
[00:23:14] Scriptonaut: thanks slash_away and sevenseacat
[00:23:17] Symbiosisz: has joined #RubyOnRails
[00:23:17] Scriptonaut: that clears it up
[00:23:24] p8m: has joined #RubyOnRails
[00:23:25] adam_: has joined #RubyOnRails
[00:24:02] kanzure: has joined #RubyOnRails
[00:25:31] hadees: sevenseacat: I'm trying to create a reusable component that is tied to some special frontend javascript
[00:25:47] jrvlima: has joined #RubyOnRails
[00:26:00] sevenseacat: okay, so like just a partial?
[00:26:06] hadees: sevenseacat: at first I didn't think I did but once I started writing it, i started adding more and more helper methods in the helper module
[00:26:28] hadees: sevenseacat: no, it needs to be more configuarable
[00:26:36] chandlerbing: has joined #RubyOnRails
[00:26:38] gaustin_: has joined #RubyOnRails
[00:26:48] sevenseacat: how configurable can a table be?
[00:27:32] hadees: sevenseacat: you've never used a table that lets you preform multiple types of actions on a user?
[00:27:54] sevenseacat: sure, but whats 'configurable' about that?
[00:28:07] sevenseacat: you're feeding like 2% of the story to us with each sentence
[00:28:11] hadees: the actions, the columns, who shoes up
[00:28:40] hadees: sevenseacat: because i'm asking where to put a view class, i already know I want to write one
[00:29:41] axl__: has joined #RubyOnRails
[00:29:45] sevenseacat: okay. its really not a common thing to do, so the answer is 'i dont know, i've never done it'
[00:30:04] sevenseacat: i still dont really see the use case
[00:30:58] sarink: has joined #RubyOnRails
[00:31:09] RegulationD: has joined #RubyOnRails
[00:31:09] jbrhbr: has joined #RubyOnRails
[00:31:12] hadees: sevenseacat view models are more common in larger applications, I get you don't see the use case but I'm pretty confident it's the right approach. I'm just going to create a view_models directory
[00:33:38] CarlosYoo: has joined #RubyOnRails
[00:33:39] Scriptonaut: is there a special syntax to order activerecord columns by a string field alphabetically?
[00:33:59] sevenseacat: the same syntax you used before?
[00:34:11] sevenseacat: order(your_field: :asc) or desc
[00:34:19] Scriptonaut: I do: Person.order(first_name: :desc).first, and Person.order(first_name: :asc).first, and they're the same guy (and the list is very large)
[00:34:44] sevenseacat: do you have any other scopes on your model?
[00:34:48] sevenseacat: that are being used
[00:34:58] Scriptonaut: ya, it's actually a scope that I'm using it on
[00:35:50] sevenseacat: then the other scope is being applied first
[00:35:52] helpa: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[00:37:06] colleenmcguckin: has joined #RubyOnRails
[00:38:57] Scriptonaut: Oh, there is an order clause earlier in the thing
[00:39:01] Scriptonaut: could that be causing it?
[00:39:27] sevenseacat: of course. thats being applied first.
[00:39:53] Scriptonaut: ah, I got it now, thanks again :)
[00:39:58] sevenseacat: if you want to reorder the results to use just your new ordering, use reorder(stuff: :asc) instead of order
[00:40:05] ap4y: has joined #RubyOnRails
[00:40:51] sevenseacat: http://apidock.com/rails/ActiveRecord/QueryMethods/reorder
[00:44:01] edwinvdgraaf: has joined #RubyOnRails
[00:44:16] jbrhbr: has joined #RubyOnRails
[00:47:39] DLSteve: has joined #RubyOnRails
[00:49:12] diego1: has joined #RubyOnRails
[00:51:15] asteros: has joined #RubyOnRails
[00:52:52] ascarter: has joined #RubyOnRails
[00:54:00] K_r3aPeR: has joined #RubyOnRails
[00:54:13] bronson: has joined #RubyOnRails
[00:55:33] juddey: Radar: You round?
[00:56:03] juddey: May I step into your private office (pm)?
[00:56:20] banister: has joined #RubyOnRails
[00:56:27] juddey: Radar: May I step into your private office (pm)?
[00:56:43] rromanchuk: has joined #RubyOnRails
[00:56:44] rromanch_: has joined #RubyOnRails
[00:59:08] axl_: has joined #RubyOnRails
[00:59:53] jessemcgilallen: has joined #RubyOnRails
[01:00:18] hardtail: has joined #RubyOnRails
[01:06:15] SteenJobs: has joined #RubyOnRails
[01:09:07] atrius: has joined #RubyOnRails
[01:09:23] jgt3: has joined #RubyOnRails
[01:10:24] CarlosYoo: has joined #RubyOnRails
[01:10:43] CarlosYoo: has joined #RubyOnRails
[01:11:29] wildlander: has joined #RubyOnRails
[01:13:53] one_zero: has joined #RubyOnRails
[01:15:29] diego1: has joined #RubyOnRails
[01:15:43] wldcordeiro: has joined #RubyOnRails
[01:19:22] annlewis: has joined #RubyOnRails
[01:21:48] sankaber: has joined #RubyOnRails
[01:22:07] hadees: has joined #RubyOnRails
[01:24:01] asteros: has joined #RubyOnRails
[01:25:27] bruce_lee2: has joined #RubyOnRails
[01:27:13] triangles: How much has Capistrano changed over time? I've got a video guide to it here, but it's from 2007.
[01:27:21] triangles: Is it still good, or should I ignore it?
[01:28:56] owenjones: has joined #RubyOnRails
[01:29:55] null__: 2007 is a *long* time ago
[01:30:23] null__: 2007 was when ruby 1.9 was released
[01:30:24] sevenseacat: there was a massive jump between cap 2 and cap 3, and your video is likely for cap 1.
[01:32:07] creyes: has joined #RubyOnRails
[01:32:15] Axighi: has joined #RubyOnRails
[01:32:23] RegulationD: has joined #RubyOnRails
[01:32:35] Axighi: has joined #RubyOnRails
[01:32:52] djbkd: has joined #RubyOnRails
[01:33:19] crystalneth: has joined #RubyOnRails
[01:33:29] zeel: has joined #RubyOnRails
[01:34:01] creyes_: has joined #RubyOnRails
[01:34:28] creyes_: Anyone know of a gem that'll allow me to track the amount of time t takes a user to fill out a form?
[01:35:41] zeel: creyes_: do it via google analytics? no need for a gem
[01:36:22] zeel: https://developers.google.com/analytics/devguides/collection/analyticsjs/user-timings?hl=en
[01:36:46] zeel: alternatively: http://screentime.parsnip.io/
[01:36:51] creyes_: Nah I need to use the info in the administrator dashboard. Eg, therapist fills out a form when with client. Want to to store a value in the that tracks that time
[01:37:06] creyes_: Store a value in the db*
[01:37:42] zeel: you would have to do it via the front end, I don't think there is a gem specifically for this
[01:37:56] CarlosYoo: has joined #RubyOnRails
[01:38:08] debster: has joined #RubyOnRails
[01:38:15] Radar: triangles: Here is a more up-to-date blog post about deploying a Rails app with Capistrano: http://ryanbigg.com/2015/07/deploying-a-rails-application-on-ubuntu-passenger-edition/
[01:38:26] creyes_: Like log load time -> time submit is pressed? Then pass that in a before_save action?
[01:38:51] Radar: The one from 2007 will neglect to mention setting up secrets and precompiling assets, which are crucial for today's Rails aps
[01:38:58] zeel: https://github.com/robflaherty/screentime/blob/master/screentime.js see from line 65
[01:38:59] pwnd_nsfw: has joined #RubyOnRails
[01:39:23] zeel: yeah, based on form visibility, run an interval to track time elapsed
[01:39:41] creyes_: Hmm thanks zeel I think this will work
[01:39:43] zeel: send that as part of the post request on form submission
[01:39:50] zeel: just a thought ;)
[01:40:18] diego1: has joined #RubyOnRails
[01:40:40] christiandsg: has joined #RubyOnRails
[01:40:55] diego1: has joined #RubyOnRails
[01:42:31] dstarh: has joined #RubyOnRails
[01:44:06] asteros: has joined #RubyOnRails
[01:45:12] lessless: has joined #RubyOnRails
[01:45:25] sarink: has joined #RubyOnRails
[01:45:42] nbdy: has joined #RubyOnRails
[01:46:01] CarlosYoo: has joined #RubyOnRails
[01:52:08] crystalneth: has joined #RubyOnRails
[01:53:01] djbkd_: has joined #RubyOnRails
[01:56:43] LambdaSource: has joined #RubyOnRails
[01:56:59] eddiegrey_: has joined #RubyOnRails
[01:57:33] eddiegrey: has joined #RubyOnRails
[01:58:42] sonofdirt: has joined #RubyOnRails
[02:00:16] sevenseacat: has joined #RubyOnRails
[02:00:28] djbkd: has joined #RubyOnRails
[02:00:36] diego1: has joined #RubyOnRails
[02:01:17] diego1: has joined #RubyOnRails
[02:01:27] Cervajz: has joined #RubyOnRails
[02:01:49] eddiegrey_: has joined #RubyOnRails
[02:02:48] IrishGringo: has joined #RubyOnRails
[02:02:53] eddiegrey: has joined #RubyOnRails
[02:03:02] blackmesa: has joined #RubyOnRails
[02:12:46] nertzy: has joined #RubyOnRails
[02:16:25] thelasti_: has joined #RubyOnRails
[02:18:27] colleenmcguckin: has joined #RubyOnRails
[02:21:59] Pazician: has joined #RubyOnRails
[02:22:37] Oliphaunte: has joined #RubyOnRails
[02:23:17] CarlosYoo: has joined #RubyOnRails
[02:24:49] flashpoint9: has joined #RubyOnRails
[02:25:40] owenjones: has joined #RubyOnRails
[02:25:56] annlewis: has joined #RubyOnRails
[02:30:51] owenjones: has joined #RubyOnRails
[02:31:00] pwnd_nsfw: has joined #RubyOnRails
[02:32:35] CarlosYoo: has joined #RubyOnRails
[02:32:55] Jasaka: has joined #RubyOnRails
[02:35:06] Maletor: has joined #RubyOnRails
[02:35:47] boxofrox: has joined #RubyOnRails
[02:36:07] n1lo: has joined #RubyOnRails
[02:41:57] dstarh: has joined #RubyOnRails
[02:44:35] akshat: has joined #RubyOnRails
[02:44:40] Oliphaunte: has joined #RubyOnRails
[02:45:23] DavidDudson: has joined #RubyOnRails
[02:49:03] boxofrox: anyone know how a controller configures ActionController::ParamsWrapper::Options with respect to the controller's associated model? i've tossed `puts` statements in the constructor of ParamsWrapper::Options, only see one log for json format for ActionController::Base, yet my PuchaseController fails to wrap the parameters--gives `purchase => {}` and indicates the ParamsWrapper options are tailored to the
[02:49:05] boxofrox: Purchase model.
[02:50:02] ascarter: has joined #RubyOnRails
[02:50:12] LambdaSource: has joined #RubyOnRails
[02:50:31] boxofrox: ParamsWrapper appears to be a value object, so I confused at how the options are changed without a new instance.
[02:51:37] pwnd_nsfw: has joined #RubyOnRails
[02:54:16] boxofrox: strike that last bit. it's not a value object. something is changing its values through setters. gah ><
[02:56:12] _Tariq: has joined #RubyOnRails
[02:56:43] user083: has joined #RubyOnRails
[02:57:27] eddiegrey: has joined #RubyOnRails
[02:58:49] maloik: has joined #RubyOnRails
[02:59:41] user083: has joined #RubyOnRails
[03:00:01] Radar: xy problem so hard
[03:00:04] Radar: boxofrox: !xy
[03:00:04] helpa: boxofrox: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[03:00:08] Radar: boxofrox: !specific
[03:00:08] helpa: boxofrox: Questions concerning problems with code you've written must describe the specific problem and include valid code to reproduce it. See http://SSCCE.org for guidance.
[03:00:25] Darkman738: has joined #RubyOnRails
[03:01:07] user083: has joined #RubyOnRails
[03:01:23] _Tariq: has joined #RubyOnRails
[03:01:34] pwnd_nsfw: has joined #RubyOnRails
[03:02:41] Darkman738: hi all, I'm working on some validation in a tableless model and I can't seem to get this custom validation to throw when providing incorrect input: http://pastebin.com/Dbw01r99
[03:02:47] CarlosYoo: has joined #RubyOnRails
[03:02:58] n1lo: has joined #RubyOnRails
[03:03:58] corioliss: has joined #RubyOnRails
[03:04:45] Darkman738: http://pastie.org/private/2vgyde6t3kx4463rjjw I guess this is a friendlier host
[03:05:45] tasaif: has joined #RubyOnRails
[03:06:19] blackmesa: has joined #RubyOnRails
[03:06:23] tasaif: when I do rails generate model X, what type should I use for the date? just an integer?
[03:07:41] elton: has joined #RubyOnRails
[03:07:59] shanemcd: has joined #RubyOnRails
[03:08:46] DLSteve: has joined #RubyOnRails
[03:09:57] boxofrox: Radar: thanks, but I'm just trying to understand how rails uses ParamWrapper, but the source hasn't been easy to understand. Now that I've corrected my assumption about the value object, I'm making progress again.
[03:11:54] Radar: boxofrox: But why do you want to understand that?
[03:12:03] Radar: boxofrox: What are you hoping to get out of this understanding?
[03:13:15] diegoviola: has joined #RubyOnRails
[03:14:27] Mia: has joined #RubyOnRails
[03:14:28] Mia: has joined #RubyOnRails
[03:15:13] boxofrox: I want to understand why all the params coming from my client aren't wrapped, and if it's necessary to use `wrap_parameters` to override the default behavior.
[03:15:28] diegoviola: has joined #RubyOnRails
[03:16:12] sonofdirt: has joined #RubyOnRails
[03:16:23] sevenseacat: things dont get wrapped by default
[03:16:35] sevenseacat: the params you get are the params you pass in
[03:16:43] sevenseacat: (plus a few extra)
[03:17:28] Radar: sevenseacat: uh, they do if you specify the JSON content type iirc
[03:17:48] sevenseacat: that would be... weird.
[03:17:52] Radar: boxofrox still hasn't followed the crew member instructions or lighted signs, so I give up.
[03:18:01] Radar: "PLZ HALP" "Show us the code" "PLZ HALP"
[03:18:11] sevenseacat: ah yes, for json you do.
[03:18:11] _Tariq: has joined #RubyOnRails
[03:18:17] sevenseacat: however, json wasnt mentioned at all.
[03:18:23] uris: has joined #RubyOnRails
[03:18:23] boxofrox: i have config/initializers/wrap_parameters.rb in my repo's initial commit. i can't recall if I added it or if rails v4.1 initialized with it.
[03:18:26] krzkrzkrz: has joined #RubyOnRails
[03:18:45] shibabu: has joined #RubyOnRails
[03:18:50] Radar: boxofrox: New Rails apps come with it.
[03:20:29] boxofrox: yea, i'm working with json. it was mentioned off-hand in my initial question.
[03:20:56] Radar: One more time.
[03:20:57] helpa: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[03:21:16] Radar: If you can't follow that instruction then I'm going to put you on /ignore and carry on with my day.
[03:21:28] ivanyk_: has joined #RubyOnRails
[03:21:30] boxofrox: anyway, like I told Radar, I'm making progress figuring it out, so carry on as you please.
[03:21:37] ElectricAlan: has joined #RubyOnRails
[03:21:49] sevenseacat: ElectricAlan: afternoon
[03:21:50] ElectricAlan: ACTION is back, yo
[03:22:00] ElectricAlan: hey sevenseacat, how goes it?
[03:22:05] sevenseacat: not bad, and yourself?
[03:22:34] ElectricAlan: hey where you located on this planet? is just afternoon here, but I get used to the idea that ppl on the internet aren't in my time zone
[03:22:42] ElectricAlan: like, other side of the world kinda thing
[03:22:47] ElectricAlan: I'm in Adelaide, Australia
[03:22:52] Radar: ACTION is in Melbourne AU
[03:22:53] sevenseacat: atm in Sydney, but live in Perth
[03:23:21] ElectricAlan: yeah I'm doing alright
[03:23:33] ElectricAlan: you guys even more rad than I thought
[03:23:44] sevenseacat: ACTION is in Sydney until Friday, then in Canberra until Monday, then back home to sunny Perth
[03:24:09] htmldrum: Is it possible to serialize an array in ActiveModel::Serializer without having that array be the result of an ActiveRecord query? I've got a serializer and I just want to output extra virtual fields for a virtual has_many relation.
[03:24:50] ElectricAlan: so my latest issue is trying to view my applicaiton in my hosts browser, and the app is running on a VM
[03:24:58] ElectricAlan: but that's a vbox question not a ror one
[03:25:08] ElectricAlan: and the vbox channel didn't seem as active and helpful
[03:25:41] sevenseacat: should be okay if you point to the right IP address from the host
[03:26:03] sevenseacat: thought maybe you'll need to start the app bound to 0.0.0.0
[03:26:18] hello9: has joined #RubyOnRails
[03:26:43] annlewis: has joined #RubyOnRails
[03:26:52] hello9: is there a way to delete a "new" (i.e unsaved, nil id'd) activerecord object from an array?
[03:27:21] Radar: hello9: yes
[03:27:27] ElectricAlan: that's what I thought
[03:27:33] Radar: HELPA HAS SPOKEN
[03:27:40] sevenseacat: typically I'd just put a conditional when iterating over them
[03:27:42] hello9: ive tried subtracting another new record with the same attributes, and calling .delete
[03:27:54] Radar: Free kick for the next person to ask about code without showing code.
[03:28:08] hello9: Radar, ill gist, its just not code specific
[03:28:10] Radar: hello9: That means you!
[03:28:44] sevenseacat: ACTION behaves and goes back to building Super Mega Ultimate Search Form
[03:28:45] ElectricAlan: sevenseacat, I used to be able to view my app at 192.168.0.10:3000 or something I think
[03:28:46] zeel: can't I just show you my Gemfile? will that help?
[03:29:00] sevenseacat: ElectricAlan: yeah that sounds like it should work if the IP is correct
[03:29:02] Radar: zeel: Huh?
[03:29:18] ElectricAlan: yeah it used to work, but now doesn't
[03:29:19] sevenseacat: help for what?
[03:29:24] zeel: the Gemfile contains all my source code right
[03:29:30] sevenseacat: ElectricAlan: got the right IP?
[03:29:33] zeel: (just kidding)
[03:29:35] ElectricAlan: also the ifconfig outputchanged
[03:29:41] tasaif: sevenseacat, thanks
[03:29:46] ElectricAlan: don't have static ip set up, tha's probably what I want to do
[03:29:54] ElectricAlan: but now the new ip listed doesn't work like the old one
[03:30:08] B1n4r10: has joined #RubyOnRails
[03:30:17] zeel: ElectricAlan: which address are you binding to on `rails s` ?
[03:30:34] ElectricAlan: that's the default right?
[03:30:35] zeel: that should work
[03:30:40] zeel: yeah, just making sure
[03:30:51] sevenseacat: can we define 'doesnt work'?
[03:31:10] bronson: has joined #RubyOnRails
[03:32:07] ElectricAlan: I get invalid address or connection timed out
[03:32:12] ElectricAlan: if I try the wrong ip
[03:32:25] hello9: Radar, https://gist.github.com/anonymous/ead02990314f77b095c1
[03:32:33] sevenseacat: what about if you try the right IP? >_>
[03:32:35] hello9: it works btw when I try a saved record (i.e with an id)
[03:32:57] ElectricAlan: https://gist.github.com/anonymous/5f978f3f3a17d07597bc
[03:33:14] RegulationD: has joined #RubyOnRails
[03:33:14] ElectricAlan: that's the output of ifconfig
[03:33:24] boxofrox: hello9: try a.delete_if { |x| x.id.nil? }
[03:33:38] Radar: hello9: a.select(&:persisted?)
[03:34:06] zeel: ElectricAlan: do you have port forwarding correctly set up via virtualbox?
[03:34:52] ElectricAlan: I am pretty sure I did that before
[03:35:09] ElectricAlan: like I used to be able to view the app in my host browser before
[03:35:18] ElectricAlan: so presumably I needed port forwarding set up for that
[03:35:23] ElectricAlan: will go double check
[03:35:24] zeel: is http://10.0.2.15:3000 not resolving then?
[03:35:42] hello9: Radar, so if there are multiple non-persisted recs, then I have to select on those by description?
[03:35:50] Maletor: has joined #RubyOnRails
[03:35:53] Radar: hello9: what
[03:36:08] Radar: hello9: I'm assuming that extra post is there because you did something like model.posts.build
[03:36:22] hello9: there can be multiple nils
[03:36:23] Radar: But you're not going to show any actual code because that'd be being useful and this is the Hour of Uselesness.
[03:36:33] sevenseacat: it appears to be so.
[03:36:34] Radar: hello9: !specific
[03:36:34] helpa: hello9: Questions concerning problems with code you've written must describe the specific problem and include valid code to reproduce it. See http://SSCCE.org for guidance.
[03:36:53] Radar: ACTION struggles to understand how it is hard to grasp that people want actual code to help you fix actual code issues
[03:37:00] ElectricAlan: zeel, yeah that address is timing out
[03:37:34] hello9: I more or less was just wondering if i was just doing something wrong
[03:37:40] hello9: with subtracting the nil
[03:37:44] ElectricAlan: hello9, I think if you post code it gives them abit of context and a bettter idea of what you're trying to do than jsut you trying to communicate it
[03:37:48] hello9: but i guess its just not supported
[03:37:48] i: has joined #RubyOnRails
[03:37:58] hello9: ElectricAlan, yeah, its just a lot of time :)
[03:38:09] ElectricAlan: take it from a fellow scrub
[03:38:15] sevenseacat: hello9: given you didnt show us the output of what you were doing and told us if it was what you were after or not
[03:38:23] sevenseacat: we have nfi and cannot read your mind
[03:38:29] ElectricAlan: it takes longer if the ppl helping you can't
[03:38:34] sevenseacat: we answered the questions you asked
[03:38:41] sevenseacat: but it appears you were XYing like a mofo
[03:38:43] Axighi: has joined #RubyOnRails
[03:38:54] helpa: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[03:38:58] user1138: has joined #RubyOnRails
[03:39:00] Axighi: has left #RubyOnRails: ()
[03:39:09] Radar: hello9: This is the second time this week that we've had this discussion with you.
[03:39:17] BlackCoyote: has joined #RubyOnRails
[03:39:34] hello9: I was just kind of asking if that is supported by AR
[03:39:41] Radar: Had it yesterday too.
[03:39:43] sevenseacat: its got nothing to do with AR
[03:39:44] hello9: i.e subtraacting non-persisted records
[03:39:47] Radar: Radar kicked hello9: thanks
[03:39:47] sevenseacat: you're using plain ruby methds
[03:40:04] Radar: Several warnings and still...
[03:40:24] sevenseacat: ACTION dusts off Radar's kicking shoes
[03:40:34] versatiletech: has joined #RubyOnRails
[03:41:00] ElectricAlan: that just happened
[03:41:06] DiCablo: has joined #RubyOnRails
[03:41:07] boxofrox: ignoring him wasn't an acceptable option?
[03:41:17] zeel: ElectricAlan: It might be your subnet mask I think
[03:41:22] Radar: boxofrox: Following instructions from those who are trying to help you wasn't an acceptable option?
[03:41:31] sevenseacat: boxofrox: we have channel rules.
[03:41:34] Radar: boxofrox: imo, it is disruptive to the channel to continue in such a manner. Hence: kick.
[03:41:38] sevenseacat: boxofrox: we appreciate when people follow them.
[03:41:40] Rodya_: has joined #RubyOnRails
[03:42:01] ElectricAlan: I think it's more that it's simpler to jsut kick him now than carry on for a while and make radar get angry
[03:42:05] sevenseacat: also, probably shouldnt assume it's a "him"
[03:42:13] ElectricAlan: it might be better ^
[03:42:16] boxofrox: right. and toss them out if they don't. got it.
[03:42:32] sevenseacat: boxofrox: we give lots and lots of warnings
[03:42:41] ElectricAlan: yeah the warnings were very real
[03:42:42] sevenseacat: number varies depending on mood and frequency of rule-breaking
[03:42:52] boxofrox: yes, i did notice those.
[03:43:13] sevenseacat: but if you think we get out of line, please do let us know.
[03:43:26] zeel: ElectricAlan: are you using vagrant for your virtualbox?
[03:43:30] sevenseacat: we are only human and have bad days like the rest :)
[03:43:42] sevenseacat: ACTION had a bad day yesterday -_-
[03:43:45] boxofrox: i just didn't see it coming. i'll get over it.
[03:44:03] ElectricAlan: zeel, I have port forwarding set up for the NAT adapter, I have a bridged adapter also, but the port forwarding button is disabled on that tab
[03:44:14] ElectricAlan: zeel, sry idk what vagrant means
[03:44:22] zeel: it means a homeless person
[03:44:43] ElectricAlan: yeah I know that
[03:44:43] ElectricAlan: idk what it means in context
[03:44:56] zeel: http://www.linuxjournal.com/content/introducing-vagrant
[03:44:58] hello9: has joined #RubyOnRails
[03:44:59] sevenseacat: its a library used for spinning up VMs for use in development
[03:45:11] ElectricAlan: I'm not using that
[03:45:22] ElectricAlan: I still jerk off manually
[03:45:27] DiCablo: hello guys, I just wonder what would be best way to create a simple rails app that would edit text of exiting html templates, and I don't plan to use any database tbh
[03:45:50] Radar: https://gist.github.com/radar/996779#what-happens-when-you-break-the-rules
[03:45:59] CarlosYoo: has joined #RubyOnRails
[03:46:01] Radar: Codified what happens when someone breaks the rules since we have this discussion lots and lots.
[03:46:18] diegoviola: has joined #RubyOnRails
[03:46:32] Radar: iirc, only mices is up to #7 atm.
[03:47:02] Radar: DiCablo: Hi, it looks like you're trying to create a CMS. May I suggest running very quickly in the other direction?
[03:47:13] Radar: DiCablo: Alternatively: look at Refinery and/or comfortable-mexican-sofa.
[03:47:16] sevenseacat: ElectricAlan: TMI :P
[03:47:23] Radar: And the static site generators like nanoc, jekyll and ghost.
[03:47:35] ElectricAlan: sevenseacat, was trying for a big lebowski reference
[03:47:40] ElectricAlan: not sure why I felt that was necessary
[03:48:11] sevenseacat: Radar: ok, good to have it stated and in the place we link everyone too
[03:48:19] diegoviola: has joined #RubyOnRails
[03:48:41] ElectricAlan: zeel, I have guest 10.0.2.15:22 set to forward to host 127.0.1.1:22
[03:48:52] ElectricAlan: can't remember why at the time but tha'ts how I set it up
[03:48:56] sevenseacat: 22 is for ssh, no?
[03:49:08] diegoviola: has joined #RubyOnRails
[03:49:28] ElectricAlan: yeah I remember now
[03:49:45] ElectricAlan: this was set up so I can ftp from host
[03:49:54] ElectricAlan: not for serving pages to a browser
[03:50:08] zeel: I was just about to spam you a bunch of SO links for your problem
[03:50:10] boxofrox: Radar: rules read and acknowledged.
[03:50:16] Radar: boxofrox: Thank you.
[03:50:30] zeel: ElectricAlan: resolved now I guess?
[03:51:09] zeel: I had a similar issue in regards to it by using the IE vms to test some stuff on
[03:51:17] zeel: can't remember the exact solution
[03:51:24] zeel: http://unix.stackexchange.com/questions/242920/virtual-box-guest-on-different-subnet-than-host
[03:51:33] zeel: http://stackoverflow.com/questions/25433488/vagrant-can-not-ping-guest-machine-from-the-host
[03:51:45] zeel: http://superuser.com/questions/280241/virtualbox-connecting-host-only-networks-on-separate-hosts <-- most detailed explanation
[03:51:47] ElectricAlan: I kinda don't want to bother with this, because I can use the guest browser, but it's so slow, I know I'll eventually save time if I get it sorted now
[03:52:07] ElectricAlan: win7 host, ubuntu guest, if that matters
[03:52:13] DavidDudson: has joined #RubyOnRails
[03:52:55] zeel: At the time I was trying to figure it out with Mac Host Ubuntu Guest trying to connect from Win7 guest
[03:53:04] zeel: but you might have something else obscure going on
[03:53:33] ElectricAlan: am I right in wanting a NAT and bridged conncections?
[03:53:52] ElectricAlan: thanks for lettting me discuss this here btw, and even being helpful
[03:54:13] SteenJobs: has joined #RubyOnRails
[03:54:29] ElectricAlan: I know some channels don't allow off-topic discussion, even when it's this closely related
[03:55:01] DiCablo: Radar thank you for your suggestion I just take a look at comfortable-mexican-sofa and Refinery but that's not really what I need. So may I query you so that I can explain it to you :)
[03:55:03] djbkd: has joined #RubyOnRails
[03:55:19] Radar: DiCablo: Can I send you through my private consultating contract?
[03:55:22] Radar: consulting*
[03:55:34] Radar: I'll need you to sign it before I do any private consulting.
[03:55:44] Radar: Of course you can just talk about it in this channel too.
[03:55:46] sevenseacat: ElectricAlan: most of the time we dont mind it, but sometimes people get waaaaaay off topic and do it *all the time* so we poke them back in line
[03:56:30] ElectricAlan: I am aware the level of tolerance varies with channel acctivity
[03:56:58] sevenseacat: in the past, this kind of bridging has 'just worked' for me but I don't do it often.
[03:56:59] ElectricAlan: zeel, I'm going to try and remove the nat adapter and just have bridged
[03:57:16] zeel: ElectricAlan: go back to basics, spin up a static server on your host and try connect via that
[03:57:18] ElectricAlan: that might mean I can't ftp tho, or will have to change soemthine else to let me do that
[03:57:29] zeel: then for sure you know it's a virtualbox configuration issue
[03:57:36] zeel: unless you test that and can confirm
[03:57:43] zeel: process of elimination, remember
[03:58:00] ElectricAlan: when you say static server, what do you mean
[03:58:23] zeel: do you have ruby installed on your windoze box?
[03:58:40] Spami: has joined #RubyOnRails
[03:59:03] berserk_ren: has joined #RubyOnRails
[03:59:14] zeel: https://gist.github.com/willurd/5720255
[04:00:00] ElectricAlan: nah everything is only installed on the vm
[04:00:13] ElectricAlan: right you wanted me to run a server on the host
[04:00:24] ElectricAlan: that might tkae more time to set up than it's worth for me right now
[04:00:59] sbarg: has joined #RubyOnRails
[04:01:15] ElectricAlan: oh wow, maybe it isnt, didn't realise you can jsut do that so simply
[04:01:35] ElectricAlan: ACTION installs ruby
[04:02:41] zeel: in the words of the late Mr Michael Jackson, it's as easy as 123
[04:03:17] DiCablo: ok so as a newbie in rails i have thought of making a simple app that will add a text into a exciting template and then to generate that into a pdf
[04:03:46] DiCablo: i have managed to make pdfkit working
[04:04:09] cyrin: has joined #RubyOnRails
[04:04:14] DiCablo: but wonder how i can make a user to add a input into that html file
[04:04:48] zeel: DiCablo: you need to use a templating engine ideally
[04:04:55] zeel: for sanity's sake
[04:05:32] zeel: http://liquidmarkup.org/
[04:05:49] sevenseacat: or just use ERB which comes with rails
[04:06:31] sevenseacat: sounds like you want a form where a user can input that text, then you process the form when they submit it, and generate the pdf
[04:06:36] sevenseacat: with the right content
[04:07:03] zeel: lol so simple
[04:07:16] DiCablo: like I said i am a n00b :P
[04:07:23] DiCablo: still learning programming :D
[04:07:52] zeel: so basically the work is already done for you in that regards, you then have to figure out how to process the output of the html
[04:08:07] blackmesa: has joined #RubyOnRails
[04:09:50] braincrash: has joined #RubyOnRails
[04:11:17] ElectricAlan: zeel, once ruby is installed I should be able to jsut type 'ruby' into the win command prompt yeah?
[04:11:37] ElectricAlan: says ruby isn't recognised
[04:11:49] jhn: has joined #RubyOnRails
[04:12:28] ElectricAlan: thought maybe I had to open a new window, but not. I'm not that familiar with this territory but I'd guess I need to add ruby to my path?
[04:12:54] Didac: has joined #RubyOnRails
[04:13:43] zeel: ElectricAlan: possibly, I'm not sure in Windows environments
[04:14:05] sevenseacat: depending on how you installed ruby, that should have been a checkbox in the install process
[04:14:26] ElectricAlan: hmm, I don't remember any checkboxes
[04:15:44] ascarter: has joined #RubyOnRails
[04:17:37] ElectricAlan: what the shit? I can't copy output from cmd prompt
[04:17:51] ElectricAlan: how the balls am I supposed to pastie it to ppl?
[04:18:18] boxofrox: i think right mouse drag in cmd will highlight and copy.
[04:19:18] ElectricAlan: I can select and copy all
[04:19:22] iamayam: right click, select Mark
[04:19:28] ElectricAlan: jsut not excerpts
[04:19:43] CarlosYoo: has joined #RubyOnRails
[04:20:37] ElectricAlan: so here's the relevent output from my host and guest configs
[04:20:37] ElectricAlan: http://pastie.org/10619740
[04:20:39] edwinvdgraaf: has joined #RubyOnRails
[04:21:16] ElectricAlan: looks like the subnet mask is the same, except for the loopback connection(or w/e I should call it)
[04:21:53] boxofrox: iamayam got it right. last tip at http://www.howtogeek.com/howto/windows-vista/copy-to-the-clipboard-from-the-windows-command-prompt/
[04:22:51] Pazician: has joined #RubyOnRails
[04:22:53] ElectricAlan: yeah I made it past that issue thanks
[04:23:23] DavidDudson: has joined #RubyOnRails
[04:23:25] ElectricAlan: but I thought the loopback connection wouldn't mattter anyway
[04:24:13] ElectricAlan: man I've spent so much time on this I havne't done anything useful today
[04:26:51] crystalneth_: has joined #RubyOnRails
[04:27:29] annlewis: has joined #RubyOnRails
[04:28:34] jscheel: has joined #RubyOnRails
[04:30:00] zeel: inet addr:127.0.0.1 Mask:255.0.0.0 should be inet addr:127.0.0.1 Mask:255.255.255.0 if I recall correctly
[04:30:07] zeel: on guest
[04:30:50] ElectricAlan: yeah idk about the loopback connection, I thought it didn't matter
[04:30:55] sarink: has joined #RubyOnRails
[04:31:00] ElectricAlan: as it was primarily for testing
[04:31:23] zeel: where are you trying to access the lan address from?
[04:33:05] will_wielder: has joined #RubyOnRails
[04:33:13] ElectricAlan: is that what you mean?
[04:35:20] zeel: http://10.0.0.0:3000
[04:35:50] zeel: http://10.0.0.1:3000 maybe?
[04:35:55] revengeofbigd: has joined #RubyOnRails
[04:35:58] zeel: it's 4:35 am :S
[04:36:08] ElectricAlan: will try that
[04:36:20] ElectricAlan: I'm going to paly around with the adapter settings a bit
[04:36:28] ElectricAlan: then move it back to how I had it before and try that ip
[04:36:34] Maletor: has joined #RubyOnRails
[04:39:41] LambdaSource: has joined #RubyOnRails
[04:39:57] nyaa: has joined #RubyOnRails
[04:41:09] ElectricAlan: zeel, http://10.0.0.1:3000/ timed out also
[04:42:25] SteenJobs: has joined #RubyOnRails
[04:43:11] noober3: has joined #RubyOnRails
[04:44:16] ramfjord: has joined #RubyOnRails
[04:45:27] lacuna: has joined #RubyOnRails
[04:45:28] lacuna: has joined #RubyOnRails
[04:46:05] elton: has joined #RubyOnRails
[04:47:01] elton: has joined #RubyOnRails
[04:48:10] ewnd9: has joined #RubyOnRails
[04:49:40] Spami: for some reason Im suddenly getting "(error) NOAUTH Authentication required." with redis
[04:49:55] Spami: even tho # requirepass is commented
[04:53:18] christia1: has joined #RubyOnRails
[04:55:06] ascarter: has joined #RubyOnRails
[04:55:06] iateadonut: has joined #RubyOnRails
[04:55:57] will_wielder: has left #RubyOnRails: ()
[05:00:08] Puffball: has joined #RubyOnRails
[05:00:38] tjbiddle: has joined #RubyOnRails
[05:01:17] noober3: can someone tell me what is wrong with my query, test = Store.includes(:cars).where(id: params[:cars_chosen]).all; I have cars_chosen as an array of ids and i want to find all the stores where they sell these cars.
[05:01:44] rhizome: you shouldn't have to .all
[05:02:12] noober3: stores and cars use through: cars_stores table
[05:02:56] uris: has joined #RubyOnRails
[05:03:21] rhizome: the id: refers to Store
[05:03:25] noober3: when i run this it seems to only return the first result
[05:03:38] noober3: how do i get the id to refer to the cars
[05:04:04] lyoshajapan: has joined #RubyOnRails
[05:04:20] CarlosYoo: has joined #RubyOnRails
[05:07:29] lyoshajapan: has joined #RubyOnRails
[05:09:56] lyoshajapan: Whats up with the new version of Capibara, it cannot click on things unless I manually scroll there with js beforehand. Anyone knows of a workaround?
[05:10:20] noober3: i have a bit of code that produces what i want but it seems there should be an easier way to give me what i want with the use of includes, http://pastebin.com/zZAKa62a
[05:10:27] blackmesa: has joined #RubyOnRails
[05:10:57] sevenseacat: lyoshajapan: !debug
[05:10:57] helpa: lyoshajapan: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[05:12:00] noober3: i have a bit of code that produces what i want but it seems there should be an easier way to give me what i want with the use of includes, http://pastie.org/10619802
[05:12:20] noober3: anyone have an idea on how i could accomplish this?
[05:12:38] sevenseacat: Car.includes(:stores).where....
[05:12:58] noober3: oh so i should do it the other way around
[05:13:23] sevenseacat: err, thats what your code says youre ding
[05:13:30] sevenseacat: loading up car records
[05:14:46] noober3: um that didnt seem to work for me.
[05:14:56] sevenseacat: define 'didnt work'
[05:15:56] noober3: i am trying to find the name of all stores that are selling cars with ids in an array. when i changed the code, to Cars.include... I just got a list of cars
[05:16:19] sevenseacat: well no shit, because the sample code you gave is looking up cars, and now you change the requirements
[05:16:22] noober3: the ids refer to the cars and not the stores
[05:16:28] sevenseacat: so you actually want to look up stores?
[05:16:38] noober3: yes based on cars ids
[05:16:56] sevenseacat: and how do stores and cars relate to each other?
[05:17:29] lyoshajapan: sevenseacat: https://gist.github.com/lyosha85/633f425c81e6a32f762d
[05:17:49] sevenseacat: lyoshajapan: !code
[05:17:49] helpa: lyoshajapan: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[05:18:19] lyoshajapan: its rather complicated to reproduce, I'll need some time. Ill be back :-)
[05:18:40] noober3: through a table, i have a belongs to in CarsStore model, and the models have has_many to the CarsStore and to the other model using through.
[05:18:43] sevenseacat: if capybara can scroll down to find an element, it can also scroll back up, so i think you have other problems.
[05:18:53] sevenseacat: noober3: show, don't tell.
[05:18:55] helpa: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[05:19:46] htmldrum: htmldrum: I was able to serialize the objects by creating a class that implemented ActiveModel::Model and support methods for serialization and just enclosed those within an array
[05:20:01] debster: has joined #RubyOnRails
[05:21:25] djellemah_: has joined #RubyOnRails
[05:21:57] crdpink: has joined #RubyOnRails
[05:23:01] diego1: has joined #RubyOnRails
[05:23:03] noober3: this shows the relations that the models have, https://gist.github.com/anonymous/c35a52e2e4c377fa9b92
[05:23:50] diego1: has joined #RubyOnRails
[05:24:19] sevenseacat: noober3: ok, so you want to look up Store records, joined to Car records so you can filter by the Car records
[05:25:16] sevenseacat: actually you dont even need to join to cars, you can just join to car stores
[05:25:40] sevenseacat: something like Stores.join(:car_stores).where(car_stores: {car_id: whatever}) ?
[05:26:23] sevenseacat: you have a problem in your associations though, because you have car has_many :store - it should be :stores
[05:27:13] tjbiddle: has joined #RubyOnRails
[05:28:18] annlewis: has joined #RubyOnRails
[05:28:19] wethu: has joined #RubyOnRails
[05:28:21] noober3: when would i use includes?
[05:28:41] sevenseacat: when you want to include the associated records to avoid n+1 queries
[05:28:54] sevenseacat: which is what you had there before
[05:29:07] sevenseacat: which is what i assumed the problem was, from your vague explanation
[05:29:17] njero: has joined #RubyOnRails
[05:33:58] RegulationD: has joined #RubyOnRails
[05:34:02] bronson: has joined #RubyOnRails
[05:34:06] SteenJobs: has joined #RubyOnRails
[05:34:08] yfeldblum: has joined #RubyOnRails
[05:34:09] shibabu: has joined #RubyOnRails
[05:35:08] yfeldblum: has joined #RubyOnRails
[05:35:18] noober3: awsome, thanks so much
[05:37:18] Maletor: has joined #RubyOnRails
[05:39:53] CarlosYoo: has joined #RubyOnRails
[05:40:18] arooni: has joined #RubyOnRails
[05:40:58] diego1: has joined #RubyOnRails
[05:42:58] rvanlieshout: has joined #RubyOnRails
[05:45:14] ElectricAlan: sevenseacat, got a general question, not a problem to fix. is it acceptable to put JS in my individual view files?
[05:45:25] ElectricAlan: rather than in assets
[05:45:37] ElectricAlan: even if it's a simple one line function?
[05:46:00] ElectricAlan: ok, I will explain what I'm doing that for to see if you have a better approach
[05:46:17] agoldboi: has joined #RubyOnRails
[05:46:18] rvanlieshout: has joined #RubyOnRails
[05:46:29] ElectricAlan: so I have a _form partial that I use for edit, show, and new
[05:46:54] nidhin: has joined #RubyOnRails
[05:47:16] ElectricAlan: that partial has a class on all the input fields, and I want to use jquery to disable them all in the show file, after it has rendered _form
[05:47:58] ElectricAlan: I could include that in assets/js/user/ but I'd need another step of logic to determine what view it's being rendered in
[05:48:27] Radar: ElectricAlan: I would strong advise against using the same partial for the show view.
[05:48:31] ElectricAlan: or maybe that's trivial
[05:49:10] ElectricAlan: oh ok, there will be quite a lot of duplicated code tho
[05:49:13] Rubie: has joined #RubyOnRails
[05:49:20] rvanlieshout: why would you want to use it in show?
[05:49:20] rvanlieshout: what's wrong with just showing it's attributes directly in show.html.erb?
[05:49:24] nidhin: has joined #RubyOnRails
[05:50:19] rvanlieshout: what duplication?
[05:50:37] shibabu: has joined #RubyOnRails
[05:50:44] Radar: ElectricAlan: if you use a different view for this, you won't need some janky JS
[05:52:13] ElectricAlan: yeah but I don't intend for there to be any difference between the two for what I'm making
[05:52:42] srinidhi: has joined #RubyOnRails
[05:52:44] ElectricAlan: the show view is fine to jsut be the same as the edit view with fields disabled
[05:53:02] ElectricAlan: I'm making a management system, so it doesn't need to have a fancy front end to look pretty
[05:53:03] rvanlieshout: i wouldn't even want input fields in my dom tree on show
[05:53:12] ElectricAlan: just display a bunch of fields
[05:53:13] rvanlieshout: it's ugly, it's slow and it's wrong
[05:53:30] SteenJobs: has joined #RubyOnRails
[05:53:32] Pazician: has joined #RubyOnRails
[05:54:09] noobda: has joined #RubyOnRails
[05:55:03] ElectricAlan: I'm not anticipating the show view to be used much ever if at all for this application
[05:55:09] ElectricAlan: if that changes anything
[05:55:39] ElectricAlan: like I don't want to go and modify a bunch of code a little when it's never going to be used
[05:55:42] rvanlieshout: then remove the show action and directly go to edit
[05:55:52] rvanlieshout: but you do want to add som janky js for this?
[05:56:10] Cervajz: has joined #RubyOnRails
[05:56:17] nidhin: has left #RubyOnRails: ()
[05:56:42] ElectricAlan: what's the problem with the js?
[05:56:52] ElectricAlan: it's like one line to select and disable the fields I want
[05:56:56] rvanlieshout: it's unneeded overhead of an overcomplicated setup
[05:57:07] ElectricAlan: the field classes are alredy in place
[05:57:16] Cervajz: has joined #RubyOnRails
[05:57:19] nidhin: has joined #RubyOnRails
[05:57:20] rvanlieshout: ok. then what's the actual issue?
[05:57:27] ElectricAlan: so in show then do I jsut render/redirect to the edit view?
[05:57:50] sevenseacat: why do you have a show if you dont want a show
[05:58:30] pontiki: no business like show business
[05:58:31] ElectricAlan: I want it there so that non-admin users can view records if need be, but I don't expect that to be a very likely or critical function
[05:59:28] melonstorm: has joined #RubyOnRails
[05:59:28] sevenseacat: okay then why would you render/redirect to the edit view in it
[05:59:52] stannard: has joined #RubyOnRails
[05:59:53] sevenseacat: showing some data and making it manageable are typically two different things with different requirements
[06:00:05] sevenseacat: using one view for both is just kludgy
[06:00:14] sevenseacat: makes your life easier, at the expense of your users
[06:01:27] rawrwx: has joined #RubyOnRails
[06:01:52] juddey: has joined #RubyOnRails
[06:03:03] rawrwx: Someone think of a good public repo that best illustrates the disctinction between a decorator vs a presenter?
[06:04:17] rvanlieshout: are there any?
[06:04:54] troys: has joined #RubyOnRails
[06:05:01] diego1: has joined #RubyOnRails
[06:05:05] ElectricAlan: sevenseacat, I think I'm a little biased by my past work experience, the places I've worked for have all made custom management apps, and in each case there pretty muc hwasn't a show view
[06:05:06] rvanlieshout: aren't you looking for differences betewen two gems?
[06:05:15] ElectricAlan: perhaps I jsut included it becasue I thought it was important for learning the ROR way
[06:07:49] paulodiniz: has joined #RubyOnRails
[06:08:27] pontiki: rawrwx: I'll add it to my list of examples to make one, but i don't have the time or energy at this time
[06:09:05] rawrwx: pontiki: decorator's should stictly be limited to extending some object?
[06:09:37] ElectricAlan: onto a different topic, are checkboxes nice and easy to use in ror?
[06:09:38] CarlosYoo: has joined #RubyOnRails
[06:09:49] ElectricAlan: they're notorious for being tricky in php frameworks
[06:11:00] pontiki: rawrwx: that's the general idea, yes
[06:11:25] exadeci: has joined #RubyOnRails
[06:11:45] sevenseacat: ElectricAlan: err, same as any other form field type
[06:12:45] rubyonrailed: has joined #RubyOnRails
[06:13:30] blackmesa: has joined #RubyOnRails
[06:13:46] ascarter: has joined #RubyOnRails
[06:14:25] pontiki: they're pretty easy
[06:14:29] djbkd: has joined #RubyOnRails
[06:17:54] arup_r: has joined #RubyOnRails
[06:18:22] Radar: ElectricAlan: What makes them difficult to use in PHP? It's been so long that I've forgotten.
[06:18:31] Radar: In so much that when they're unchecked they don't send through any value?
[06:18:35] sevenseacat: yeah I didnt remember them being weird either
[06:18:42] sevenseacat: but that was a long time ago and the frameworks have changed
[06:19:37] dionysus69: has joined #RubyOnRails
[06:19:41] rawrwx: has joined #RubyOnRails
[06:19:56] ElectricAlan: Radar, that's one of the issues
[06:20:13] ElectricAlan: I feel like I've had more, but can't think of them
[06:20:13] Radar: Rails fixes that by pairing the checkbox with a hidden field.
[06:21:03] ElectricAlan: yeah I'm pretty sure I had one workplace not even bother, and use yes/no drop downs for every boolean field to completely avoid using checkboxen
[06:21:26] wldcordeiro: has joined #RubyOnRails
[06:21:33] ewnd9: has joined #RubyOnRails
[06:22:16] nbdy: has joined #RubyOnRails
[06:22:45] rawrwx: pontiki: >Presenters is for more complicated queries with two or more models.
[06:22:52] rawrwx: would you say that's a fair statement?
[06:23:19] ElectricAlan: so I want to use an integer to store the checkbox value in the db yeah?
[06:24:13] pontiki: rawrwx: as a general rule of thumb, that's pretty good
[06:24:30] kp666: has joined #RubyOnRails
[06:24:49] pontiki: it's not something that is hard and fast, nor so much a convention, as that's how they usually get used.
[06:24:53] sevenseacat: ElectricAlan: a checkbox only has two values, so what field type would be better suited for that? :P
[06:25:27] pontiki: time for bed, goodnight folks
[06:25:43] ElectricAlan: but the applications I've worked on in the past have used integer for some reason
[06:25:54] ElectricAlan: something to to with 0,1 being nicer to work with that true/false
[06:25:59] sevenseacat: sounds like you've worked on some weird applications in the past
[06:26:11] sevenseacat: no checkboxes, weird show pages, integers instead of booleans
[06:26:16] agoldboi1: has joined #RubyOnRails
[06:26:47] ElectricAlan: it's really easy to confuse false, with "false" and have the string 'false' evaluate to true
[06:26:55] ElectricAlan: I think that was the main reason to use int
[06:27:00] sevenseacat: why would you ever have the string "false"
[06:27:05] sevenseacat: or be comparing with it
[06:27:09] Symbiosisz: has joined #RubyOnRails
[06:27:14] rawrwx: sevenseacat: maybe write your migration or your model first?
[06:27:24] sevenseacat: rawrwx: what?
[06:27:31] annlewis: has joined #RubyOnRails
[06:27:34] ElectricAlan: idk why, buyt Ican tell you what
[06:27:51] rawrwx: to describe what you're trying to store to the db
[06:28:11] ElectricAlan: rawrwx, think ur meant to be directing that at me
[06:28:19] sevenseacat: rawrwx: I'm not sure what you're talking about , but okay.
[06:28:22] rawrwx: oh my bad
[06:28:31] ElectricAlan: I never said it was a good way to go about things, jsut that's how I've handled it in the past with other workplaces
[06:28:33] rawrwx: helping is hard
[06:29:10] sevenseacat: ElectricAlan: ok, so let's forget the bad practices and start fresh :)
[06:29:36] ElectricAlan: sevenseacat, sometimes you try to put a value onto some js on a screen and somewhere between the db and the js it becomes a string instead of a value
[06:29:42] ElectricAlan: yeah I'm keen for that
[06:30:52] baweaver: then just write a to_bool method that acts differently on String
[06:31:01] sevenseacat: baweaver: wuuuuuuut
[06:31:10] elton: has joined #RubyOnRails
[06:31:32] baweaver: there are cases when some tools do stupid things
[06:31:38] baweaver: things you can't guard against
[06:31:48] baweaver: like turning false into 'false'
[06:32:05] sevenseacat: let's not totally confuse the situation given ElectricAlan is just learning rails
[06:32:18] baweaver: ideally you want to find and kill that code
[06:32:24] sevenseacat: lets let them learn how rails works and how most of what theyve had as problems in the past are complete non-issues with rails
[06:32:53] ElectricAlan: ACTION isn't that inexperienced
[06:32:56] ElectricAlan: it jsut comes off that way
[06:33:19] ElectricAlan: and this isn't somethign I have to work with now, I'm jsut discribing past situations
[06:33:36] sevenseacat: [17:29:10] sevenseacat: ElectricAlan: ok, so let's forget the bad practices and start fresh :)
[06:33:38] ElectricAlan: and implicitly hyping up rails in doing so
[06:33:48] ElectricAlan: yeah I know, jsut explaining for baweaver
[06:33:48] sevenseacat: lets learn rails for what it is
[06:34:04] Rubie: has joined #RubyOnRails
[06:34:16] trautwein: has joined #RubyOnRails
[06:36:22] steffkes: has joined #RubyOnRails
[06:36:22] steffkes: has joined #RubyOnRails
[06:36:36] rawrwx: ElectricAlan: are you creating something from scratch or inheriting some existing rails project?
[06:37:04] rawrwx: so like some basic crud app?
[06:37:18] ElectricAlan: ACTION doesn't have checkbox problems any more
[06:37:38] rawrwx: the rails 4 way is pretty great read
[06:37:43] ElectricAlan: took me half a second to remember what CRUD means and that you weren't insulting my app
[06:38:08] Maletor: has joined #RubyOnRails
[06:38:14] ElectricAlan: I have a few years experience in php frameworks, I'm taking this project on for a few reasons
[06:38:26] elton: has joined #RubyOnRails
[06:38:40] ElectricAlan: but a large part if that ror is a desireable quality for software devs in adelaide and I want to learm more to get more employable
[06:38:55] ElectricAlan: ror knowledge*
[06:40:13] ElectricAlan: sevenseacat, http://pastie.org/10619920 here's a basic controller, I want to redirect back to edit once a record is saved with the notice "this record has been updated"
[06:40:15] sevenseacat: i think we do devhubs in adelaide - maybe keep an eye on https://reinteractive.net/community/development_hub
[06:40:20] rawrwx: yeah i'd recommend getting the rails 4 way to accompany your journey since rails can be pretty daunting to learn alone
[06:41:02] sevenseacat: i know we do installfests in adelaide, so we probably do devhubs too
[06:41:06] ElectricAlan: so I just change the if update code to render 'edit' then flash notice w/e right?
[06:41:28] sevenseacat: a render isnt a redirect
[06:41:38] sevenseacat: if you want to redirect, then redirect, don't render
[06:42:10] sandstrom: has joined #RubyOnRails
[06:42:57] annlewis: has joined #RubyOnRails
[06:42:58] ElectricAlan: rawrwx, fwiw I don't tend to learn that well by reading lots of documentation, I can google things and find what I want but I'm not good at pouring through docs and retaining it all at once. I learn a lot better by hands on work
[06:43:33] ElectricAlan: also having someone who I can ask specific questions helps, as it allows me to point out whenever I don't fully get one aspect of somethign and fix up that understanding
[06:43:52] ElectricAlan: rather than try to comb through details on everything to find the specific thing I'm looking for
[06:44:17] shanemcd: has joined #RubyOnRails
[06:45:34] debster: has joined #RubyOnRails
[06:49:41] sevenseacat: I'm all for that, but dont get annoyed when we just point you to resources that answer your questions :)
[06:50:05] lacuna: has joined #RubyOnRails
[06:52:17] ElectricAlan: it's definitely something I'm working on
[06:52:33] ElectricAlan: for example, I went and googled the redirect syntax instead of pestering someone
[06:52:49] lyoshajapan: has joined #RubyOnRails
[06:53:41] bmalum: has joined #RubyOnRails
[06:56:23] lxsameer: has joined #RubyOnRails
[06:56:24] dopie: has joined #RubyOnRails
[06:59:05] maloik: has joined #RubyOnRails
[06:59:47] Pazician: has joined #RubyOnRails
[06:59:50] acosonic: has joined #RubyOnRails
[07:00:30] acosonic: Hi, a little help migrating routes to rails 3? http://pastie.org/10619953
[07:00:56] ElectricAlan: man, application development is pretty fun
[07:01:05] ElectricAlan: when you get something working nicely and it all looks cool
[07:01:23] CarlosYoo: has joined #RubyOnRails
[07:02:07] sevenseacat: acosonic: its pretty similar, which part are you stuck on?
[07:03:30] acosonic: sevenseacat: I tried various, now ended up with this http://pastie.org/10619964
[07:03:54] Cohedrin: has joined #RubyOnRails
[07:04:11] sevenseacat: all you really need to do was delete the `map` and `kanban` block variable parts
[07:04:17] sevenseacat: the rest looks pretty samey
[07:04:38] puria: has joined #RubyOnRails
[07:05:36] ElectricAlan: ACTION is off to home for now
[07:05:40] ElectricAlan: thanks for the help all
[07:06:49] acosonic: sevenseacat: like this: http://pastie.org/10619977 sorry I'm new to rails...
[07:07:02] nocontrol: has joined #RubyOnRails
[07:07:07] sevenseacat: and the `do |kanban|`
[07:07:13] acosonic: still figuring out stuff
[07:07:19] helpa: http://guides.rubyonrails.org/routing.html - Rails Routing From the Outside In - Rails Guide - by Mike Gunderloy
[07:08:27] pyemkey: has joined #RubyOnRails
[07:08:51] AzaToth: has joined #RubyOnRails
[07:09:14] acosonic: helpa: thanks, but I don't see anything about plugin routing in http://guides.rubyonrails.org/routing.html
[07:09:23] sevenseacat: theres nothing about plugin routing in your code either
[07:10:10] rromanchuk: has joined #RubyOnRails
[07:10:17] christiandsg: has joined #RubyOnRails
[07:10:20] rromanch_: has joined #RubyOnRails
[07:10:33] jgt3: has joined #RubyOnRails
[07:10:57] acosonic: sevenseacat: ok, no error, now I get (No route matches {:action=>"show", :controller=>"assigned_kanbans", :id=>nil}) I gues it needs to be added.
[07:11:08] sevenseacat: no, now you're missing an ID
[07:13:03] Bloomer: has joined #RubyOnRails
[07:13:38] acosonic: sevenseacat: hm, so I guess it's not only removing few blocks.
[07:13:53] sevenseacat: no, the problem is no longer with your routing - its the code using it.
[07:14:04] sevenseacat: why are you trying to show an assigned_kanban without specifying the ID to show?
[07:14:23] acosonic: sevenseacat: I'm just trying to update plugin
[07:14:30] acosonic: to work with Redmine 3
[07:14:45] sevenseacat: I'm telling you what the problem is, I'm not really fussed as to whose code it is :)
[07:15:05] sevenseacat: a lot changed between rails 2 and 3
[07:16:07] jas02: has joined #RubyOnRails
[07:16:17] acosonic: sevenseacat: is there some migration guide?
[07:16:21] sevenseacat: rails 3 started phasing out plugins entirely
[07:16:32] blackmesa: has joined #RubyOnRails
[07:16:42] sevenseacat: http://guides.rubyonrails.org/3_0_release_notes.html
[07:17:18] sevenseacat: unfortunately it doesnt look like there's a specific 'upgrading from 2.3 to 3' guide, as that was like five years ago
[07:17:40] teclator: has joined #RubyOnRails
[07:18:49] sevenseacat: if its not your plugin you're upgrading, i'd suggest contacting its author.
[07:19:14] crystalneth: has joined #RubyOnRails
[07:20:06] yardenbar: has joined #RubyOnRails
[07:21:50] dionysus69: has joined #RubyOnRails
[07:21:54] emilkarl: has joined #RubyOnRails
[07:23:13] Cervajz: has joined #RubyOnRails
[07:23:52] ewnd9: has joined #RubyOnRails
[07:24:53] B1n4r10: has joined #RubyOnRails
[07:26:25] lemur: has joined #RubyOnRails
[07:27:33] ewnd9_: has joined #RubyOnRails
[07:28:58] baweaver_: has joined #RubyOnRails
[07:29:16] lyoshajapan: has joined #RubyOnRails
[07:29:22] rawrwx: has joined #RubyOnRails
[07:30:39] CarlosYoo: has joined #RubyOnRails
[07:31:52] ewnd9: has joined #RubyOnRails
[07:32:14] Wizek: has joined #RubyOnRails
[07:33:57] acosonic: sevenseacat: Code looks ok, only routing seems to be the problem, the http://pastie.org/10620024 actually produces: An error occurred while loading the routes definition of redmine_kanban plugin (/home/nrgsystems/redmine/plugins/redmine_kanban/config/routes.rb): Invalid route name: 'my-requests' when I try to uninstall it
[07:34:43] sevenseacat: well you've removed the block now, so your routes are no longer nested
[07:34:56] sevenseacat: I dont know if that will make a difference, but you still need to provide a record if you want to show something
[07:35:41] herbst: has joined #RubyOnRails
[07:35:41] herbst: has joined #RubyOnRails
[07:37:00] aganov: has joined #RubyOnRails
[07:37:58] agit0: has joined #RubyOnRails
[07:38:14] netzfisch: has joined #RubyOnRails
[07:39:23] acosonic: sevenseacat: ok, added the do part, now it says redmine_kanban/config/routes.rb): Invalid route name: 'kanban_my-requests'.
[07:39:40] sevenseacat: I dont know what you want me to say. you're shooting fish in a barrel here.
[07:40:08] Maletor: has joined #RubyOnRails
[07:40:27] sevenseacat: rails 2->3 upgrades are not trivial and it sounds like you dont know rails, so
[07:40:31] eyck: has joined #RubyOnRails
[07:40:45] acosonic: sevenseacat: this got me confused http://stackoverflow.com/questions/4091024/help-migrating-routes-to-rails-3-format
[07:41:06] sevenseacat: because its a blob of code with zero explanation, and is a completely useless answer
[07:41:19] sevenseacat: though to be fair its a pretty useless 'do my work for me' question
[07:41:52] benhuda: has joined #RubyOnRails
[07:45:42] arBmind: has joined #RubyOnRails
[07:45:44] rubyonrails167: has joined #RubyOnRails
[07:47:06] lemur: has joined #RubyOnRails
[07:47:59] lxsameer: hey people, root_url , return localhost:3000 on production, how can I fix this ?
[07:48:10] baweaver_: has joined #RubyOnRails
[07:48:18] sevenseacat: by setting the actual url in your config
[07:49:15] coderhut: has joined #RubyOnRails
[07:49:32] defsdoor: has joined #RubyOnRails
[07:49:57] rubyonrails167: i am kinda stuck with sanitize gem. Anyone?
[07:51:00] lxsameer: sevenseacat, what is the config name ?
[07:51:12] sevenseacat: lxsameer: its pretty obvious if you look through your config file.
[07:51:23] rvanlieshout: rubyonrails167: just ask :)
[07:51:35] lxsameer: sevenseacat, thanks
[07:52:53] annlewis: has joined #RubyOnRails
[07:53:31] steffkes: has joined #RubyOnRails
[07:53:32] steffkes: has joined #RubyOnRails
[07:53:51] bruce_lee2: has left #RubyOnRails: ()
[07:53:54] adac: has joined #RubyOnRails
[07:54:11] bruce_lee: has joined #RubyOnRails
[07:54:14] shibabu: has joined #RubyOnRails
[07:54:57] jbrhbr: has joined #RubyOnRails
[07:55:57] DeXterbed: has joined #RubyOnRails
[07:56:05] elton: has joined #RubyOnRails
[07:57:53] cornerma1: has joined #RubyOnRails
[07:59:11] alchemist95: has joined #RubyOnRails
[08:00:29] alchemist95_: has joined #RubyOnRails
[08:03:37] alchemist95_: has left #RubyOnRails: ()
[08:03:39] lessless: has joined #RubyOnRails
[08:03:48] lyoshajapan: has joined #RubyOnRails
[08:04:09] rubyonrails340: has joined #RubyOnRails
[08:04:30] pyemkey: has joined #RubyOnRails
[08:04:53] lyoshajapan: has joined #RubyOnRails
[08:05:35] sandstrom: has joined #RubyOnRails
[08:06:51] comrad: has joined #RubyOnRails
[08:07:01] davonrails: has joined #RubyOnRails
[08:07:25] pyemkey: has joined #RubyOnRails
[08:08:03] futilegames: has joined #RubyOnRails
[08:08:07] pyemkey: Hello. I decided to write test first. As someone said: "Code without test is mostly broken". There is simple task. I want to read branch name from revisions.log and don't have idea how to test case with file existence. revisions.log file is placed in home directory. https://gist.github.com/pyemkey/c54d0c9f67c3ba4bcc58 How do you test file no exist case?
[08:08:45] pyemkey: sorry for double question, but I lost internet connection and I'm not sure the question was posted
[08:09:27] noober3: has joined #RubyOnRails
[08:10:07] jscheel: has joined #RubyOnRails
[08:11:18] christiandsg: has joined #RubyOnRails
[08:11:26] lyoshajapan: has joined #RubyOnRails
[08:11:45] sevenseacat: pyemkey: what does File.readlines return if you try to read a file that doesnt exist? stub the method out in your test, to return that
[08:11:58] maloik: has joined #RubyOnRails
[08:12:28] davonrails: has joined #RubyOnRails
[08:12:34] pyemkey: should return "file does not exist"
[08:12:56] darutoko: has joined #RubyOnRails
[08:12:58] sevenseacat: though it seems like thats what you've already tested in the other tst
[08:13:35] sevenseacat: and its the case where the file *does* exist that you need to fix
[08:14:10] sevenseacat: though I can think of a few cases where the file does exist, but would raise an exception and display 'file does not exist'
[08:15:27] pyemkey: can you provide example when file does exist and return in my case exception?
[08:15:48] sevenseacat: when the file is empty. when it contains a single character. when its not readable.
[08:15:55] G: has joined #RubyOnRails
[08:16:02] noober3: if i have a query: Vehicule.includes(:features).where( features: { id: [1,2] } )... is there a way to only return records for which all feature_ids have to match
[08:16:39] djbkd: has joined #RubyOnRails
[08:17:29] arup_r: has joined #RubyOnRails
[08:17:30] elton: has joined #RubyOnRails
[08:17:51] brunto: has joined #RubyOnRails
[08:18:24] pyemkey: single character will return nil, but you are right about case when file is not readable. As you can see in the first test I actually check if exception is not raised.
[08:19:15] edwinvdgraaf: has joined #RubyOnRails
[08:19:33] blackmesa: has joined #RubyOnRails
[08:20:23] maloik: I'm using WickedPdf to render a html view and turn that into a pdf document. Their docs mention wicked_pdf_image_tag helpers for assets which work fine, but image_tag with an absolute url (image hosted on s3) is not working. Has anyone run into this before?
[08:22:03] wmdrossard: has joined #RubyOnRails
[08:22:22] bob_f: pyemkey: Your problem is that you don't deal with specific exceptions. You just have a blanket `rescue`. If you want to inform the caller that the file does not exist then only catch the exception relevant to the file not existing.
[08:22:57] netzfisch: has joined #RubyOnRails
[08:23:24] njero: noober3: have you tried join with selection condition?
[08:25:04] noober3: not sure what you mean. i know with my query it looks for either id and doesn't force the results to have both
[08:25:31] enkristoffer: has joined #RubyOnRails
[08:26:28] bob_f: noober3: Looks like you want a group by/having.
[08:27:17] bob_f: You're saying you want records from the left-hand side of the join where there is a join on the right-hand side available for all specified IDs ?
[08:27:21] sevenseacat: pyemkey: the first test is the exception raised version
[08:27:34] sevenseacat: though it says it isnt
[08:28:16] noober3: bob_f: yes this is what i want
[08:28:47] pyemkey: sevenseacat: As I said before I learn how to test code ;)
[08:28:49] bob_f: noober3: Then yes, I would implement it as a `group by` with a `having` clause.
[08:29:39] pyemkey: I feel a little bit like a boy in a fog :)
[08:30:25] bob_f: pyemkey: Start by fixing your `rescue`. Try to open a file that does not exist in `irb`. Look at the exception you get, then rescue that specific exception.
[08:30:39] bob_f: Otherwise your `file does not exist` return value is inaccurate.
[08:31:39] pyemkey: bob_f: I've got Errno::ENOENT. BTW thank you for suggestion about checking in console what exception I will get
[08:31:57] enkristoffer: I'm trying to delete a nested attribute in a Rails 5 API, but the following doesn't work. Am I doing something wrong? `patch :update, params: { id: @foo, foo: { bars_attributes: [id: @bar.id, _destroy: '1'] } }`
[08:32:28] sloggerkhan: has joined #RubyOnRails
[08:33:36] Pumukel: has joined #RubyOnRails
[08:33:59] ngr: why is it that everywhere I see 'RAILS_ENV=production rake assets:precompile' when 'rake assets:precompile' seems to do the same thing? is there a difference? I'm trying to avoid running into a cargo cult here.
[08:34:17] artto: has joined #RubyOnRails
[08:34:54] bob_f: ngr: Yep, there's a difference. There may not be a difference in your specific case, but it's certainly a good habit to get into.
[08:37:57] hahuang65: has joined #RubyOnRails
[08:38:32] solars: has joined #RubyOnRails
[08:38:34] juddey: has joined #RubyOnRails
[08:38:36] paulodiniz: has joined #RubyOnRails
[08:38:44] arup_r: has joined #RubyOnRails
[08:39:04] brunto: has joined #RubyOnRails
[08:39:55] maesitos: has joined #RubyOnRails
[08:40:30] ngr: bob_f: okay, I can imagine how setting RAILS_ENV would affect the assets. Asking the other way round: Will setting RAILS_ENV=production harm my development environment? I'm building a Dockerfile and would prefere to keep it environment agnostic
[08:40:42] mark4: has joined #RubyOnRails
[08:40:51] Maletor: has joined #RubyOnRails
[08:41:49] bob_f: ngr: Personally I would make the Docker image agnostic by allowing it to handle RAILS_ENV and apply it everywhere. You can set a default.
[08:42:03] bob_f: ngr: Then you can use the image in production and development, just by setting RAILS_ENV somewhere.
[08:42:44] bob_f: ngr: Otherwise what you'll end up doing is getting frustrated that your assets work in production and not development, or vice versa, or having some other issue. My recommendation would be to be consistent with RAILS_ENV everywhere.
[08:43:23] ngr: bob_f: would that mean to not include RAILS_ENV in the 'rake' command line but instead setting it when building the image using 'docker build -e'?
[08:43:32] pyemkey: I updated my my gist. How can I stub this line https://gist.github.com/pyemkey/c54d0c9f67c3ba4bcc58#file-version_reader-rb-L3
[08:44:13] bob_f: ngr: Sure. And then having your docker image set RAILS_ENV and use it everywhere.
[08:44:15] tvw: has joined #RubyOnRails
[08:44:29] bob_f: ngr: Or you can call it "MY_APP_ENV" and do "RAILS_ENV=$MY_APP_ENV rake ..."
[08:44:38] bob_f: Whatever floats your boat.
[08:46:40] herbst: has joined #RubyOnRails
[08:46:51] herbst: has joined #RubyOnRails
[08:46:59] enkristoffer: has joined #RubyOnRails
[08:47:34] bronson: has joined #RubyOnRails
[08:51:39] blackmesa: has joined #RubyOnRails
[08:52:01] blackhuey: has joined #RubyOnRails
[08:53:38] annlewis: has joined #RubyOnRails
[08:55:15] srinidhi: has joined #RubyOnRails
[08:56:01] ewnd9: has joined #RubyOnRails
[08:56:51] teclator: has joined #RubyOnRails
[09:01:03] Mia: has joined #RubyOnRails
[09:01:04] Mia: has joined #RubyOnRails
[09:01:27] paulodiniz: has joined #RubyOnRails
[09:04:47] sarink: has joined #RubyOnRails
[09:05:25] nettoweb: has joined #RubyOnRails
[09:06:02] lyoshajapan: has joined #RubyOnRails
[09:06:08] sarink: has joined #RubyOnRails
[09:07:46] lyoshajapan: has joined #RubyOnRails
[09:09:05] jsrn_: has joined #RubyOnRails
[09:09:49] drptbl: has joined #RubyOnRails
[09:09:58] ngr: bob_f: thanks. I'm using --build-arg now to set RAILS_ENV to 'production' unless I do a local build (using docker-compose) in which case it defaults to 'development'. which is also a good workaround for compose not supporting build-args.
[09:10:29] bob_f: ngr: Cool, sounds like a workable solution to me.
[09:10:46] Xentil: has joined #RubyOnRails
[09:12:26] ibouvousaime: has joined #RubyOnRails
[09:12:43] hahuang65: has joined #RubyOnRails
[09:13:11] Cervajz: has joined #RubyOnRails
[09:13:37] B1n4r10: has joined #RubyOnRails
[09:13:40] Cervajz_: has joined #RubyOnRails
[09:15:03] noober3: having issues with group and having to ensure that results will only display if all ids are found, https://gist.github.com/anonymous/b8d902bc0fc02e04d6a6
[09:15:15] snowy: has joined #RubyOnRails
[09:15:45] noober3: not sure how to implement group and having, which is what i believe i need
[09:15:57] christiandsg: has joined #RubyOnRails
[09:18:11] agoldboi: has joined #RubyOnRails
[09:21:27] sevenseacat: has joined #RubyOnRails
[09:22:07] lacrymology: has joined #RubyOnRails
[09:23:33] paulodiniz: has joined #RubyOnRails
[09:24:15] Cervajz: has joined #RubyOnRails
[09:25:07] Cervajz: has joined #RubyOnRails
[09:25:12] lyoshajapan: has joined #RubyOnRails
[09:25:24] njero: noober3: check git and see if that'll work?
[09:26:06] armyriad: has joined #RubyOnRails
[09:26:33] njero: *your gist
[09:28:47] Zackio: has joined #RubyOnRails
[09:29:50] noober3: no seems to give me the same results, where it only has to be one of the ids not all of them
[09:30:25] marr: has joined #RubyOnRails
[09:30:38] njero: noober3: all of them??.. then i misunderstood
[09:30:59] zpe: has joined #RubyOnRails
[09:31:52] noober3: yes, so if store has car 1 and 2 then i want that record, but if it only has car 1 or car 2 i don't
[09:35:36] iwmrby: has joined #RubyOnRails
[09:35:37] lyoshajapan: has joined #RubyOnRails
[09:35:38] debster: has joined #RubyOnRails
[09:36:30] defsdoor: noober3, you want stores that have a and b but not just and and b ?
[09:37:01] defsdoor: you'll need multiple queries or manipulate a wider result set
[09:37:11] ql6wlld: has joined #RubyOnRails
[09:38:16] noober3: i meant yes, but a and b would correspond to ids
[09:38:31] wmdrossard: has joined #RubyOnRails
[09:39:49] herbst: has joined #RubyOnRails
[09:41:11] DeXterbed: has joined #RubyOnRails
[09:41:37] Maletor: has joined #RubyOnRails
[09:42:55] vasilakisFiL: has joined #RubyOnRails
[09:44:02] vasilakisFiL: Hi! I am trying to connect to my staging mongodb using mongoid but I get: Mongo::Error::NoServerAvailable: No server is available matching preference. However I am able to connect to it using the cli tool mongo
[09:44:06] vasilakisFiL: what could I do wrong ?
[09:47:59] rvanlieshout: vasilakisfil: how did you tell rails what server to use?
[09:49:13] vasilakisFiL: I used mongoid and added the url
[09:49:25] vasilakisFiL: I also tried by breaking the url into host, port, user and password
[09:49:32] bronson: has joined #RubyOnRails
[09:49:41] vasilakisFiL: I mean, in the mongoid.yml
[09:51:13] paulodiniz: has joined #RubyOnRails
[09:51:46] vasilakisFiL: I also tried to manually connect using Mongo::Client.new(URL) but any query I try it fails
[09:52:03] rvanlieshout: what's in the mongoid.yml?
[09:54:24] annlewis: has joined #RubyOnRails
[09:54:55] vasilakisFiL: http://pastie.org/private/gzerqiv3fsy4k2d3wvaa look on the development
[09:56:37] shibabu: has joined #RubyOnRails
[09:56:38] Bloomer: has joined #RubyOnRails
[09:59:59] rvanlieshout: vasilakisfil: but you have this problem on development?
[10:00:15] rvanlieshout: or is this file the same on staging?
[10:00:25] vasilakisFiL: I am trying to connect from development to staging mongo
[10:00:31] vasilakisFiL: and I am getting this error: Mongo::Error::NoServerAvailable: No server is available matching preference: #<Mongo::ServerSelector::Primary:0x0000000aecbb48 @options={"database"=>"open-api-db", "user"=>"public.api", "password"=><REDACTED>}, @tag_sets=[], @server_selection_timeout=30>
[10:00:55] rvanlieshout: and the db on the staging allows remote access?
[10:00:57] vasilakisFiL: but I can connect to the mongodb if I open a console..
[10:01:42] vasilakisFiL: since I connect to the mongodb using a console and I can run queries there, I also used http://humongous.io/ which also works I don't think there is an issue
[10:02:54] vasilakisFiL: so what the heck, I have been standing here trying to solve that 4 hours now :O
[10:04:28] blackmesa: has joined #RubyOnRails
[10:04:46] djbkd: has joined #RubyOnRails
[10:07:45] Cervajz_: has joined #RubyOnRails
[10:08:17] Bloomer: has joined #RubyOnRails
[10:09:45] FooMunki: has joined #RubyOnRails
[10:12:42] sarink: has joined #RubyOnRails
[10:12:50] rvanlieshout: vasilakisfil: ok. so where is the hostname in that @options hash?
[10:14:37] rodfersou: has joined #RubyOnRails
[10:14:56] herbst: has joined #RubyOnRails
[10:14:57] herbst: has joined #RubyOnRails
[10:15:00] arBmind: has joined #RubyOnRails
[10:15:42] benhuda: has joined #RubyOnRails
[10:16:19] Cervajz: has joined #RubyOnRails
[10:17:17] jds: has joined #RubyOnRails
[10:18:42] christiandsg: has joined #RubyOnRails
[10:20:36] shanemcd: has joined #RubyOnRails
[10:21:28] vasilakisFiL: for some reason it doesn't parse host :O
[10:24:18] sar1nk: has joined #RubyOnRails
[10:24:23] maesitos: has joined #RubyOnRails
[10:24:24] rvanlieshout: why should it? where is it defined?
[10:25:05] herbst: has joined #RubyOnRails
[10:25:41] arup_r: has joined #RubyOnRails
[10:27:05] Peg-leg: has joined #RubyOnRails
[10:27:07] maesitos: has joined #RubyOnRails
[10:30:21] solars: has joined #RubyOnRails
[10:31:47] vasilakisFiL: rvanlieshout according to https://github.com/mongodb/mongo-ruby-driver/blob/master/lib/mongo/client.rb#L341-L346 hosts go to @cluster
[10:31:53] vasilakisFiL: and I get it right
[10:32:50] vasilakisFiL: this works: s = Mongo::Client.new(ENV['OLD_OAUTH2_MONGO_URI']); s.cluster and I get back #<Mongo::Cluster:0x69715400 servers=[#<Mongo::Server:0x69714640 address=nosql.videofy.me:27017>] topology=Single>
[10:32:54] vasilakisFiL: so it's ok I think
[10:33:57] agoldboi: has joined #RubyOnRails
[10:35:06] rvanlieshout: but that's of the mongodb client, not the mongoid one
[10:35:42] kitsuneyo: has joined #RubyOnRails
[10:36:11] vayan: has left #RubyOnRails: ()
[10:40:48] vasilakisFiL: rvanlieshout hosts are defined in the mongoid.yml
[10:40:56] rvanlieshout: not for staging
[10:41:10] vasilakisFiL: for development
[10:41:30] vasilakisFiL: if you see on the pastie, for development env I have 2 clients
[10:42:01] vasilakisFiL: the options in Mongo::ServerSelector::Primary I think come from the Mongo driver and not from Mongoid
[10:42:24] Maletor: has joined #RubyOnRails
[10:43:25] rvanlieshout: and that's the way it should be done?
[10:44:37] vasilakisFiL: yes according to mongoid docs: https://docs.mongodb.org/ecosystem/tutorial/ruby-mongoid-tutorial/#configuration
[10:45:08] elton: has joined #RubyOnRails
[10:45:31] rvanlieshout: and how are you using that old_oauth2?
[10:45:34] rvanlieshout: cause else it's only localhost
[10:46:34] vasilakisFiL: I use it my model like that: store_in collection: 'oauth2.access_tokens', client: 'old_oauth2'
[10:46:58] rvanlieshout: and it uses that for the connection?
[10:47:03] blackmesa: has joined #RubyOnRails
[10:47:06] srinidhi: has joined #RubyOnRails
[10:47:18] vasilakisFiL: Also if I run OldOauth2::AccessToken.mongo_client.cluster I get it right (OldOauth2::AccessToken is my model): #<Mongo::Cluster:0x86703060 servers=[#<Mongo::Server:0x86702400 address=54.75.232.44:27017>] topology=Single>
[10:47:35] vasilakisFiL: OldOauth2::AccessToken.mongo_client.options are also correct
[10:48:00] rvanlieshout: and are you sure it uses that when that Mongo::ServerSelector::Primary happens?
[10:49:07] lyoshajapan: has joined #RubyOnRails
[10:49:21] chihaja: has joined #RubyOnRails
[10:49:24] vasilakisFiL: Well I guess so cause I run OldOauth2::AccessToken.first and after 30 sec I get this error
[10:51:46] paulodiniz: has joined #RubyOnRails
[10:53:44] vasilakisFiL: I just enabled debug logs and I can see that open-api-db.getnonce succeeds and open-api-db.authenticate succeeds but then it stucks there and I get this stupid error
[10:53:44] raja: has joined #RubyOnRails
[10:54:32] ldnunes: has joined #RubyOnRails
[10:54:38] vasilakisFiL: if I change the password authenticate fails
[10:54:46] vasilakisFiL: so there is something fishy going on after authentication
[10:54:56] raja: I am getting this error while precompiling assets in production environment
[10:54:57] raja: Sass::SyntaxError: Invalid CSS after "...{width:100% \0/": expected expression (e.g. 1px, bold), was ";height:30px \0..."
[10:54:59] nfk|laptop: has joined #RubyOnRails
[10:55:11] annlewis: has joined #RubyOnRails
[10:55:49] agoldboi: has joined #RubyOnRails
[10:55:49] raja: Sass SyntaxError but error is not showing any file or number .... how to troubleshoot
[10:56:32] herbst: has joined #RubyOnRails
[10:56:32] herbst: has joined #RubyOnRails
[10:57:38] vasilakisFiL: oh.... mongodb version is 1.2.2, interesting
[11:00:16] shibabu: has joined #RubyOnRails
[11:02:24] B1n4r10: has joined #RubyOnRails
[11:03:10] benhuda: has joined #RubyOnRails
[11:03:52] raja: Sass::SyntaxError: Invalid CSS after "...{width:100% \0/": expected expression (e.g. 1px, bold), was ";height:30px \0..."... is what I am getting while precompile assets through production environment
[11:03:59] raja: how to get rid of this error ?
[11:04:07] SalexW: has joined #RubyOnRails
[11:05:16] brunto: raj_: Add ; at the end of each lines
[11:06:34] iwmrby: has joined #RubyOnRails
[11:06:46] chrise86: has joined #RubyOnRails
[11:07:31] raja: brunto_ in which file ? I have gone through with the error but it isn't showing in which file this error is from
[11:08:42] Spami: has joined #RubyOnRails
[11:08:45] kitsuneyo: has joined #RubyOnRails
[11:08:47] blackmesa: has joined #RubyOnRails
[11:10:04] artto: has joined #RubyOnRails
[11:10:34] raja: brunto_ here is the complete error https://gist.github.com/anonymous/7728cbbb8c20c9fe3e61
[11:11:36] jhass: "in /home/Lappy/Desktop/dummy/jsvp2/app/assets/stylesheets/application.css"?
[11:14:14] dideler: has joined #RubyOnRails
[11:14:37] raja: jhass_ https://gist.github.com/anonymous/9ccf103c1ac7810ef32d
[11:15:00] jhass: just grep for width: 100% then, can't be that many
[11:15:18] raja: yeah did that too found nothing :(
[11:16:18] Janno: problem might be in one of the vendor assets?
[11:16:30] kitsuneyo: has joined #RubyOnRails
[11:18:24] raja: In development environment it's working fine. But throwing error in production environ
[11:18:34] _3by8: has joined #RubyOnRails
[11:18:48] jhass: bin/rake tmp:cache:clear assets:clobber assets:precompile is always worth a shot then
[11:20:33] raja: assets:clobber ?
[11:22:49] FernandoBasso: has joined #RubyOnRails
[11:22:52] herbst: has joined #RubyOnRails
[11:22:52] herbst: has joined #RubyOnRails
[11:24:49] _3by8: So I was trying to create a custom route earlier so that I could send users to a page called "manage_orders" not defined by resources. In routes, I had it defined as get 'orders/manage', as: 'manage_orders' but when I tried going to /manage_orders, I got some sort of error about "show". So I assume that Rails was seeing orders/manage as show from resources and trying to use 'manage' as
[11:24:49] _3by8: the ID, does that sound right? Is it possible to create a custom route/page like that if I'm using resources? Is it possible at all?
[11:25:19] christiandsg: has joined #RubyOnRails
[11:25:44] helpa: _3by8: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[11:26:19] chridal: has joined #RubyOnRails
[11:33:03] Sephyros: has joined #RubyOnRails
[11:33:08] Sephyrus: has joined #RubyOnRails
[11:33:13] raja: jhass_ https://gist.github.com/anonymous/be5932d7beec616239fe
[11:33:56] _3by8: https://gist.github.com/threebyeight/0e26185488c922418001 that's my routes.rb file
[11:34:45] sevenseacat: some weird stuff in there but okay
[11:34:56] sevenseacat: you have not defined a /manage_orders url
[11:35:03] sevenseacat: so you cannot go there
[11:35:04] annlewis: has joined #RubyOnRails
[11:35:12] quazimodo: has joined #RubyOnRails
[11:36:06] wmdrossard: has joined #RubyOnRails
[11:36:28] Sephyros: Hello Everyone
[11:36:37] sevenseacat: evening Sephyros
[11:37:07] Janno: isn't target action require? Like get 'orders/manage', to: 'orders#manage'
[11:37:14] Janno: required'
[11:37:44] Sephyros: i have after_save :method, on: :create in my WorkOrder class, that have WaitingWorkOrder class linked by STI
[11:37:47] _3by8: Thanks everyone!
[11:38:09] Sephyros: and other types too*
[11:38:27] Sephyros: but the method is called every "type" change...
[11:39:13] _3by8: sevenseacat when you said weird, stuff, what stuck out immediately?
[11:39:22] sevenseacat: the entire top half of the file
[11:39:39] sevenseacat: non-resourceful routing should be fairly uncommon
[11:39:51] sevenseacat: doing things like 'update_printers' via a GET route
[11:40:41] wasane: has joined #RubyOnRails
[11:40:44] _3by8: sevenseacat ah, that part is probably not necessary but it's the way the example I found on StackExchange worked. It's for an AJAX request.
[11:40:56] codergeek: has joined #RubyOnRails
[11:41:11] sevenseacat: ajax can make non-GET requests
[11:41:12] renegadeandy: has joined #RubyOnRails
[11:41:26] _3by8: sevenseacat I assume I don't need to label it and that leaving it resourceful is fine.
[11:41:37] _3by8: Or not label but rename?
[11:41:48] sevenseacat: label/rename what?
[11:41:51] netzfisch: has joined #RubyOnRails
[11:42:38] sameerynho: has joined #RubyOnRails
[11:42:56] _3by8: Sorry for the confusion/lack of proper vernacular but what I meant was changing the route from 'ownerships/update_printers' to just 'update_printers' I could probably still send a request to 'ownerships/update_printers' just as well.
[11:43:10] Maletor: has joined #RubyOnRails
[11:43:26] sevenseacat: that has nothing to do with anything I said
[11:44:01] codergeek: has joined #RubyOnRails
[11:44:10] _3by8: Oh, okay, I assumed that's what you meant. I was looking at what you'd said about non-resourceful routing.
[11:44:21] sevenseacat: yes, most of it shouldnt be.
[11:44:51] sevenseacat: and do you really want URLs like /static_pages/about ?
[11:45:03] emilkarl: has joined #RubyOnRails
[11:45:15] _3by8: sevenseacat definitely not, those are placeholders that were generated.
[11:45:53] sevenseacat: then thats what sticks out as being weird
[11:46:27] elton: has joined #RubyOnRails
[11:47:10] kitsuneyo: has joined #RubyOnRails
[11:47:27] _3by8: Thanks for pointing that out. What was your worry in regards to 'update_printers' and AJAX? Is there something there I should investigate?
[11:49:38] wasane: has joined #RubyOnRails
[11:49:54] bronson: has joined #RubyOnRails
[11:52:21] herbst: has joined #RubyOnRails
[11:52:21] herbst: has joined #RubyOnRails
[11:53:29] lyoshajapan: has joined #RubyOnRails
[11:54:19] bmalum_: has joined #RubyOnRails
[11:54:33] wireshark: has joined #RubyOnRails
[11:54:35] yfeldblum: has joined #RubyOnRails
[11:54:36] sevenseacat: you shouldnt be making changes to data in a GET request.
[11:55:29] adre: has joined #RubyOnRails
[11:56:30] jgt3: has joined #RubyOnRails
[11:57:58] gavit: if I want to use http://apidock.com/rails/ActionView/Helpers/AssetUrlHelper in a ruby class, shouldnt a require be sufficient?
[11:59:25] gavit: I want to use image_url in my controller
[11:59:56] _3by8: sevenseacat true! I'm going against conventions.
[12:00:31] Diabolik: what is the best way of testing the content of a pdf using capybara
[12:00:35] CarlosYoo: has joined #RubyOnRails
[12:01:15] Macaveli: has joined #RubyOnRails
[12:02:03] _3by8: sevenseacat thank you for being so helpful tonight :)
[12:02:07] Macaveli: has joined #RubyOnRails
[12:02:25] paulodiniz: has joined #RubyOnRails
[12:02:29] Sephyros: how i can run a method only on create but after save? i tried after_save :method, on: :create but still calling on update... (maybe cuz when change STI type its thinks i am creating a new object?)
[12:02:32] sarink: has joined #RubyOnRails
[12:03:00] rvanlieshout: Sephyros: STI sucks :)
[12:03:11] rvanlieshout: but besides that you could try if .new_record? still returns true
[12:03:15] Sephyros: yeah i know, but i am not the architect =/
[12:03:19] rvanlieshout: and what's wrong with after_save?
[12:03:46] maloik: has joined #RubyOnRails
[12:03:59] Sephyros: after_create... i never tried :D i will try now
[12:05:29] herbst: has joined #RubyOnRails
[12:05:38] mostlybadfly: has joined #RubyOnRails
[12:05:39] rvanlieshout: hmm. i thought i read that in your question
[12:05:44] rvanlieshout: lemme check if that one even exists
[12:05:57] Sephyros: exist and works like a charm
[12:06:04] Sephyros: thanks again!
[12:06:43] emilkarl: has left #RubyOnRails: ()
[12:06:50] jgpawletko: has joined #RubyOnRails
[12:06:51] djbkd: has joined #RubyOnRails
[12:07:07] gavit: when adding an image to /app/assets/images/myfile.jpg do I need to do something else to see the file in my dev environment rails4?
[12:07:18] rvanlieshout: gavit: you need to use it properly
[12:08:02] gavit: rvanlieshout: in my controller I have view_context.image_path('myfile.jpg')
[12:08:33] gavit: I get a /assests/myfile-e3a759f8e315ac1da195610e5ebf8eadfb91c6b0f97fb57a1c98a7752c8fbc0b.jpg not found
[12:09:59] benhuda: has joined #RubyOnRails
[12:10:30] rvanlieshout: did you enable asset precompilation in development?
[12:10:37] rvanlieshout: or performed a assets:precompile?
[12:11:40] kitsuneyo: has joined #RubyOnRails
[12:11:57] AimlessRAven: has joined #RubyOnRails
[12:12:12] AimlessRAven: Hello all, how to make link_to to work as query
[12:12:35] rvanlieshout: AimlessRaven: what does 'as query' mean?
[12:12:46] AimlessRAven: search link.. like rasnack
[12:12:48] krzkrzkrz: has joined #RubyOnRails
[12:13:44] AimlessRAven: i want when i click to one of my link_to to find for example all orders with status pending
[12:14:08] rvanlieshout: i don't really understand what your question is
[12:14:38] AimlessRAven: ok i write clear
[12:14:58] gavit: rvanlieshout: my svg seems to work fine in my view. this is the first time I use something like image_path in my controller
[12:14:59] AimlessRAven: i have view with orders, and another view with link_to
[12:15:04] robert_: has joined #RubyOnRails
[12:15:23] gavit: rvanlieshout: also tried doing a bundle exec rake assets:precompile to be sure, but no results
[12:15:25] AimlessRAven: and i want when i click to my link_to .. to find all orders with status pending
[12:16:02] rvanlieshout: gavit: remove the compiled assets from your development environment. they should not exist there
[12:16:12] rvanlieshout: also check your config/environments/development.rb for asset related stuff
[12:16:33] wmdrossard: has joined #RubyOnRails
[12:17:04] renegadeandy: Anybody out there will to help me with this : http://stackoverflow.com/questions/34033517/how-can-i-find-the-number-of-current-subscriptions-using-privatepub-and-faye-in
[12:17:10] brunto: has joined #RubyOnRails
[12:18:17] codergeek: has joined #RubyOnRails
[12:19:13] edwinvdg_: has joined #RubyOnRails
[12:19:55] Darkman738: has joined #RubyOnRails
[12:20:25] herbst: has joined #RubyOnRails
[12:20:26] herbst: has joined #RubyOnRails
[12:22:54] ql6wlld: has joined #RubyOnRails
[12:23:45] gavit: rvanlieshout: after a bundle exec rake assets:cleanad restarting of the server I get the same error. also dont see asset precompilation enabled in my development.rb: https://gist.github.com/gavit/7e20d4a24540c0d00a4f
[12:24:31] rvanlieshout: config.assets.digest = true
[12:24:34] rvanlieshout: that's not default iirc
[12:24:51] johnflux: has joined #RubyOnRails
[12:24:51] johnflux: has joined #RubyOnRails
[12:26:19] christiandsg: has joined #RubyOnRails
[12:26:28] gavit: rvanlieshout: I set it to false, and now the 'hash' is gone, but same error :( almost makes me think I have the wrong path...
[12:26:38] rvanlieshout: where did you save that file?
[12:27:28] gavit: rvanlieshout: in my other projects config.assets.digest = true is specified, so I think its a 'new default' if your recollection is correct
[12:27:42] sevenseacat: its true in development by default nowadays.
[12:27:47] sevenseacat: i do not know why.
[12:28:02] gavit: rvanlieshout: app/assets/images/myfile.jpg
[12:28:27] rvanlieshout: and public/assets is gone?
[12:29:16] tasaif: hi, I have a troubling problem I don't know if this is the right place
[12:29:18] gavit: rvanlieshout:public/assets is not gone, actually it has myfile-hash.jpg
[12:29:28] raja: ace.min.css was troubling me while precompile assets in production environment
[12:29:46] raja: If I remove that file and replace it with empty file
[12:29:57] tasaif: I'm not sure how to approach this problem and I have tried google
[12:30:08] raja: assets:precompile is working but. I don't see any css on the pages
[12:30:29] tasaif: raj_, maybe the page is cached?
[12:30:32] artto: has joined #RubyOnRails
[12:31:03] tasaif: in chrome you can ctrl+shift+R to do a clean refresh I think
[12:31:16] gavit: rvanlieshout: okay, all the files?
[12:31:45] rvanlieshout: you shouldn't have a public/assets in development
[12:32:36] tasaif: I have a checkbox in a form and when the form is submitted if the box is not checked I get no information about it in params
[12:32:58] codergeek: has joined #RubyOnRails
[12:33:08] tasaif: I need to know if the checkbox is off or on, not just if it's on
[12:33:33] tasaif: please to help
[12:33:40] tasaif: my wife will leave me if I can not solve this
[12:33:46] tasaif: my marriage hangs in the balance
[12:33:54] gavit: rvanlieshout: I replaced the .svg with my .jpg in my view and it works, so the 'path' it generates is correct.
[12:34:06] rvanlieshout: tasaif: how did you add that checkbox tag?
[12:34:35] tasaif: input name="resp-#{resp.id}" type='checkbox' checked=(if resp.resume == @resume)
[12:34:37] sankaber: has joined #RubyOnRails
[12:34:40] gavit: rvanlieshout: in my controller: report = PDFReport.new(:page_size => "A4", :background => view_context.image_path('myfile.jpg'))
[12:34:49] rvanlieshout: gavit: the path without the hash right? does your we server has access to it?
[12:34:53] rvanlieshout: or wkhtmltopdf
[12:34:55] rvanlieshout: tasaif: use rails helpers
[12:35:07] rvanlieshout: and if you have a normal form use the form builder helpers
[12:35:10] tasaif: I have a weird relationship between two models to where I don't think I can
[12:35:10] rvanlieshout: because it'll add a hidden input
[12:35:12] rvanlieshout: with the same name
[12:35:19] rvanlieshout: you always can
[12:36:14] rvanlieshout: <%= hidden_field_tag "resp-#{resp.id}", '0' %><%= check_box_tag "resp-#{resp.id}", '1', resp.resume == @resume %>
[12:36:24] rvanlieshout: and that's because a browser just doesn't submit unchecked checkboxes
[12:36:40] tasaif: I will try with a form helper
[12:36:46] tasaif: but it I can't I will use that, thank you
[12:36:52] tasaif: you've saved my marriage
[12:37:01] crdpink2: has joined #RubyOnRails
[12:37:06] rvanlieshout: i don't solve things in panic mode
[12:37:09] tasaif: although she may still leave me for cheating on her
[12:37:09] rvanlieshout: it just doesn't help :)
[12:38:39] A124: has joined #RubyOnRails
[12:38:44] tasaif: I think in this situation I would need nested forms to use the form helper
[12:38:52] tasaif: and I don't think nested forms are good
[12:38:58] cac: has joined #RubyOnRails
[12:39:34] user1138: has joined #RubyOnRails
[12:39:55] Xentil: has joined #RubyOnRails
[12:40:08] tasaif: rvanlieshout, you sirmam are a gentleperson and a scholar
[12:41:34] annlewis: has joined #RubyOnRails
[12:41:48] Xentil: has joined #RubyOnRails
[12:41:51] nettoweb: has joined #RubyOnRails
[12:42:11] gavit: rvanlieshout: in code without hash, in error with hash if config.assets.digest = true, in error withouthash if config.assets.digest = false
[12:42:48] B1n4r10: has joined #RubyOnRails
[12:42:53] Xentil: rvanlieshout: what is the best book in your opinion about RoR for beginners ?
[12:43:22] gavit: rvanlieshout: http://127.0.0.1:3000/assets/myfile-e3a759f8e315ac1da195610e5ebf8eadfb91c6b0f97fb57a1c98a7752c8fbc0b.jpg gives me an image
[12:43:32] rvanlieshout: gavit: you should not use assets.digest
[12:43:52] rvanlieshout: i only have config.assets.debug = true and config.assets.raise_runtime_errors = true for asset stuff in dev
[12:43:54] Maletor: has joined #RubyOnRails
[12:44:09] kitsuneyo: has joined #RubyOnRails
[12:44:15] T3K3N: has joined #RubyOnRails
[12:44:17] rvanlieshout: Xentil: either !r4ia or agile web development with rails
[12:44:22] helpa: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[12:44:34] rvanlieshout: but it's been way to long for me to give a serious answer
[12:44:38] rvanlieshout: i've not used both
[12:45:08] gavit: rvanlieshout: sevenseacat said, its default nowadays. so untill I understand why I'm trying both if you dont mind
[12:45:24] Xentil: good, thanks
[12:45:29] yfeldblum: has joined #RubyOnRails
[12:46:09] rvanlieshout: that both reflected to those books
[12:46:09] gavit: maybe my prawn needs an absoulte path?
[12:46:19] rvanlieshout: i would expect so
[12:46:27] rvanlieshout: you don't use the asset pipeline there
[12:46:38] rvanlieshout: just Rails.root.join('app','assets','images','foobar.jpg')
[12:47:28] hardtail: has joined #RubyOnRails
[12:48:22] Macaveli: Is it possible to easily strip tabs from a structure?
[12:48:23] gavit: rvanlieshout: that seems to work, but it seems ugly :)
[12:48:39] rvanlieshout: it's not. you're not using the asset pipeline
[12:48:43] rvanlieshout: it's something local
[12:48:55] Macaveli: I don't want to loop the structure https://gist.github.com/DelawareConsulting/69e909175e2435c90ffc
[12:49:36] herbst: has joined #RubyOnRails
[12:49:37] herbst: has joined #RubyOnRails
[12:49:48] rvanlieshout: the what?, Macaveli
[12:50:11] Macaveli: rvanlieshout i forgot the right name :$ so many program languages I am working on
[12:51:06] lyoshajapan: has joined #RubyOnRails
[12:51:25] bronson: has joined #RubyOnRails
[12:52:25] banister: has joined #RubyOnRails
[12:54:45] Macaveli: it's a hash
[12:55:09] rvanlieshout: so then why are you using that?
[12:55:43] DeXterbed: has joined #RubyOnRails
[12:55:53] artto: has joined #RubyOnRails
[12:56:20] Macaveli: there is a hash in the gist no?
[12:56:36] Macaveli: is ther an easy way to use ruby strip on an hash
[12:57:52] rvanlieshout: on that description_txt?
[12:57:56] jacobat: has joined #RubyOnRails
[12:58:34] rvanlieshout: you could use .map(&:strip)
[12:58:34] jacobat: How do I prevent Rails from writing a session cookie?
[12:58:39] rvanlieshout: if you're using the values
[12:58:45] rvanlieshout: jacobat: by not using the session
[12:58:50] jacobat: rvanlieshout: Nope
[12:59:03] jacobat: rvanlieshout: Doesn't matter if I use the session or not, the cookie is written
[12:59:54] matthewd: jacobat: Are you sure you're not using the session?
[13:00:23] matthewd: e.g., CSRF protection uses it
[13:01:06] blackmesa: has joined #RubyOnRails
[13:01:25] CarlosYoo: has joined #RubyOnRails
[13:01:35] jacobat: I've got this controller: https://gist.github.com/jacobat/6b6bd8eab3b78df8a4f7
[13:01:44] jacobat: Hitting the index action writes a session cookie
[13:01:47] rvanlieshout: and in application controller?
[13:02:04] rvanlieshout: and why worry about that cookie? you don't need a notification or ask the user
[13:02:08] rvanlieshout: for this kind of cookies
[13:02:20] kitsuneyo: has joined #RubyOnRails
[13:02:30] jacobat: rvanlieshout: I've got this in application controller: protect_from_forgery with: :exception
[13:02:37] jacobat: I'll try removing it
[13:02:50] rvanlieshout: but i would consider that protection > cookie presence
[13:03:08] jacobat: Still writing a cookie
[13:03:19] sarink: has joined #RubyOnRails
[13:03:25] rvanlieshout: restarted your rails server?
[13:03:36] rvanlieshout: anything else in your app controller?
[13:03:36] matthewd: jacobat: If you look in the session, is it empty?
[13:04:18] jacobat: matthewd: Not quite - the browser is sending along a session cookie in the request
[13:04:23] asxbr: has joined #RubyOnRails
[13:04:31] jacobat: matthewd: That wasn't an answer to your question
[13:04:38] jacobat: rvanlieshout: No, the application controller is empty
[13:04:46] shibabu: has joined #RubyOnRails
[13:04:54] jacobat: This is a fresh rails app all I did was write the controller code pasted
[13:05:19] rvanlieshout: and what matthewd asked. is the session empty?
[13:05:29] agoldboi: has left #RubyOnRails: ()
[13:05:35] asxbr: hi guys... what order criteria Rails use to validate model ? The order that validations are defined on class?
[13:06:19] rvanlieshout: i suppose so, asxbr
[13:07:08] rvanlieshout: it'll run all, so the order is not likely to be important
[13:07:36] jacobat: rvanlieshout: No, the session is not empty
[13:07:39] havenwood: has left #RubyOnRails: ("Bye!")
[13:08:01] asxbr: i have a situation here, that a validator may run if all other validations passed
[13:08:16] rvanlieshout: jacobat: then the browser will continue to send that cookie. clear your browser cookies
[13:08:37] rvanlieshout: asxbr: it'll always run. so change your method so that it can handle that
[13:08:46] jacobat: rvanlieshout: Yes, I can clear my cookies but that's not very helpful. I need to find a way to not send a new session cookie if it's not needed.
[13:09:04] rvanlieshout: you cannot test that if your browser keeps sending one
[13:09:06] matthewd: jacobat: "new"?
[13:09:10] rvanlieshout: that doesn't make it new
[13:09:13] jacobat: If the content of the session doesn't change, why would Rails rewrite the cookie
[13:09:31] rvanlieshout: iirc that's how these things work
[13:09:32] matthewd: jacobat: That's a different question to the one you asked before :|
[13:09:46] matthewd: jacobat: And has a much simpler answer: expiry.
[13:10:24] jacobat: matthewd: Huh?
[13:10:59] rvanlieshout: isn't it that if it wouldn't return the cookie it's considered deleted?
[13:11:03] jacobat: matthewd: AFAICT Rails doesn't set expiration on session cookies
[13:11:34] sadaf2605: has joined #RubyOnRails
[13:12:07] nettoweb: guys when I run current.job.valid? is show the error messages from job and user model, is it possible to show just the validation messages for job model?
[13:12:08] rvanlieshout: but you're still willing to disable that forgery protection over the presence of that cookie?
[13:12:23] matthewd: jacobat: https://github.com/rack/rack/blob/1-6-stable/lib/rack/session/abstract/id.rb#L292-L320
[13:12:29] rvanlieshout: nettoweb: use is a property, and it's invalid
[13:12:37] nettoweb: I can this way Job.find(...).valid?
[13:12:40] jacobat: rvanlieshout: I don't see why it needs to be one or the other, you should be able to have both
[13:12:41] asxbr: @rvanlieshout: http://pastebin.com/dyTyExpf
[13:12:55] nettoweb: rvanlieshout sorry?
[13:13:06] asxbr: take a look in card_expired? method
[13:13:44] matthewd: jacobat: Oh, this actually sounds familiar... there might be a default middleware that ~always ends up loading the session?
[13:13:46] asxbr: it is raising fatal error when the month is 3 digits "ex: 123"
[13:13:54] rvanlieshout: nettoweb: i might have misunderstood you then :)
[13:14:00] matthewd: jacobat: Possibly CSRF, possibly something else? Don't quite recall.
[13:14:06] gremly: has joined #RubyOnRails
[13:14:35] nettoweb: rvanlieshout In my code Im checking like this "if !current.job.valid?" but it run user validation too. I want just the validation for job
[13:14:41] rvanlieshout: asxbr: i cannot open pastepin with my adblock enabled
[13:14:43] asxbr: my idea is avoid the "card_expired?" validation run if the ":card_expiration_month" dont pass
[13:14:51] rvanlieshout: nettoweb: yeah as it should be. cause it's a property of the job
[13:14:53] asxbr: i'll put in pastie
[13:15:25] nettoweb: it work with "if !Job.find(first).valid?" but I dont think is the better option, but I'm listening for options
[13:15:27] jacobat: matthewd: Hmm...
[13:15:39] asxbr: @rvanlieshout: http://pastie.org/10620741
[13:15:39] nettoweb: rvanlieshout hmmm, so the only option is like my second example?
[13:15:50] Cervajz: has joined #RubyOnRails
[13:16:09] rvanlieshout: nettoweb: one where the user isn't loaded yes
[13:16:15] matthewd: jacobat: Ah, I think it's flash
[13:16:26] jacobat: matthewd: Even when I'm not using flash :s
[13:16:52] asxbr: @rvanlieshout: my idea is make the "card_expired?" method only be called if all :card_expiration_month validations pass before
[13:16:58] jacobat: matthewd: My issue is that I'm using HTTP caching and running a caching proxy in front of my Rails app
[13:17:00] rvanlieshout: asxbr: on that validate_card_expiration add a return unless card_expiration_year.present? && ...
[13:17:06] asxbr: should i put all month validation inside the custom validation ?
[13:17:15] jacobat: matthewd: Session cookies get persisted in the proxy and served to random users, big probem
[13:17:17] rvanlieshout: asxbr: even better would be if card_expired? won't break if called :)
[13:17:24] asxbr: the present is not the question
[13:17:34] asxbr: when the user types an invalid month
[13:17:35] jacobat: matthewd: I can just remove cookies in the proxy it just feels wrong to have to hack around like that
[13:17:38] asxbr: like "123"
[13:17:45] asxbr: the Date.new raise error
[13:17:51] Macaveli: so rvanlieshout I was wrong, I have an hash in hash so I'm trying to use strip on the deepest hash: any idea why he doesn't strip the DESCRIPTION_TXT https://gist.github.com/DelawareConsulting/056f8c40326b842984f9 ?
[13:17:54] rvanlieshout: then test for that
[13:18:16] rvanlieshout: Macaveli: because it just executes that method.. it doesn't use map or strip!
[13:18:38] asxbr: thinking in not being redundant, should i change the "less_then_or_equal_to" to inside the custom validation?
[13:18:55] d0nn1e: has joined #RubyOnRails
[13:19:12] asxbr: @rvanlieshout: stop to use the model "validate" for this, and do it manual?
[13:19:41] owenjones: has joined #RubyOnRails
[13:20:27] maesitos: has joined #RubyOnRails
[13:20:30] asxbr: but in this case i'll do it manual, right? without rails automatic "validate"
[13:20:38] asxbr: @rvanlieshout
[13:20:40] rvanlieshout: for that single on that validates the range
[13:20:49] matthewd: jacobat: Per that link, you should be able to set skip on the session
[13:21:38] asxbr: is possible to reuse the rails logic of "less_than_or_equal_to" ?
[13:22:04] asxbr: i'm trying to avoid to remake a thing that is done by rails
[13:22:07] matthewd: jacobat: But personally, I'd just make the proxy strip set-cookie on public responses... much less error-prone than remembering to do it every time you set a caching header
[13:22:45] jacobat: matthewd: I guess you're right
[13:24:01] asxbr: @rvanlieshout: if i implement it manually, i'll need to make tests for it
[13:24:13] rvanlieshout: asxbr: errors.add unless (1..12).include?(123)
[13:24:14] asxbr: its the reason that i'm avoiding to remake the logic
[13:24:15] rvanlieshout: not really hard :)
[13:24:40] herbst: has joined #RubyOnRails
[13:24:41] herbst: has joined #RubyOnRails
[13:25:03] asxbr: sounds really simple
[13:25:17] blackmesa: has joined #RubyOnRails
[13:25:17] chihaja: has joined #RubyOnRails
[13:26:46] rvanlieshout: use value.to_i to enforce integer
[13:27:03] rvanlieshout: invalid stuff becomes 0, so it would trigger an error
[13:27:21] asxbr: you are the man
[13:27:41] jgt3: has joined #RubyOnRails
[13:27:41] gremly: has joined #RubyOnRails
[13:27:53] rvanlieshout: you could also test the string for \D
[13:28:40] codergeek: has joined #RubyOnRails
[13:29:06] christiandsg: has joined #RubyOnRails
[13:29:38] asxbr: it should solve the "numericality" question
[13:30:22] lacrymology: has joined #RubyOnRails
[13:31:29] davonrails_: has joined #RubyOnRails
[13:31:30] arup_r: has joined #RubyOnRails
[13:31:59] AzaToth: has joined #RubyOnRails
[13:32:36] jkamenik: has joined #RubyOnRails
[13:34:47] hardtail: has joined #RubyOnRails
[13:35:12] Macaveli_: has joined #RubyOnRails
[13:35:23] gremly: has joined #RubyOnRails
[13:36:27] Macaveli_: has joined #RubyOnRails
[13:39:14] artto: has joined #RubyOnRails
[13:39:46] ivanyk: has joined #RubyOnRails
[13:40:43] c355E3B: has joined #RubyOnRails
[13:40:49] B1n4r10: has joined #RubyOnRails
[13:41:54] faisal: has joined #RubyOnRails
[13:41:56] goodcodeguy: has joined #RubyOnRails
[13:42:22] annlewis: has joined #RubyOnRails
[13:43:10] brendan-: has joined #RubyOnRails
[13:44:03] njero: hey.. i have one dump doubt.. Should the project using rails also be necessarily open source?..
[13:44:23] njero: i mean should i publish code online..
[13:44:40] Maletor: has joined #RubyOnRails
[13:45:35] lyoshajapan: has joined #RubyOnRails
[13:45:39] jscheel: has joined #RubyOnRails
[13:46:19] shanemcd: has joined #RubyOnRails
[13:47:46] elton: has joined #RubyOnRails
[13:48:03] nopolitica: has joined #RubyOnRails
[13:48:44] cac: has joined #RubyOnRails
[13:49:40] nopolitica: hello, guys! can you help me to understand a way of joining two ActiveRecord::Relation results, for example I have @objects1 = Object.where(blah) @objects2 = Object.where(blah2) and I want to join objects1 and objects2 without loosing Relation class
[13:51:46] atomical: has joined #RubyOnRails
[13:55:01] angeloc: has joined #RubyOnRails
[13:57:00] jhass: nopolitica: what result do you expect?
[13:57:01] kitsuneyo: has joined #RubyOnRails
[13:57:07] jhass: a mixture of the model classes?
[13:57:56] matthewd: nopolitica: Assuming you want all the objects from both collections, you could look at the where-or gem
[13:59:37] nopolitica: jhass: well, when I try to sum this two results I get Array ) It looks like it's not needed at all due to I can make a query using one operation instead of two )
[13:59:45] Cervajz: has joined #RubyOnRails
[13:59:46] angeloc: has joined #RubyOnRails
[13:59:53] nopolitica: matthewd: thank you, I'll take a look )
[14:00:07] nopolitica: jhass: right?
[14:00:20] jhass: how should I know?
[14:00:46] nopolitica: jhass: According to your question I thought you mean I don't need this )
[14:02:56] CarlosYoo: has joined #RubyOnRails
[14:03:20] adre: has joined #RubyOnRails
[14:03:32] ornerymoose: has joined #RubyOnRails
[14:03:55] tasaif: Hi, I have a form that when I submit goes to the wrong place in my controller
[14:04:02] tasaif: maybe I'm misunderstanding something fundamental
[14:04:28] sarink: has joined #RubyOnRails
[14:04:40] tasaif: this is the route file https://gist.github.com/anonymous/3779b4231f3a6700e98e
[14:05:08] Macaveli_: mmm rvanlieshout https://gist.github.com/DelawareConsulting/47e325671c5d0e6a6d0c last problem
[14:05:12] tasaif: this is the form https://gist.github.com/anonymous/859c5b59d08f29dce822
[14:05:24] Macaveli_: the gsub not working on this code ...
[14:05:26] tasaif: namely the = form.submit 'New Responsibility'
[14:07:03] ornerymoose: What would be the correct way to show only the selected item (instead of a full select menu with the selected item highlighted) in the active admin panel? https://gist.github.com/anonymous/f1db62eb8478213958c0 (for :properties, line 15 in the gist)
[14:07:31] erichu: has joined #RubyOnRails
[14:08:47] banister: has joined #RubyOnRails
[14:10:43] shanemcd: has joined #RubyOnRails
[14:11:05] tasaif: never mind I figured mine out
[14:11:22] tasaif: it was matching with the first patch in the route file for some reason
[14:11:48] rvanlieshout: i was away for a sec
[14:11:59] rvanlieshout: what's with that Macaveli_?
[14:12:01] shanemcd: has joined #RubyOnRails
[14:12:31] rvanlieshout: gsub(/\W/, '').gsub(/\s\s+/, ' ')
[14:13:49] cac: has joined #RubyOnRails
[14:14:49] herbst: has joined #RubyOnRails
[14:15:04] angeloc: has joined #RubyOnRails
[14:16:28] ramortegui: has joined #RubyOnRails
[14:17:39] yaewa: has joined #RubyOnRails
[14:19:06] Zadrel: has joined #RubyOnRails
[14:19:10] sankaber: has joined #RubyOnRails
[14:20:08] moei: has joined #RubyOnRails
[14:20:23] davonrails: has joined #RubyOnRails
[14:20:35] Macaveli_: wil that clear the tabs
[14:21:12] cac: has joined #RubyOnRails
[14:21:29] Macaveli_: it doesn't :(
[14:21:33] akshat: has joined #RubyOnRails
[14:21:41] Macaveli_: the gsub doesn't remove the \t's
[14:23:36] DylanJ: \W matches tabs Macaveli_
[14:24:18] Macaveli_: mmm seems not DylanJ
[14:24:21] rvanlieshout: [a-zA-Z0-9othercharsyouwanttoallow]
[14:24:39] Macaveli_: le me guest
[14:24:55] Macaveli_: https://gist.github.com/DelawareConsulting/7f046d6655e9e2c56f6b
[14:25:04] Macaveli_: squish! does the trick so it seems
[14:25:06] FLeiXiuS: has joined #RubyOnRails
[14:25:07] FLeiXiuS: has joined #RubyOnRails
[14:26:19] DylanJ: Macaveli_: do you know what sub does?
[14:26:25] DylanJ: vs what gsub does?
[14:26:44] Macaveli_: forgot the g -.-
[14:26:53] DylanJ: no, accidents happen
[14:27:35] chandlerbing: has joined #RubyOnRails
[14:28:03] Macaveli_: *Performnces Seppuku *
[14:28:37] jscheel: has joined #RubyOnRails
[14:28:45] mary5030: has joined #RubyOnRails
[14:28:47] blackmesa: has joined #RubyOnRails
[14:30:38] neox999: has joined #RubyOnRails
[14:31:08] akshat: has joined #RubyOnRails
[14:31:10] kitsuneyo: has joined #RubyOnRails
[14:31:40] cac: has joined #RubyOnRails
[14:31:50] Didac: has joined #RubyOnRails
[14:31:52] christiandsg: has joined #RubyOnRails
[14:32:17] amortimer1: has joined #RubyOnRails
[14:34:15] Macaveli: has joined #RubyOnRails
[14:34:33] weckl: has joined #RubyOnRails
[14:35:01] Sylario: has joined #RubyOnRails
[14:35:28] _Tariq: has joined #RubyOnRails
[14:39:23] Darkman738: has joined #RubyOnRails
[14:39:24] daivyk: has joined #RubyOnRails
[14:39:45] Cervajz: has joined #RubyOnRails
[14:40:27] AzaToth: has joined #RubyOnRails
[14:40:40] sadaf2606: has joined #RubyOnRails
[14:43:05] annlewis: has joined #RubyOnRails
[14:43:50] crystalneth: has joined #RubyOnRails
[14:44:36] lyoshajapan: has joined #RubyOnRails
[14:45:24] Maletor: has joined #RubyOnRails
[14:46:21] codergeek: has joined #RubyOnRails
[14:46:26] n1lo_: has joined #RubyOnRails
[14:46:33] sadaf2605: has joined #RubyOnRails
[14:46:52] Pazician: has joined #RubyOnRails
[14:48:31] Oliphaunte: has joined #RubyOnRails
[14:48:40] elton: has joined #RubyOnRails
[14:50:03] johnnegron: has joined #RubyOnRails
[14:50:16] steffkes: has joined #RubyOnRails
[14:50:17] steffkes: has joined #RubyOnRails
[14:51:28] herbst: has joined #RubyOnRails
[14:51:29] herbst: has joined #RubyOnRails
[14:53:35] uris: has joined #RubyOnRails
[14:53:53] thejoecarroll: has joined #RubyOnRails
[14:54:04] bronson: has joined #RubyOnRails
[14:56:55] Darkman738: has joined #RubyOnRails
[14:57:21] mag42c: has joined #RubyOnRails
[14:59:39] arup_r: has joined #RubyOnRails
[14:59:57] jlebrech: has joined #RubyOnRails
[15:00:15] jlebrech: can you extend a class so it has access to the params hash?
[15:00:15] B1n4r10: has joined #RubyOnRails
[15:00:45] jhass: your question is pretty vague
[15:01:13] stannard: has joined #RubyOnRails
[15:01:37] jlebrech: jhass: in my controller i do ObjectThatProcessesUserInput.new(params).doZXY but i want it to be a singleton.
[15:01:53] chihaja: has joined #RubyOnRails
[15:02:20] neox999: has left #RubyOnRails: ()
[15:02:22] thelastinuit: has joined #RubyOnRails
[15:02:37] jlebrech: to clean it up a but, I don't need to touch params from the controller.
[15:02:52] jhass: I don't think it will get an cleaner
[15:02:54] njero: has joined #RubyOnRails
[15:02:58] Oliphaunte: has joined #RubyOnRails
[15:03:10] jkamenik1: has joined #RubyOnRails
[15:03:14] netzfisch: has joined #RubyOnRails
[15:03:15] jhass: at least not by turning it into a singleton while it clearly depends on request state
[15:03:43] CarlosYoo: has joined #RubyOnRails
[15:04:25] shibabu: has joined #RubyOnRails
[15:04:34] jhass: if you desperately seek a usecase for a pattern you do it wrong
[15:04:46] jhass: it should emerge naturally from your code and only help to formalize the last step
[15:05:02] benhuda: has joined #RubyOnRails
[15:05:16] DeXterbed: has joined #RubyOnRails
[15:05:29] jlebrech: could I make both the class (service?) and the controller use a concern and the concern could set up a method and monad and set it up with a beforefilter? but overkill to replace MyObject.new(params).x tho.
[15:06:09] jhass: I fail to parse that
[15:07:40] jlebrech: basically a method that does: @myService |== MyService.new(params). but I think I'm just trying to be less verbose, which isn't a good idea.
[15:08:27] shibabu_: has joined #RubyOnRails
[15:08:32] B1n4r10: has joined #RubyOnRails
[15:08:52] Jasaka: has joined #RubyOnRails
[15:09:41] Pumukel: has joined #RubyOnRails
[15:09:47] jlebrech: jhass i think using initialize is just as good. thanks.
[15:09:48] _Tariq: has joined #RubyOnRails
[15:10:06] n1lo_: has joined #RubyOnRails
[15:10:59] noober3: has joined #RubyOnRails
[15:11:08] mary5030: has joined #RubyOnRails
[15:11:21] n1lo: has joined #RubyOnRails
[15:11:22] futilegames: has joined #RubyOnRails
[15:11:25] rawrwx: has joined #RubyOnRails
[15:12:02] AzaToth: has joined #RubyOnRails
[15:12:05] adavia: has joined #RubyOnRails
[15:13:58] vasilakisFiL: is there any open source tool that imitates travisci/cicleci/semaphoreci etc that I can deploy in my vps ?
[15:15:21] annlewis: has joined #RubyOnRails
[15:15:29] ethe: has joined #RubyOnRails
[15:16:16] axl_: has joined #RubyOnRails
[15:17:03] bratsche: has joined #RubyOnRails
[15:18:04] cac: has joined #RubyOnRails
[15:20:25] kitsuneyo: has joined #RubyOnRails
[15:20:40] _Tariq: has joined #RubyOnRails
[15:22:05] hardtail: has joined #RubyOnRails
[15:26:07] jtb__: has joined #RubyOnRails
[15:26:43] RegulationD: has joined #RubyOnRails
[15:28:02] herbst: has joined #RubyOnRails
[15:28:03] herbst: has joined #RubyOnRails
[15:28:17] banister: has joined #RubyOnRails
[15:29:46] Rubie: has joined #RubyOnRails
[15:34:10] nickjj: vasilakisfil, you can try using gitlab/gitlab-ci
[15:34:14] dionysus69: has joined #RubyOnRails
[15:34:35] christiandsg: has joined #RubyOnRails
[15:36:02] The_Phoenix: has joined #RubyOnRails
[15:36:33] nickjj: or jenkins too
[15:38:13] elaptics: depends what you mean by imitates - there's plenty of CI services but ones like semaphore deal with the hassle of getting things installed, etc to run your builds
[15:38:35] elaptics: I don't know of anything like that which is open source
[15:38:41] The_Phoenix: has joined #RubyOnRails
[15:39:06] lyoshajapan: has joined #RubyOnRails
[15:40:45] futilegames: has joined #RubyOnRails
[15:42:35] Bloomer: has joined #RubyOnRails
[15:43:06] |PiP|: has joined #RubyOnRails
[15:43:16] Darkman738: has joined #RubyOnRails
[15:43:33] puria: has joined #RubyOnRails
[15:43:36] noober3: can someone please tell me how to convert my sql statments into activerecord statements? https://gist.github.com/anonymous/49e88ce46e8cb414b38c
[15:44:12] noober3: i want one activerecord query but done in the rails activerecord way.
[15:44:57] pontiki: http://guides.rubyonrails.org/active_record_querying.html
[15:46:02] AzaToth: has joined #RubyOnRails
[15:46:15] Maletor: has joined #RubyOnRails
[15:46:17] jds: has joined #RubyOnRails
[15:46:43] jessemcgilallen: has joined #RubyOnRails
[15:47:35] steffkes: has joined #RubyOnRails
[15:47:36] steffkes: has joined #RubyOnRails
[15:48:24] podman: has joined #RubyOnRails
[15:48:42] lacuna: has joined #RubyOnRails
[15:49:35] teclator: has joined #RubyOnRails
[15:51:41] banister: has joined #RubyOnRails
[15:51:44] faisal_: has joined #RubyOnRails
[15:52:37] sarink: has joined #RubyOnRails
[15:53:35] nyaa: has joined #RubyOnRails
[15:53:54] herbst0: has joined #RubyOnRails
[15:54:22] sbarg1: has joined #RubyOnRails
[15:55:27] trautwein: has joined #RubyOnRails
[15:57:49] adre: has joined #RubyOnRails
[15:58:16] rubyonrailed: has joined #RubyOnRails
[15:58:37] pwnd_nsfw: has joined #RubyOnRails
[15:59:28] noober3: not sure how to do a bunch of joins where only the id is changing: joins(:car_dealerships).where
[15:59:44] arup_r: has joined #RubyOnRails
[15:59:53] noober3: (car_dealerships: {car_id: id_from_array})
[16:01:05] DiCablo: has joined #RubyOnRails
[16:05:11] CarlosYoo: has joined #RubyOnRails
[16:06:22] loechel: has joined #RubyOnRails
[16:07:19] matthewd: noober3: That doesn't look like a query you'd want to write, to me
[16:07:31] paulodiniz: has joined #RubyOnRails
[16:08:52] Yomero2: has joined #RubyOnRails
[16:09:41] arup_r: I am trying to test one ActiveAdmin controller. My test is failing when trying to create a record. But test log not showing any thing relevant. How should I debug to find out what is wronG? https://gist.github.com/aruprakshit/276b815f02176532d0b7
[16:09:46] noober3: matthewd: do you have a suggestion that you think will produce what i want? I thought this would work.
[16:10:20] Pumukel: has joined #RubyOnRails
[16:10:47] jmarchello: has joined #RubyOnRails
[16:11:23] matthewd: noober3: It sounds like you're trying to do a "manual" pivot/crosstab query
[16:12:23] dopie: has joined #RubyOnRails
[16:13:57] jmarchello: Good morning, I'm trying to work with nested resources before their persisted (for validation). Does anyone know a good way to do so?
[16:14:38] lxsameer: has joined #RubyOnRails
[16:14:38] lxsameer: has joined #RubyOnRails
[16:15:03] tubbo: jmarchello: define "work with"
[16:15:57] benhuda: has joined #RubyOnRails
[16:16:09] annlewis: has joined #RubyOnRails
[16:16:38] elaptics: jmarchello: do you mean like using the validates_associated ?
[16:16:40] matthewd: noober3: Instead, I think I'd just do a single straight join (via `includes`), and use that... though my vagueness is increasing as we move further from "code/context I can see" to "wild inferences drawn from the query you pasted"
[16:16:48] banister: has joined #RubyOnRails
[16:16:56] jmarchello: I have a Form that has many Answers. The answers are created via nested forms. So may params look like "form => {??? answer_attributes => {???}}
[16:16:59] arup_r: eyes on me ? my eyes are not working.. :)
[16:17:07] blackmesa: has joined #RubyOnRails
[16:17:11] nettoweb_: has joined #RubyOnRails
[16:17:26] mary5030: has joined #RubyOnRails
[16:17:55] elaptics: jmarchello: then the rails way would be to use validates_associated :answers in the Form model if you want to validate all the answers
[16:18:16] hfp: has joined #RubyOnRails
[16:18:57] nettoweb: has joined #RubyOnRails
[16:19:05] jmarchello: I need to validate the answers, but It's a little more complicated than that. The Form also has questions and those questions have the answers. I need to pull the answers, and then check if there are answers for each of the required questions
[16:19:40] jmarchello: let me look at validates_associated and see if it fits my needs
[16:19:42] noober3: matthewd: wouldn't i be stuck with the same issue if i used includes?
[16:20:10] jmarchello: btw, thanks for the help
[16:20:38] wsewolod: has joined #RubyOnRails
[16:21:52] jmarchello: will validates_associated run a custom validation as well? (ie. validate :my_validation_method)
[16:22:11] matthewd: noober3: "single" -- not many joins to the same table
[16:22:46] matthewd: noober3: Alternatively, *why* do you want to compose the query like that? What are you doing with it, that makes that shape more convenient?
[16:23:08] hfp: Hi! I'd like to build a small rails app where I can upload a huge text file (up to 750k lines) and then process it in the backend to return a chain of lines matching a particular algorithm. Is it a good idea to use carrierwave/refile/paperclip for that or are these gems intended for image upload only?
[16:23:19] efy: has joined #RubyOnRails
[16:24:00] noober3: matthewd: i am lost and i was looking at sql code that seemed to give me my result and tried to convert it to activerecord notation
[16:24:16] matthewd: noober3: What is your result?
[16:24:45] kitsuneyo: has joined #RubyOnRails
[16:24:49] jmarchello: hfp: I've used paperclip for storing large zip files before. It's supports all kinds of files. I would recommend paperclip.
[16:24:53] matthewd: hfp: Yes, they're all good for uploads in general
[16:24:55] efy: has joined #RubyOnRails
[16:25:13] efy: has joined #RubyOnRails
[16:25:43] mag42c: has joined #RubyOnRails
[16:25:58] noober3: matthewd: it gives me all dealerships that have both cars, i am not interesed in dealerships that only have one or the other, they must have both
[16:26:13] arup_r: nvm, I found out the reason.
[16:26:52] paulodin_: has joined #RubyOnRails
[16:27:08] hfp: jmarchello, matthewd: I'm not clear if they're expected to put the uploaded file in an ORM or if that's optional
[16:27:09] jmarchello: elaptics: Thank you, I'm going to look into a solution using validated_associated
[16:28:38] efy: has joined #RubyOnRails
[16:28:58] mag42c: has left #RubyOnRails: ()
[16:29:03] sarink: has joined #RubyOnRails
[16:29:25] mag42c: has joined #RubyOnRails
[16:29:29] Cervajz: has joined #RubyOnRails
[16:29:30] matthewd: hfp: They'll normally link the uploaded file to an ORM record (but not normally store the actual contents therein)... I imagine you'd want that, though, to keep track of your processing
[16:30:21] thecyclone: has joined #RubyOnRails
[16:30:31] nettoweb: has joined #RubyOnRails
[16:30:58] lacuna: has joined #RubyOnRails
[16:32:16] hfp: matthewd: Thanks
[16:32:18] Spami: has joined #RubyOnRails
[16:34:06] ewnd9: has joined #RubyOnRails
[16:35:17] lyoshajapan: has joined #RubyOnRails
[16:35:29] matthewd: noober3: Hmm... I think my best suggestion would be `EXISTS(..)`, though AR can't do much to help you compose that
[16:35:33] hobodave: has joined #RubyOnRails
[16:35:55] matthewd: noober3: Or .joins(), which would allow you to construct your original query -- again, without much help
[16:36:13] jmarchello: has left #RubyOnRails: ()
[16:36:54] hobodave: has joined #RubyOnRails
[16:37:27] christiandsg: has joined #RubyOnRails
[16:38:08] mwlang: has joined #RubyOnRails
[16:38:10] matthewd: noober3: A more creative option might be `honda.dealerships.includes(:cars).where(cars: { id: ford })`, though that obviously only works for exactly two
[16:38:46] noober3: yea i want it to work for a bunch of different options
[16:40:38] netzfisch: has joined #RubyOnRails
[16:40:53] matthewd: Then I'd strongly recommend EXISTS; the DISTINCT might be hiding the multiplication of rows from the final result, but your DB server will still very much notice
[16:40:55] [Butch]: has joined #RubyOnRails
[16:41:28] jbrhbr: has joined #RubyOnRails
[16:43:53] n1lo: has joined #RubyOnRails
[16:45:36] noober3: mattewd: doesnt exists only work with a single condition?
[16:45:59] adre: has joined #RubyOnRails
[16:46:59] Maletor: has joined #RubyOnRails
[16:47:31] matthewd: noober3: EXISTS(SELECT 1 FROM cars_dealerships WHERE dealership_id = dealerships.id AND car_id = 1) AND EXISTS(SELECT 1 FROM cars_dealerships WHERE dealership_id = dealerships.id AND car_id = 2) AND etc
[16:48:02] corioliss: has joined #RubyOnRails
[16:50:01] elton: has joined #RubyOnRails
[16:50:25] _Tariq: has joined #RubyOnRails
[16:50:54] griffindy: has joined #RubyOnRails
[16:51:15] kies: has joined #RubyOnRails
[16:52:08] sonofdirt: has joined #RubyOnRails
[16:52:57] rubyonrailed: has joined #RubyOnRails
[16:53:51] stannard: has joined #RubyOnRails
[16:55:08] srinidhi: has joined #RubyOnRails
[16:56:15] adre: has joined #RubyOnRails
[16:56:34] bronson: has joined #RubyOnRails
[16:57:33] _Tariq: has joined #RubyOnRails
[16:57:46] Oliphaunte: has joined #RubyOnRails
[16:59:28] tildes: has joined #RubyOnRails
[17:00:37] CarlosYoo: has joined #RubyOnRails
[17:01:05] B1n4r10: has joined #RubyOnRails
[17:01:19] rubyonrailed: In rspec, I have one spec file that I want to use `config.mock_with :mocha` Is there a way to assign that only to that spec file?
[17:02:07] maloik: has joined #RubyOnRails
[17:05:10] agit0: has joined #RubyOnRails
[17:05:32] codergeek: has joined #RubyOnRails
[17:06:11] noober3: matthewd: thanks for your help. i will try to work on this more
[17:06:34] Coldblackice: has joined #RubyOnRails
[17:06:39] dici: has joined #RubyOnRails
[17:07:48] brunoalano: has joined #RubyOnRails
[17:08:17] brunoalano: Why Rails it's generating session cookies for assets? (I'm using Redis as session store, and it's taking too much time)
[17:09:16] agit0: has joined #RubyOnRails
[17:09:56] sbarg: has joined #RubyOnRails
[17:11:41] djbkd: has joined #RubyOnRails
[17:11:58] sarink: has joined #RubyOnRails
[17:12:57] jmarchello: has joined #RubyOnRails
[17:13:02] eddiegrey: has joined #RubyOnRails
[17:14:00] Rodya_: has joined #RubyOnRails
[17:16:53] annlewis: has joined #RubyOnRails
[17:17:27] centrx: has joined #RubyOnRails
[17:19:06] Sylario: Is there anyone that replaced railscast? I would pay even for something with a lesser quality
[17:20:00] elaptics: sylario: there's https://gorails.com/ and https://devchat.tv/rails-clips/ - no idea of the quality though, I've not watched any of them
[17:20:18] Sylario: elaptics: thanks !
[17:20:45] adre: has joined #RubyOnRails
[17:20:58] jtb__: has joined #RubyOnRails
[17:20:59] elaptics: sylario: if you're not after rails specifically then I can highly recommend rubytapas for a more general ruby one http://www.rubytapas.com/
[17:21:34] jmarchello: I've never seen rails-clips, but I listen to the guys podcast and he's pretty legit. He also hosts Rails Remote Conf.
[17:23:04] paulodin_: has joined #RubyOnRails
[17:23:22] Oliphaunte: has joined #RubyOnRails
[17:24:45] Cervajz: has joined #RubyOnRails
[17:24:45] hardtail: has joined #RubyOnRails
[17:27:27] Sylario: Damn, ??? is low ^^
[17:29:18] hardtail: has joined #RubyOnRails
[17:29:27] Sylario: Thanks for the links, i am kind of an isolated Rails dev and without conf or meetups it can be hard to stay up to date
[17:29:51] sonofdirt: has joined #RubyOnRails
[17:30:51] stesind: has joined #RubyOnRails
[17:31:30] markh: has joined #RubyOnRails
[17:31:54] Xentil: has joined #RubyOnRails
[17:32:28] wmdrossard: has joined #RubyOnRails
[17:32:30] nightsh: has joined #RubyOnRails
[17:32:30] KrzaQ: has joined #RubyOnRails
[17:33:44] lyoshajapan: has joined #RubyOnRails
[17:34:35] tingansob: has joined #RubyOnRails
[17:34:47] debster: has joined #RubyOnRails
[17:35:57] tingansob: has left #RubyOnRails: ()
[17:36:12] tingansob: has joined #RubyOnRails
[17:37:41] tingansob_: has joined #RubyOnRails
[17:37:46] njero: is there an intelligent bot for irc which can create an faq kind of thing from all conversions and provide search in that, so that repeated queries can be avoided... :P
[17:38:53] jmarchello1: has joined #RubyOnRails
[17:39:03] goodcodeguy: has joined #RubyOnRails
[17:40:07] paulodiniz: has joined #RubyOnRails
[17:40:10] adre: has joined #RubyOnRails
[17:40:10] Oliphaunte: has joined #RubyOnRails
[17:40:18] christiandsg: has joined #RubyOnRails
[17:41:02] aurels: has joined #RubyOnRails
[17:41:17] aurels: has joined #RubyOnRails
[17:41:27] njero: hm.. seems like that was also a frequently asked query which is everyone ignores.. :P
[17:41:30] djbkd: has joined #RubyOnRails
[17:41:46] jmarchello1: sylaria: podcasts could help too if you're into that. Checkout Ruby Rouges and The Changelog
[17:42:17] unreal: has joined #RubyOnRails
[17:43:23] aurels: has joined #RubyOnRails
[17:43:43] aurels: has left #RubyOnRails: ()
[17:44:07] aurails: has joined #RubyOnRails
[17:44:15] eddiegrey: I have been listening to The Changelog
[17:44:59] lacuna: has joined #RubyOnRails
[17:45:13] eddiegrey: listen. I am working on the rails tutorial by Hartl and I am really going to need some further reading on test driven development. I am not used to doing things in this way. Any recommendations for a good TDD resource for beginners?
[17:47:06] brunto: has joined #RubyOnRails
[17:47:44] Maletor: has joined #RubyOnRails
[17:48:04] renegadeandy: Can anyone please help me with this problem : http://stackoverflow.com/questions/34181827/solr-initilization-failure-in-production-environment-with-ruby-on-rails
[17:48:09] thejamespinto: has joined #RubyOnRails
[17:50:19] drptbl: has joined #RubyOnRails
[17:50:28] hardtail: has joined #RubyOnRails
[17:51:00] elton: has joined #RubyOnRails
[17:52:55] mrtomme: has joined #RubyOnRails
[17:52:57] KensoDev: has joined #RubyOnRails
[17:53:25] nightsh: has joined #RubyOnRails
[17:54:30] Zamerick: has joined #RubyOnRails
[17:54:52] cs44: has joined #RubyOnRails
[17:56:05] blackmesa: has joined #RubyOnRails
[17:58:27] jessemcgilallen: has joined #RubyOnRails
[17:59:00] agit0: has joined #RubyOnRails
[17:59:41] moeabdol: has joined #RubyOnRails
[18:00:02] sleungcy: has joined #RubyOnRails
[18:00:32] qejk: has joined #RubyOnRails
[18:01:24] jbrhbr: has joined #RubyOnRails
[18:01:37] bmalum: has joined #RubyOnRails
[18:02:04] arBmind: has joined #RubyOnRails
[18:03:00] CarlosYoo: has joined #RubyOnRails
[18:03:14] KrzaQ: I have an externally fed database table that I want to display and make easily searchable by columns' contents. Is RoR a correct choice for that kind of job? I feel overwhelmed by the tutorials
[18:03:21] paulodiniz: has joined #RubyOnRails
[18:05:34] mwlang: with activerecord, how do I get at the underlying table definition? For example, if I wanted to know the length of ???first_name??? in the ???users??? table?
[18:06:11] colleenmcguckin: has joined #RubyOnRails
[18:06:18] wireshark: has joined #RubyOnRails
[18:06:29] _Tariq: has joined #RubyOnRails
[18:06:51] lemur: has joined #RubyOnRails
[18:06:53] pipework: KrzaQ: It's practically what it does best.
[18:07:14] AntiSpamMeta: has joined #RubyOnRails
[18:07:15] slash_mode: mwlang: YoModel#columns_hash
[18:07:18] pipework: If you don't need much customization, activeadmin or rails-admin is useful.
[18:07:25] mc_fail_: has joined #RubyOnRails
[18:08:03] mc_fail_: does active record support something like cascade relations?
[18:08:12] slash_mode: mwlang: Link.columns_hash["placement"].limit #=> 255
[18:08:16] mc_fail_: like, i have 3 tables, which t
[18:08:28] mwlang: slash_mode: thanks!
[18:08:38] slash_mode: mwlang: sure thing
[18:08:45] tubbo: slash_mode: yo model so fat
[18:08:50] pipework: mc_fail_: Do you mean like, 'destroy: true' on the relation?
[18:08:55] pipework: tubbo: Shut up, tubbo.
[18:09:15] aurails: has joined #RubyOnRails
[18:10:00] mc_fail_: which is 3 objects, table 1 is connected to table 2, table 2 is connected to table 3, and i like to have data from table 3 like 1.find(id).2.where(sth).3
[18:10:17] agit0: has joined #RubyOnRails
[18:10:39] tubbo: pipework: :'(
[18:10:49] pipework: tubbo: tub up, shutto.
[18:12:05] mc_fail_: like if @a = 1.find(id).2.where(sth).3, i expect to have a record from table 3 in @a
[18:12:48] KrzaQ: pipework: active admin looks like whatI want to achieve. Thanks. I'll have to figure out how to make it work
[18:13:08] matthewd: mc_fail_: Yes, activerecord can work with databases that have more than two related tables?
[18:13:30] thejamespinto: mc_fail_: I really don't mean to offend here. But maybe you would benefit from writing down your explanation on your favorite text editor and iterating thru it a few times. I trust to the best of your understanding your are laying down the explanation. But if you give us a compact explanation we will be able to understand and help better.
[18:13:32] pipework: First.find(some_id).seconds.find(some_other_id).thirds(some_last_id), right? Have you tried?
[18:13:42] misz_: has joined #RubyOnRails
[18:13:45] pipework: mc_fail_: !relations
[18:13:56] pipework: !associations
[18:13:56] helpa: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[18:14:01] pipework: That's the one.
[18:14:08] thejamespinto: mc_fail_: !ask
[18:14:58] rubyonrailed: has joined #RubyOnRails
[18:15:12] steffkes: has joined #RubyOnRails
[18:15:13] steffkes: has joined #RubyOnRails
[18:15:40] thejamespinto: helpa: damn you
[18:15:47] thejamespinto: pipework: hey ging
[18:16:43] centrx: has joined #RubyOnRails
[18:16:50] pwnd_nsfw: has joined #RubyOnRails
[18:17:24] _Tariq: has joined #RubyOnRails
[18:17:39] annlewis: has joined #RubyOnRails
[18:18:04] jgpawletko: has joined #RubyOnRails
[18:18:32] shibabu: has joined #RubyOnRails
[18:19:00] _Tariq: has joined #RubyOnRails
[18:19:18] cs44: has left #RubyOnRails: ()
[18:19:40] christiandsg: has joined #RubyOnRails
[18:20:08] sarink: has joined #RubyOnRails
[18:20:18] jkamenik: has joined #RubyOnRails
[18:21:49] codergeek: has joined #RubyOnRails
[18:23:43] paulodiniz: has joined #RubyOnRails
[18:23:48] RegulationD: has joined #RubyOnRails
[18:24:10] aurails: has joined #RubyOnRails
[18:27:59] jmarchello: has joined #RubyOnRails
[18:28:19] berserk_ren: has joined #RubyOnRails
[18:28:22] lyoshajapan: has joined #RubyOnRails
[18:29:13] Spami: has joined #RubyOnRails
[18:29:19] mc_fail_: there is the detailed example http://fpaste.org/299226/
[18:29:36] mc_fail_: i don't see why it couldn't build a relation for 3 objects
[18:30:07] agit0: has joined #RubyOnRails
[18:30:27] Cervajz: has joined #RubyOnRails
[18:30:42] Potatomound: has joined #RubyOnRails
[18:31:01] matthewd: mc_fail_: !fake
[18:31:01] helpa: mc_fail_: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[18:31:26] centrx: I don't think any of those work
[18:31:34] mc_fail_: centrx why?
[18:32:20] Xentil: has joined #RubyOnRails
[18:32:40] centrx: has joined #RubyOnRails
[18:32:42] mc_fail_: centrx i took it from the exmaple http://guides.rubyonrails.org/association_basics.html
[18:32:59] nettoweb: has joined #RubyOnRails
[18:33:09] djbkd_: has joined #RubyOnRails
[18:33:09] centrx: Well it's not found on that page anywhere
[18:33:10] codergeek: has joined #RubyOnRails
[18:33:12] kadoppe: has joined #RubyOnRails
[18:33:53] disgrntld: has joined #RubyOnRails
[18:33:57] codergeek: has joined #RubyOnRails
[18:34:00] mc_fail_: centrx on this one i pasted?
[18:34:41] matthewd: mc_fail_: Are you seriously arguing that the thing you pasted, is something you've actually run?
[18:35:49] mc_fail_: matthewd it is something i run, i cut some details from the models, but that's it
[18:36:16] mc_fail_: (i just doing it to have a bit practice with ror and active records)
[18:36:24] centrx: mc_fail_, What's under the RUN part, you didn't run that
[18:36:25] matthewd: No, you (at best) mangled the lines entirely
[18:36:30] Xentil: has joined #RubyOnRails
[18:36:37] matthewd: mc_fail_: You're lying, and I'm losing interest
[18:37:06] RegulationD: has joined #RubyOnRails
[18:37:26] pipework: mc_fail_: !gettingstarted
[18:37:26] helpa: mc_fail_: http://guides.rubyonrails.org/getting_started.html - Getting started with Ruby on Rails guide written by Mike Gunderloy and Ryan Bigg
[18:37:30] pipework: You might want to start with that.
[18:37:31] cnk: has joined #RubyOnRails
[18:37:45] rubyonrailed: has joined #RubyOnRails
[18:39:10] Oliphaunte: has joined #RubyOnRails
[18:39:20] mag42c: has joined #RubyOnRails
[18:40:22] renegadeandy: When somebody gets a chance can they please take a look and respond to my stack overflow post here : http://stackoverflow.com/questions/34186523/sunspot-rails-fails-to-reindex-in-production
[18:40:55] aurails: has joined #RubyOnRails
[18:41:27] jsrn_: has joined #RubyOnRails
[18:45:07] jbrhbr: has joined #RubyOnRails
[18:48:35] Maletor: has joined #RubyOnRails
[18:49:09] aurails: Hi ! Is it a good choice to choose RoR for large project ?
[18:49:22] markh: has joined #RubyOnRails
[18:49:47] centrx: aurails, Yes
[18:49:54] centrx: aurails, The best choice!
[18:50:19] LambdaSource: has joined #RubyOnRails
[18:50:26] kitsuneyo: has joined #RubyOnRails
[18:51:11] squaresurf: has joined #RubyOnRails
[18:51:29] elton: has joined #RubyOnRails
[18:51:35] adac: has joined #RubyOnRails
[18:54:11] jscheel: has joined #RubyOnRails
[18:56:03] B1n4r10: has joined #RubyOnRails
[18:56:36] Xentil: has joined #RubyOnRails
[18:57:09] crystalneth: has joined #RubyOnRails
[18:58:32] bronson: has joined #RubyOnRails
[19:00:50] TheNet: has joined #RubyOnRails
[19:01:05] TheNet: is the convention AddUserRefToProducts or AddUserToProducts?
[19:01:25] nertzy: has joined #RubyOnRails
[19:02:51] code: has joined #RubyOnRails
[19:03:37] hobodave: has joined #RubyOnRails
[19:03:38] Papierkorb: TheNet: the column is probably called user_id, so I'd go with AddUserIdToProducts
[19:03:58] nettoweb: has joined #RubyOnRails
[19:04:23] CarlosYoo: has joined #RubyOnRails
[19:05:26] B1n4r10: has joined #RubyOnRails
[19:05:56] jeffleeismyhero: has joined #RubyOnRails
[19:06:34] TheNet: Papierkorb: the docs has it as UserRef, I'm guessing it doesn't matter?
[19:07:07] Papierkorb: TheNet: Probably not. IMO, a human will be able to comprehend what you meant as long it has 'User' in it :)
[19:07:47] jeffleeismyhero: I???m having some trouble using DISTINCT ON with a join with PostgreSQL. https://gist.github.com/jeffleeismyhero/24767036dacd2bcdf17d
[19:08:12] bronson: has joined #RubyOnRails
[19:08:25] jeffleeismyhero: Without the join, everything works great. With the join, I get: PG::SyntaxError: ERROR: syntax error at or near "DISTINCT"
[19:08:45] stannard: has joined #RubyOnRails
[19:12:22] symbol: has joined #RubyOnRails
[19:13:07] shutto: isn't there a distinct() helper in AR?
[19:13:40] Oliphaunte: has joined #RubyOnRails
[19:14:20] shibabu: has joined #RubyOnRails
[19:14:43] centrx: shutto, What do you mean?
[19:14:53] hardtail: has joined #RubyOnRails
[19:14:55] kitsuneyo: has joined #RubyOnRails
[19:15:16] aurails: has joined #RubyOnRails
[19:16:16] shutto: like can't you do Model.select('something').distinct
[19:16:25] shutto: centrx: it was more of a response to jeffleeismyhero
[19:16:55] centrx: yeah, 'distinct' or 'uniq', same thing
[19:17:11] jeffleeismyhero: You cannot use distinct on an hstore column
[19:17:24] Oliphaunte: has joined #RubyOnRails
[19:17:39] jeffleeismyhero: You have to use DISTINCT ON()
[19:18:26] annlewis: has joined #RubyOnRails
[19:18:31] wldcordeiro: has joined #RubyOnRails
[19:20:00] shutto: jeffleeismyhero: ahhh that's probably it
[19:20:12] hobodave: has joined #RubyOnRails
[19:20:39] jeffleeismyhero: It seems as though I can use a custom join to work around it.
[19:20:59] shutto: jeffleeismyhero: if you're getting PG errors, you should probably be able to `to_sql` that query and fix it manually.
[19:21:24] shutto: typically, AR gives you the option of dropping down to SQL at any given point if you need to...
[19:21:30] renegadeandy: has joined #RubyOnRails
[19:23:06] Oliphaunte: has joined #RubyOnRails
[19:23:21] versatiletech: has joined #RubyOnRails
[19:24:07] hardtail: has joined #RubyOnRails
[19:24:30] lacuna: has joined #RubyOnRails
[19:24:32] colleenmcguckin: has joined #RubyOnRails
[19:24:43] lyoshajapan: has joined #RubyOnRails
[19:25:51] thejamespinto: has joined #RubyOnRails
[19:26:12] ur5us: has joined #RubyOnRails
[19:26:24] juddey: has joined #RubyOnRails
[19:27:29] brunto: has joined #RubyOnRails
[19:29:01] |PiP|: has joined #RubyOnRails
[19:29:50] Sephyros: has joined #RubyOnRails
[19:30:35] codergeek: has joined #RubyOnRails
[19:30:36] Sephyros: hello, i have a method on presented that get position of record inside a query, but the code doesnt run all time... how can i force this?
[19:30:41] jscheel: has joined #RubyOnRails
[19:31:07] rubyonrailed: I'm using factory girl v 2.2 and ruby 1.9.3. I'm trying to setup factory girl traits. Does anyone know why i'm getting this error? https://gist.github.com/JasonMannon/74245cbab5f7e07da294
[19:31:14] RegulationD: has joined #RubyOnRails
[19:32:17] Sephyros: ooohhh nvm!
[19:33:09] colleenmcguckin: has joined #RubyOnRails
[19:33:19] lacuna: has joined #RubyOnRails
[19:33:19] lacuna: has joined #RubyOnRails
[19:33:25] jmrepetti: has joined #RubyOnRails
[19:34:20] Bloomer: has joined #RubyOnRails
[19:34:20] daivyk: has joined #RubyOnRails
[19:38:20] lacuna: has joined #RubyOnRails
[19:38:20] lacuna: has joined #RubyOnRails
[19:38:27] jtb__: has joined #RubyOnRails
[19:38:39] arBmind: has joined #RubyOnRails
[19:39:24] differentreality: has joined #RubyOnRails
[19:40:07] Cervajz: has joined #RubyOnRails
[19:40:12] Xentil: has joined #RubyOnRails
[19:40:40] colleenmcguckin: has joined #RubyOnRails
[19:41:45] Scriptonaut: does anyone know how I can specify the table in a where clause when I join/includes several tables with the same column?
[19:42:14] jmrepetti: has joined #RubyOnRails
[19:42:31] Scriptonaut: I want to: MyRelationWithIncludes.where('people.status' => 'blh'), something like taht
[19:42:33] Cohedrin: has joined #RubyOnRails
[19:43:22] shanemcd: has joined #RubyOnRails
[19:44:02] nya: has joined #RubyOnRails
[19:44:11] MrSnugglepants: maybe like Model.where(people: { status: 'blah' }).or(bar: { status: 'blah' })?
[19:45:14] lacuna: has joined #RubyOnRails
[19:45:20] Radar: GOOD MORNING
[19:45:29] colleenmcguckin: has joined #RubyOnRails
[19:45:35] Radar: Scriptonaut: what have you tried so faR?
[19:45:57] arthurix: has joined #RubyOnRails
[19:47:20] sonofdirt: has joined #RubyOnRails
[19:47:52] Scriptonaut: ah, I tried the above and it worked
[19:47:59] Scriptonaut: MrSnugglepants: I like that way
[19:48:29] hardtail: has joined #RubyOnRails
[19:49:18] Maletor: has joined #RubyOnRails
[19:49:57] slash_mode: Gooood morning
[19:50:28] Cervajz: has joined #RubyOnRails
[19:50:48] kies: has joined #RubyOnRails
[19:51:08] Cervajz_: has joined #RubyOnRails
[19:51:29] DoubleMalt: has joined #RubyOnRails
[19:52:11] sonofdirt: has joined #RubyOnRails
[19:52:27] elton: has joined #RubyOnRails
[19:55:37] ap4y: has joined #RubyOnRails
[19:56:26] nettoweb: has joined #RubyOnRails
[19:58:26] FCser: has joined #RubyOnRails
[20:00:24] akshat: has joined #RubyOnRails
[20:00:34] cac: has joined #RubyOnRails
[20:01:08] paulodiniz: has joined #RubyOnRails
[20:01:56] goodcodeguy: has joined #RubyOnRails
[20:05:07] CarlosYoo: has joined #RubyOnRails
[20:05:18] Zamerick: has joined #RubyOnRails
[20:05:27] slash_mode: rhizome: enjoy your creeping rootstalks
[20:06:21] rhizome: that's a heck of a way to talk about my feet
[20:07:03] ibouvousaime: has joined #RubyOnRails
[20:07:38] lemur: has joined #RubyOnRails
[20:08:38] hardtail: has joined #RubyOnRails
[20:08:59] slash_mode: rhizome: nice stems, rootshoot
[20:09:05] crankharder: has joined #RubyOnRails
[20:10:18] emilkarl: has joined #RubyOnRails
[20:10:29] agit0: has joined #RubyOnRails
[20:12:16] FCser: has joined #RubyOnRails
[20:12:20] adac: has joined #RubyOnRails
[20:14:31] ewnd9: has joined #RubyOnRails
[20:14:36] jkamenik: has joined #RubyOnRails
[20:15:46] bmalum: has joined #RubyOnRails
[20:15:48] diegoviola: has joined #RubyOnRails
[20:15:55] Cervajz: has joined #RubyOnRails
[20:16:29] diegoviola: I hate this helper, it's ugly but it works: https://gist.github.com/9c972e101016f169f209
[20:16:50] diegoviola: I wonder how to improve it
[20:17:25] paulodiniz: has joined #RubyOnRails
[20:17:33] DoubleMalt: has joined #RubyOnRails
[20:18:00] rhizome: diegoviola: watch this:
[20:18:03] rhizome: https://www.youtube.com/watch?v=8bZh5LMaSmE
[20:18:37] Scriptonaut: does anyone know if there is a symbol equivalent of: .order("source_categories.name DESC")?
[20:18:50] cac: has joined #RubyOnRails
[20:18:51] Scriptonaut: My api works with symbols, but there is this one special case where I can only seem to make it work with strings
[20:19:04] bronson: has joined #RubyOnRails
[20:19:05] Scriptonaut: wondering if I could do any casting or something to get it to work like a symbol
[20:19:13] annlewis: has joined #RubyOnRails
[20:19:18] arooni: has joined #RubyOnRails
[20:20:04] rhizome: http://hashrocket.com/blog/posts/rails-quick-tips-activerecord-ordering
[20:20:05] SteenJobs: has joined #RubyOnRails
[20:20:18] slash_mode: Scriptonaut: wha? like "source_categories.name" => :desc???
[20:20:27] jmarchello: has joined #RubyOnRails
[20:20:38] Scriptonaut: Yes slash_mode
[20:20:40] Scriptonaut: that doesn't work though
[20:20:44] diegoviola: rhizome: watching
[20:20:50] Scriptonaut: rhizome: I read that yesterday, it doesn't cover what I need
[20:21:03] Scriptonaut: I have joins and I need to prepend the table name to the column name with .
[20:21:06] slash_mode: Scriptonaut: show me "doesn't work"?
[20:21:56] Scriptonaut: slash_mode: here's me in a binding pry: https://gist.github.com/robins35/9bf7778fc45544d59dc9
[20:22:08] zanzarel: has joined #RubyOnRails
[20:22:11] Scriptonaut: see how I show you what order_by is equal to? And then I pass it to order
[20:22:24] DoubleMalt: has joined #RubyOnRails
[20:22:40] slash_mode: well it's working...
[20:22:44] lyoshajapan: has joined #RubyOnRails
[20:23:07] Scriptonaut: well, when I pass it "source_categories.name DESC" rather than the hash, it doesn't throw any errors
[20:23:08] slash_mode: Scriptonaut: how would you describe the relationship of source_categories to people?
[20:23:08] rawrwx: has joined #RubyOnRails
[20:23:10] Scriptonaut: and it returns the collection
[20:23:18] slash_mode: Scriptonaut: therein lies the difference :)
[20:23:21] Scriptonaut: people belong_to source_categories
[20:23:32] slash_mode: "source_categories" != "source_category"
[20:23:54] slash_mode: ACTION highfives Scriptonaut 
[20:25:16] DoubleMalt: has joined #RubyOnRails
[20:26:34] paulodiniz: has joined #RubyOnRails
[20:26:59] codergeek: has joined #RubyOnRails
[20:27:41] Scriptonaut: gah I celebrated too early slash_mode
[20:27:52] Scriptonaut: it still gives me an error when I do the symbol version
[20:28:24] DoubleMalt: has joined #RubyOnRails
[20:28:37] Coldblackice: has joined #RubyOnRails
[20:28:51] sandstrom: has joined #RubyOnRails
[20:28:55] SteenJobs: has joined #RubyOnRails
[20:28:57] slash_mode: you may gist
[20:28:58] Scriptonaut: slash_mode: https://gist.github.com/robins35/9bf7778fc45544d59dc9
[20:29:06] Scriptonaut: thank you for permission
[20:29:33] slash_mode: Scriptonaut: :) no problem! lol... can you add your schema for the relevant tables?
[20:29:51] FCser: has joined #RubyOnRails
[20:29:56] diegoviola: rhizome: I've wrote it this way basically because my client threw me some pseudo code that just ended up working in Ruby, but I'm trying to refactor that now
[20:30:09] bronson: has joined #RubyOnRails
[20:30:57] Scriptonaut: slash_mode: https://gist.github.com/robins35/9bf7778fc45544d59dc9
[20:31:05] Scriptonaut: I put people and source_categories schema info in there too
[20:31:07] nickenchuggets: has joined #RubyOnRails
[20:31:08] nickenchuggets: has joined #RubyOnRails
[20:31:55] rhizome: diegoviola: that's what that video is all about
[20:32:30] diegoviola: rhizome: yeah I'm watching it, thanks
[20:32:49] hobodave: has joined #RubyOnRails
[20:33:57] shanemcd: has joined #RubyOnRails
[20:34:13] Jasaka: has joined #RubyOnRails
[20:36:05] wsewolod: has joined #RubyOnRails
[20:37:35] aurails: has joined #RubyOnRails
[20:38:37] rawrwx: has joined #RubyOnRails
[20:38:39] bmalum: has joined #RubyOnRails
[20:38:48] edwinvdgraaf: has joined #RubyOnRails
[20:39:12] Sigma00: sorry, wrong channel
[20:39:25] Scriptonaut: if you look at the second main comment to this article, you can see that the guy from hashrocket says he hasn't yet figured out a way to order associations with a hash: http://hashrocket.com/blog/posts/rails-quick-tips-activerecord-ordering#comment-1879401599
[20:40:12] Scriptonaut: looks like I'll have to do something janky
[20:43:32] paulodiniz: has joined #RubyOnRails
[20:43:56] Radar: Scriptonaut: uh, it's just source_categories.name, not people.source_categories.name.
[20:44:17] Radar: And it should be a string, not a symbol
[20:44:29] Radar: leads.object.order("source_categories.name ASC")
[20:44:35] IFrank00: has joined #RubyOnRails
[20:44:42] Scriptonaut: I can make it work with a string, my problem is my entire API is setup to pass this part of the code symbols
[20:44:53] Scriptonaut: so I'd have to make a special case for this one column
[20:44:54] Pazician: has joined #RubyOnRails
[20:45:37] Scriptonaut: that hashrocket article seemed to imply that passing order hases is superior
[20:48:28] dopie: Radar, are you a vim user?
[20:48:39] Radar: dopie: I use Sublime with Vintage (vim) mode enabled.
[20:49:17] rawrwx: has joined #RubyOnRails
[20:49:29] Scriptonaut: I tried Vintage, and it wasn't the same as vim. A few things annoyed me like holding down a direction key (h,j,k,l) would only go one line until it stopped
[20:49:33] Scriptonaut: you had to repeatedly hit it
[20:50:02] jmarchello: has joined #RubyOnRails
[20:50:11] Maletor: has joined #RubyOnRails
[20:50:44] christiandsg: has joined #RubyOnRails
[20:51:30] annlewis: has joined #RubyOnRails
[20:52:06] Scriptonaut: Ya I want to marry vim I love it so much
[20:52:54] netzfisch: has joined #RubyOnRails
[20:53:36] ziggy: has joined #RubyOnRails
[20:53:42] ziggy: dumb question. I'm trying to clean up a deployment image (it's quite large). is there any reason that I can't remove APP_ROOT/vendor/bundle/ruby/2.2.0/cache/*.gem after I bundle install?
[20:54:34] eddiegrey: has joined #RubyOnRails
[20:54:58] Papierkorb: Ziggy: doesn't "$ bundle clean" remove those?
[20:56:20] uris: has joined #RubyOnRails
[20:56:44] ziggy: I'm `bundle install --deployment --clean --no-cache` which I thought would do the same thing as bundle clean
[20:56:48] ziggy: I'll check
[20:58:04] chihaja: has joined #RubyOnRails
[20:58:16] jmarchello: has left #RubyOnRails: ()
[20:58:47] srinidhi: has joined #RubyOnRails
[20:59:07] IFrank00: Quick question https://gist.github.com/Frank004/a8f4aeb0d15606059684
[20:59:23] iateadonut: has joined #RubyOnRails
[20:59:33] ewnd9: has joined #RubyOnRails
[21:00:23] IFrank00: I have a Users and Tasks How can I do a block for each user an then for each user view the tasks where the start_date of the task is in a range of dates
[21:00:24] _Tariq: has joined #RubyOnRails
[21:00:29] rawrwx: has joined #RubyOnRails
[21:00:53] ziggy: commented
[21:01:14] Sceko: has joined #RubyOnRails
[21:01:15] Sceko: has joined #RubyOnRails
[21:02:57] Scriptonaut: IFrank00: Users.all.each {|u| u.tasks.where(start_date > first_date..end_date) }
[21:03:11] Scriptonaut: IFrank00: Users.all.each {|u| u.tasks.where(start_date: first_date..end_date) }
[21:03:13] theblang: has joined #RubyOnRails
[21:03:16] Scriptonaut: that's correct I think
[21:03:37] ziggy: generally first_date and end_date are an expression; I find it easier to read when you surround them in ()
[21:03:41] ziggy: that was my answer
[21:03:44] johnnegron: Ziggy???s comment on the gist looks like the correct answer
[21:03:52] claytonzaugg: has joined #RubyOnRails
[21:04:15] ziggy: 1.week.ago..Time.current still works I think
[21:04:17] Scriptonaut: Oh, I didn't see that
[21:04:32] tvw: has joined #RubyOnRails
[21:05:14] aurails: has joined #RubyOnRails
[21:06:24] IFrank00: Scriptonaut, thankyou!
[21:06:48] CarlosYoo: has joined #RubyOnRails
[21:06:56] Scriptonaut: Ziggy beat me to it
[21:07:32] lemur: has joined #RubyOnRails
[21:08:50] speaking1ode: has joined #RubyOnRails
[21:09:15] Frem: has joined #RubyOnRails
[21:11:16] speaking1ode: has left #RubyOnRails: ()
[21:11:43] speakingcode: has joined #RubyOnRails
[21:11:49] speakingcode: i have a file in app/assets/images/... i want to read this file from a controller. how can i access it?
[21:14:07] MrSnugglepants: speakingcode: define "read this file"
[21:14:15] IFrank00: Ziggy, thankS!
[21:14:40] speakingcode: ok, i am not asking how to open and read the file, but rather how to get it's path within the controller
[21:15:31] sandstrom: has joined #RubyOnRails
[21:15:47] speakingcode: i've tried ActionController::Base.helpers.asset_path('astley.mp4')
[21:16:05] rawrwx: has joined #RubyOnRails
[21:16:14] speakingcode: and that results in ActionController::MissingFile (Cannot read file /assets/astley-d3c4ce2a48a808661133022b1cb84fa9c57efd7d20f297a9442490ca82177077.mp4)
[21:16:40] TheSuper: has joined #RubyOnRails
[21:17:48] TheSuper: Quick question: is there a standard rails way to sanitize user-supplied URLs, or is just using link_to fine?
[21:18:20] Papierkorb: speakingcode: assets are to be sent to the client, not read by your controller. I'd put it somewhere else. maybe into ROOT/private/videos
[21:18:22] melonstorm_: has joined #RubyOnRails
[21:19:02] speakingcode: it will go to the client, but it needs auth protection, hence reading from controller
[21:19:17] speakingcode: either way, is there a trick to get a realtive path within the controller or do i have to put an absolute path?
[21:19:29] Papierkorb: speakingcode: http://apidock.com/rails/ActionController/Streaming/send_file
[21:19:58] speakingcode: thats what i'm using
[21:20:22] speakingcode: but, obviously, i odn't know what the path to the file is
[21:20:42] amortimer: has joined #RubyOnRails
[21:20:46] Papierkorb: speakingcode: also, obviously the -hashcrap is not present in the real file name. Just do Rails.root.join('app/assets/images', the_file)
[21:20:59] Papierkorb: speakingcode: and .. I'm not sure if images/ is a good choice for a video
[21:21:40] versatiletech: has joined #RubyOnRails
[21:21:46] speakingcode: Papierkorb: yeah, naming convention aside i'm just trying to figure out how to relatively access the path, i can make meaningful path names afterwards
[21:22:09] boxofrox: if it's going to the client, won't the client need a path from the doc root, not filesystem root?
[21:22:30] Papierkorb: boxofrox: send_file just sends the file. the client doesn't have anything to do with it.
[21:22:35] speakingcode: i don'treally care about that _yet_ boxofrox
[21:22:48] htmldrum: has joined #RubyOnRails
[21:22:55] Papierkorb: boxofrox: see it like this: your controller action looks like a file to the client, but in reality, it's not a file, but code that gets run
[21:22:59] speakingcode: my goal right now is to simply have a static asset that is protected
[21:23:09] SalexW: has joined #RubyOnRails
[21:23:30] boxofrox: Papierkorb: gotcha
[21:24:03] ziggy: speakingcode: send_file is your answer, but the file should be in public
[21:24:08] ziggy: since that's your docroot
[21:24:46] speakingcode: then wouldn't the file be publicly accessible?
[21:24:53] ziggy: block it with the web server
[21:25:24] ziggy: make public/protected always a 403
[21:25:32] Denarii: has joined #RubyOnRails
[21:25:37] ziggy: if this is nginx, then you can do something a bit cleverer
[21:26:36] speakingcode: lol i don't want public to be blocked
[21:26:43] ziggy: add a location to your config file called /protected which is an alias, then use X-Accel-Redirect: /protected/whatever - it'll go to ALIAS/whatever
[21:26:52] ziggy: you block public/protected
[21:26:57] ziggy: https://www.nginx.com/resources/wiki/start/topics/examples/x-accel/
[21:27:13] speakingcode: subdirectory, not either or. overload / operator :)
[21:27:24] speakingcode: overloaded* in english language
[21:27:48] speakingcode: thanks Ziggy , Papierkorb
[21:27:58] ziggy: APP_ROOT/public = open, APP_ROOT/public/private = 403 for all requests
[21:28:02] SteenJobs: has joined #RubyOnRails
[21:28:07] speakingcode: i at least got it working, and it appears to be streaming the video as intended
[21:28:15] IrishGringo: has joined #RubyOnRails
[21:28:32] ziggy: add a location which makes private/XXX work with an internal redirect
[21:28:41] ziggy: honestly, you're best off just using S3 signed URLs
[21:28:53] ziggy: (or Azure signed URLs if you're in to that)
[21:30:05] rubyonrailed: has joined #RubyOnRails
[21:30:09] anime4christ: has joined #RubyOnRails
[21:30:15] speakingcode: this is just for a proof of concept/demo app, keeping as few moving parts as possible :-)
[21:30:17] MrSnugglepants: yeah that's what i use. STS is pretty neat
[21:30:43] speakingcode: also need to have it done in like a few hours, as part of the sell for rails
[21:30:55] ziggy: still, using S3 signed URLs is simple
[21:31:05] Papierkorb: and costs extra money
[21:31:25] jkamenik: has joined #RubyOnRails
[21:31:36] rawrwx: has joined #RubyOnRails
[21:31:49] ziggy: if you're running on AWS anyways, storing the files on EBS is an order of magnitude more expensive
[21:31:50] speakingcode: if it requires any more steps than what i've done and got working already then it's out of the question for today... so it's out of the question for today :-p
[21:31:53] Papierkorb: I still don't get the "solve this simple problem yourself, or solve it by adding another gem to your app, with its complexity, and pay someone to do the same for a small scale application [which a demo is]" sentiment
[21:32:06] MrSnugglepants: speakingcode: lol well...that would be literally anything we suggest to you
[21:32:30] MrSnugglepants: Papierkorb: there are a lot of stupid developers out there :)
[21:32:33] ziggy: Papierkorb: some of us run our small scale PoC on AWS from day 1 because we do not have servers
[21:32:43] speakingcode: MrSnugglepants: you read between the lines well ;)
[21:32:43] Papierkorb: Ziggy: Some of us do have servers.
[21:33:18] ziggy: awesome, then going 0 to webapp involves SSH and stuff for you
[21:33:26] MrSnugglepants: i don't see how that's relevant Ziggy
[21:33:33] Papierkorb: Ziggy: cluster.rb publish && cluster.rb update
[21:33:38] Papierkorb: Ziggy: I agree, really hard
[21:33:49] speakingcode: this is small scale as in 'we have a meeting tomorrow morning, can you have a demo ready showing that you can make a working app that streams password protected video?"
[21:33:51] MrSnugglepants: i mean, it involves SSH regardless
[21:34:09] MrSnugglepants: at *some* point, someone is using SSH.
[21:34:16] Papierkorb: Ziggy: this is completely pointless btw. Some people have other priorities than you do.
[21:34:17] ziggy: I guess that's technically true
[21:34:32] ziggy: I just don't have a cluster with which to run my shiny new app on
[21:34:42] ziggy: I use Packer to build a new image, deploy that image
[21:34:49] speakingcode: i have a laptop to run it on and that shall suffice
[21:34:55] rhizome: aren't there pornsite gems? seems like there would be by now
[21:35:02] ziggy: alternatively I use Packer to build a new docker image, deploy that image
[21:35:07] sandstrom: has joined #RubyOnRails
[21:35:18] speakingcode: all i need is 'see, no authentication -> no video. authenticaton -> video" done
[21:35:38] speakingcode: i don't mean polish pretty demo to stakeholders
[21:35:39] rhizome: are those tests written yet
[21:35:55] aurails: has left #RubyOnRails: ()
[21:35:56] speakingcode: all good suggestions if this project goes to life
[21:35:58] nickjj: sign urls are really the only reasonable option imo
[21:36:47] sonofdirt: has joined #RubyOnRails
[21:36:51] ziggy: right - maybe not if your laptop is the server and you're displaying it on a projector... but then in that case it doesn't actually have to "work" and you could have faked it with plain HTML and nginx magic ;)
[21:37:27] speakingcode: theres some political reasoning to not do that
[21:38:04] ziggy: since I'm already loading my boilerplate aws-sdk and friends, it's a piece of cake to sign a URL and redirect_to it
[21:38:46] nickjj: does it need to be streamed? because it would take like 10min to just use x-accel-redirect to serve protected files
[21:38:53] ziggy: but my requirements are different - a demo would have to work for 0.0.0.0/0, and since we don't have an office server, aws
[21:39:14] ziggy: nickjj: that's what speakingcode is doing
[21:39:23] nickjj: oh, i didn't scroll up
[21:40:00] ziggy: nickjj: it works, but presumably the file is user-provided and not part of the app (once in production)
[21:40:10] nickjj: just noticed the channel flash on 'deploy' and saw streaming private videos
[21:40:21] sonofdirt: has joined #RubyOnRails
[21:40:38] jbrhbr: has joined #RubyOnRails
[21:42:09] nickjj: i once tied in downloadable content to some info about a user along with a timeout, but that's basically signed urls in the end
[21:43:28] codergeek: has joined #RubyOnRails
[21:43:32] paulodiniz: has joined #RubyOnRails
[21:44:11] ziggy: I'm about to try this, someone tell me if it's going to break things if they can: for gem in $(find ./vendor/bundle/ruby -iname '*.gem'); do rm -fv $gem; done
[21:44:15] ziggy: this is after bundle install
[21:44:36] lyoshajapan: has joined #RubyOnRails
[21:45:07] MrSnugglepants: cant you just rm -r vendor/bundle/cache?
[21:45:11] MrSnugglepants: that's where all the .gem files are IIRC
[21:45:12] trautwein: has joined #RubyOnRails
[21:46:10] ziggy: MrSnugglepants: negative, they're in vendor/bundle/ruby/*/cache
[21:46:29] srinidhi1: has joined #RubyOnRails
[21:47:09] rawrwx: has joined #RubyOnRails
[21:47:22] zacts: has joined #RubyOnRails
[21:47:29] cac: has joined #RubyOnRails
[21:47:57] nickjj: Ziggy, if you're paranoid just run rm -ifv
[21:48:25] nickjj: -i will prompt you for each file
[21:49:01] ziggy: nickjj: this is in a chef recipe, noninteractive
[21:50:49] Maletor: has joined #RubyOnRails
[21:51:04] maesitos: has joined #RubyOnRails
[21:51:13] creyes_: has joined #RubyOnRails
[21:53:45] elton: has joined #RubyOnRails
[21:54:43] yfeldblum: has joined #RubyOnRails
[21:55:34] annlewis: has joined #RubyOnRails
[21:58:32] braincrash: has joined #RubyOnRails
[21:59:37] MrSnugglepants: Ziggy: don't edit your vendor/bundle with Chef...
[21:59:40] MrSnugglepants: why are you even doing that?
[22:00:26] chihaja_: has joined #RubyOnRails
[22:01:05] ewnd9: has joined #RubyOnRails
[22:01:35] Cervajz: has joined #RubyOnRails
[22:02:03] Cervajz_: has joined #RubyOnRails
[22:02:39] rawrwx: has joined #RubyOnRails
[22:03:34] sonofdirt: has joined #RubyOnRails
[22:03:41] djbkd: has joined #RubyOnRails
[22:03:43] _Tariq: has joined #RubyOnRails
[22:05:40] creyes_: I have a group of forms that I'm going to bundle into a "Packet" - I'd like to schedule the availability of that packet. Like, 1 packet a week must be completed, it's "completed" when all 4 forms are finished. IS there a better option than using 1.week.ago?
[22:05:53] creyes_: Like a solid gem that provides that sort of scheduling ability
[22:05:53] stannard: has joined #RubyOnRails
[22:06:03] slash_mode: creyes_: ice cube
[22:06:27] slash_mode: https://github.com/seejohnrun/ice_cube
[22:06:40] creyes_: BAM exactly what I was looking for thanks slash_mode
[22:06:50] slash_mode: creyes_: enjoy!
[22:07:48] mdel: has joined #RubyOnRails
[22:09:01] tenderlove: has joined #RubyOnRails
[22:09:10] CarlosYoo: has joined #RubyOnRails
[22:10:25] sonofdirt: has joined #RubyOnRails
[22:10:42] rakm: has joined #RubyOnRails
[22:12:00] idakyne: has joined #RubyOnRails
[22:12:21] rawrwx: has joined #RubyOnRails
[22:12:53] recurrence: has joined #RubyOnRails
[22:13:26] recurrence: Is there a table that defines what events are called by various AR actions. eg: If I call update! on a new???d model, will after_create be called? It???d be great to see what triggers when.
[22:15:29] sevenseacat: has joined #RubyOnRails
[22:18:57] B1n4r10: has joined #RubyOnRails
[22:21:08] puria: has joined #RubyOnRails
[22:21:21] Cervajz: has joined #RubyOnRails
[22:25:58] momomomomo: has joined #RubyOnRails
[22:28:04] ap4y: has joined #RubyOnRails
[22:29:03] MrSnugglepants: recurrence: take a wild guess
[22:29:06] sandstrom: has joined #RubyOnRails
[22:29:23] MrSnugglepants: like...if you call update() on a model, can you guess whether an after_**create** callback is being run?
[22:29:26] rdavila: has joined #RubyOnRails
[22:29:34] jscheel: has joined #RubyOnRails
[22:30:06] recurrence: Hi MrSnugglepants : I prefer not to build technology based on wild guesses :) I am reading through the active record source at the moment but a table would be convenient :)
[22:30:31] nyaa: has joined #RubyOnRails
[22:30:37] recurrence: it does turn out that after_create triggers in that case though
[22:30:42] recurrence: your comment seems to imply it would not :)
[22:31:30] MrSnugglepants: recurrence: you must be doing something wrong, or there's something you're not telling me. when you have a previously saved model, and you run update() on it, after_create callbacks should not be triggered.
[22:31:45] MrSnugglepants: recurrence: if you *don't* have a previously saved model, and you try to call update(), it might actually try to create() it instead.
[22:31:56] zanzarel: has left #RubyOnRails: ()
[22:32:22] MrSnugglepants: recurrence: i typically refer to this ordered list, because it also shows you *when* each callback is called... http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html
[22:33:06] recurrence: MrSnugglepants: I???m just going to quote what I wrote ???If I call update! on a new???d model, will after_create be called????. I think this discussion pretty clearly justifies my request :)
[22:33:22] djbkd: has joined #RubyOnRails
[22:34:14] MrSnugglepants: recurrence: you don't have to quote it, this is IRC and I can see it :P
[22:34:42] recurrence: I???m making a table based on the source, I???ll send out a PR to Rails when it???s done. I think they might include it ;)
[22:35:37] MrSnugglepants: recurrence: you might also find http://guides.rubyonrails.org/active_record_callbacks.html to be helpful
[22:36:27] recurrence: Thanks, I had read through that and it did help some but there???s still ambiguity with a number of events. AR has grown a lot and has tons of functionality now :)
[22:36:34] creyes_: slash_away: have you used ice_cube before? I get how to make a schedule and rules but am sort of confused about how to apply those rules. Like to a form
[22:37:23] codergeek: has joined #RubyOnRails
[22:38:52] _Tariq: has joined #RubyOnRails
[22:39:26] Cervajz_: has joined #RubyOnRails
[22:39:49] newmanships: has joined #RubyOnRails
[22:39:59] aurails: has joined #RubyOnRails
[22:40:25] maloik: has joined #RubyOnRails
[22:41:26] bratsche_: has joined #RubyOnRails
[22:42:37] lyoshajapan: has joined #RubyOnRails
[22:45:27] pyemkey: has joined #RubyOnRails
[22:45:49] lemur: has joined #RubyOnRails
[22:46:01] tfitts: has joined #RubyOnRails
[22:47:19] tfitts: I have a model called Item that has_one Bin. I know I can do Bin.item = nil to remove the association. Is there a way using forms to remove the item_id from a Bin without destroying the bin?
[22:48:11] morsik: has joined #RubyOnRails
[22:48:28] sevenseacat: if they had a select box to select an item, they could select the empty option (no item)
[22:48:43] sevenseacat: or the other way around
[22:48:47] urkle: has joined #RubyOnRails
[22:49:23] teclator: has joined #RubyOnRails
[22:49:29] morsik: Hello there. I'm running GitLab through uWSGI, but I just discovered funny thing. When i specify "Host" header in http request i'm getting reply from Rails. But when I don't (for eg: curl http://127.0.0.1:8001 for internal purposes) - I'm getting "Not Found: /" from rails app (it's from rails for sure cause I see X-Cascade header in reply)
[22:49:49] morsik: My question is: is this somehow configurable in Rails? Or it's rather GitLab "feature"?
[22:51:40] Maletor: has joined #RubyOnRails
[22:53:17] ruid: has joined #RubyOnRails
[22:53:18] ruid: has joined #RubyOnRails
[22:54:43] elton: has joined #RubyOnRails
[22:54:47] brunto: has joined #RubyOnRails
[22:55:18] njero: has joined #RubyOnRails
[22:56:07] _Tariq: has joined #RubyOnRails
[22:56:49] rickmasta: has joined #RubyOnRails
[23:02:25] wsewolod: has joined #RubyOnRails
[23:03:39] recurrence: has joined #RubyOnRails
[23:05:27] rromanch_: has joined #RubyOnRails
[23:05:30] annlewis: has joined #RubyOnRails
[23:05:32] rromanch_: has joined #RubyOnRails
[23:05:34] hahuang65: has joined #RubyOnRails
[23:06:22] DukeDave: has joined #RubyOnRails
[23:07:34] versatiletech: has joined #RubyOnRails
[23:12:13] puria: has joined #RubyOnRails
[23:17:20] hoodow: has joined #RubyOnRails
[23:17:22] hoodow: has joined #RubyOnRails
[23:21:51] nickenchuggets: has joined #RubyOnRails
[23:21:51] nickenchuggets: has joined #RubyOnRails
[23:21:55] Seich: has joined #RubyOnRails
[23:22:36] recurrence: Hi morsik You may want to ask in #gitlab :)
[23:22:36] CarlosYoo: has joined #RubyOnRails
[23:29:05] noober3: has joined #RubyOnRails
[23:29:24] jhill: has joined #RubyOnRails
[23:29:26] exadeci: has joined #RubyOnRails
[23:30:20] morsik: recurrence: asked already, but maybe it's something Rails specific so I asked here too ;)
[23:30:32] recurrence: oh haha, sorry
[23:30:33] morsik: I don't know rails too much, and routing engine is from Rails
[23:31:08] quazimodo: has joined #RubyOnRails
[23:34:27] jhass: !crosspost
[23:34:27] helpa: Please do not crosspost without at least telling so. Experience shows that people don't bother to inform the other channels of provided solutions, therefore it is considered rude.
[23:34:42] nertzy: has joined #RubyOnRails
[23:34:45] jhass: ACTION kicks helpa
[23:39:03] aurails: has left #RubyOnRails: ()
[23:44:44] rawrwx: has joined #RubyOnRails
[23:46:54] jkamenik: has joined #RubyOnRails
[23:48:02] pyemkey: has joined #RubyOnRails
[23:48:07] jgt3: has joined #RubyOnRails
[23:52:01] Hosh: has joined #RubyOnRails
[23:53:59] ebryn: has joined #RubyOnRails
[23:54:00] upgrayeddd: has joined #RubyOnRails
[23:58:48] jgt4: has joined #RubyOnRails