« Back to channel list

#RubyOnRails - 01 October 2015

« Back 1 day Forward 1 day »
[00:00:11] davidhq: has joined #RubyOnRails
[00:01:10] roxtrongo: has joined #RubyOnRails
[00:02:33] tenderlove: has joined #RubyOnRails
[00:03:41] mary5030: has joined #RubyOnRails
[00:04:06] mxrguspxrt: has joined #RubyOnRails
[00:04:07] SteenJobs: has joined #RubyOnRails
[00:05:20] roxtrongo: has joined #RubyOnRails
[00:05:39] Radar: GOOD MORNING
[00:05:47] Radar: I have _amazing_ jetlag right now
[00:06:26] FailBit: tell me about it
[00:06:34] FailBit: I've been moving my sleep schedule back
[00:06:44] FailBit: go to bed at 7, wake up at 3 etc
[00:07:42] Jon30: has joined #RubyOnRails
[00:07:52] ericjphillips: has joined #RubyOnRails
[00:08:17] s2013: has joined #RubyOnRails
[00:10:55] baweaver: has joined #RubyOnRails
[00:11:04] Maletor: has joined #RubyOnRails
[00:11:26] das3in: has joined #RubyOnRails
[00:11:46] iateadonut: has joined #RubyOnRails
[00:11:51] Aeyrix: Welcome home Radar. :>
[00:11:55] Radar: thank you
[00:12:02] das3in: this is a dumb question, but why whenever I loop through an object does the array of objects get printed on the website (dev)
[00:12:16] idd2d: has joined #RubyOnRails
[00:13:04] Radar: das3in: !ncnh
[00:13:04] helpa: das3in: If you don't provide any code, it becomes really difficult for us to help you. Providing code to reproduce the problem increases your chances of getting great, accurate help immensely.
[00:13:09] tenderlove: has joined #RubyOnRails
[00:13:34] EminenceHC: has joined #RubyOnRails
[00:14:09] apalmblad: has joined #RubyOnRails
[00:14:11] Aeyrix: Law and order is back in the channel.
[00:15:23] bronson: has joined #RubyOnRails
[00:15:50] das3in: But it's not really a code problem lol. http://imgur.com/pa4Jp4r
[00:16:08] Aeyrix: He says, showing off a code problem.
[00:16:16] Aeyrix: [ gender assumptions intensify ]
[00:19:29] rhizome: smathy: set DatabaseCleaner to transactions?
[00:20:10] baweaver: has joined #RubyOnRails
[00:21:44] greengriminal: has joined #RubyOnRails
[00:25:13] apalmblad: has joined #RubyOnRails
[00:28:36] tenderlove: has joined #RubyOnRails
[00:29:53] rhizome: i have to be doing this wrong, thinking that data will persist at all in a controller test
[00:30:36] bruno-: has joined #RubyOnRails
[00:33:45] Lytol: has joined #RubyOnRails
[00:35:30] bronson: has joined #RubyOnRails
[00:37:18] dikaio: has joined #RubyOnRails
[00:38:21] Radar: das3in: It's a problem that is caused by coe.
[00:38:33] Radar: das3in: And if you want help with a code problem, you should give us the code.
[00:38:46] Radar: das3in: Likely that you're doing <%= when you mean to be doing <%
[00:40:48] roxtrongo: has joined #RubyOnRails
[00:40:53] tenderlove: has joined #RubyOnRails
[00:41:17] das3in: Here's the show page and I already linked a picture of what was showing up on screen. https://gist.github.com/das3in/c1b238386f06a5671aee
[00:41:27] dopie: has joined #RubyOnRails
[00:41:29] das3in: it's probably just a debug setting somewhere i'm just not sure where to look
[00:41:58] Aeyrix: <%= @poll.questions.each do |question| %>
[00:42:03] Aeyrix: <% @poll.questions.each do |question| %>
[00:42:16] Aeyrix: <%= is "output to page"
[00:42:31] das3in: Thanks, checked on that right when Radar said it, thanks everyone
[00:42:41] das3in: I just assumed it was a setting, my fault
[00:47:30] thejamespinto: each returns a the list of objects you've iterated thru for chaining purposes
[00:48:06] thejamespinto: <%= form_for ... do %> returns an actual <form> tag, that's the difference, you see?
[00:48:38] allcentury: has joined #RubyOnRails
[00:50:56] mary5030: has joined #RubyOnRails
[00:50:59] bmurt: has joined #RubyOnRails
[00:51:01] Maletor: has joined #RubyOnRails
[00:53:14] ellisTAA: i want to create a field, but i want to only allow users to submit a score of 1 - 5, how do i prevent any submission other than taht range, i???m worried someone will just open up source code and change value - bypassing dropdown button
[00:54:04] ellisTAA: some sort of validations?
[00:54:26] Scient: I have about 16 boolean columns on one of my tables, any great suggestions how to somehow squash them... thought about doing a JSON column, but handling defaults would be a little icky there I guess
[00:54:33] madebymarkca: has joined #RubyOnRails
[00:55:44] rickmasta: has joined #RubyOnRails
[00:56:28] nya: has joined #RubyOnRails
[00:56:51] tenderlove: has joined #RubyOnRails
[00:57:25] thejamespinto: EllisTAA: validates_inclusion_of :field_name, in: [1,2,3,4,5]
[00:57:57] diegoviola: is there any code here that you guys think I can move to my model? https://github.com/diegoviola/movies/blob/master/app/controllers/movies_controller.rb
[00:58:10] ellisTAA: thejamespinto: thanks man
[00:58:12] das3in: EllisTAA http://edgeguides.rubyonrails.org/active_record_validations.html#inclusion
[00:58:21] das3in: thejamespinto beat me to it
[00:58:28] diegoviola: it's like 25 LoC but my potential employer is saying I have to use service objects or facades
[00:58:34] ellisTAA: well thanks heidegger
[00:59:34] thejamespinto: EllisTAA: actually, here's a slightly nicer way to do it, so you don't need to repeat the array on model and view https://gist.github.com/thejamespinto/0aa9e723333b9c0801e6
[01:00:55] Joufflu: has joined #RubyOnRails
[01:00:56] sevenseacat: has joined #RubyOnRails
[01:01:20] thejamespinto: diegoviola: what you are looking for is a CurrentUserNullOBject strategy
[01:01:58] diegoviola: thejamespinto: I have no idea how to write that
[01:03:59] thejamespinto: diegoviola: do you know how to do decorators?
[01:04:09] ellisTAA: i tried to create a model called feedback and it gaave me feedbacks ...
[01:04:19] Radar: EllisTAA: show us
[01:04:28] thejamespinto: diegoviola: well, then you just don't have the skills to implement it, sorry... :(
[01:04:29] Radar: EllisTAA: did you do "rails g model feedbacks"?
[01:04:40] ellisTAA: Radar: yeah i did rails generate model Feedback
[01:04:48] Radar: EllisTAA: Show me the output from that please
[01:05:04] workmad3: has joined #RubyOnRails
[01:05:11] ellisTAA: it???s gone
[01:05:14] Radar: EllisTAA: I can't reproduce the issue in a new app
[01:05:26] thejamespinto: diegoviola: look for the railscast on "draper", so you get an idea... here's a draft of what you are looking for https://gist.github.com/thejamespinto/29de373663a9e3cdc85a
[01:06:06] ellisTAA: Radar: well the model was called feedback, but the migration said feedbacks
[01:06:19] bronson: has joined #RubyOnRails
[01:06:22] Radar: EllisTAA: yes, because the table is the pluralised version of the model
[01:06:41] tenderlove: has joined #RubyOnRails
[01:06:53] ellisTAA: feedbacks doesn???t sound right
[01:06:58] diegoviola: thejamespinto: isn't this just the same thing except it's moving to its own class?
[01:07:04] thejamespinto: diegoviola: I've just updated the gist with a second (easier) to do it
[01:07:21] Radar: EllisTAA: I would probably call it "comment" or "feedback comment"
[01:07:36] thejamespinto: diegoviola: all the alternatives out there move it to it's own class and hide it from you, so you don't feel like that's what it is doing :)
[01:08:26] thejamespinto: diegoviola: sorry, if current_user is nil, you gotta an instance of something else, you can't beat on a nil horse, it's nil :)
[01:08:55] thejamespinto: diegoviola: huehuehue >:)
[01:09:21] tenderlo_: has joined #RubyOnRails
[01:11:04] kaduribeiro: can somebody help me?
[01:11:37] thejamespinto: kaduribeiro: !ask
[01:11:52] thejamespinto: helpa: wake up
[01:12:18] symbole: has joined #RubyOnRails
[01:12:45] helpa: You are not worthy of this bot!
[01:12:54] thejamespinto: kaduribeiro: yes, somebody can help you, take some time to formulate your question and place it here, the better structured your question is the more likely people are to help you
[01:13:05] kaduribeiro: I'm writting =D
[01:13:05] Yakko: !botsnack
[01:13:05] helpa: Nom nom. Thanks, yakko!
[01:13:18] helpa: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[01:17:00] kaduribeiro: I'm migrating an app from rails 4.1.x to rails 4.2.4. A have an error when I use ActiveModel::Erros.new(object) when the object is not an ActiveRecord / ActiveModel.
[01:17:35] kaduribeiro: I am looking on the rails source code and the ActiveModel::Error has changed from 4.1.x to 4.2.4 https://github.com/rails/rails/blob/v4.2.4/activemodel/lib/active_model/errors.rb#L412
[01:17:42] ericjphillips: has left #RubyOnRails: ()
[01:18:34] kaduribeiro: this method on the line 437 (https://github.com/rails/rails/blob/v4.2.4/activemodel/lib/active_model/errors.rb#L437) is trying to look for the method model_name from the instance, but in the version 4.1.x it looks from the class. It was changed on this commit: https://github.com/rails/rails/commit/6b0e834a194d112585f41deba0a40780d68e38c6
[01:18:39] Papierkorb: has joined #RubyOnRails
[01:18:47] sankaber: has joined #RubyOnRails
[01:20:06] kaduribeiro: Anyone knows why it have been changed? I'm with trouble now =/. I can fix it by creating a module that I can use on my class with this method using the ActiveModel::Naming. But I think that the older way it's right when you use it on a object that is not an activerecord/activemodel
[01:21:35] mary5030: has joined #RubyOnRails
[01:21:47] jhn: has joined #RubyOnRails
[01:23:15] jhn: has joined #RubyOnRails
[01:23:29] jhn: I'm using RVM and for some reason when I run `rails -c`, a config file that's supposed to be loading isn't (specifically a freshly generated mongoid.conf)
[01:24:02] jhn: the strange thing is if I start the rails console from IntelliJ, it works just fine (with the same Ruby / RVM gemset as above).
[01:24:34] jhn: I'm not sure how I'd go about debugging this.
[01:25:05] blackmesa: has joined #RubyOnRails
[01:25:23] jhn: I tried directly modifying the source of mongoid, i.e.
[01:25:50] jhn: Users/jmena/.rvm/gems/ruby-2.2.1@rails4.2/gems/mongoid-5.0.0/
[01:27:04] jhn: but when I do `bin/rails console development`, none of the expected extra output (some puts statements in the place that loads the config) appears
[01:28:25] rhizome: two different problems. the solution to the first one is removing the hyphen
[01:29:04] jhn: which problem are you referring to?
[01:29:35] rhizome: the first one. the command isn't rails -c, it's rails c
[01:29:43] jhn: oh yeah, that was a typo
[01:29:47] jhn: disregard that
[01:30:02] EminenceHC: has joined #RubyOnRails
[01:30:03] Radar: #welltheresyourproblem
[01:30:18] Radar: ruby-install + churby ftw
[01:30:34] Radar: jhn: Steps to reproduce in a new app kthx
[01:31:17] tenzan: has joined #RubyOnRails
[01:32:44] das3in: Radar did you write Multitenancy?
[01:32:48] Radar: das3in: Yes that's me.
[01:33:04] das3in: Sweet! I just bought those books. Great stuff
[01:33:08] bruno-: has joined #RubyOnRails
[01:33:16] dymk: has left #RubyOnRails: ("Leaving")
[01:33:42] Radar: thank you!
[01:34:07] Radar: das3in: Did you buy v2 or v1? https://leanpub.com/multi-tenancy-rails-2
[01:34:08] arooni: has joined #RubyOnRails
[01:34:15] das3in: Radar bot
[01:35:36] pjammer: has joined #RubyOnRails
[01:35:38] das3in: Radar: I don't fully get it yet. But the first book at least (haven't gotten to #2 yet) is really well written. Preemptively answering my questions as I have them
[01:36:24] tenderlove: has joined #RubyOnRails
[01:36:28] sevenseacat: *Radar's author skills level up
[01:37:14] jenrzzz: has joined #RubyOnRails
[01:40:06] mary5030: has joined #RubyOnRails
[01:41:39] cmoel: has joined #RubyOnRails
[01:44:57] Creeves: has joined #RubyOnRails
[01:48:10] tenderlove: has joined #RubyOnRails
[01:49:21] Radar: time to fly. have fun kids
[01:49:45] wldcordeiro: has joined #RubyOnRails
[01:53:29] ellisTAA: has joined #RubyOnRails
[01:54:43] jhn: Radar: Steps to reproduce the above https://gist.github.com/jhn/ffeeeb6a08f965948e9c
[01:54:50] jhn: Sorry if it's a lot :(
[01:55:11] bmurt: has joined #RubyOnRails
[01:55:22] sevenseacat: he's on a plane, so I'll give it a go
[01:55:43] jhn: bless your beautiful soul
[01:57:34] diegoviola: is it bad to try to render a partial from a helper?
[01:57:55] sevenseacat: I wouldn't do it.
[01:58:01] sevenseacat: but I've seen others do it
[01:58:34] diegoviola: https://github.com/diegoviola/movies/blob/master/app/views/movies/index.html.erb
[01:58:43] diegoviola: I don't like this if in my view, not sure where to move it to
[01:58:58] diegoviola: a helper method comes to my mind, but how I handle this render?
[01:59:48] sevenseacat: seems okay to me.
[02:00:15] diegoviola: I don't like the if in the view though
[02:00:16] sevenseacat: I wouldnt do the string interpolation like that, but apart from that, don't see a huge problem with it
[02:01:01] diegoviola: somewhere I read I shouldn't have logic code in my views
[02:01:18] nickenchuggets: has joined #RubyOnRails
[02:02:56] sevenseacat: jhn: try `spring stop` in your console and try again
[02:03:06] sevenseacat: diegoviola: there's business logic and there's presentational logic
[02:03:59] jhn: within my console:
[02:04:01] jhn: spring stop
[02:04:01] jhn: NameError: undefined local variable or method `stop' for main:Object
[02:04:07] sevenseacat: nono, in your terminal sorry
[02:04:12] sevenseacat: outside the rails console
[02:04:31] sevenseacat: quit `rails c`, spring stop, `rails c` again
[02:04:32] rushed: *after closing said console
[02:04:48] sevenseacat: cuz that fixed it here
[02:05:51] jhn: oh I didn't realize that I changed it back to the default val before.
[02:05:52] jhn: that worked!
[02:05:58] jhn: what is this spring magic?
[02:06:00] jhn: a cache?
[02:06:09] jhn: I've been out of the rails loop for a while...
[02:06:31] diegoviola: sevenseacat: I see, thanks
[02:06:43] sevenseacat: https://gist.github.com/sevenseacat/74c159ab505e39dbaee4
[02:06:52] jhn: yes, it worked.
[02:06:57] sevenseacat: jhn: yeah its a shitty application cache
[02:07:10] jhn: since 4.0?
[02:07:32] sevenseacat: 4.0 or 4.1 I think.... good thing it's easy to remove
[02:08:23] jhn: thanks for your help!
[02:08:35] tenderlove: has joined #RubyOnRails
[02:09:52] rhizome: diegoviola: do different partials for logged_in and logged_out so you don't have to sprinkle that stuff all over
[02:11:52] jenrzzz: has joined #RubyOnRails
[02:13:29] diegoviola: rhizome: you mean so that I can do render "foo" if user_logged_in?
[02:13:42] rhizome: sure, that's good too
[02:14:06] rhizome: i've done something more like "render user_logged_in? ? 'logged_in' : 'logged_out'
[02:15:31] pwnd_nsfw: I dislike having toooooo many partials
[02:15:44] mary5030: has joined #RubyOnRails
[02:15:49] rhizome: i love 'em
[02:15:57] srinidhi: has joined #RubyOnRails
[02:15:58] pwnd_nsfw: NESTED PARTIALS
[02:16:13] sevenseacat: i'll put things in partials when they need to be reused
[02:16:35] rhizome: 90% of the time a helper is just a thing that's too small to partialize
[02:17:34] pwnd_nsfw: and faster !
[02:18:06] rhizome: oh you're not an i/o nerd are you
[02:18:29] rhizome: bleh, i can't do this now. gotta split
[02:19:06] nettoweb: has joined #RubyOnRails
[02:19:24] sevenseacat: when partials have more erb code in them than HTML, it's probably a sign that it should be a helper instead
[02:19:33] ejnahc: has joined #RubyOnRails
[02:19:41] bklane: has joined #RubyOnRails
[02:19:42] sevenseacat: that being said, I tend to use helpers for little one-liner things
[02:20:18] rhizome: i think my first helper was from how flaky adding custom time formats was for me
[02:20:36] wldcordeiro: has joined #RubyOnRails
[02:20:54] chouhoulis: has joined #RubyOnRails
[02:21:15] simkessy: side note, partial locals are sooo useful
[02:21:41] sevenseacat: if you ever use instance variables in a partial I will hunt you down
[02:22:04] simkessy: haha, I used too until I learned about locals
[02:22:41] apalmblad: has joined #RubyOnRails
[02:26:02] wldcordeiro: has joined #RubyOnRails
[02:27:32] blackmesa: has joined #RubyOnRails
[02:27:37] CanTonic: has joined #RubyOnRails
[02:29:45] Meow-J: has joined #RubyOnRails
[02:31:04] diegoviola: https://github.com/diegoviola/movies/blob/master/app/controllers/movies_controller.rb#L5
[02:31:07] diegoviola: I'm not sure about that line there
[02:31:27] baweaver: has joined #RubyOnRails
[02:32:35] simkessy: you don't need current_user ?
[02:32:49] simkessy: you're already checking for a logged in user using the before_filter
[02:32:50] w0rd-driven: has joined #RubyOnRails
[02:32:50] SteenJobs: has joined #RubyOnRails
[02:33:02] sevenseacat: the before filter is except :index
[02:33:15] simkessy: remove that if you're going to check for user?
[02:33:23] simkessy: why except it?
[02:33:35] RegulationD: has joined #RubyOnRails
[02:33:41] sevenseacat: to show an index page for unauthenticated users?
[02:33:47] diegoviola: people have been complaining I need to use more facades and decorators
[02:33:55] diegoviola: I don't even know what those things mean
[02:34:00] thejamespinto: diegoviola: PM
[02:34:02] jhn: hi guys, just as a follow up on my earlier, spring-related problem. what would be a good option to tell spring that I want my config file watched for changes?
[02:34:11] simkessy: sevenseacat: ah, that makes sense
[02:34:17] thejamespinto: diegoviola: you really should know what they mean :|
[02:34:19] jhn: spring says in their readme: https://github.com/rails/spring#watching-files-and-directories
[02:34:30] sevenseacat: jhn: personally I would just remove spring from your project.
[02:34:39] CanTonic: hey there. when using guard-rspec the output in iTerm2 looks like this: https://gist.github.com/cantonic/238f7dc24f1eb4a76312
[02:35:01] jhn: sevenseacat: idk, it just seems like this might be a useful thing but I just need to add that one file to the list of watches
[02:35:05] adam12: Does anybody even use spring? I only did a test project on 4.2 and I removed it right away.
[02:35:10] aruntomar: has joined #RubyOnRails
[02:35:15] jhn: plus it's now a default gem?
[02:35:27] sevenseacat: CanTonic: you're using two conflicting formatters
[02:35:36] sevenseacat: the progress one and fuubar by the looks of it
[02:36:01] sevenseacat: jhn: fair enough. good luck.
[02:36:04] CanTonic: sevenseacat: aahhh... weird, my Guardfile has this: `guard :rspec, failed_mode: :none, cmd: "bin/rspec", cmd_additional_args: "-f progress" do`
[02:36:22] CanTonic: sevenseacat: without the "cmd_additional_args" i am getting the same
[02:36:29] sevenseacat: you might be loading another formatter in something like your .rspec file
[02:36:50] CanTonic: yeah... profile in .rspec
[02:37:02] CanTonic: thanks sevenseacat. You've been helpful as always :)
[02:38:16] mices: i can't overcome this routing problem
[02:38:16] aruntomar_: has joined #RubyOnRails
[02:38:51] diegoviola: do you guys use decorators and facades?
[02:39:12] sevenseacat: decorators sometimes. no idea what a facade is in terms of programming.
[02:39:30] sevenseacat: also, remember that not everyone here is a 'guy'.
[02:40:56] CanTonic: hehehe. sevenseacat: always when I type "hey guys, ..." in an irc chan, I delete it again and change it to "hey there, ..." since you have reminded me of that :)
[02:41:35] sevenseacat: I do that too sometimes.
[02:42:26] adam12: mices: what routing problem
[02:43:25] wldcordeiro: has joined #RubyOnRails
[02:43:29] CanTonic: sevenseacat: but "hey guys" is gender-neutral, isn't it?
[02:43:39] CanTonic: at least in most regions i think
[02:43:51] sevenseacat: I don't consider it to be so.
[02:44:02] CanTonic: let's google it :)
[02:44:29] sevenseacat: not sure how that will help
[02:45:02] CanTonic: https://en.wiktionary.org/wiki/guy#Usage_notes
[02:45:33] CanTonic: also found a stackexchange discussion about the topic and the opinions are divided :)
[02:45:42] simkessy: ""You guys" is a familiar, all-inclusive way of addressing a group of men or women directly. That said, there are some important distinctions you must understand:"
[02:45:52] simkessy: http://english.stackexchange.com/questions/11816/is-guy-gender-neutral
[02:46:00] sevenseacat: I am not having this discussion for the five hundredth time.
[02:46:32] some_coder: has joined #RubyOnRails
[02:46:34] sevenseacat: I am simply asking people to keep it in mind.
[02:46:53] CanTonic: it worked for me. I do :)
[02:47:41] thejamespinto: sevenseacat: please put your sarcastic nails down, you know what a Facade is you just don't agree with using it
[02:47:48] bronson: has joined #RubyOnRails
[02:48:19] ChanServ: +o baweaver
[02:48:22] sevenseacat: thejamespinto: please put your stupid nails down, and believe that if I say I do not know what the term means in a programming sense, I mean it.
[02:48:37] baweaver: thejamespinto: calm it
[02:49:04] sevenseacat: it may very well be a term that applies to a concept I know, but I don't know the connection.
[02:49:06] thejamespinto: baweaver: Rebecca and I have it way back
[02:49:17] sevenseacat: thejamespinto: er, wat? do I know you?
[02:49:33] wldcordeiro: has joined #RubyOnRails
[02:51:04] montagesoftware: has joined #RubyOnRails
[02:51:19] Yakko: !botsnack
[02:51:19] helpa: Nom nom. Thanks, yakko!
[02:51:28] Yakko: helpa: Hi Five!
[02:51:45] ChanServ: -o baweaver
[02:53:08] workmad3: has joined #RubyOnRails
[02:53:15] thejamespinto: sevenseacat: I have to congratulate your keeping the same nickname all this time
[02:53:56] sevenseacat: I've changed it once in the past almost-five years
[02:53:56] das3in: Hey everyone I'm getting a error I don't quite understand. "undefined method `merge' for 1:Fixnum" - tryna implement checkboxes https://gist.github.com/das3in/72843c6aedf6e0d64725
[02:54:34] sevenseacat: das3in: the second argument to check_box is a hash of options, most likely
[02:54:51] mices: when i click update it issues a get instead of a patch
[02:54:59] sevenseacat: mices: !debug
[02:54:59] helpa: mices: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[02:55:16] CanTonic: has joined #RubyOnRails
[02:55:52] mices: sevenseacat: can i do this in routes ... patch '/clubs/:id' => 'clubs#update'
[02:56:09] sevenseacat: yes. it would make more more sense as a routing resource though.
[02:56:28] rubyonrailed: has joined #RubyOnRails
[02:56:52] adam12: mices: show us view with form that has update button.
[02:57:05] das3in: sevenseacat well, there's supposed to be a value right? I"m trying to pass the possible_answers_id
[02:58:00] sevenseacat: das3in: http://api.rubyonrails.org/classes/ActionView/Helpers/FormBuilder.html#method-i-check_box
[02:58:10] sevenseacat: second argument is an options hash
[03:03:33] das3in: Hmmm. I'm sorta confused what to do then. If the checkbox only passes a 1 or 0 how do I get it to pass an id? With a radio button it's simple, it's the second parameter
[03:04:52] sevenseacat: das3in: see the third argument
[03:06:15] charliesome_: has joined #RubyOnRails
[03:06:27] das3in: Yeah I'm looking, I think I gotta redo some relationships. I just used a blank options hash. But I'm getting fk errors. Thanks!
[03:06:41] das3in: Pretty sure I accidently designed to only take one answer
[03:09:54] braincrash: has joined #RubyOnRails
[03:12:35] gambl0re: has joined #RubyOnRails
[03:12:57] CanTonic: has joined #RubyOnRails
[03:13:29] gambl0re: has joined #RubyOnRails
[03:14:20] bklane: has joined #RubyOnRails
[03:14:49] bmurt: has joined #RubyOnRails
[03:15:08] gambl0re: has joined #RubyOnRails
[03:18:39] JayM: has joined #RubyOnRails
[03:22:55] greengriminal: has joined #RubyOnRails
[03:24:20] wldcordeiro: has joined #RubyOnRails
[03:28:08] blackmesa: has joined #RubyOnRails
[03:29:50] superlou: has joined #RubyOnRails
[03:31:02] nya: has joined #RubyOnRails
[03:31:57] CanTonic: has joined #RubyOnRails
[03:32:19] nyaa: has joined #RubyOnRails
[03:35:34] aruntomar: has joined #RubyOnRails
[03:36:13] arooni: hey everyone; having trouble deploying to production ... it seems like i have passenger phusion running on ubuntu 14.04 running ok with nginx... but i want to have the ruby used as rvm .. but whenever i try to set the path to something like "/home/chasetoys/.rvm/rubies/ruby-1.8.7-p334/bin/ruby" ... nginx wont start
[03:36:16] bmurt: has joined #RubyOnRails
[03:36:49] n1lo: has joined #RubyOnRails
[03:38:38] mices: Couldn't find Club with 'id'=District_of_Columbia https://gist.github.com/mices/bf3cbcd2351597c1f280
[03:39:45] sevenseacat: IDs are typically integers, not strings.
[03:40:26] mices: i was counting on rails magic to use :state instead of :id
[03:40:29] sevenseacat: you have some seriously bizarre routes there
[03:40:36] sevenseacat: where did you tell it to do that
[03:41:20] mices: there's a route to /clubs/:state/
[03:41:21] diego1: has joined #RubyOnRails
[03:41:31] diego1: has joined #RubyOnRails
[03:41:32] sevenseacat: thats not being used
[03:41:43] mices: so how do i fix that
[03:42:09] sevenseacat: you already have resources :clubs above it
[03:42:13] sevenseacat: which is being used instead
[03:42:47] mices: if i put it below i get a different error, then /clubs/1/edit goes it show instead of edit
[03:43:48] sevenseacat: you need to learn about routing.
[03:43:51] helpa: http://guides.rubyonrails.org/routing.html - Rails Routing From the Outside In - Rails Guide - by Mike Gunderloy
[03:44:06] mices: i read that guide several times
[03:44:43] sevenseacat: okay, so you see how /clubs/:state conflicts with the /clubs/:id provided by resources :clubs
[03:45:06] sevenseacat: so how do you want to resolve it? you can't have both
[03:45:15] sevenseacat: unless you want to start looking at constraints
[03:47:21] diegoviola: I'm still confused about this line here: https://github.com/diegoviola/movies/blob/master/app/controllers/movies_controller.rb#L5
[03:47:52] simkessy: diegoviola: what are you confused about
[03:47:54] diegoviola: some people tell me to use a decorator for this but that doesn't make sense to me, and I think there's nothing wrong with this line
[03:48:12] diegoviola: I mean, it makes sense to me
[03:48:23] simkessy: It makes sense to me as well
[03:48:38] simkessy: I don't think a decorator is necessary here at all
[03:48:48] mices: sevenseacat: so then i can't make up my own routes that conflict with the 7 resource created routes
[03:48:49] nej: has joined #RubyOnRails
[03:49:05] diegoviola: simkessy: some people just like to overcomplicate things it seems
[03:49:14] sevenseacat: diegoviola: ask the people who are telling you to use a decorator
[03:49:15] diegoviola: then they tell me I'm the idiot for not doing things their way
[03:49:15] simkessy: who are these people telling you this?
[03:49:32] sevenseacat: mices: you can. but then you can't use the default ones.
[03:49:40] arup_r: has joined #RubyOnRails
[03:49:51] mices: so what would have been a better choice of route path
[03:49:52] simkessy: mice, just use the console you test out ur routes.
[03:50:24] simkessy: you can just the route helpers in the console and see what the url turns out to be, if it doesn't work like intended play around with your routes till you get what you need
[03:50:26] diegoviola: simkessy: thejamespinto
[03:50:30] CanTonic: has joined #RubyOnRails
[03:50:38] mices: clubs/state/District_of_Columbia
[03:50:40] sevenseacat: mices: I don't know what your requirements are, but I probably wouldn't have the /clubs/:state route.
[03:50:41] mices: like that?
[03:51:02] mices: clubs/states/dis...
[03:51:06] Maletor: has joined #RubyOnRails
[03:51:20] armyriad: has joined #RubyOnRails
[03:51:20] mices: just don't use those key routes as my own custom routes
[03:51:50] EasyCo: has joined #RubyOnRails
[03:52:00] simkessy: diegoviola: that line is really small and clear. Personally I don't think a decorator is necessary. It can be done with one however and it's totally your choice. If you're going to use decorators JUST for this 1 thing, don't bother. If you plan on using them throughout, sure you can include that line as well
[03:52:22] simkessy: If you're working with thejamespinto, and he's a lead on the project, do what he says
[03:52:36] diegoviola: I'm not working with him
[03:52:50] simkessy: okay cool, do what you want
[03:53:04] ellisTAA: has joined #RubyOnRails
[03:53:05] diegoviola: I just don't like people belittling me on private because I don't do things their way
[03:53:28] diegoviola: I'm really pissed right now
[03:54:19] SteenJobs: that???s so interesting that someone can be so determined to do something their way and so confident in their programming skills that they would still not change their mind even if told at least a few knowledgeable people in the rails community think it should be otherwise.
[03:54:37] SteenJobs: but what do i know
[03:55:05] sevenseacat: SteenJobs: some people are just odd.
[03:55:12] diegoviola: SteenJobs: what do you mean?
[03:55:19] simkessy: SteenJobs, have multiple people said to use a decorator for that line? I'm currious, I wasn't paying attention.
[03:56:03] michael_mbp: has joined #RubyOnRails
[03:56:15] baash05: has joined #RubyOnRails
[03:56:26] SteenJobs: no idea, i just came on, but given that sevenseacat said ???not us???, that means > 1 and it???s safe to assume if she feels that way there???s a good chance others do haha
[03:57:02] thejamespinto: diegoviola: you are free to do what you want
[03:57:23] sevenseacat: I get that people need to vent but if you want to complain that you don't know why person X said something, it's 100% always better to ask person X
[03:57:33] sevenseacat: not a general public channel of people who don't know the contaxt
[03:57:41] SteenJobs: diegoviola: if i ever asked something here, and people like sevenseacat, Radar, smathy_afk, etc. said it???s better to do it a certain way and they???re pretty confident about it (as opposed to not having a strong opinion), even if i disagreed i would always defer in that situation.
[03:57:55] SteenJobs: ^ if that???s the case, then i agree.
[03:57:59] SteenJobs: didn???t realize that was the sitch
[03:58:18] sevenseacat: thejamespinto: and if you're abusing people in PM, one word - don't.
[03:59:24] baash05: Hey.. something happened today that is so funny I had to share it.
[03:59:50] diegoviola: you can suggest all the programming practices you want, but please just don't pm anymore
[04:00:04] sevenseacat: !rule12 is a thing in this channel, so you know.
[04:00:04] helpa: Do not PM members of the channel without first asking if that is OK.
[04:00:07] bmurt: has joined #RubyOnRails
[04:00:17] sevenseacat: diegoviola: if people are breaking it, tell them/us and we'll sort it.
[04:00:26] thejamespinto: diegoviola: dude, get lost!
[04:00:28] baweaver: ACTION reads back
[04:00:32] sevenseacat: thejamespinto: cool it.
[04:00:39] ChanServ: +o baweaver
[04:00:44] baweaver: ACTION triggered
[04:00:45] diegoviola: thejamespinto: please stop being a jerk
[04:01:07] thejamespinto: diegoviola: get lost, I came with you with nothing but calm jokes
[04:01:11] baash05: We have a slug generated with friendly slugs.. There's number at the end is based on a global in the db, that grows randomly with each request. To help with uniqueness.
[04:01:12] sevenseacat: baweaver: ops, activate! :P
[04:01:12] baweaver: +q #RubyOnRails!*@*
[04:01:23] baweaver: -q #RubyOnRails!*@*
[04:01:27] diegoviola: thejamespinto: I don't like your jokes
[04:01:34] sevenseacat: thejamespinto: diegoviola: both of you, time out. end conversation.
[04:01:35] baash05: We found the slug too long so wrapped the number in base 36
[04:01:44] baash05: today we got 713801 -> FART
[04:01:55] sevenseacat: baweaver: heh
[04:02:12] baash05: I've been waiting for it for days :)
[04:02:54] SteenJobs: yikes. didn???t realize this was the sitch. sounds like a classic everyone needs to chill because things seem like a bigger deal than they are and we???ll realize in a sec that we overreacted and things are actually unnecessarily not chill type of sitch
[04:03:05] SteenJobs: haha you know that classic sitch? it???s a long title to remember though.
[04:04:16] diegoviola: I don't take jokes very lightly even, in fact, the last time I was working at a company I had a fight with the manager due to that reason
[04:04:38] diegoviola: maybe it's my personality, who knows, I just don't like it
[04:05:06] baweaver: +q thejamespinto!*@*
[04:05:23] SteenJobs: sounds like both sides have things to work on, as does everyone always. doesn???t mean it???s not totally your prerogative to feel that way, but it could definitely be healthy to work on being more ok with jokes. same way it would be important to someone else to work on being more sensitive about said jokes.
[04:05:49] diegoviola: I mean, I will laugh if the joke is funny... I just don't like when people are jerks
[04:06:06] nej: hi i leik rails
[04:06:21] baweaver: one mute is enough today
[04:07:00] sevenseacat: just remember to unmute at some point.
[04:07:58] baweaver: I will, one day timeout for now
[04:08:15] baweaver: If someone on channel is harassing anyone via PM, tell me
[04:09:33] mices: sevenseacat: i can't believe it was that simple
[04:09:34] baweaver: or Radar, or another op on channel
[04:10:07] baweaver: ./msg chanserv access #RubyOnRails list
[04:10:11] baweaver: if you need the list.
[04:10:22] mices: sevenseacat: i was stuck on this all day and night
[04:10:28] arooni: hey folks; struggling with my nginx config on production (ubuntu 14.04) ... still getting 403 error messages ... any one have any ideas? passenger phusion + nginx and it looks like i installed correctly (correct path for ruby_path and path to phusion_)
[04:11:12] bmurt: has joined #RubyOnRails
[04:11:16] iamjarvo_: has joined #RubyOnRails
[04:11:23] mices: now i realize my first commit was f#*ked up can i just delete it
[04:11:36] mices: i wanna commit again same name same ver
[04:14:37] CanTonic: has joined #RubyOnRails
[04:15:36] lurkmaster: has joined #RubyOnRails
[04:17:45] jun_: has joined #RubyOnRails
[04:18:00] lurkmaster: i need some help. whenever i use the delete or create action in my app, instead of redirecting me back to the index page, i get the error message "server unexpectedly dropped the connection" and i have to refresh the page
[04:18:30] lurkmaster: cant figure out why this is happening
[04:19:02] lurkmaster: it successfully applies the change to the database, but it wont redirect me, the server just drops the connection for some reason
[04:21:45] lurkmaster: http://pastie.org/10453148
[04:22:12] bmurt: has joined #RubyOnRails
[04:23:21] annlewis: has joined #RubyOnRails
[04:28:57] youngbaks: has joined #RubyOnRails
[04:29:07] blackmesa: has joined #RubyOnRails
[04:29:48] michaeldeol: has joined #RubyOnRails
[04:30:37] baegle: has joined #RubyOnRails
[04:31:17] arup_r: lurkmaster: You got the issue in Safari ?
[04:31:34] arup_r: **found the issue
[04:31:54] CanTonic: has joined #RubyOnRails
[04:32:04] baegle: Newbie here. Been reading doc and google for 2 hours. I can't understand why setting config.relative_url_root works in config/application.rb but not in an initializer. Can anyone help me figure out what I'm doing wrong?
[04:32:09] arup_r: humm.. It is the browser only showing this issue.. I am also seeing it at my work since last week
[04:32:23] arup_r: None of the other browser is showing this.. but safari
[04:32:44] arup_r: our QA keep reporting me. But I have no cluse about it
[04:32:53] simkessy: well that didn't work
[04:33:07] arup_r: simkessy: Type on your own.. :)
[04:33:19] arup_r: baegle: Please make a gist
[04:33:20] simkessy: what do you mean
[04:34:17] arup_r: what you wanted from !gisthub ?
[04:34:27] diego1: has joined #RubyOnRails
[04:34:38] diego1: has joined #RubyOnRails
[04:34:40] arup_r: lurkmaster: just check it another browser ?
[04:35:21] lurkmaster: arup_r: yea i tried it in firefox and now i'm getting a completely different error
[04:35:31] arup_r: what is that ?
[04:35:51] lurkmaster: the connection was reset
[04:35:59] lurkmaster: which is essentially the same thing
[04:36:25] simkessy: arup_r: I wanted to get the link to it so I could create one
[04:37:05] arup_r: ok. I thought you asked baegle to make a gist about the problem.. sorry to bother you then
[04:37:37] simkessy: no no, I was just trying to bring up the link so I could make one about my own problem. No worries :)
[04:37:50] arup_r: lurkmaster: Can you do the same action and look at the log ?
[04:38:04] arup_r: simkessy: oic :D
[04:38:54] baegle: https://gist.github.com/Beagle/2725a9028a8289df473f
[04:38:57] baegle: Well, I created one anyway
[04:39:29] baegle: It's really only 2 lines in question and I'm sure it's knowledge gap issue. I just don't know how to find the answer anywhere
[04:39:30] lurkmaster: arup_r: the error console in the browser?
[04:40:34] simkessy: Hey, I'm using 1 partial for 2 mailer methods and also to display on my site as static page. I'm trying to hide a specific section if it's coming from a specific action. I accomplished this by targeting the subject but it's really ugly
[04:40:43] ejnahc: has joined #RubyOnRails
[04:40:48] simkessy: can this be improved: https://gist.github.com/simkessy/cbd0d57bcb9deabc5b05
[04:41:17] workmad3: has joined #RubyOnRails
[04:41:48] tjbiddle: has joined #RubyOnRails
[04:42:21] VeryBewitching: simkessy: I would have the mailer method determine what should be displayed and to render different partials instead of muddying the ERB with that kind of logic.
[04:42:33] diego1: has joined #RubyOnRails
[04:42:44] arup_r: lurkmaster: no .. Rails log I meant
[04:43:06] simkessy: VeryBewitching: is it worth having a different partial, if I'm just hiding 1 row though
[04:43:14] lurkmaster: arup_r: wheres the rails log?
[04:43:31] pawnbox: has joined #RubyOnRails
[04:43:43] diego1: has joined #RubyOnRails
[04:43:49] arup_r: tail -f log/production.log if you are in production
[04:44:08] VeryBewitching: simkessy: Well, maybe not if it's just that simple. But the kind of condition you're testing for could be done in the mailer method and assign a simple value for it. I would use a different partial to account for two scenarios of this message.
[04:44:17] idd2d: has joined #RubyOnRails
[04:44:21] lurkmaster: im not in production
[04:44:41] VeryBewitching: simkessy: That's my opinion though, ask around and get a few more maybe.
[04:45:37] pawnbox_: has joined #RubyOnRails
[04:46:43] lurkmaster: arup_r: how do i get the log if im in a development environment rather than production?
[04:46:44] arup_r: lurkmaster: whatever environment you are use that ..
[04:47:05] arup_r: it is coming right in the console where you ran rails s
[04:47:11] simkessy: VeryBewitching: hmm so maybe some helper function ex: "display_header" which does all the logic to return true or false then in the view just call that function and display if true
[04:47:27] simkessy: that sounds cleaner
[04:47:28] arup_r: also the same you can see from tail -f log/devlopment.log
[04:47:54] bronson: has joined #RubyOnRails
[04:48:15] arup_r: baegle: I never used that.. so i wouldn't be able to help on that. :(
[04:48:28] VeryBewitching: simkessy: I like to keep all of code readable enough that someone who doesn't write code could maybe understand what's happening. :D
[04:49:11] simkessy: VeryBewitching: so are you saying the helper method idea is not readable?
[04:49:29] VeryBewitching: simkessy: No, it's certainly more readable if you define the methods well.
[04:49:54] simkessy: VeryBewitching: ah okay awesome, I'll give it a shot. Thanks.
[04:50:11] pawnbox: has joined #RubyOnRails
[04:51:39] havenwood: has joined #RubyOnRails
[04:52:17] arup_r: baegle: Didn't see any direct answer for you here http://guides.rubyonrails.org/configuring.html#deploy-to-a-subdirectory-relative-url-root
[04:53:27] lurkmaster: im getting a bad uri error message
[04:53:43] arup_r: yes,, then fix it... you got the hints
[04:54:27] diegoviola: I'm trying to understand the mindset about the decorator pattern, is it just a class that wraps the model? like a helper class? I don't understand why would I want to do that?
[04:54:31] lurkmaster: http://pastie.org/10453175
[04:54:41] lurkmaster: i dont get whats wrong with my uri though
[04:54:52] diegoviola: why not use concerns or just add stuff in the model directly?
[04:55:14] lurkmaster: do you see anything --> http://pastie.org/10453148
[04:55:32] sadaf2606: has joined #RubyOnRails
[04:55:48] arup_r: show the error log
[04:56:08] lurkmaster: errors --> http://pastie.org/10453175
[04:56:43] lurkmaster: the weird thing is, in safari it successfully deletes the message. in firefox it doesn't
[04:56:59] arup_r: lurkmaster: this is wrong redirect_to 'messages'
[04:57:28] lurkmaster: whats wrong with it
[04:58:31] arup_r: well try redirect_to messages_path # path to your index action
[04:59:51] simkessy: VeryBewitching: worked perfectly https://gist.github.com/simkessy/24914d367cb592baddf7
[05:01:35] lurkmaster: arup_r: that worked, thanks!
[05:01:38] dideler73: has joined #RubyOnRails
[05:02:34] baweaver: -q #RubyOnRails!*@*
[05:02:43] baweaver: -q #RubyOnRails!*@*
[05:02:44] VeryBewitching: simkessy: Much cleaner
[05:02:59] chrissonar: has joined #RubyOnRails
[05:03:49] baweaver: -q thejamespinto!*@*
[05:04:51] VeryBewitching: ACTION gives baweaver a broom.
[05:05:10] baweaver: It's the trend that's sweeping the nation
[05:05:19] baweaver: what are we talking about?
[05:05:41] Yakko: ACTION gives helpa a snack
[05:05:43] Yakko: !botsnack
[05:05:43] helpa: Nom nom. Thanks, yakko!
[05:05:48] VeryBewitching: You were housecleaning :D
[05:07:47] jenrzzz: has joined #RubyOnRails
[05:08:44] Cervajz: has joined #RubyOnRails
[05:09:18] krz: has joined #RubyOnRails
[05:09:48] pawnbox: has joined #RubyOnRails
[05:10:30] Cervajz_: has joined #RubyOnRails
[05:11:17] diego1: has joined #RubyOnRails
[05:11:21] diego1: has joined #RubyOnRails
[05:12:50] pawnbox_: has joined #RubyOnRails
[05:14:35] arooni: hey folks! have been trying for 3 hours to solve a 403 forbidden problem on ubuntu 14.04 with nginx 1.80 (installed as a package) and latest passenger phusion... this is on a live production site :(
[05:14:51] arooni: anyone run into this type of prolem before?
[05:14:52] Aeyrix: sounds like you should've been using your uat environment
[05:14:54] lurkmaster: that sucks man
[05:14:59] TvL2386: has joined #RubyOnRails
[05:15:07] ruurd: has joined #RubyOnRails
[05:17:11] thejamespinto: arooni: it's been a very long time but here it goes... scan your /etc/nginx and /var/log/nginx folders for log files, verify if they are being written or if they are writeable
[05:18:32] arooni: they are being written to ; seeing this error: 2015/09/30 21:31:38 [error] 28237#0: *7 directory index of "/var/www/a_phone_site/current/public/" is forbidden, client:, server: www.phonemyphone.com, request: "GET / HTTP/1.1", host: "www.aphonesite.com"
[05:18:37] thejamespinto: arooni: we had a very similar situation where we simply could not find out where the persmission problem was and it turned out /var/log/nginx... did not have writing permissions, so it looked to us like the issue was not happeneing on that level
[05:19:01] rubyonrailed: has joined #RubyOnRails
[05:19:18] arooni: thejamespinto, what *should* permissions be for /var/log/nginx
[05:19:22] arooni: and files underneath it
[05:19:23] thejamespinto: arooni: cool, so that's where your forbidden access is leading you, just like ours :)
[05:19:38] arooni: and who should own that directory?
[05:19:53] thejamespinto: arooni: I honestly don't remember, I haven't done any devops work for over a year, sorry :(
[05:20:21] baweaver: who runs nginx?
[05:20:25] baweaver: what user, rather
[05:20:34] Aeyrix: if it isn't user id 33
[05:20:35] thejamespinto: arooni: but judging by your logs, you should make public have the same rules as it's sister files and folders
[05:20:44] baweaver: they should own it
[05:20:52] tjbiddle: has joined #RubyOnRails
[05:21:30] tejasmanohar: has joined #RubyOnRails
[05:22:25] Aeyrix: oh man that reminds me when I admin'd a minecraft server
[05:22:28] Aeyrix: and the owner renamed the root user
[05:22:32] Aeyrix: to his own fucking name
[05:22:34] arooni: well now /var/log/nginx and all files underneath it is set to ...
[05:22:41] arooni: www-data:www-data (the nginx user)
[05:22:44] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[05:22:55] baweaver: ls -la /var/www/a_phone_site/current/
[05:22:56] arooni: but same problem
[05:23:38] baweaver: sorry, running back and forth a bit here.
[05:24:06] annlewis: has joined #RubyOnRails
[05:24:25] thejamespinto: arooni: gist us this "sudo ls -hl /var/www/a_phone_site/current/"
[05:24:36] arooni: https://gist.github.com/arooni/9568a160d49a782a0114
[05:25:12] arooni: lrwxrwxrwx 1 www-data www-data 52 Aug 13 2014 /var/www/find_my_phone_rails/current -> /var/www/find_my_phone_rails/releases/20140813214528
[05:25:23] thejamespinto: oops sudo ls -hl /var/www/find_my_phone_rails/releases/20140813214528/
[05:25:27] arooni: i hate this passenger phusion thing... the errors are so opaque
[05:25:30] dhjondoh: has joined #RubyOnRails
[05:25:46] baweaver: yay symlinks
[05:25:51] arooni: https://gist.github.com/arooni/b802f4a21e7bd7372a2e
[05:25:58] thejamespinto: everybody loves symlinks
[05:26:36] baweaver: 775 on public
[05:26:52] arooni: should it be different?
[05:27:10] baweaver: should be fine
[05:27:11] baweaver: http://stackoverflow.com/questions/8131806/rails-3-1-nginx-passenger-directory-index-forbidden/8142328
[05:27:16] baweaver: that looks to answer some of it
[05:27:23] ellisTAA: has joined #RubyOnRails
[05:27:56] wldcordeiro: has joined #RubyOnRails
[05:28:51] baweaver: use `which ruby` to find out its path if you need that
[05:29:55] blackmesa: has joined #RubyOnRails
[05:31:23] raunicolae: has joined #RubyOnRails
[05:32:48] ChanServ: -o baweaver
[05:33:31] arooni: thanks baweaver ; i verifieid i dont have any of those problems
[05:34:32] baweaver: does `which ruby` line up with that path in your config?
[05:35:01] jojo_: has joined #RubyOnRails
[05:35:03] RegulationD: has joined #RubyOnRails
[05:35:37] thejamespinto: arooni: I also found this one for you http://stackoverflow.com/questions/19285355/nginx-403-error-directory-index-of-folder-is-forbidden
[05:35:41] baweaver: http://serverfault.com/a/641428
[05:35:44] baweaver: and that one
[05:35:54] arooni: man i think ive seen each one of these earlier ;P
[05:35:57] arooni: ill check each one
[05:36:06] arooni: im about ready to go back to a snapshot i had earlier
[05:36:07] arooni: and call it a night
[05:36:19] baweaver: have you changed anything?
[05:36:36] baweaver: basically, what's the difference between working and now?
[05:37:05] arooni: upgraded from phusion 3.02 and older version of nginx
[05:37:08] arooni: to latest and greatest
[05:37:18] sevenseacat: thats a big jump
[05:37:23] arooni: i hate myself
[05:37:38] baweaver: happens to anyone who dares touch ops
[05:37:43] baweaver: ACTION works in devops
[05:37:50] baweaver: ACTION knows too well the horrors
[05:38:11] thejamespinto: Hail Heroku Almighty :(
[05:38:14] arooni: it would be easier if passenger would just tell you *why* its failing
[05:38:17] VeryBewitching: First step is to create a migration plan. Second step is to panic about all the crap you're about to do.
[05:38:20] baweaver: might want to roll a lab server to test
[05:38:21] arooni: but it is completely opque
[05:38:32] arooni: no way of knowing why its failing
[05:38:35] baweaver: Puma tends to be better honestly.
[05:38:38] arooni: and thats core issue
[05:38:45] arooni: is there an alternative for passenger?
[05:38:50] arooni: that will work with an older rails app?
[05:38:57] baweaver: define older
[05:38:58] arooni: and rvm ideally?
[05:39:02] arooni: one moment ill telll you
[05:39:15] diegoviola: what are decorators for? view models? what?
[05:39:30] yaw: has joined #RubyOnRails
[05:39:47] sdwrage: has joined #RubyOnRails
[05:39:47] baweaver: there are a number of articles on it, I'd have to find them again though.
[05:39:59] VeryBewitching: diegoviola: http://robertomurray.co.uk/blog/2014/decorators-presenters-delegators-rails/
[05:40:06] Radar: made logs.ryanbigg.com 10x faster using this one weird trick (a database index)
[05:40:07] tagrudev: has joined #RubyOnRails
[05:40:10] Radar: and now for sleep
[05:40:21] Radar: more like afternoon
[05:40:42] arooni: can puma run that?
[05:40:52] arooni: ideally thru rvm?
[05:41:15] lurkmaster: i tried add a title column to my table and now im getting the error message "Undefined method title" in my new view --> http://pastie.org/10453209
[05:41:18] lurkmaster: what am i doing wrong
[05:41:33] lurkmaster: i know its some weird noob mistake, just cant identify it
[05:41:36] baweaver: have you tried turning rails off and on again?
[05:41:54] SteenJobs: has joined #RubyOnRails
[05:41:58] sevenseacat: did you run the migration? :)
[05:41:59] arooni: so will puma run a rails 2.1.0 app ? with ruby 1.8.7 ?
[05:42:13] sevenseacat: you didn't edit a migration you'd already run, did you?
[05:42:35] baweaver: 1.8.7 I really doubt
[05:42:39] lurkmaster: i did run the migration, idk whats going on
[05:42:54] baweaver: if possible I'd get out of that version of ruby
[05:42:56] lurkmaster: i did edit that migration
[05:43:07] lurkmaster: was i supposed to create a new migration file
[05:43:08] Aeyrix: what the hell
[05:43:10] sevenseacat: lurkmaster: once you've run a migration, thats it. if you want more changes, make a new migration.
[05:43:15] thejamespinto: arooni: my routine back when I worked with ops was tail -f these files and see if they were being written: production, worker, cron, puma, nginx, and the linux internal log files as a measure of last resort http://stackoverflow.com/questions/19285355/nginx-403-error-directory-index-of-folder-is-forbidden
[05:43:47] baweaver: Aeyrix: some people are stuck, though I agree they really need to upgrade that
[05:43:55] thejamespinto: arooni: sorry this is the link I meant to paste http://www.thegeekstuff.com/2011/08/linux-var-log-files/
[05:44:54] lurkmaster: sevenseacat: got it thanks :)
[05:45:29] roxtrongo: has joined #RubyOnRails
[05:45:37] Aeyrix: baweaver: I can understand being stuck on Rails 3
[05:45:39] Aeyrix: not rails 2
[05:45:41] Aeyrix: that's like being stuck on Windows XP.
[05:46:03] srinidhi: has joined #RubyOnRails
[05:46:05] baweaver: hospitals are stuck on ME
[05:46:16] baweaver: often it's not a matter of sanity
[05:46:18] Aeyrix: They're not connected to the internet.
[05:46:37] Aeyrix: Source: Reviewed hospitals in the past.
[05:46:58] thejamespinto: Aeyrix: what are you talking about? XP was their last usable version!
[05:47:09] Aeyrix: thejamespinto: i kind of hope you lose your hands right now
[05:47:42] thejamespinto: Aeyrix: that's not very nice :P
[05:48:47] Aeyrix: Neither is Windows XP.
[05:48:47] baweaver: well time for me to check out for the night, getting late.
[05:48:53] Aeyrix: Ciao baweaver
[05:49:01] bronson: has joined #RubyOnRails
[05:49:22] thejamespinto: ACTION is feeling unsafe here alone with Aeyrix
[05:49:42] Aeyrix: I won't actually rm your hands.
[05:50:05] diegoviola: ok so drapper is about moving code from views to a class and then calling #decorate on the class in order to access those methods from the view?
[05:50:33] thejamespinto: Aeyrix: you scared me :o
[05:50:44] shinnya: has joined #RubyOnRails
[05:50:57] jenrzzz: has joined #RubyOnRails
[05:52:03] Maletor: has joined #RubyOnRails
[05:52:09] piotrj: has joined #RubyOnRails
[05:53:22] sevenseacat: it's about decorating activerecord objects with a presentation layer. how it does that is the rest of what you said
[05:53:54] raunicolae: has left #RubyOnRails: ("Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is")
[05:56:05] sevenseacat: "Draper adds an object-oriented layer of presentation logic to your Rails application." first line of the draper readme
[05:56:41] darutoko: has joined #RubyOnRails
[05:57:41] rvanlieshout: has joined #RubyOnRails
[05:58:42] cih: has joined #RubyOnRails
[06:00:07] diegoviola: so every time I need to add an if block in my view I just do that on a decorator?
[06:00:22] bronson: has joined #RubyOnRails
[06:00:31] sevenseacat: thats not what decorators are for.
[06:01:24] Aeyrix: Who introduced you to decorators?
[06:01:26] Aeyrix: They made a mistake.
[06:01:56] Spami: has joined #RubyOnRails
[06:01:57] diegoviola: I have a hard time getting the concept
[06:02:09] diegoviola: Aeyrix: why would they have made a mistake?
[06:02:31] sevenseacat: again, they're about wrapping *models* - you put presentation logic for a model instance in the decorator
[06:02:35] Aeyrix: Because of your question of whether or not you should be including that sort of logic in the view.
[06:03:13] Aeyrix: sevenseacat: Do you even need to use decorators for that?
[06:03:19] Aeyrix: Can't you just kind of do it manually with almost as little effort?
[06:03:29] sevenseacat: do they make things a lot tidier? sometimes
[06:03:30] diegoviola: Aeyrix: I don't add logic in my view if that's what you're asking
[06:03:46] sevenseacat: does draper sometimes make you curse its existence whenever you use it? yes
[06:03:50] Aeyrix: <diegoviola> so every time I need to add an if block in my view I just do that on a decorator?
[06:03:59] Aeyrix: You didn't do it, but you nearly did.
[06:04:19] tagrudev: hmm is there a way to validate virtual attributes of an activerecord class
[06:05:28] diegoviola: Aeyrix: are you just here to argue about what I do or not?
[06:06:14] dionysus69: has joined #RubyOnRails
[06:06:54] yardenbar: has joined #RubyOnRails
[06:06:54] sanjayu: has joined #RubyOnRails
[06:07:30] Cervajz: has joined #RubyOnRails
[06:07:36] rushed: tagrudev: custom validators are just functions so you can do whatever you like
[06:09:58] tagrudev: also if I define a validation on a missing field, would that result in automatically creating a virtual attribute
[06:10:15] tagrudev: according to the docs it should, but reality is different
[06:13:01] CanTonic: has joined #RubyOnRails
[06:14:44] arup_r: has joined #RubyOnRails
[06:15:59] bronson: has joined #RubyOnRails
[06:17:07] iateadonut: has joined #RubyOnRails
[06:19:29] Obfuscate: has left #RubyOnRails: ()
[06:19:55] Creeves: has joined #RubyOnRails
[06:21:26] Macaveli: has joined #RubyOnRails
[06:22:13] comrad: has joined #RubyOnRails
[06:23:20] riotjones: has joined #RubyOnRails
[06:23:51] rushed: anyone know of a short circut for AR queries looking for zero id related models? or maybe the opposite (ie reading zero ids as nil)? context: cases where zero is being used (perhaps inappropriately) in place of null for FKs in the db?
[06:24:35] sevenseacat: no perhaps about it :P
[06:24:53] annlewis: has joined #RubyOnRails
[06:25:14] piotrj_: has joined #RubyOnRails
[06:28:08] eGGsha: has joined #RubyOnRails
[06:28:41] rvanlieshout: rushed: zero id related models?
[06:29:19] workmad3: has joined #RubyOnRails
[06:29:56] freedrull: anyone deploying apps with aws code deploy? do you still need capistrano ?
[06:30:03] michael_mbp: has joined #RubyOnRails
[06:30:06] rushed: rvanlieshout: FK of zero
[06:30:20] rvanlieshout: what dus 'FK of zero' even mean?
[06:30:29] rushed: rvanlieshout: foreign key of zero
[06:30:35] rvanlieshout: i know what fk means
[06:30:40] blackmesa: has joined #RubyOnRails
[06:30:49] rvanlieshout: you mean things that don't have some relationship?
[06:30:54] rvanlieshout: like authors without books
[06:31:24] rakm: has joined #RubyOnRails
[06:31:46] rushed: rvanlieshout: as I mentioned I have some tables which are using zero in place of null, I would like to avoid the resulting unneeded queries
[06:32:13] thejamespinto: rushed: you mean when a comment has user_id == 0 ???
[06:32:16] Lycanii: has joined #RubyOnRails
[06:32:31] rushed: thejamespinto: right
[06:33:02] thejamespinto: rushed: OK, so 2 things... 1. zero is a number, you should have NULL in there instead
[06:33:27] rushed: thejamespinto: I acknowledged that, but thanks :)
[06:33:36] rvanlieshout: aah like that
[06:33:37] norc: has joined #RubyOnRails
[06:33:42] thejamespinto: 2. it's called a parentless model, or a nullified column, or a lot of other names people call it
[06:33:45] rvanlieshout: rushed: create a migration to update them to nil?
[06:33:49] rvanlieshout: cause 0 is just wrong data
[06:34:17] hihorut: has joined #RubyOnRails
[06:34:32] thejamespinto: rushed: so, if you are looking to avoid queries, one of the things you can do, which is kinda Quick & Dirty, is to override the reader method with a bit of decision making logic :)
[06:34:36] hihorut: can anyone explain to me why `references()` is mandatory when using `includes()` but not when using `order()`?
[06:34:45] norc: Hi. I have a model Session and a model User. I want to provide a view that displays all sessions distinct by username. My question is, how would you describe this as a RESTful route?
[06:34:52] rvanlieshout: hihorut: it's never mandatory
[06:35:01] norc: (Just cannot figure out a sensible RESTful URL for this)
[06:35:11] hihorut: rvanlieshout: yes ok, I mean when I'm passing where conditions with strings inside
[06:35:12] rvanlieshout: hihorut: it all depends on what you want
[06:35:14] hihorut: and rails can't parse it
[06:35:15] sevenseacat: norc: /users/foo/sessions ?
[06:35:19] sanjayu: has joined #RubyOnRails
[06:35:24] rvanlieshout: hihorut: includes tells rails to include some related data
[06:35:37] rvanlieshout: hihorut: and since left joins suck, it tries to perform a separate query for it
[06:35:51] thejamespinto: rushed: you also have counter cache columns, for the has_many where you don't want to query comments for a user just to see they had zero comments, learn more here http://railscasts.com/episodes/23-counter-cache-column
[06:35:53] rvanlieshout: hihorut: now.. when using conditions in a string you really need some join and not the separate query
[06:35:56] tetraktys: has joined #RubyOnRails
[06:36:09] norc: sevenseacat: that implies all sessions by user foo. I rather mean, you have 3 sessions by "bar", 2 sessions by "quux" and 0 sessions by "foo". My resulting view shall only contain "foo" and "bar".
[06:36:15] sanjayu: has joined #RubyOnRails
[06:36:22] rvanlieshout: hihorut: ergo: you need to tell rails to use the left join.. rails would already know what if you use a hash for conditions or refer to it using something like order
[06:36:25] norc: sevenseacat: Or with other words, a list of all users that have at least a single session.
[06:36:37] sevenseacat: oh right, a users list, not a session list
[06:36:46] sevenseacat: I misunderstood
[06:36:46] rvanlieshout: hihorut: but even better: IF your condition implies that the relationship is required, use a .joins to perform an inner join
[06:36:50] norc: All good :)
[06:36:56] rvanlieshout: hihorut: or stick to includes IF you need that related data
[06:37:36] norc: sevenseacat: Or would this just be GET /users with an optional parameter that limits the users to only those with a session?
[06:37:48] thejamespinto: rushed: last, remember, premature optimization is the source of all evil, let the app be used first, it's very likely that you will need to change the code to better suit the users needs, so you should only look to optimize things that are running live after they become a problem, focus on having code that is easy to read and maintain instead ;)
[06:38:12] rushed: thejamespinto: all great points thanks
[06:38:13] Trynemjoel: has joined #RubyOnRails
[06:38:18] thejamespinto: make it work, make it better, THEN make it faster :)
[06:38:48] thejamespinto: and I'm off to bed!
[06:38:50] norc: thejamespinto: You forgot the profiling between making it better and making it faster.
[06:39:07] norc: A rather important point that many people completely neglect to do.
[06:39:30] thejamespinto: norc: well, sure, but then my sentence wouldn't have as much impact :)
[06:39:40] norc: Fair enough :)
[06:40:24] thejamespinto: so yeah, I'm willing to misslead people into shadowier days so I look good on my statements :)
[06:40:44] sevenseacat: thejamespinto: who unmuted you and why?
[06:41:05] pawnbox: has joined #RubyOnRails
[06:41:14] pkh: has joined #RubyOnRails
[06:41:41] thejamespinto: sevenseacat: Happy October to you too
[06:43:03] norc: You presume he does not live in Honolulu there.
[06:43:43] spkprav: has joined #RubyOnRails
[06:43:49] norc: Or even some some west coast cities in the US. :-)
[06:44:00] sevenseacat: norc: you presume he is a he
[06:44:11] jojo__: has joined #RubyOnRails
[06:44:13] thejamespinto: norc: you presume she is human
[06:45:20] hihorut: rvanlieshout: but I still don't get why `SkuReview.includes(sku: :category).where("categories.id = 5")` does not requires a `references`
[06:46:14] norc: sevenseacat: Here in Germany it feels like authors of books are obligated to write a notice in the beginning, asking for understanding that the author will use "he" throughout a book to simplify things...
[06:46:19] arup_r: after using assign_attributes and if I find valid? retruns false, I want to reset the object. Is it possible ?
[06:46:56] sevenseacat: norc: not sure how thats related, but sure :)
[06:47:32] norc: sevenseacat: I use "he" without trying to indicate a gender. ;-)
[06:47:41] sevenseacat: how wonderfully exclusionary of you.
[06:47:48] spkprav: Just a hi to everyone to see whether my limechat works ;)
[06:47:53] sevenseacat: spkprav: howdy.
[06:47:57] arup_r: got it restore_attributes
[06:47:59] norc: Here is a question. Model.select(:foo).distinct.first produces an obvious SQL error. Should this happen however?
[06:48:04] arup_r: thanks DHH
[06:48:19] thejamespinto: arup_r: I know they're kept in .changes and you can always use .reload
[06:48:56] arup_r: O i see. I remember reload on in console :)
[06:49:03] arup_r: thejamespinto: you are right!
[06:49:24] thejamespinto: arup_r: but reload is more like when you want to ensure you have the latest version from the DB
[06:50:11] thejamespinto: norc: try Model.uniq.pluck(:foo)
[06:50:30] pawnbox_: has joined #RubyOnRails
[06:50:44] norc: thejamespinto: works better than selecting both :foo and :id thanks
[06:51:13] ruurd: has joined #RubyOnRails
[06:51:51] thejamespinto: arup_r: looks like you have <field_name>_reset! methods, but you gotta call them one by one http://stackoverflow.com/questions/18663699/how-to-revert-undo-local-changes-to-an-activerecord-object
[06:54:19] jojo__: has joined #RubyOnRails
[06:54:25] herbst: has joined #RubyOnRails
[06:54:25] herbst: has joined #RubyOnRails
[06:54:35] arup_r: thejamespinto: Yes. But I want to restore all
[06:54:39] thejamespinto: arup_r: just checked the sources, there's a model.restore_attributes method you can call ;)
[06:54:47] arup_r: yes.. it worked
[06:54:56] arup_r: I thanked to DHH already
[06:55:32] thejamespinto: I'm not gonna scrutinize the whole thing and find out who came up with the idea for that particular method :P
[06:55:39] arup_r: I was redirecting to the :back .. and as I used assign_attributes it was showing all unsaved data as model object still has a hold on it
[06:56:05] arup_r: But .. restore_attributes refreshed it
[06:56:33] thejamespinto: arup_r: only use redirect_to :back on non-GET requests
[06:56:35] arup_r: thejamespinto: I have shown my respect to the guy who added this method in top down approach
[06:56:46] trautwein: has joined #RubyOnRails
[06:56:51] arup_r: oic.. that is a good idea.
[06:56:59] arup_r: I didn't knew this
[06:57:12] thejamespinto: just think about it and you will find out why :)
[06:57:26] arup_r: Already it clicked .. on my mind..
[06:57:30] finnnnnnnnnnn: has joined #RubyOnRails
[06:57:35] arup_r: after u pointed
[06:57:40] arBmind: has joined #RubyOnRails
[06:57:59] thejamespinto: this is a create or update situtation, correct?
[06:58:13] thejamespinto: this is either a ....*
[06:58:24] redmaverick: has joined #RubyOnRails
[06:58:33] arup_r: update one basically
[06:58:37] thejamespinto: why are you not having render action: 'edit' ???
[06:59:00] arup_r: the page is a mess.. lots of shit in the page..
[06:59:09] arup_r: where I am redirecting back
[06:59:30] arup_r: I can't explain you without showing .. how it messed up
[06:59:30] cih: has joined #RubyOnRails
[06:59:40] thejamespinto: try to segment the process
[06:59:40] arup_r: not a single controller involved in the page..
[06:59:48] thejamespinto: or something like that, a wizard you know, something...
[07:01:04] thejamespinto: it might feel like you are writing less code sometimes, therefore optimizing for less code because you reuse a lot of controller actions for different things
[07:01:07] arup_r: hum.. man, something I can't tell you.. why it is a mess :( just read me ...
[07:01:16] thejamespinto: but that's usually a bad idea :(
[07:01:33] arup_r: I know I agree.. but I can't put decision..
[07:01:38] thejamespinto: you usually want to have a pair of actions for each step of the way :P
[07:01:50] thejamespinto: oh sure, we're not always given the choice, I know
[07:02:13] arup_r: what do you mean? can you elaborate? "you usually want to have a pair of actions... "
[07:02:14] freezevee: has joined #RubyOnRails
[07:02:35] nfk|laptop: has joined #RubyOnRails
[07:02:56] thejamespinto: you know how sometimes you want to have.... say a wizard with 7 steps?
[07:03:01] freezevee: hi all, can anyone please help me with Puma https://www.reddit.com/r/ruby/comments/3myo1s/puma_is_failing/ ?
[07:03:15] thejamespinto: and all the steps are basically calling the action update....
[07:03:58] thejamespinto: or how you might have... say... posts, comments, replies and likes
[07:04:12] AzaToth: has joined #RubyOnRails
[07:04:16] arup_r: thejamespinto: I got you now
[07:04:34] thejamespinto: you usually want to avoid reusing actions, so, have a pair for each step
[07:04:48] thejamespinto: later on, if you find a way to optimize, yay, that's a bonus
[07:04:59] jojo__: has left #RubyOnRails: ()
[07:04:59] jojo__: has joined #RubyOnRails
[07:05:07] CanTonic: has joined #RubyOnRails
[07:05:30] thejamespinto: but it's far more likely that some rocks on the road will make you need changes you never planned to
[07:05:38] thejamespinto: focus on making it readable instead
[07:05:57] linus4: has joined #RubyOnRails
[07:06:04] jojo__: has left #RubyOnRails: ()
[07:06:04] jojo__: has joined #RubyOnRails
[07:06:18] thejamespinto: like any newbie could come and say - I could have done it, this guy writes code like a 5 years old, it should be all fuzzy and full of complex awesome logic
[07:07:37] pkkm: has joined #RubyOnRails
[07:08:47] Maletor: has joined #RubyOnRails
[07:09:47] spkprav: has joined #RubyOnRails
[07:10:21] jojo__: has joined #RubyOnRails
[07:10:50] rubyonrailed: has joined #RubyOnRails
[07:12:02] jojo__: has joined #RubyOnRails
[07:12:30] blackmesa: has joined #RubyOnRails
[07:13:00] spkprav: has joined #RubyOnRails
[07:14:46] piotrj: has joined #RubyOnRails
[07:15:21] roxtrongo: has joined #RubyOnRails
[07:15:49] spkprav: jojo__: Welcome
[07:16:13] jojo__: i was not able to send any messages to this channel thanks worked now
[07:16:59] sandstrom: has joined #RubyOnRails
[07:17:27] jenrzzz: has joined #RubyOnRails
[07:23:03] habitullence: has joined #RubyOnRails
[07:24:16] CanTonic: has joined #RubyOnRails
[07:25:39] annlewis: has joined #RubyOnRails
[07:25:53] jojo_: has joined #RubyOnRails
[07:27:05] aganov: has joined #RubyOnRails
[07:27:40] arup_r: jojo__: ok
[07:28:04] piotrj: has joined #RubyOnRails
[07:32:15] tejasmanohar: has joined #RubyOnRails
[07:32:28] nandx64: has joined #RubyOnRails
[07:33:14] solars: has joined #RubyOnRails
[07:34:21] ELCALOR: hi! with the new mongodb 3.0 update i'm getting: Moped::Errors::AuthenticationFailure (The operation: #<Moped::Protocol::Commands::Authenticate
[07:34:32] ELCALOR: and: failed with error 18: "auth failed"
[07:34:40] ELCALOR: (i'm using heroku with mongoid 5.0)
[07:35:01] jenrzzz: has joined #RubyOnRails
[07:36:05] yardenbar: has joined #RubyOnRails
[07:36:07] CanTonic: has joined #RubyOnRails
[07:36:32] piotrj: has joined #RubyOnRails
[07:36:37] bronson: has joined #RubyOnRails
[07:37:52] jojo__: How can i check weather two files are identical or not
[07:38:37] rubyonra_: has joined #RubyOnRails
[07:38:48] aruntomar: has joined #RubyOnRails
[07:39:26] herbst: hash them if you dont need to know the diff
[07:39:52] herbst: thats actually exactly what we have md5 for
[07:40:16] pawnbox: has joined #RubyOnRails
[07:41:17] Radar: ELCALOR: Steps to reproduce in a new app plzkthx
[07:44:24] ahmgeek: has joined #RubyOnRails
[07:45:48] artto: has joined #RubyOnRails
[07:45:52] aruntomar: has joined #RubyOnRails
[07:47:16] CanTonic: has joined #RubyOnRails
[07:48:59] pawnbox: has joined #RubyOnRails
[07:50:10] drptbl: has joined #RubyOnRails
[07:51:47] jojo__: yeah md5 hash is good option thanks
[07:52:04] piotrj: has joined #RubyOnRails
[07:54:36] robbyoconnor: has joined #RubyOnRails
[07:58:24] charliesome: has joined #RubyOnRails
[07:58:27] mikecmpbll: has joined #RubyOnRails
[07:59:54] jsrn_: has joined #RubyOnRails
[08:03:22] drptbl: has joined #RubyOnRails
[08:03:48] defsdoor: has joined #RubyOnRails
[08:05:17] krisquigley: has joined #RubyOnRails
[08:07:29] CanTonic: has joined #RubyOnRails
[08:07:43] emilkarl: has joined #RubyOnRails
[08:08:39] tsujp: has joined #RubyOnRails
[08:08:51] aruntomar: has joined #RubyOnRails
[08:09:06] mcnesium: has left #RubyOnRails: ("Weechat part")
[08:09:17] emilkarl: If you got a has_one /belongs_to relationship and want to create a new has_one record when editing using ??? @user.build_user_profile
[08:09:30] emilkarl: it would not like it to create it if I do not save the @user record.
[08:09:47] emilkarl: UserProfile belongs_to -> user
[08:09:54] emilkarl: User has_one user_profil
[08:12:29] SteenJobs: has joined #RubyOnRails
[08:12:48] Palsson: has joined #RubyOnRails
[08:14:27] rhizome: sounds fine so far
[08:14:41] workmad3: has joined #RubyOnRails
[08:14:42] yfeldblum: has joined #RubyOnRails
[08:17:43] siaW: has joined #RubyOnRails
[08:23:09] sadaf2605: has joined #RubyOnRails
[08:24:46] aruntomar: has joined #RubyOnRails
[08:25:08] cih: has joined #RubyOnRails
[08:26:24] annlewis: has joined #RubyOnRails
[08:28:47] marr: has joined #RubyOnRails
[08:29:01] Cervajz: has joined #RubyOnRails
[08:31:22] Cervajz_: has joined #RubyOnRails
[08:33:00] Pupeno: has joined #RubyOnRails
[08:33:04] roxtrongo: has joined #RubyOnRails
[08:34:00] Balzrael: has joined #RubyOnRails
[08:36:49] jwang: has joined #RubyOnRails
[08:37:46] bronson: has joined #RubyOnRails
[08:38:47] blackmesa: has joined #RubyOnRails
[08:38:50] voker57: has joined #RubyOnRails
[08:39:43] arup_r: no body have any problems in their app now..it seems so..All working smoothly..
[08:39:51] Radar: why is the user profile separate from the user?
[08:39:53] Radar: emilkarl: ^
[08:40:03] Radar: I _still_ don't understand this thinking process
[08:40:21] skroon: has joined #RubyOnRails
[08:40:23] emilkarl: that was just an example
[08:40:43] helpa: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[08:41:20] sararegan: has joined #RubyOnRails
[08:42:20] Cervajz: has joined #RubyOnRails
[08:43:25] cih: has joined #RubyOnRails
[08:43:34] arup_r: When we use form_for @user . How rails detects the correct controller action ? How does it analyse it ?
[08:43:43] universa1: arup_r: url_for
[08:43:53] Radar: arup_r: http://ryanbigg.com/2012/03/polymorphic-routes/
[08:44:13] universa1: what radar said ;)
[08:44:38] arup_r: Radar: thanks
[08:44:51] workmad3: has joined #RubyOnRails
[08:44:56] Sheperson: has joined #RubyOnRails
[08:45:01] piotrj: has joined #RubyOnRails
[08:45:16] zlogan: has joined #RubyOnRails
[08:45:34] Sheperson: I am trying to use bower components in my Rails application
[08:46:13] arup_r: Radar: Your blog will give the OP lights. So I am going to link itt there http://stackoverflow.com/questions/32878902/no-implicit-conversion-of-symbol-into-integer-with-form-for
[08:46:13] sininen: has joined #RubyOnRails
[08:46:36] Sheperson: everything works fine, except that the bower components use some sprites, but Rails doesn???t find those sprites
[08:46:58] universa1: sheperson: how did you include the bower components?
[08:47:06] universa1: sheperson: did you have a look at rails-assets.org ?
[08:47:41] qejk: has joined #RubyOnRails
[08:48:02] Sheperson: universa1: I added vendor/assets/components to my asset load path
[08:48:15] Sheperson: and included the libraries in my js and css
[08:48:39] universa1: sheperson: you need to change the url(whatever) stuff in the css.
[08:50:27] subshad: has joined #RubyOnRails
[08:50:30] BaNzounet: Hey, is it possible with dragonfly, to store multi image in an array(in postgress)? Or the only way to have an object with multiple images is to have another class Image?
[08:50:57] sheperson_: has joined #RubyOnRails
[08:51:58] sheperson_: has joined #RubyOnRails
[08:52:07] rvanlieshout: sheperson_: !g bower-rails
[08:53:29] universa1: sheperson: you need to change the url(whatever) stuff in the css. rails generates different urls for the images, etc...
[08:53:53] universa1: sheperson: so static urls will not work, i'm not sure if bower-rails will solve that part.
[08:54:10] Sheperson: universa1: Yes, I can change the url(???) in css
[08:54:22] Sheperson: but what about when other team members try to install the bower components?
[08:54:42] universa1: sheperson: http://guides.rubyonrails.org/asset_pipeline.html#coding-links-to-assets
[08:55:21] universa1: sheperson: personally i'd have a look at bower-rails and rails-assets.org (they might solve your problem)
[08:55:38] arup_r: so.. Radar: as you wrote how it determines the url #{@post.class.downcase}_path(@post.to_param) ... That means if I do the update/create using a controller which doesn't match the name of the model class name it wouldn' work. Am I right ?
[08:55:42] Sheperson: thanks universa1
[08:56:01] Radar: arup_r: example?
[08:57:35] Macaveli_: has joined #RubyOnRails
[08:57:39] piotrj: has joined #RubyOnRails
[08:58:11] arBmind: has joined #RubyOnRails
[08:59:47] piotrj_: has joined #RubyOnRails
[09:02:00] Mia: has joined #RubyOnRails
[09:02:10] arup_r: here is the small gist. I am trying to get the idea: https://gist.github.com/aruprakshit/5d63962b00d1a22b82f2 How form_for @profile will find out the Profile controller ..
[09:02:46] tetraktys: has joined #RubyOnRails
[09:02:56] arup_r: @profile inspect will show User model..
[09:03:18] arup_r: because User is my model ,
[09:03:21] universa1: arup_r: have you run that?
[09:04:15] arup_r: long back. it didn't work.. so wrote all by hand,,
[09:04:24] rromanch_: has joined #RubyOnRails
[09:04:49] sininen: has joined #RubyOnRails
[09:05:04] mxrguspxrt: has joined #RubyOnRails
[09:05:33] arup_r: i have understanding gap I know.. that is why asking.
[09:06:14] Pupeno: has joined #RubyOnRails
[09:06:36] universa1: without the line being correct one: it comes down to something like it: https://github.com/rails/rails/blob/9c592fec4b0fe462e93b93dc01769813a0bdb931/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb#L283
[09:07:19] YahooAnswersFTW: has joined #RubyOnRails
[09:07:45] arup_r: My main question is: Should my model name and controller name has to be same to take the advantage of those automatic detection of urls ..?
[09:08:16] arup_r: Because the way it makes route ... hints me like I said..
[09:08:33] adre: has joined #RubyOnRails
[09:09:08] YahooAnswersFTW: Hi. Could someone give me some advice please? I've got a User model that has various discrete roles (Manager, Employee, Customer, etc) and I want to associate various profiles to this model, depending on the role. Should I use nested resources for that?
[09:09:12] FrankD: has joined #RubyOnRails
[09:09:15] arup_r: Well.. I have to follow the convetion.. otherwise need to write it by hand.. cool
[09:10:15] universa1: YahooAnswersFTW: those are two different questions: nested resources are frontend, where associations are backend (if I'm understanding what you're saying correctly)
[09:10:43] mikecmpb_: has joined #RubyOnRails
[09:11:45] habitullence: has joined #RubyOnRails
[09:14:28] baash05: has joined #RubyOnRails
[09:14:49] baash05: has joined #RubyOnRails
[09:15:25] YahooAnswersFTW: universal: I guess I'm also asking if it makes sense to have a whole bunch of associations between User and the various profiles, even if the various different Users aren't going to have more than one profile at a time.
[09:15:35] baash05: has joined #RubyOnRails
[09:15:41] blackmesa: has joined #RubyOnRails
[09:16:01] universa1: YahooAnswersFTW: why does the role than not belong to a profile?
[09:16:03] baash05: has joined #RubyOnRails
[09:16:33] baash05: has joined #RubyOnRails
[09:16:39] YahooAnswersFTW: universal: I'm using rolify. Each User model is given a role.
[09:16:51] YahooAnswersFTW: and sometimes a context
[09:17:08] baash05: has joined #RubyOnRails
[09:17:12] YahooAnswersFTW: Like 'I'm a manager of that Restaurant'
[09:17:22] CanTonic: has joined #RubyOnRails
[09:17:40] YahooAnswersFTW: I was going to create the User instance and then associate the relevant profile
[09:17:45] baash05: has joined #RubyOnRails
[09:18:05] YahooAnswersFTW: the profile being all the user-role specific stuff like for Employees it'd be qualifications, etc.
[09:18:36] YahooAnswersFTW: universal: that make sense?
[09:18:45] sararegan: has joined #RubyOnRails
[09:18:46] baash05: has joined #RubyOnRails
[09:19:16] baash05: has joined #RubyOnRails
[09:19:50] baash05: has joined #RubyOnRails
[09:19:51] YahooAnswersFTW: universal: if I delete the user, I need the relevant role-specific profile to die too.
[09:19:53] universa1: YahooAnswersFTW: sorry, not really following you. draw it out on paper and try it out. whatever feels best for you: go with it ;)
[09:20:16] YahooAnswersFTW: universal: well, ok...
[09:20:26] baash05: has joined #RubyOnRails
[09:20:35] toomus: has joined #RubyOnRails
[09:20:53] YahooAnswersFTW: universal: I guess I'm asking how to associate various different models to one model
[09:20:56] baash05: has joined #RubyOnRails
[09:21:11] YahooAnswersFTW: universal: when you're only going to use one of those 'different' ones
[09:21:31] baash05: has joined #RubyOnRails
[09:21:33] YahooAnswersFTW: universal: you'll end up with a few null's for the id I guess, in the models you don't use.
[09:21:50] YahooAnswersFTW: (the foreign keys)
[09:21:51] workmad3: has joined #RubyOnRails
[09:22:01] baash05: has joined #RubyOnRails
[09:22:07] universa1: there are also polymorphic associations.
[09:22:23] universa1: YahooAnswersFTW: !associations
[09:22:23] helpa: YahooAnswersFTW: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[09:22:34] baash05: has joined #RubyOnRails
[09:22:38] universa1: but they have some drawbacks you should be aware of, so read about them first ;)
[09:22:57] DoubleMalt: has joined #RubyOnRails
[09:23:06] baash05: has joined #RubyOnRails
[09:23:43] baash05: has joined #RubyOnRails
[09:23:46] nettoweb: has joined #RubyOnRails
[09:24:00] YahooAnswersFTW: universal: Yeah, I've been reading all that. It doesn't explain best-practice though.
[09:24:13] baash05: has joined #RubyOnRails
[09:24:44] baash05: has joined #RubyOnRails
[09:25:04] universa1: YahooAnswersFTW: there is no universal best practice
[09:25:19] baash05: has joined #RubyOnRails
[09:25:51] universa1: YahooAnswersFTW: try different solutions to your problem
[09:25:54] baash05: has joined #RubyOnRails
[09:26:01] YahooAnswersFTW: universal: Ok but surely this is a problem people come up against all the time, when they have to model a hierarchy of things.
[09:26:54] YahooAnswersFTW: universal: essentially the problem is various children of User will have different fields but they all need to be reference-able as children.
[09:26:55] baash05: has joined #RubyOnRails
[09:27:10] annlewis: has joined #RubyOnRails
[09:27:11] YahooAnswersFTW: I mean, I guess I could use STI.
[09:27:27] Ergo: has joined #RubyOnRails
[09:27:30] baash05: has joined #RubyOnRails
[09:27:57] YahooAnswersFTW: But that's not really what I need. A StaffProfile isn't a type-of Staff.
[09:28:23] sevenseacat: has joined #RubyOnRails
[09:28:23] YahooAnswersFTW: But that's not really what I need. A StaffProfile isn't a type-of User - I meant to say.
[09:28:35] nickenchuggets: has joined #RubyOnRails
[09:28:35] baash05: has joined #RubyOnRails
[09:29:05] baash05: has joined #RubyOnRails
[09:29:12] YahooAnswersFTW: Ok, let me ask this another, hopefully simpler way....
[09:29:30] YahooAnswersFTW: Is there a simple way to include parameters for other objects in a form?
[09:29:38] lxsameer: has joined #RubyOnRails
[09:29:40] baash05: has joined #RubyOnRails
[09:29:41] universa1: YahooAnswersFTW: nested model form
[09:29:55] YahooAnswersFTW: is that the same thing as nested resources?
[09:29:56] spkprav: has joined #RubyOnRails
[09:30:15] baash05: has joined #RubyOnRails
[09:30:45] baash05: has joined #RubyOnRails
[09:31:11] JayM: has joined #RubyOnRails
[09:31:17] baash05: has joined #RubyOnRails
[09:31:52] baash05: has joined #RubyOnRails
[09:31:57] YahooAnswersFTW: universal: ah, I think all I need is fields_for
[09:32:23] baash05: has joined #RubyOnRails
[09:32:54] baash05: has joined #RubyOnRails
[09:33:00] jas02: has joined #RubyOnRails
[09:33:28] baash05: has joined #RubyOnRails
[09:34:03] baash05: has joined #RubyOnRails
[09:34:33] baash05: has joined #RubyOnRails
[09:35:07] baash05: has joined #RubyOnRails
[09:35:37] baash05: has joined #RubyOnRails
[09:36:08] rubyonrails524: has joined #RubyOnRails
[09:36:12] baash05: has joined #RubyOnRails
[09:36:36] RegulationD: has joined #RubyOnRails
[09:36:41] bronson: has joined #RubyOnRails
[09:36:44] baash05: has joined #RubyOnRails
[09:37:14] baash05: has joined #RubyOnRails
[09:37:24] rubyonrails524: has left #RubyOnRails: ()
[09:37:34] rubyonrails524: has joined #RubyOnRails
[09:38:19] baash05: has joined #RubyOnRails
[09:38:52] baash05: has joined #RubyOnRails
[09:39:54] baash05: has joined #RubyOnRails
[09:40:29] baash05: has joined #RubyOnRails
[09:40:37] tvw: has joined #RubyOnRails
[09:41:02] baash05: has joined #RubyOnRails
[09:41:31] baash05: has joined #RubyOnRails
[09:42:06] baash05: has joined #RubyOnRails
[09:42:39] baash05: has joined #RubyOnRails
[09:42:51] toomus: I have column where I save serialized array
[09:43:23] baash05: has joined #RubyOnRails
[09:43:53] baash05: has joined #RubyOnRails
[09:44:22] baash05: has joined #RubyOnRails
[09:44:56] baash05: has joined #RubyOnRails
[09:45:00] toomus: but I can't create new record like this User.create(some_column: [1,2,3,4,5])
[09:45:26] baash05: has joined #RubyOnRails
[09:45:29] universa1: toomus: !code
[09:45:29] helpa: toomus: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[09:45:29] rvanlieshout: toomus: what db engine?
[09:45:59] baash05: has joined #RubyOnRails
[09:46:37] baash05: has joined #RubyOnRails
[09:47:12] baash05: has joined #RubyOnRails
[09:47:42] baash05: has joined #RubyOnRails
[09:47:43] iateadonut: has joined #RubyOnRails
[09:48:21] toomus: http://pastie.org/10453593
[09:48:22] baash05: has joined #RubyOnRails
[09:48:57] baash05: has joined #RubyOnRails
[09:49:12] quazimodo: has joined #RubyOnRails
[09:49:18] rvanlieshout: toomus: add the full model
[09:49:27] baash05: has joined #RubyOnRails
[09:49:44] tsujp: has joined #RubyOnRails
[09:49:57] baash05: has joined #RubyOnRails
[09:50:38] baash05: has joined #RubyOnRails
[09:51:10] baash05: has joined #RubyOnRails
[09:51:49] baash05: has joined #RubyOnRails
[09:51:59] universa1: and also define: doesn't work ;)
[09:52:24] baash05: has joined #RubyOnRails
[09:52:54] baash05: has joined #RubyOnRails
[09:52:57] habitullence: has joined #RubyOnRails
[09:53:24] baash05: has joined #RubyOnRails
[09:53:59] baash05: has joined #RubyOnRails
[09:54:34] baash05: has joined #RubyOnRails
[09:55:09] baash05: has joined #RubyOnRails
[09:55:43] baash05: has joined #RubyOnRails
[09:56:16] baash05: has joined #RubyOnRails
[09:56:51] baash05: has joined #RubyOnRails
[09:57:26] baash05: has joined #RubyOnRails
[09:57:52] Jameser: has joined #RubyOnRails
[09:57:56] baash05: has joined #RubyOnRails
[09:58:12] sininen: has joined #RubyOnRails
[09:58:31] baash05: has joined #RubyOnRails
[09:59:06] baash05: has joined #RubyOnRails
[09:59:38] baash05: has joined #RubyOnRails
[10:00:13] baash05: has joined #RubyOnRails
[10:00:50] baash05: has joined #RubyOnRails
[10:01:23] baash05: has joined #RubyOnRails
[10:02:28] Jameser: has joined #RubyOnRails
[10:02:29] piotrj: has joined #RubyOnRails
[10:03:04] baash05: has joined #RubyOnRails
[10:03:34] baash05: has joined #RubyOnRails
[10:04:12] baash05: has joined #RubyOnRails
[10:04:47] baash05: has joined #RubyOnRails
[10:05:25] baash05: has joined #RubyOnRails
[10:05:58] baash05: has joined #RubyOnRails
[10:06:26] Jameser`: has joined #RubyOnRails
[10:06:30] baash05: has joined #RubyOnRails
[10:07:07] baash05: has joined #RubyOnRails
[10:07:33] baash05: has joined #RubyOnRails
[10:08:12] baash05: has joined #RubyOnRails
[10:08:44] baash05: has joined #RubyOnRails
[10:09:19] baash05: has joined #RubyOnRails
[10:09:54] baash05: has joined #RubyOnRails
[10:10:29] baash05: has joined #RubyOnRails
[10:10:54] blackmesa: has joined #RubyOnRails
[10:10:59] baash05: has joined #RubyOnRails
[10:11:35] baash05: has joined #RubyOnRails
[10:12:07] baash05: has joined #RubyOnRails
[10:12:42] baash05: has joined #RubyOnRails
[10:13:18] baash05: has joined #RubyOnRails
[10:13:48] baash05: has joined #RubyOnRails
[10:14:26] blackhuey: has joined #RubyOnRails
[10:14:26] baash05: has joined #RubyOnRails
[10:14:59] baash05: has joined #RubyOnRails
[10:15:34] baash05: has joined #RubyOnRails
[10:16:06] baash05: has joined #RubyOnRails
[10:16:38] baash05: has joined #RubyOnRails
[10:17:13] baash05: has joined #RubyOnRails
[10:17:13] pjammer: has joined #RubyOnRails
[10:17:48] baash05: has joined #RubyOnRails
[10:17:52] rubyonrails524: has anyone used grape-jbuilder here before?
[10:18:09] raidiant: has joined #RubyOnRails
[10:18:19] helpa: Nope. No one. Ever. In the history of the world.
[10:18:23] baash05: has joined #RubyOnRails
[10:18:23] universa1: ahh wrong one
[10:18:28] universa1: rubyonrails524: !used
[10:18:28] helpa: rubyonrails524: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[10:18:57] baash05: has joined #RubyOnRails
[10:19:32] baash05: has joined #RubyOnRails
[10:20:07] baash05: has joined #RubyOnRails
[10:20:37] baash05: has joined #RubyOnRails
[10:20:52] frzn: has joined #RubyOnRails
[10:20:52] frzn: has joined #RubyOnRails
[10:21:12] baash05: has joined #RubyOnRails
[10:21:28] piotrj: has joined #RubyOnRails
[10:21:47] baash05: has joined #RubyOnRails
[10:21:56] eGGsha: has joined #RubyOnRails
[10:22:22] baash05: has joined #RubyOnRails
[10:22:57] baash05: has joined #RubyOnRails
[10:23:29] baash05: has joined #RubyOnRails
[10:24:04] baash05: has joined #RubyOnRails
[10:24:21] ruurd: has joined #RubyOnRails
[10:24:39] baash05: has joined #RubyOnRails
[10:25:09] baash05: has joined #RubyOnRails
[10:25:40] nettoweb: hello guys, Im getting a lot of errors like this: ActiveRecord::StatementInvalid: PG::Error: ERROR: value "516120849569" is out of range for type integer : SELECT "articles".* FROM "articles" WHERE "articles"."id" = $1 AND (deleted_at IS NULL) LIMIT 1
[10:25:44] baash05: has joined #RubyOnRails
[10:25:56] nettoweb: probably coming from some bot, like google or facebook
[10:26:14] baash05: has joined #RubyOnRails
[10:26:42] bruno-: has joined #RubyOnRails
[10:26:44] nettoweb: is there a way to fix these errors? it no make sense because I even dont have a hundred articles...this number is random possibly
[10:26:54] baash05: has joined #RubyOnRails
[10:27:27] baash05: has joined #RubyOnRails
[10:27:57] annlewis: has joined #RubyOnRails
[10:28:01] baash05: has joined #RubyOnRails
[10:28:36] baash05: has joined #RubyOnRails
[10:29:12] baash05: has joined #RubyOnRails
[10:29:41] baash05: has joined #RubyOnRails
[10:30:16] baash05: has joined #RubyOnRails
[10:30:37] artto: has joined #RubyOnRails
[10:30:51] baash05: has joined #RubyOnRails
[10:31:26] baash05: has joined #RubyOnRails
[10:31:59] baash05: has joined #RubyOnRails
[10:32:33] baash05: has joined #RubyOnRails
[10:33:09] baash05: has joined #RubyOnRails
[10:33:15] Flying_Squirrel: has joined #RubyOnRails
[10:33:43] baash05: has joined #RubyOnRails
[10:34:14] baash05: has joined #RubyOnRails
[10:34:38] jenrzzz: has joined #RubyOnRails
[10:34:51] nej: Would it make sense to have an ActiveJob that performs other ActiveJobs? E.g. a job called InvoiceAllJob that performs multiple instances of InvoiceJob?
[10:35:42] workmad3: nej: is queuing all those jobs really that time-consuming?
[10:36:04] linus4: has joined #RubyOnRails
[10:36:43] yaw: has joined #RubyOnRails
[10:36:45] nej: It???s not time-consuming to queue them, but I need to do it periodically. Current I???m using the `crono` gem which is like cron for ActiveJob.
[10:36:46] eGGsha: has joined #RubyOnRails
[10:36:56] mostlybadfly: has joined #RubyOnRails
[10:36:57] Radar: what workmad3 said
[10:37:34] workmad3: nej: so queue them in your crono callback (not sure how crono works... I tend to use clockwork for scheduling :) )
[10:37:39] bronson: has joined #RubyOnRails
[10:37:51] FailBit: nettoweb: do you have IP/referrer info for those requests?
[10:38:01] aruntomar_: has joined #RubyOnRails
[10:38:30] nettoweb: FailBit user_agent: facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)
[10:38:41] FailBit: you might want to check whether the IPs are in the dronebl
[10:39:41] nej: workmad3: Would it somehow be bad to do it in an ActiveJob? Just to keep things organized, seeing how closely related the queueing and ???child jobs??? are.
[10:40:26] Radar: nej: Depends on how many jobs are being enqueued, really.
[10:40:33] Radar: If there's quite a lot then, sure, have a job that enqueues the others
[10:40:42] Radar: but as workmad3 said, it should be relatively fast to enqueue them
[10:40:53] stoffus: has joined #RubyOnRails
[10:40:59] workmad3: nej: you could also consider adding a class method to your `InvoiceJob` method that contains that logic
[10:41:04] Radar: and especially since it's going to be happening in a non-request-thread environment... I don't think the time it takes to enqueue them is that big of a concern
[10:41:45] piotrj: has joined #RubyOnRails
[10:41:46] YahooAnswersFTW: universal: nailed it, I think. Thanks for your help.
[10:41:58] FailBit: I've never even heard of crono/clockwork
[10:42:12] workmad3: nej: then your crono task could be something like `InvoiceJob.perform_all_later` and you'd add a method `def self.perform_all_later(*options);` that queued all your invoices up and passes the options to the `perform_later` call
[10:42:15] FailBit: I just literally put a rails runner in my crontab
[10:42:37] dici: has joined #RubyOnRails
[10:42:39] nej: Radar: Right! That makes sense.
[10:43:37] workmad3: FailBit: heh :) my current company uses heroku a lot, and heroku scheduler sucks so they tend to use clockwork (which basically runs a scheduling loop for invoking periodic tasks)
[10:43:47] nej: workmad3: That sounds like a really good idea. That also solves the problem of coming up with good names for the two job classes, hehe.
[10:44:42] nej: Thanks! And I???ll definitely have to look into Clockwork.
[10:44:46] workmad3: nej: btw, the name `perform_all_later` is to keep your naming sort of consistent with the ActiveJob calls of `perform_later` and `perform_now`
[10:45:52] nej: workmad3: Yeah, and it reads nicely. Unfortunately crono requires to be given an object which responds to `#perform`, so I guess I???ll go for `InvoiceJob::Enqueuer` or something.
[10:46:25] jamey-uk: has joined #RubyOnRails
[10:47:28] nej: s/an object which responds to/a class which implements the instance method
[10:47:44] allcentury: has joined #RubyOnRails
[10:48:43] Blaze_Boy: has joined #RubyOnRails
[10:53:47] jamey-uk: has joined #RubyOnRails
[10:53:58] zlogan: has joined #RubyOnRails
[10:54:36] CanTonic: has joined #RubyOnRails
[10:55:32] stamina: has joined #RubyOnRails
[10:57:02] tetraktys: has joined #RubyOnRails
[10:58:55] chills42: has joined #RubyOnRails
[10:59:38] nettoweb: FailBit Its wasnt listed there but I dont know how this crawler try to access as article with a random number
[11:04:16] absklb: has joined #RubyOnRails
[11:04:26] absklb: i have a loop <%= @allmd.each do |cp| %>
[11:04:28] absklb: 50 <%= cp.workflow_state %>
[11:04:30] absklb: 51 <% end %>
[11:04:49] absklb: sorry, it asked me to paste and directly send output. i thought after pasting i will be able to edit.
[11:05:14] absklb: so is this loop it prints value of cp.workflow_state + the original @allmd object. how to stop that + part?
[11:06:34] workmad3: absklb: `<% @allmd.each` rather than `<%= @allmd.each`
[11:06:43] CanTonic: has joined #RubyOnRails
[11:06:49] workmad3: absklb: also in future, please gist anything > 1 line of code
[11:06:53] absklb: oh right!
[11:07:12] absklb: workmad3: sure.
[11:08:03] pjammer: has joined #RubyOnRails
[11:09:45] jkamenik: has joined #RubyOnRails
[11:11:38] blackmesa: has joined #RubyOnRails
[11:12:20] thejamespinto: has joined #RubyOnRails
[11:14:40] tsujp: has joined #RubyOnRails
[11:14:54] jamey-uk: has left #RubyOnRails: ()
[11:16:18] jkamenik: has joined #RubyOnRails
[11:16:34] arup_r: absklb: <% execute .. <%= execute and print
[11:16:59] arup_r: that is all about this ERb.. very tinny language .. but demanding
[11:17:57] ruurd: has joined #RubyOnRails
[11:19:09] elsurudo: has joined #RubyOnRails
[11:19:20] rodfersou: has joined #RubyOnRails
[11:19:52] norc_: has joined #RubyOnRails
[11:20:29] absklb: arup_r: yeah i know
[11:20:36] syath: has joined #RubyOnRails
[11:20:37] charliesome: has joined #RubyOnRails
[11:20:53] arup_r: absklb: sorry :(
[11:21:07] KinderSpiel: has joined #RubyOnRails
[11:21:17] nfk|laptop: has joined #RubyOnRails
[11:22:26] ericjphillips: has joined #RubyOnRails
[11:25:44] FailBit: that's all it is on the surface
[11:28:45] annlewis: has joined #RubyOnRails
[11:29:52] charliesome: has joined #RubyOnRails
[11:30:26] absklb: arup_r: it was a mistake. i did not intentionaly typed it. the reason why = was there because initially i only had <%= @allmd %> and printiing that only. then i just edited it and meanwhile in all these many iterations forgot to remove =
[11:32:10] Radar: arup_r: ah but what is <%- ?
[11:32:38] dionysus69: is it a good idea to assign 4 cores of host to guest VM and cap execution at like 70%?
[11:32:54] dionysus69: for a web server and I am planning to put nginx and puma on it
[11:32:55] arup_r: Radar: I need to read doc now. I forgot it.. probably some space stuff.. but not sure need to lookup
[11:33:14] Radar: dionysus69: my string is a different length to your string
[11:33:33] dionysus69: meaning ? :P Radar
[11:34:15] Radar: dionysus69: meditate on it please
[11:34:52] krisquigley: has joined #RubyOnRails
[11:35:33] frmendes: has joined #RubyOnRails
[11:35:37] dionysus69: haha I understand, my question was aiming at is providing 2 full cores to VM better or providing half of 4 cores, since there is multithreading going on
[11:37:28] ldnunes: has joined #RubyOnRails
[11:37:40] RegulationD: has joined #RubyOnRails
[11:37:55] wethu: has joined #RubyOnRails
[11:38:27] Pumukel: has joined #RubyOnRails
[11:38:35] bronson: has joined #RubyOnRails
[11:40:39] charliesome: has joined #RubyOnRails
[11:43:35] sdwrage: has joined #RubyOnRails
[11:45:54] jalnt: has joined #RubyOnRails
[11:46:46] charliesome: has joined #RubyOnRails
[11:48:01] IceyEC: has joined #RubyOnRails
[11:48:50] Jameser`: has joined #RubyOnRails
[11:50:50] cih: has joined #RubyOnRails
[11:51:59] pjammer: has joined #RubyOnRails
[11:52:24] sankaber: has joined #RubyOnRails
[11:55:54] monoprotic: has joined #RubyOnRails
[11:58:45] zlogan: has joined #RubyOnRails
[12:02:51] Janno: has joined #RubyOnRails
[12:04:02] tagrudev: has joined #RubyOnRails
[12:05:08] krisquigley: has joined #RubyOnRails
[12:06:33] quazimodo: has joined #RubyOnRails
[12:09:02] DLSteve: has joined #RubyOnRails
[12:09:14] AlHafoudh: has joined #RubyOnRails
[12:09:38] mrmylanman: has joined #RubyOnRails
[12:09:51] linus4: has joined #RubyOnRails
[12:12:16] DoubleMalt: has joined #RubyOnRails
[12:13:38] blackmesa: has joined #RubyOnRails
[12:17:54] spkprav: has joined #RubyOnRails
[12:18:13] frmendes: has joined #RubyOnRails
[12:21:47] krisquigley: has joined #RubyOnRails
[12:22:41] stamina: has joined #RubyOnRails
[12:24:16] frzng: has joined #RubyOnRails
[12:29:04] aruntomar: has joined #RubyOnRails
[12:29:39] arBmind: has joined #RubyOnRails
[12:29:49] annlewis: has joined #RubyOnRails
[12:31:36] atomical: has joined #RubyOnRails
[12:37:08] roxtrongo: has joined #RubyOnRails
[12:38:10] jtb__: has joined #RubyOnRails
[12:38:34] sararegan: has joined #RubyOnRails
[12:39:22] bronson: has joined #RubyOnRails
[12:41:10] jhn: has joined #RubyOnRails
[12:44:39] pcpanic: has joined #RubyOnRails
[12:46:20] aaronr: has joined #RubyOnRails
[12:47:29] jtb___: has joined #RubyOnRails
[12:50:49] mrbubbles: has joined #RubyOnRails
[12:51:33] mrbubbles: if I???m using active record I know I can use Person.maximum(:age) to get the maximum value for an age column
[12:52:06] mrbubbles: but is it possible to grab a timestamp based on that column? So Country.maximum(:temperature) and then get the value of the timestamp column where that maximum value occured?
[12:52:25] Jameser`: has joined #RubyOnRails
[12:55:14] dstarh: has joined #RubyOnRails
[12:56:09] Silex: I'm making an app that requires dynamic ACLs (stored in the db). I have no problem saying stuffs like "this user has access to this resource", but I have trouble making _editable_ roles with rules like "users with this role are able to view records where :foo == bar"
[12:56:35] Silex: What is the simplest way to edit/store conditions?
[12:57:13] Silex: e.g even storing the simple "Users of role 'user' are allowed to edit their own entry" is complicated
[12:57:27] zomgbie: has joined #RubyOnRails
[12:57:37] ramortegui: has joined #RubyOnRails
[12:57:43] Blaze_Boy: Silex: i think you can add a relation with each permission to a separate model which should execute the logic you need
[12:58:37] Silex: Blaze_Boy: so, not really fully editable permissions but offer a set of the most common requirements?
[12:59:52] Silex: e.g: Permission.create(controller: :user, action: :edit_self) ?
[13:00:24] roxtrongo: has joined #RubyOnRails
[13:00:25] Detch: has joined #RubyOnRails
[13:00:54] Silex: I was originally thinking of Permission.create(controller: :user, action: :edit, conditions: { id: current_user.id })
[13:01:10] Silex: and eval the conditions when checking permissions, but that sounds a bit nasty
[13:01:20] Blaze_Boy: i can't tell you exact implementation as it depends, but i think you'll just need away to attach a separate class to each permission that will handle the separate logic
[13:01:27] nya: has joined #RubyOnRails
[13:01:48] Silex: Blaze_Boy: yes but that logic would be static
[13:01:49] Blaze_Boy: and each one of these permission classes should have an editing form of its own to get params and save then serialized to a column in DB
[13:01:59] Silex: e.g not editable through the admin interface
[13:02:28] universa1: mrbubbles: Country.order(temperate: :asc).limit(1).pluck(:timestamp)
[13:02:37] universa1: mrbubbles: or alike ;)
[13:02:44] Silex: maybe I'd just give up on such granularity
[13:03:05] mrbubbles: thanks universa1 I had somethign liek that first but thought there might be an easier way :)
[13:03:09] Silex: and have immutable rules like "you can edit what you created"
[13:04:18] Silex: anyway, thanks
[13:05:08] charliesome: has joined #RubyOnRails
[13:05:15] kzsh: has joined #RubyOnRails
[13:08:10] dmz: morning y'all, hey i have a has_many through lookup table i'm generating from a model with the has_many items as checkbox items to select. I am trying to validate that the IDs send with the submission actually exist in the nested model. does anyone have any suggestoins?
[13:08:40] quazimodo: has joined #RubyOnRails
[13:08:42] n1lo: has joined #RubyOnRails
[13:08:55] cmoel: has joined #RubyOnRails
[13:09:08] dmz: for example if i post the create and include in the ids list an ID that doesn't exist i get a RecordNotFound error; i want to just make that a standard valdidatoin
[13:09:32] Flying_Squirrel: has joined #RubyOnRails
[13:10:05] ramortegui: has joined #RubyOnRails
[13:10:13] SeanLazer: has joined #RubyOnRails
[13:11:59] stannard: has joined #RubyOnRails
[13:12:15] dhjondoh: has joined #RubyOnRails
[13:13:20] mrbubbles: has joined #RubyOnRails
[13:14:50] blackmesa: has joined #RubyOnRails
[13:15:32] moeabdol: has joined #RubyOnRails
[13:15:59] Creeves: has joined #RubyOnRails
[13:16:12] Miron_: has joined #RubyOnRails
[13:16:38] CanTonic: has joined #RubyOnRails
[13:17:08] chills42: has joined #RubyOnRails
[13:17:30] Macaveli: has joined #RubyOnRails
[13:17:46] kenpoint: has joined #RubyOnRails
[13:20:13] kaduribeiro: has joined #RubyOnRails
[13:21:39] habitullence: has joined #RubyOnRails
[13:21:53] symbole: has joined #RubyOnRails
[13:22:28] Palsson: has joined #RubyOnRails
[13:22:38] habitullence: has joined #RubyOnRails
[13:25:15] yardenbar: has joined #RubyOnRails
[13:25:21] allcentury: has joined #RubyOnRails
[13:25:27] coderkatze: has joined #RubyOnRails
[13:29:43] zomgbie: has joined #RubyOnRails
[13:29:55] devdazed: has joined #RubyOnRails
[13:30:16] annlewis: has joined #RubyOnRails
[13:32:13] CanTonic: has joined #RubyOnRails
[13:33:09] piotrj: has joined #RubyOnRails
[13:34:19] jgpawletko: has joined #RubyOnRails
[13:35:31] Fire-Dragon-DoL: has joined #RubyOnRails
[13:36:05] habitullence: has joined #RubyOnRails
[13:37:35] bejar37: has joined #RubyOnRails
[13:38:28] RegulationD: has joined #RubyOnRails
[13:38:40] centipedefarmer: has joined #RubyOnRails
[13:39:50] moeabdol: has joined #RubyOnRails
[13:40:14] bronson: has joined #RubyOnRails
[13:42:13] dopie: has joined #RubyOnRails
[13:43:10] nopaj: has joined #RubyOnRails
[13:46:11] greengriminal: has joined #RubyOnRails
[13:46:12] dmz: I just ended up creating my own validate function :)
[13:46:32] chrissonar: Do you test, if there is an association like has_many set in a model?
[13:48:21] ngscheur1: has joined #RubyOnRails
[13:50:25] chills42: has joined #RubyOnRails
[13:50:55] sadaf2606: has joined #RubyOnRails
[13:51:46] some_coder: has joined #RubyOnRails
[13:51:49] CanTonic: has joined #RubyOnRails
[13:52:13] KinderSpiel: has joined #RubyOnRails
[13:52:39] zomgbie: has joined #RubyOnRails
[13:54:46] victortyau: has joined #RubyOnRails
[13:54:58] habitullence: has joined #RubyOnRails
[13:56:37] sheepman: has joined #RubyOnRails
[13:57:31] bronson: has joined #RubyOnRails
[14:00:13] goldbug: has joined #RubyOnRails
[14:00:46] chouhoulis: has joined #RubyOnRails
[14:02:20] habitullence: has joined #RubyOnRails
[14:02:57] charliesome: has joined #RubyOnRails
[14:04:05] sheepman: I have a controller that receives webhook callbacks to notify me when a payment has been received, I want to use a websocket to notify the client as soon as I receive the webhook but im not sure how that can work as its two separate controllers without one polling the other or polling the DB?
[14:04:11] sheepman: hopefully that makes some sense :/
[14:05:20] simplyianm: has joined #RubyOnRails
[14:05:50] siaW: has joined #RubyOnRails
[14:06:58] Cervajz_: has joined #RubyOnRails
[14:08:10] charliesome: has joined #RubyOnRails
[14:08:33] pwnd_nsfw: has joined #RubyOnRails
[14:10:51] stardiviner: has joined #RubyOnRails
[14:11:35] dopamean_: has joined #RubyOnRails
[14:13:16] qejk: has joined #RubyOnRails
[14:13:25] nickjj: sheepman, in the payment webhook why can't you just broadcast the notification then?
[14:13:55] kzsh: has joined #RubyOnRails
[14:13:57] sheepman: nickjj: i think im just getting a bit confused tbh, then i would have to setup the ws inside that controller no?
[14:14:02] nickjj: i don't know how you're working with websockets but in my case, i have things setup where i just call a method with a channel name and msg
[14:14:27] rubyonrailed: has joined #RubyOnRails
[14:14:27] nickjj: so it would be a Broadcast.message('/someuser', 'hey dude, it worked')
[14:15:16] nickjj: i would imagine that line being dropped into the controller of your payment webhook
[14:15:22] sheepman: im new to websockets so i think im getting a bit confused, if i have multiple users subscribed to the same channel they will all see the payment right?
[14:15:41] artto: has joined #RubyOnRails
[14:16:00] nickjj: yes, you would need to do additional filtering to make sure they only see their own
[14:16:48] sheepman: so then how would i address a single user of the channel if that makes sense?
[14:16:49] HalcyonicStorm: has joined #RubyOnRails
[14:17:02] CanTonic: has joined #RubyOnRails
[14:17:02] sheepman: i know you can make them private but im not sure if that helps me?
[14:18:01] nickjj: what are you using for your WS implementation?
[14:18:31] sheepman: i was intending to use websocket-rails gem
[14:18:39] sheepman: or is there something else i should look at?
[14:19:03] sheepman: p.s thanks for your help so far
[14:19:14] centrx: has joined #RubyOnRails
[14:19:15] nickjj: personally i would run the websocket server in a different process from your web server, and use faye
[14:19:31] sheepman: ok i'll do some research
[14:19:51] nickjj: then your rails process just needs to send an http request to your websocket server to send data to it
[14:20:01] baash05: is there a way to use delegate if the object might not be there.
[14:20:18] sheepman: nickjj: ah i see
[14:20:21] sheepman: that makes sense
[14:20:48] sheepman: i guess i could do the same thing inside of rails in a separate controller though?
[14:20:50] baash05: like delegate :name, to: user, if: :user o
[14:20:51] nickjj: there's a railscast video that explains some of it
[14:21:36] goldbug: Trying to ensure an object (person_periods) can only be created if another object (person, linked via a has_many / belongs_to association) has a particular attribute (is_composer = true). My thinking: 'validates :person, is_composer => true'. Is this correct?
[14:21:52] nickjj: yeah, and then you could make a request to that controller but that also couples your WS server to your rails app
[14:22:23] sheepman: i know what needs to happen now so thanks nickjj :)
[14:24:08] lurkmaster: has joined #RubyOnRails
[14:27:23] zomgbie: has joined #RubyOnRails
[14:27:30] umgrosscol: has joined #RubyOnRails
[14:28:05] iateadonut: has joined #RubyOnRails
[14:28:57] chills42: has joined #RubyOnRails
[14:31:03] annlewis: has joined #RubyOnRails
[14:32:09] sarink: has joined #RubyOnRails
[14:33:58] FCser: has joined #RubyOnRails
[14:34:40] Jon30: has joined #RubyOnRails
[14:35:16] constantinexvi: has joined #RubyOnRails
[14:36:18] IFrank00: has joined #RubyOnRails
[14:36:24] n008f4g_: has joined #RubyOnRails
[14:37:36] CanTonic: has joined #RubyOnRails
[14:37:42] pawnbox: has joined #RubyOnRails
[14:38:05] nickenchuggets_: has joined #RubyOnRails
[14:39:17] brazenbraden: has joined #RubyOnRails
[14:41:25] otacon-: has joined #RubyOnRails
[14:42:09] arup_r: has joined #RubyOnRails
[14:42:56] arup_r: has joined #RubyOnRails
[14:43:03] brazenbraden: que pasa? trying to do bundle install and getting Gem::Ext::BuildError: ERROR: Failed to build gem native extension. "make failed, exit code 2". why? i have make, gcc, g++, build-essentials, make, ruby-dev, all installed. (using ruby 2.2.3 via rvm)
[14:44:03] ruurd: has joined #RubyOnRails
[14:44:34] FailBit: you'll need to gist your build log
[14:44:41] FailBit: wherever that may reside on your system
[14:44:50] KinderSpiel: has left #RubyOnRails: ()
[14:45:05] KinderSpiel: has joined #RubyOnRails
[14:45:15] piotrj: has joined #RubyOnRails
[14:45:16] zomgbie: has joined #RubyOnRails
[14:45:23] nickenchuggets: has joined #RubyOnRails
[14:45:36] brazenbraden: https://gist.github.com/brazenbraden/31371b65d535b546e023
[14:46:19] brazenbraden: ive tried re-installing ruby 2.2.3 as well
[14:46:43] mwlang: has joined #RubyOnRails
[14:47:23] IFrank00: Hello Good day, Im working on a Todo Task with recurrence events, where each task its creating a recurrent taks call task_trans. Im using Ice_cube to generate the recurrences dates. Now im looking for a way to have a "schedule TASK" to run every month to generate the new recurrence form that month from the "parent" task
[14:48:20] IFrank00: new recurrence from that month*
[14:49:32] IFrank00: any guide, tools, gem or code that can help me get that working
[14:50:00] brazenbraden: IFrank00, not a job for cron?
[14:50:08] FailBit: BrazenBraden: it's failing because you don't have openmp
[14:50:13] FailBit: what's your build system
[14:50:28] brazenbraden: FailBit, wtf is openmp lol
[14:50:32] FailBit: hmm, that should definitely have it
[14:50:38] havenwood: has joined #RubyOnRails
[14:50:57] FailBit: compiler based multithread support
[14:51:12] idd2d: has joined #RubyOnRails
[14:51:24] IFrank00: BrazenBraden, I was looking at cron jobs with the whenever gem but was not clear of the use has I haven use it before
[14:51:41] brazenbraden: i see. which of those should i try apt-get? openmp = no package
[14:52:27] FailBit: it's part of gcc
[14:52:35] FailBit: you shouldn't need to install it separately
[14:52:38] apg: has joined #RubyOnRails
[14:53:14] brazenbraden: FailBit, i see
[14:53:18] brazenbraden: IFrank00, tis easy
[14:53:29] brazenbraden: gem 'whenever'.
[14:53:55] IFrank00: BrazenBraden, yes it looks very easy to use
[14:54:01] brazenbraden: run the installer. use ruby code to specify the job. then run "wheneverize" (or something) from term
[14:54:37] brazenbraden: so FailBit, format and re-install? XD
[14:55:58] RegulationD: has joined #RubyOnRails
[14:56:21] apg: has joined #RubyOnRails
[14:57:42] IFrank00: BrazenBraden, The other part that im a little stuck is using the Ice_cube gem. I get the dates that I need for the recurrence now I dont now if I need to store the dates in a hash in a column in the task "Table" or create another "Table" lets call it "Event" to store the dates generate by the Ice_cube gem for that Task
[14:58:12] brazenbraden: IFrank00, no clue about ice_cube but it sounds cold to me
[14:58:27] mary5030: has joined #RubyOnRails
[14:58:34] brazenbraden: ACTION is slowly loosing his sanity
[14:58:53] IFrank00: BrazenBraden, LOL
[14:59:41] mary5030: has joined #RubyOnRails
[14:59:53] voker57: has joined #RubyOnRails
[14:59:54] brazenbraden: everything is failing on me. i cant bundle install, i cant bring up docker containers, i cant do ackall
[15:00:31] simkessy: If I want to create a table to store taxes for different provinces (Canada), am I still looking at generate a model? Like 'Tax' model?
[15:00:57] brazenbraden: simkessy, indeed
[15:00:57] coderkatze: has left #RubyOnRails: ()
[15:01:00] pawnbox_: has joined #RubyOnRails
[15:01:24] simkessy: BrazenBraden: thanks
[15:04:37] corioliss: has joined #RubyOnRails
[15:04:39] h7br1x: has joined #RubyOnRails
[15:04:48] Jameser`: has joined #RubyOnRails
[15:05:04] hashrocket: has joined #RubyOnRails
[15:05:11] IFrank00: BrazenBraden, thanks ill be looking at cron jobs
[15:05:17] Encapsulation: has joined #RubyOnRails
[15:06:13] h7br1x: My app has RSS Feeds for iTunes Podcasts. I would like to track how many people are subscribing or downloading the podcast. Is there a rails way to do this instead of using FeedBurner?
[15:06:14] skullz: has joined #RubyOnRails
[15:06:54] skullz: Hello, how to add an 'or' condition to Arel's join?
[15:08:00] baash05: areltable(:id).eq(1).or( areltable(:id).eq(2) )
[15:08:15] baash05: the brackets wrap the second or
[15:08:40] baash05: the second areltable query
[15:09:36] skullz: "undefined method `or' for #<Arel::SelectManager"
[15:09:52] eggie5: has joined #RubyOnRails
[15:10:34] skullz: Sorry, I placed it outside "on"
[15:10:38] skullz: Now it's working! thanks
[15:11:16] baash05: all good that one has me looking it up each time I use it.
[15:11:22] baash05: Perhaps no longer.
[15:12:09] arup_r: has joined #RubyOnRails
[15:12:38] artto: has joined #RubyOnRails
[15:12:55] chrislotix: has joined #RubyOnRails
[15:13:46] eggie5: is there a way to cache (in memory for the request) any calls to memcached?
[15:14:15] eggie5: cache the memcached call in a request
[15:14:36] eggie5: to avoid latency cost do to duplicate memcached reqeusts
[15:15:59] HalcyonicStorm: has left #RubyOnRails: ()
[15:16:01] brazenbraden: ok different question.. "rvm install 2.2.3" (installs as expected). then "rvm use --default 2.2.3" sets 2.2.3 as default and this is shown when doing "rvm list" ( =* 2.2.3) BUT when i open a new term, current is back on 2.2.2 with default on 2.2.3. por que?
[15:17:10] FailBit: eggie5: I like multi_fetch_fragments but the short answer is not really
[15:17:33] hydrozen: has joined #RubyOnRails
[15:17:35] bronson: has joined #RubyOnRails
[15:18:20] kzsh: has left #RubyOnRails: ("Leaving...")
[15:18:35] eggie5: @FailBit: yes, that gem is awesome for rendering a collection of partials. But in this case i'm building the CSV w/ the CSV module so I can't use the gem
[15:19:02] eggie5: FailBit: but I want that same idea, I know all the keys before hand, load them all at once and use it to gen. the CSV
[15:19:20] maxx88: has left #RubyOnRails: ()
[15:20:07] eggie5: Maybe there's a way to memoize dalii cachce calls, to save them in memory (just for the current request)
[15:20:37] FailBit: you could patch dalli to try to fetch from a hash
[15:20:46] arup_r: Does my calculation has any bug ? I am checking sent date and current date diff is 24 hours or not? User.last.reset_password_sent_at.utc + 24.hours == DateTime.current.utc
[15:20:52] arup_r: I think it is not buggy
[15:22:27] eggie5: FailBit: or maybe I can try to use a partial collection to build the CSV instead of the CSV module and then multi_fetch_fragments will cache the partials
[15:23:00] eggie5: FailBit: I'm note sure that CSV module is giving me a lot of helpers to generate the CSV. I think it just adds in the ","s
[15:23:37] disgrntld: has joined #RubyOnRails
[15:25:53] frzn: has joined #RubyOnRails
[15:25:53] frzn: has joined #RubyOnRails
[15:25:57] jeadre: has joined #RubyOnRails
[15:28:51] EminenceHC: has joined #RubyOnRails
[15:29:44] mxrguspxrt: If post assocations: [], then Rails treats it has the key was not set, but expected behaviour would be to destroy assocations. Any ideas?
[15:29:47] CanTonic: has joined #RubyOnRails
[15:31:01] podman: has joined #RubyOnRails
[15:31:49] annlewis: has joined #RubyOnRails
[15:33:57] goldbug: I'm trying to ensure ObjectB can only be created if it belongs to ObjectA, which has a particular attribute set to true. Is this the correct way to do it (in ObjectB.rb)?: 'validates :objectA_attribute, presence: true'
[15:35:03] eGGsha: has joined #RubyOnRails
[15:35:04] sandstrom: has joined #RubyOnRails
[15:35:10] Cervajz: has joined #RubyOnRails
[15:36:36] eggie5: I need to prefetch a collection of keys in memcached
[15:37:20] lasker85: has joined #RubyOnRails
[15:43:29] bronson: has joined #RubyOnRails
[15:43:41] TheShaun: has joined #RubyOnRails
[15:44:15] paulcsmith: has joined #RubyOnRails
[15:44:55] CanTonic: has joined #RubyOnRails
[15:46:33] EminenceHC: has joined #RubyOnRails
[15:48:26] lasker85: Does anybody know how to write a <select> view that has both a greater than and a less than in a single <option> ?
[15:48:30] farkerhaiku: has joined #RubyOnRails
[15:48:47] lasker85: So for example, if I'm trying to select for price... <%= f.select(:price_lteq, [['Less than $70', '70'], ['Less than $40', '40'], ['Less than $25', '25']], {:selected => :price_lteq}, { }) %>
[15:49:04] lasker85: Let's say I want to make one of the options between a price of $40 and $70.
[15:49:30] treehug88: has joined #RubyOnRails
[15:49:50] lurkmaster: has joined #RubyOnRails
[15:50:47] lurkmaster: whenever i type a blank line in a form in my new view, the blank line doesn't show up when displaying the data in my index view. however it is visible in the form again when i try to edit the data. is this a css problem or a rails issue?
[15:51:13] lurkmaster: not sure how to preserve this whitespace
[15:52:53] farkerhaiku: i'm having problems with rails and scaling in an api. i originally moved from unicorn to passenger because I thought the problem was the size of the responses (400k json responses are fairly common) and I thought unicorn was being tied up until the response was fully written. it turns out it almost has to be something else. i've implemented russian doll caching and store all my json in redis.
[15:53:54] farkerhaiku: tailing my logs shows that the cache lookup and first response takes 120ms~ but if i spam refresh the requests start taking up a lot of time even getting the json responses from cache. like, 5+ seconds after I refresh 20-30 times
[15:55:02] farkerhaiku: I'm running out of ideas as far as how to diagnose the problem, so uh... any thoughts on things I can check? I've followed the passenger nginx optimization guide and am using their formula to figure out how many passenger processes to use
[15:56:08] farkerhaiku: redis-benchmark shows i should be able to support like 40k writes per second, and the ec2 instance is a pretty beefy machine with 8 gb of ram
[15:58:12] EminenceHC: has joined #RubyOnRails
[15:58:55] shinnya: has joined #RubyOnRails
[15:59:28] cornerma1: has joined #RubyOnRails
[15:59:51] lurkmaster: has joined #RubyOnRails
[15:59:53] Guest2530: has joined #RubyOnRails
[16:00:46] diegoviola: has joined #RubyOnRails
[16:00:51] chills42: has joined #RubyOnRails
[16:01:30] yardenbar: has joined #RubyOnRails
[16:03:07] riotjones: has joined #RubyOnRails
[16:03:09] Guest2530: has left #RubyOnRails: ()
[16:03:25] meoblast001: has joined #RubyOnRails
[16:04:31] Guest847: has joined #RubyOnRails
[16:04:41] Guest847: has left #RubyOnRails: ()
[16:05:14] lurkmaster: has joined #RubyOnRails
[16:05:40] towski_: has joined #RubyOnRails
[16:05:40] FailBit: farkerhaiku: try using memcache for big fragments
[16:05:41] arup_r: lasker85: options_for_select
[16:06:04] FailBit: I've noticed that memcache tends to outperform redis by a lot
[16:06:26] ruurd: has joined #RubyOnRails
[16:06:26] simkessy: Hey I've been using bigdecimal type for storing prices, would you guys recommend using the money gem?
[16:07:13] yardenbar: has joined #RubyOnRails
[16:09:16] mikebonar: has joined #RubyOnRails
[16:09:32] bricker: has joined #RubyOnRails
[16:09:50] smathy: has joined #RubyOnRails
[16:11:33] KinderSpiel: has joined #RubyOnRails
[16:12:17] KinderSpiel: has left #RubyOnRails: ()
[16:13:20] mikebonar: has left #RubyOnRails: ()
[16:13:44] lasker85: arup_r. Are you sure that's correct? I'm trying to use the select to do two thing at once (greater than and less than).
[16:14:32] arup_r: You want to show values right ?
[16:14:43] arup_r: select tag has only options to show stuff..
[16:14:49] arup_r: what more you want to display
[16:14:51] sonofdirt: has joined #RubyOnRails
[16:14:53] apg_: has joined #RubyOnRails
[16:15:00] lasker85: Basically I have a model which contains prices.
[16:15:11] piotrj: has joined #RubyOnRails
[16:15:13] mwlang: if you inherited a controller action that???s a catch-all and over 12k LoC???s, how would you begin to unravel that?
[16:15:17] lasker85: I want to create a drop-down select in which one of the options is, prices $80-$100, another option is $60-$80, another $40-$60
[16:15:27] Uranio-235: has joined #RubyOnRails
[16:15:36] ruurd_: has joined #RubyOnRails
[16:15:37] lasker85: I have the ransack gem installed which has the _gteq and _lteq attributes
[16:15:58] srinidhi: has joined #RubyOnRails
[16:16:19] SteenJobs: has joined #RubyOnRails
[16:18:21] apg: has joined #RubyOnRails
[16:18:43] The_Phoenix: has joined #RubyOnRails
[16:18:47] apg: has joined #RubyOnRails
[16:18:47] The_Phoenix: has joined #RubyOnRails
[16:18:53] Anubix: has joined #RubyOnRails
[16:20:23] Anubix: How can i change routes from www.website.com/category/id to www.website.com/category_id ?
[16:20:53] Uranio-235: has left #RubyOnRails: ()
[16:21:47] mwlang: I somehow want to start getting some tests around the code and then start picking it apart ??? that much I know, but I don???t think I want to do the usual controller test structure.
[16:21:55] CanTonic: has joined #RubyOnRails
[16:22:26] sonofdirt: has joined #RubyOnRails
[16:22:36] mwlang: seems better if I can extract the whole thing into a module that???s included into the controller then unit test the module more like models are tested.
[16:22:58] mwlang: the only problem is all the embedded render returns.
[16:24:18] ramortegui_: has joined #RubyOnRails
[16:27:32] tenderlove: has joined #RubyOnRails
[16:28:18] Maletor: has joined #RubyOnRails
[16:29:57] zpe: has joined #RubyOnRails
[16:31:04] michael_mbp: has joined #RubyOnRails
[16:31:07] tubbo: Anubix: you can make a vanity route
[16:31:16] tubbo: Anubix: like get '/:category_id' => 'categories#show'
[16:31:23] tubbo: well, i guess it would have to just be :id..
[16:32:17] lasker85: has joined #RubyOnRails
[16:32:27] baegle: Newbie here. Been reading doc and google for 2 hours. I can't understand why setting config.relative_url_root works in config/application.rb but not in an initializer. Can anyone help me figure out what I'm doing wrong? https://gist.github.com/Beagle/2725a9028a8289df473f
[16:32:34] tbuehlmann: (or using `resources` with path == '')
[16:32:35] annlewis: has joined #RubyOnRails
[16:32:54] herbst: has joined #RubyOnRails
[16:33:30] tubbo: tbuehlmann: ooh, didn't know that..
[16:34:23] mdel: has joined #RubyOnRails
[16:34:49] zlogan: has joined #RubyOnRails
[16:37:02] smathy: baegle, initializers are run after the app is loaded, so too late to configure core settings like that.
[16:37:21] FelipeBHZ: has joined #RubyOnRails
[16:37:47] baegle: smathy: oh! Good to know. Isn't there a way to determine when an initializer gets run? I read something about event hooks in my reading.
[16:38:08] riotjones: has joined #RubyOnRails
[16:38:15] smathy: baegle, if you want to fully understand it then there's a very detailed reading here http://guides.rubyonrails.org/initialization.html or more "do this" instructions here: http://guides.rubyonrails.org/configuring.html
[16:38:39] pwnd_nsfw: has joined #RubyOnRails
[16:40:13] bruno-: has joined #RubyOnRails
[16:40:32] petricore: has joined #RubyOnRails
[16:40:56] trautwein: has joined #RubyOnRails
[16:41:30] baegle: smathy: based on the intialization sequence, it doesn't look there's anyway to deal with it because run_initializers isn't called until after the application server is started
[16:41:45] jsantana: has joined #RubyOnRails
[16:44:02] CanTonic: has joined #RubyOnRails
[16:44:19] skroon: has joined #RubyOnRails
[16:44:35] FelipeBHZ: has left #RubyOnRails: ("I")
[16:45:00] pawnbox: has joined #RubyOnRails
[16:46:58] diegoviola: has joined #RubyOnRails
[16:52:43] EminenceHC: has joined #RubyOnRails
[16:52:44] sininen: has joined #RubyOnRails
[16:53:26] smathy: baegle, not sure what "it" is - but yes, you have to have that sort of setting in application.rb (or the environments configs)
[16:53:52] wldcordeiro: has joined #RubyOnRails
[16:55:08] apg: has joined #RubyOnRails
[16:55:08] apg: has joined #RubyOnRails
[16:55:11] goldbug: Gonna try this question out again. I have a Person object, and a Period object. A Person can have a Period, but only if Person.is_composer = true. When I assign a Period using person1.periods << Period.find_by(name: 'Baroque'), what sort of validation should I be performing and where to ensure that person1 is a composer?
[16:55:16] baegle: smathy: is there a simple rule for which settings won't work in initializers? Are other members of application.config changeable in initializers?
[16:56:08] goldbug: From a DB perspective, Person and Period have a many-to-many relationship, so there is an intermediate person_period model which is where I'd have thought the validation would go.
[16:57:19] kidoz: has joined #RubyOnRails
[16:57:22] TomyLobo: has joined #RubyOnRails
[16:57:32] bronson: has joined #RubyOnRails
[16:58:20] chills42: has joined #RubyOnRails
[16:58:54] goldbug: There must be a way to validate a related object's attributes?
[16:59:34] krisquigley: has joined #RubyOnRails
[17:00:54] stannard: has joined #RubyOnRails
[17:01:10] _djbkd: has joined #RubyOnRails
[17:01:39] mrmylanman: has joined #RubyOnRails
[17:02:13] apalmblad: has joined #RubyOnRails
[17:02:52] idd2d: has joined #RubyOnRails
[17:02:58] cih_: has joined #RubyOnRails
[17:03:33] sonofdirt: has joined #RubyOnRails
[17:04:52] VeryBewitching: has joined #RubyOnRails
[17:04:53] habitullence: has joined #RubyOnRails
[17:05:48] tbuehlmann: fyi: http://www.drapertv.com/livestreams/yukihiro-matsumoto
[17:06:03] bricker: goldbug: validates_associated
[17:07:22] goldbug: bricker: I don't know that that would work, because the associate object is valid whether it is a composer or not.
[17:07:41] mxrguspxrt: has joined #RubyOnRails
[17:08:14] KinderSpiel: has joined #RubyOnRails
[17:08:15] Anubix: Do you know any website with examples of routing for rails 4 ?
[17:08:26] drupald: has joined #RubyOnRails
[17:08:48] Joufflu: has joined #RubyOnRails
[17:09:19] Anubix: Not RoR official routing guide, there is no solution what i need
[17:10:06] stannard: has joined #RubyOnRails
[17:10:08] tubbo: Anubix: why not gist your routes file and what you're trying to do, and maybe we can help you here?
[17:10:19] tubbo: Anubix: i learned routing from railscasts fwiw
[17:10:54] FrankD: has joined #RubyOnRails
[17:11:04] simplyianm: has joined #RubyOnRails
[17:11:40] teaearlgraycold: has joined #RubyOnRails
[17:11:58] Anubix: I need to change path for categories from website.com/category/id to website.com/category_id, or website.com/towns/1 to website.com/continent_id/country_id/town_id
[17:11:59] lasker85: has joined #RubyOnRails
[17:12:19] tubbo: Anubix: i told you how to do that already, i literally gave you code to do it :P
[17:12:37] Anubix: tubbo: Ah i wasnt there :/
[17:13:08] teaearlgraycold: I'm planning to store HTML in a database and allow users to edit the HTML as a template. The HTML will also be converted to a pdf to be printed. Is HTML the best option for that? I /could/ try latex.
[17:13:22] drptbl: has joined #RubyOnRails
[17:13:26] teaearlgraycold: Any advice on how to render the HTML on a page for editing?
[17:14:42] nickjj: teaearlgraycold, markdown to pdf is another option
[17:14:58] tubbo: Anubix: you can create a custom route that routes to 'categories#show', or you could configure the `resources` block to have path: ''
[17:15:02] teaearlgraycold: nickjj: I'd considered that but I don't think I'll have enough document structure control with markdown
[17:15:21] tubbo: Anubix: you can just specify the route path as `get '/:id'`
[17:15:27] teaearlgraycold: I'm thinking of using Wicked PDF for the pdf rendering - that part should be easy
[17:15:33] nickjj: teaearlgraycold, yeah i guess it depends on what you're doing. i use markdown to pdf for books usually
[17:15:52] teaearlgraycold: nickjj: It'll be forms and applications with field filled in automatically
[17:16:06] tubbo: teaearlgraycold: this mostly has to do with what is more comfortable for your users
[17:16:15] tubbo: that's why we still need to implement wysiwyg editors sometimes :D
[17:16:18] Anubix: tubbo: well, one more thing, i am using in show.html category_path(@category) and now it doesnt work
[17:16:31] tubbo: Anubix: !dw
[17:16:31] helpa: Anubix: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[17:16:34] Anubix: should i add as 'category' to routes?
[17:16:36] teaearlgraycold: They're used to these old paper forms - so I want to recreate those forms /exactly/ but in HTML
[17:17:18] Anubix: tubbo: undefined method `category_path'
[17:17:29] nickjj: teaearlgraycold, if you wanted to go all out you could use a client side templating language and offer your own custom dsl on top of it
[17:17:36] teaearlgraycold: Anubix: can you run "rake routes" for me?
[17:17:58] rakm: has joined #RubyOnRails
[17:18:14] nickjj: something like jinja2 or liquid, and then build up a dsl using custom functions that you've created, so creating the form is light on syntax and easy to use
[17:18:23] symbole: has joined #RubyOnRails
[17:19:31] teaearlgraycold: nickjj: Is jinja Python only?
[17:20:10] Anubix: tubbo: get '/:category_id' => 'categories#show', as: 'webcam' is already working now
[17:20:24] weaksauce: has joined #RubyOnRails
[17:20:31] Anubix: tubbo: it should be as 'category'..
[17:20:38] tubbo: Anubix: agreed :D
[17:20:38] nickjj: teaearlgraycold, liquid is pretty similar to it and works with ruby
[17:20:51] teaearlgraycold: Yeah liquid seems fine
[17:21:05] teaearlgraycold: So liquid gets converted to HTML
[17:21:06] nickjj: it's what shopify uses to expose templates to users
[17:21:10] teaearlgraycold: Then I'll just convert that to a pdf
[17:21:13] Anubix: tubbo: i am using friendly_id gem so its little more complicated
[17:21:27] nickjj: you can make both together
[17:21:50] teaearlgraycold: I suppose I could try some AJAX to detect updates to a textbox and send new HTML so people can view a live-update
[17:21:53] teaearlgraycold: That'd be pretty slick
[17:22:39] bronson: has joined #RubyOnRails
[17:23:22] nickjj: teaearlgraycold, i think there's a javascript implementation of liquid too, so you wouldn't even need to make the ajax call
[17:23:31] nickjj: not sure if it's an exact 1:1 match tho
[17:23:48] nickjj: but that doesn't mean it's not
[17:24:03] nickjj: it's worth investigating because that approach you described is exactly how i do a real time preview for another project
[17:24:05] teaearlgraycold: Found one for node
[17:24:06] nickjj: but it uses markdown instead
[17:24:18] dionysus69: has joined #RubyOnRails
[17:25:32] Anubix: tubbo: hm now doesnt work @category = Category.find(params[:id]) with error: Couldn't find Category with 'id'=
[17:25:39] tubbo: Anubix: that shouldn't define what the route name would be
[17:25:42] Anubix: tubbo: it just do it when i changed that route
[17:26:03] rclanan: has joined #RubyOnRails
[17:26:06] tubbo: Anubix: your route is passing '/whatever' as :category_id, so you need to change it to :id
[17:27:25] Anubix: tubbo: i have this get '/:category_id' => 'categories#show', as: 'category'
[17:27:54] Flyy7: has joined #RubyOnRails
[17:28:09] yfeldblum: has joined #RubyOnRails
[17:28:51] tubbo: Anubix: right
[17:28:59] Anubix: tubbo: and it still doesnt work
[17:29:17] tubbo: Anubix: that makes sense because you didn't do what i told you to do in order to fix it
[17:29:44] tubbo: if you request '/foo' from your rails app, the string 'foo' is being passed as params[:category_id]
[17:30:01] tubbo: so you either need to change your route to make that pass params[:id], or change your controller to pass params[:category_id]
[17:30:08] tubbo: Anubix: !routing will tell you all about these custom routes
[17:30:08] helpa: Anubix: http://guides.rubyonrails.org/routing.html - Rails Routing From the Outside In - Rails Guide - by Mike Gunderloy
[17:30:41] tubbo: Anubix: more specifically, http://guides.rubyonrails.org/routing.html#non-resourceful-routes
[17:32:06] Anubix: tubbo: well si now i have no idea how to do that :) official guide i read and didnt find solution
[17:33:29] yaymukund: has joined #RubyOnRails
[17:33:37] annlewis: has joined #RubyOnRails
[17:34:19] Flying_Squirrel: has joined #RubyOnRails
[17:34:20] nettoweb: has joined #RubyOnRails
[17:34:21] herbst: has joined #RubyOnRails
[17:36:13] tubbo: Anubix: check out "3.6 Naming Routes"
[17:36:19] tubbo: it gives you a pretty concrete example
[17:36:25] kgzm: has joined #RubyOnRails
[17:36:45] cconstantine: has joined #RubyOnRails
[17:37:19] loc22: has joined #RubyOnRails
[17:37:36] Anubix: tubbo: I just see exactly what i did
[17:38:50] cconstantine: Hey everyone. I???m having a really weird postgres auth issue. I have a postgres database/role created for my rails app but rails can???t connect to it. I???m getting a `password authentication failed for user ???app_user???` error from rails. When I use psql to connect to it from bash using exactly the same database, host, user, and password it succeeds. How would I go about debugging what exactly rails is doing
[17:38:51] cconstantine: when trying to connect?
[17:39:06] Anubix: tubbo: ehhh, just change :category_id to :id well :D
[17:39:11] pwnd_nsfw: has joined #RubyOnRails
[17:39:20] Rohanezio: has joined #RubyOnRails
[17:39:48] Anubix: tubbo: it works, but now i definitelly don't know how. How it knows its category id if u just write :id ? It is because 'categories#show' ?
[17:40:04] CanTonic: has joined #RubyOnRails
[17:40:53] chrissonar: has joined #RubyOnRails
[17:41:17] cnk: has joined #RubyOnRails
[17:42:03] havenwood: has joined #RubyOnRails
[17:42:12] tfitts: has joined #RubyOnRails
[17:42:26] arup_r: I want to store inside a hidden field an array of user_ids .. How to declare the hidden filed ?
[17:42:37] moeabdol: has joined #RubyOnRails
[17:42:58] tfitts: I'm looking at ActionController::Live for live steraming/server sent events. Anyone use this with unicorn? The first few articles I've read basically say to use puma
[17:43:05] tubbo: Anubix: rails actually doesn't know it's a "category id", you just named it that because you're following a convention. the way rails "knows" it's a category id is because you did Category.find(params[:id]) :)
[17:43:48] Anubix: tubbo: Well but now everything website.com/xxxxx will show as category id
[17:44:10] tubbo: Anubix: right, that's what you came in here wanting to do
[17:46:08] Anubix: has joined #RubyOnRails
[17:46:15] EminenceHC: has joined #RubyOnRails
[17:46:34] Lincee: has joined #RubyOnRails
[17:46:36] Anubix: tubbo: sorry i got DC, so now when i use website.com/policy there will be colision with category_id ?
[17:46:49] Anubix: tubbo: i lost history so i dunno if you already answered
[17:47:12] tubbo: Anubix: can you post your routes file to gist.github.com and maybe i can take a look?
[17:47:57] DLSteve: has joined #RubyOnRails
[17:48:10] Anubix: tubbo: ok minute
[17:48:19] ValicekB: has joined #RubyOnRails
[17:48:38] _djbkd: has joined #RubyOnRails
[17:48:48] youngbaks: has joined #RubyOnRails
[17:48:57] moeabdol: has joined #RubyOnRails
[17:49:25] centrx: has joined #RubyOnRails
[17:50:42] habitullence: has joined #RubyOnRails
[17:51:58] arup_r: Why not able to save the users .. I have DistribtionList has_many users ( https://gist.github.com/aruprakshit/1bb6ce70d747a2c647ee)
[17:52:42] Anubix: tubbo:http://pastie.org/10454513
[17:53:39] FailBit: Anubix: you probably want some constraints if you want to distinguish purely by routes
[17:53:57] FailBit: otherwise you might want a pages controller to resolve the ambiguity
[17:54:03] arup_r: smathy: Hi :)
[17:54:32] FailBit: there is an ambiguity with continents and webcams
[17:55:01] ruby-lang352: has joined #RubyOnRails
[17:55:10] Anubix: Failbit: Yea i see it, that's why i think this solution isn't good. Anyway this type of urls is normal used
[17:55:26] FailBit: right, like I said
[17:55:37] FailBit: you'll need constraints
[17:56:43] Anubix: FailBit: I am looking on it, but it doesn't solve this replication
[17:57:05] FailBit: since there are a limited number of continents, you could constrain /:id, /(north_america|south_america|europe|africa|asia|australia|antartica)/ => "continents#show"
[17:57:14] blackmesa: has joined #RubyOnRails
[17:57:26] _djbkd: has joined #RubyOnRails
[17:57:27] banjara: has joined #RubyOnRails
[17:58:03] mehwork: what does 'gem install rails --no-rdoc --no-ri' do and is it worth it to speed thigns up?
[17:58:52] Anubix: FailBit: Hm thats right, it's not so nice but it should work
[17:58:53] cnk: it doesn't compile the documentation and it will speed things up. How much depends on the speed of your CPU
[17:59:20] FailBit: constraints(:id => /(north_america|south_america|europe|africa|asia|australia|antartica)/) do
[17:59:22] eggie5: has joined #RubyOnRails
[17:59:23] cnk: I always use docs on the web so no-rdoc and no-ri save me some time and disk space
[17:59:23] FailBit: get '/:id', "continents#show", as: "continents"
[17:59:23] mehwork: cnk where does it install the documentation? How would i acecss it?
[17:59:25] Or1on: has joined #RubyOnRails
[18:00:08] cnk: mehwork: google for a good answer
[18:00:11] cnk: I don't use it
[18:00:28] FailBit: constraints(:id => /[A-Za-z0-9]+)/ do
[18:00:31] FailBit: get '/:id', "webcams#show", as: "short_webcams"
[18:01:02] smathy: FailBit, can you stop with the multiple lines of code please.
[18:01:38] FailBit: didn't think ???3 lines was a problem
[18:01:42] moeabdol: has joined #RubyOnRails
[18:01:49] Anubix: FailBot: And how to solve structure of continent/category/town ? I expect its not working
[18:02:23] FailBit: Anubix: that should just work
[18:02:26] ruurd: has joined #RubyOnRails
[18:02:38] FailBit: get '/:continent_id/:id', "countries#show"
[18:02:56] FailBit: get '/:continent_id/:country_id/:id'
[18:03:00] FailBit: you get the idea
[18:04:04] pwnd_nsfw: has joined #RubyOnRails
[18:04:33] Anubix: FailBit: Heh now i cant acces mi admin section :)
[18:04:59] FailBit: that's matched by the webcam constraints
[18:05:03] Jameser`: has joined #RubyOnRails
[18:05:39] FailBit: just put the admin mount above it.
[18:05:50] FailBit: that will allow it to be resolved first.
[18:06:40] pgeb: has joined #RubyOnRails
[18:06:57] mehwork: is there an authorative rails4 book that has opinions which tools/workflow to use in general?
[18:07:06] mehwork: getting lost in tutorials
[18:07:23] FailBit: mehwork: more doing, less reading
[18:07:47] smathy: mehwork, best to just do one tutorial, then start coding your projects.
[18:08:04] FailBit: my setup won't work for everyone, but I run rails in a chroot off my main box, edit code with vim, deploy with cap, and serve with unicorns
[18:08:26] smathy: mehwork, or in other words, no, there's no one authoritative set of tools/workflows.
[18:08:30] mehwork: smathy: but if i have bad habits from that, i'm likely to always have those bad habits
[18:08:38] eggie5: has joined #RubyOnRails
[18:08:43] Ergo: has joined #RubyOnRails
[18:08:45] mehwork: some tutorials say to sudo everything into system for example
[18:09:00] smathy: mehwork, habits? You think choice of tool/workflow is some subconscious process?
[18:09:39] mehwork: smathy: no but how do i know when to bundle install vs gem install for example. Or if i should 'bundle config --global path vendor/bundle' or not, etc. You know, best practices
[18:10:13] krisquigley: has joined #RubyOnRails
[18:10:18] FailBit: bundle config is hardly a practice
[18:10:35] FailBit: most don't even bother other than 'gem install bundler' and leave it at that
[18:10:35] mehwork: FailBit: not according to this https://stefanwrobel.com/bundle-everything
[18:10:49] mehwork: that's what your advice for me to google stuff has lead me to
[18:10:50] pgeb: Does anyone here have experience with oauth in Rails, specifically figuring out why a callback is timing out?
[18:10:57] mehwork: see how it's confusing either way i go?
[18:11:34] tw1sted: has joined #RubyOnRails
[18:11:35] FailBit: because you're googling for the opinion stuff
[18:11:38] smathy: mehwork, honestly, it doesn't really matter. There are only three real career paths, work for/with another team in which case you'll do whatever they want, create your own app(s) for yourself in which case you'll do whatever works, or do client work in which case you'll fit in with the client when they care and do what works when they don't.
[18:11:40] baweaver: has joined #RubyOnRails
[18:11:50] FailBit: not for "things to find out how to do"
[18:12:05] mehwork: if you're saying that i should just stick with the simplest solution and not do anything else until it seems necessary, i can kinda see the simplicity in that. But i can still lead me down wrong paths
[18:12:11] smathy: mehwork, at some later stage you'll discover pros/cons about different things you've done, and you'll adjust your course.
[18:12:24] mehwork: alright i got it
[18:12:25] FailBit: to err is human
[18:12:36] smathy: mehwork, the only wrong path is to be paralyzed by these kinds of choices.
[18:12:37] mehwork: at least i won't feel as bad if i do something wrong now, thanks
[18:12:50] pjammer: has joined #RubyOnRails
[18:12:54] manfrin: has joined #RubyOnRails
[18:13:44] Grundell: has joined #RubyOnRails
[18:14:07] nzst: has joined #RubyOnRails
[18:14:54] mehwork: i just figured there'd be some universal truths for efficiency and conflict resolution at least, that someone might have bundled into a book or tutorial and that most noobs get pointed to. I'm used to that from python anyway
[18:15:01] nzst: I'm running into trouble with an appication that includes backup in it's Gemfile causing dependencies that are too strict. The install instructions recommend not doing that http://backup.github.io/backup/v4/installation/ , but I'm unsure what to do instead. It's typically just been a part of the deployed application
[18:16:02] mehwork: but you're right that most teams will choose whatever they choose and that's what you use
[18:16:35] bronson: has joined #RubyOnRails
[18:17:24] Rohanezio: has joined #RubyOnRails
[18:17:45] eggie5: has joined #RubyOnRails
[18:18:35] habitullence: has joined #RubyOnRails
[18:18:44] greengriminal: has joined #RubyOnRails
[18:19:03] youngbaks: has joined #RubyOnRails
[18:19:29] mrmylanman: has joined #RubyOnRails
[18:21:00] tsujp: has joined #RubyOnRails
[18:21:04] rclanan: has joined #RubyOnRails
[18:22:38] tubbo: it's important as a career-minded developer to be comfortable learning new things and taking architectural decisions as they are
[18:22:47] smathy: mehwork, well there are, just that many people have their own universal truth ;)
[18:23:16] tubbo: python is definitely unique in that it has very much prescribed methods for doing things to get started with the language
[18:23:31] tubbo: ruby does too, but rails? shit changes so much it's hard to keep up
[18:24:51] loc22: has joined #RubyOnRails
[18:24:53] tubbo: i got "dive into python" and "programming ruby" around 2007. i'm pretty sure i could read the dive into python book i have on my computer here and that would be good enough to get going with python right now. but if i tried to read the programming ruby book and start with ruby right now, i'd have a few problems.
[18:25:00] glider: has joined #RubyOnRails
[18:25:07] smathy: nzst, what I'd do is have a specific backup user and just `gem install` it into their own GEM_HOME.
[18:25:31] baweaver: has joined #RubyOnRails
[18:26:06] aarmenaa: has joined #RubyOnRails
[18:26:26] glider: has left #RubyOnRails: ()
[18:26:27] pwnd_nsfw: has joined #RubyOnRails
[18:26:48] krz: has joined #RubyOnRails
[18:26:59] eggie5: has joined #RubyOnRails
[18:32:22] nzst: smathy: some of the configuration is dependent on yaml files in the application, I guess I could symlink them over
[18:34:07] annlewis: has joined #RubyOnRails
[18:34:28] simkessy: Does it matter if I set default values through the model vs the migration(sql)?
[18:34:33] bejar37: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[18:34:44] Macaveli: has joined #RubyOnRails
[18:34:52] smathy: nzst, yeah, or create a new deploy target in capistrano for those, various options.
[18:35:16] herbst: has joined #RubyOnRails
[18:35:22] smathy: simkessy, not much.
[18:35:31] dikaio: has joined #RubyOnRails
[18:35:44] cac: has joined #RubyOnRails
[18:36:07] eggie5: has joined #RubyOnRails
[18:36:19] simkessy: smathy: something like this should be good then? before_save :set_default
[18:36:32] yaymukund: has joined #RubyOnRails
[18:36:53] lasker85: has joined #RubyOnRails
[18:37:12] manfrin: has joined #RubyOnRails
[18:38:04] smathy: simkessy, sure, if you don't need those values to exist before you save.
[18:38:38] simkessy: smathy: what would be a simple situation where you might need the values to exist before saving?
[18:39:36] netzfisch: has joined #RubyOnRails
[18:40:23] smathy: simkessy, @foo = Foo.new .... = @foo.name
[18:40:51] nzst: smathy: I am unsure what you mean by new deploy target in capistrano
[18:40:57] youngbaks: has joined #RubyOnRails
[18:40:59] cac: has joined #RubyOnRails
[18:42:07] simkessy: smathy: I see, hmm I can't really image why I'd want to do that at this point. But I'll probably use after_initialize instead
[18:42:13] habitullence: has joined #RubyOnRails
[18:42:51] EminenceHC: has joined #RubyOnRails
[18:44:07] yfeldblum: has joined #RubyOnRails
[18:44:48] podman: has joined #RubyOnRails
[18:45:27] eggie5: has joined #RubyOnRails
[18:45:39] jenrzzz: has joined #RubyOnRails
[18:45:43] pwnd_nsfw: has joined #RubyOnRails
[18:45:47] smathy: nzst, sorry, I meant "roles" - I was using the wrong term. You can just create your own :backup role (like :app, :web, :db) and have your capistrano deploy the right thing for that.
[18:46:31] nzst: smathy: got it, danke :)
[18:47:20] kadoppe: has joined #RubyOnRails
[18:47:40] brazenbraden: has joined #RubyOnRails
[18:49:00] jwaldrip: has joined #RubyOnRails
[18:50:47] jenrzzz: has joined #RubyOnRails
[18:51:00] TheNet: has joined #RubyOnRails
[18:51:57] Macaveli: has joined #RubyOnRails
[18:52:39] jsantana: has joined #RubyOnRails
[18:56:25] idd2d: has joined #RubyOnRails
[18:58:37] CanTonic: has joined #RubyOnRails
[19:00:11] greengriminal: has joined #RubyOnRails
[19:02:13] h7br1x: has joined #RubyOnRails
[19:02:24] habitullence: has joined #RubyOnRails
[19:03:06] Axilla: has joined #RubyOnRails
[19:03:23] Axilla: how can I make my rails app paths available to an engine I have mounted in my rails app?
[19:04:13] FrankD: has joined #RubyOnRails
[19:04:45] Grundell: has joined #RubyOnRails
[19:05:04] pwnd_nsfw: has joined #RubyOnRails
[19:06:31] RegulationD: has joined #RubyOnRails
[19:07:30] eggie5: has joined #RubyOnRails
[19:09:16] apalmblad: has joined #RubyOnRails
[19:09:45] CanTonic: has joined #RubyOnRails
[19:10:48] sargas: has joined #RubyOnRails
[19:11:12] sargas: has joined #RubyOnRails
[19:11:42] maxx88: has joined #RubyOnRails
[19:12:32] dikaio: has joined #RubyOnRails
[19:12:48] eggie5: has joined #RubyOnRails
[19:14:47] arooni: has joined #RubyOnRails
[19:18:35] RegulationD: has joined #RubyOnRails
[19:18:42] blackmesa: has joined #RubyOnRails
[19:20:11] banister: has joined #RubyOnRails
[19:20:15] dennis__: has joined #RubyOnRails
[19:21:02] arooni: i messed up my hosting environment royally ... was trying to get ubuntu 14.04 + nginx + passenger phusion working but couldnt' due to a "directory index of "/var/www/a_phone_site/current/public/" is forbidden" ... i tried in vain for 5 hours last night to fix it, but passenger seems opaque and unable to tell me why its failing. any suggestions? move to a different app server?
[19:22:02] nettoweb: has joined #RubyOnRails
[19:22:37] markelite: has joined #RubyOnRails
[19:23:15] Axilla: sometimes its just best to start from a fresh server
[19:23:21] CanTonic: has joined #RubyOnRails
[19:23:28] Axilla: if you've made a bunch of changes and can't remember, etc
[19:23:33] Axilla: and try again
[19:24:34] smathy: arooni, you sure passenger_ruby and passenger_root are being configured?
[19:25:12] arooni: smathy, you mean have i set the paths in the http block of nginx?
[19:25:28] arooni: i wish passenger would tell me *why* its not loading instead of this generic 403 error
[19:25:49] smathy: arooni, !gist all your nginx conf files.
[19:25:49] helpa: arooni: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[19:26:05] smathy: arooni, (put their full paths as comments at the top of each file's gist)
[19:26:28] bePolite: has joined #RubyOnRails
[19:26:59] arooni: thanks for looking smathy ... i went to sleep this morning at 2am... and this is a production site of mine (albeit small)... i thought what i was doing was really straightforward .... i should use staging but i feel sometimes like i'll have to do the work twice
[19:27:01] arooni: one moment please
[19:29:11] baweaver: has joined #RubyOnRails
[19:29:44] banister: has joined #RubyOnRails
[19:29:58] zomgbie: has joined #RubyOnRails
[19:30:07] toretore: has joined #RubyOnRails
[19:30:44] Uranio-235: has joined #RubyOnRails
[19:31:50] arup_r: I have a remote: true .. but it is doing HTML request, not Ajax.. Why? https://gist.github.com/aruprakshit/f2d807a8c242b5df296d
[19:34:58] zomgbie_: has joined #RubyOnRails
[19:35:04] FailBit: how can I use expires_in with multi_fetch_fragments?
[19:35:08] annlewis: has joined #RubyOnRails
[19:35:30] FailBit: or if someone more knowledgable knows, how does expires_in work cache-store side
[19:35:59] jwaldrip: has joined #RubyOnRails
[19:36:03] KinderSpiel: has joined #RubyOnRails
[19:37:19] EminenceHC: has joined #RubyOnRails
[19:39:00] NBarnes: has joined #RubyOnRails
[19:39:02] cac: has joined #RubyOnRails
[19:39:06] chipotle: has joined #RubyOnRails
[19:39:43] TheNet: has joined #RubyOnRails
[19:40:06] CanTonic: has joined #RubyOnRails
[19:41:07] arup_r: smathy: Hi
[19:41:11] rubyonrails616: has joined #RubyOnRails
[19:41:36] Macaveli: has joined #RubyOnRails
[19:42:47] baweaver: has joined #RubyOnRails
[19:43:13] Coldblackice: has joined #RubyOnRails
[19:43:36] cac: has joined #RubyOnRails
[19:43:58] naftilos76: has joined #RubyOnRails
[19:44:11] TheNet: has joined #RubyOnRails
[19:45:14] KensoDev: has joined #RubyOnRails
[19:46:05] Uranio-235: has left #RubyOnRails: ()
[19:49:39] piotrj: has joined #RubyOnRails
[19:49:49] arup_r: any hints guys
[19:51:00] habitullence: Is it possible to do associations without keys? I'm trying to associate postgis poly to points...
[19:51:41] Jameser`: has joined #RubyOnRails
[19:52:02] arooni: smathy, sorry for the wait: https://gist.github.com/arooni/b9909d2ca1dca8dbb6e0 and https://gist.github.com/arooni/8c720786a7b9192d8b74
[19:54:09] simplyianm: has joined #RubyOnRails
[19:54:31] habitullence: OK a simpler question... Is it possible to do associations without ids/keys?
[19:56:02] annlewis: has joined #RubyOnRails
[19:56:55] waseem_: arup_r: Check your jquery-rails gem. Is it included in the Gemfile?
[19:56:58] Pumukel: has joined #RubyOnRails
[19:57:07] jenrzzz: has joined #RubyOnRails
[19:57:07] cschneid_: has joined #RubyOnRails
[19:57:30] Jameser`: has joined #RubyOnRails
[19:57:51] arup_r: waseem_: I have it.. and I see now in browser console it is making xhr call.. in Rails log it is howing HTML as a request
[19:58:01] waseem_: arup_r: Also notice there is a CSRF authenticity related error.
[19:58:16] rushed: has joined #RubyOnRails
[19:58:22] arup_r: yes.. I see that error... what is the reason ?
[20:00:07] waseem_: arup_r: Do you have csrf_meta_tag method called in your layout?
[20:00:09] idd2d: has joined #RubyOnRails
[20:00:18] arup_r: Yes.. I do have.. I checked..
[20:00:45] habitullence: has joined #RubyOnRails
[20:00:51] waseem_: arup_r: What does your form source look like?
[20:01:05] waseem_: arup_r: Also read on this http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection.html
[20:01:26] arup_r: waseem_: you mean view source ?
[20:01:33] waseem_: arup_r: Yeah, HTML.
[20:01:40] waseem_: arup_r: http://guides.rubyonrails.org/security.html#cross-site-request-forgery-csrf
[20:01:46] arup_r: let me show you
[20:02:00] iceyec_: has joined #RubyOnRails
[20:02:10] arup_r: the form inside a modal window..
[20:02:13] mxrguspxrt: has joined #RubyOnRails
[20:04:37] habitullence: What about associations via query?
[20:05:06] arup_r: waseem_: https://gist.github.com/aruprakshit/f2d807a8c242b5df296d#file-source-html
[20:05:51] cih: has joined #RubyOnRails
[20:06:31] waseem_: arup_r: That form's HTML is not in what you pasted.
[20:06:35] tvw: has joined #RubyOnRails
[20:06:49] waseem_: arup_r: Search for distribution_list id.
[20:07:04] arup_r: waseem_: The modal is coming right inside https://gist.github.com/aruprakshit/f2d807a8c242b5df296d#file-source-html-L756
[20:07:09] arup_r: using some JS
[20:07:34] waseem_: arup_r: Show me the HTML of the form not the element in which it appears.
[20:07:35] arup_r: but the modal is not there why.. :( I opened the modal and then did view source
[20:08:03] waseem_: arup_r: Browser wont update itself with elements coming from JS.
[20:08:07] arup_r: I did view source.. why it is not present there.. I am not getting it.. should I inspect and show you ?
[20:08:38] PlasmaStar: has joined #RubyOnRails
[20:08:52] waseem_: arup_r: You should inspect and see if there is a hidden field with name of authenticity_token or such in there.
[20:08:55] stamina: has joined #RubyOnRails
[20:09:25] arup_r: Inside the form ?
[20:09:35] waseem_: arup_r: Yes. How is that form generated?
[20:09:37] arup_r: No it is not present ..
[20:09:47] TheNet: has joined #RubyOnRails
[20:09:50] arup_r: let me show you
[20:10:46] arup_r: waseem_: https://gist.github.com/aruprakshit/f2d807a8c242b5df296d#file-form-html
[20:10:49] sargas: has joined #RubyOnRails
[20:11:21] krisquigley: has joined #RubyOnRails
[20:11:40] smathy: arooni, and there's definitely either an index.html or index.htm inside /var/www/find_my_phone_rails/current/public ?
[20:11:53] habitullence: Does anyone know if it's possible to create associations without keys?
[20:12:10] arooni: smathy, theres not one; but if i do put one in it serves that page...
[20:12:45] smathy: arooni, umm, but you've configured that in your location block.
[20:12:52] smathy: https://gist.github.com/arooni/b9909d2ca1dca8dbb6e0#file-phonemyphone-conf-L19
[20:12:52] arooni: but the idea is to have passenger server the rails app
[20:13:21] smathy: arooni, but you're telling nginx that the index for that location is one of those two files.
[20:13:32] Miron_: has joined #RubyOnRails
[20:13:38] arooni: should i not have a location block?
[20:13:47] arup_r: O god.. why me always ? :(
[20:14:05] Macaveli: has joined #RubyOnRails
[20:14:15] jwaldrip_: has joined #RubyOnRails
[20:14:36] arooni: smathy, i tried commenting out the index line in the location block and i still run into the same problem
[20:16:58] blackmesa: has joined #RubyOnRails
[20:17:12] shinnya: has joined #RubyOnRails
[20:18:11] futilegames: has joined #RubyOnRails
[20:18:49] smathy: arooni, well, having `index` is definitely wrong, so I'd remove that. And no, you don't need a location / block.
[20:18:56] arooni: smathy, ive spent like 6 hours on this... is there an alternative to passenger phusion + nginx?
[20:18:58] mary5030: has joined #RubyOnRails
[20:19:20] arooni: smathy, removed im still running into the same thing; and nginx still wont boot when i point it at the correct rvm directory id like to use
[20:19:42] arooni: i mean to say i removed the whole location block and still running into the same issue
[20:20:25] smathy: arooni, well that's a 1.8.7 ruby, maybe your passenger was built with a different ruby?
[20:20:44] arooni: i had never thought of that
[20:20:58] uris: has joined #RubyOnRails
[20:21:24] targaf: what's the standard "rails way" of having your 404 page render as a partial without overriding your site layout?
[20:21:38] arup_r: waseem_: There?
[20:21:40] sararegan: has joined #RubyOnRails
[20:21:51] arooni: i happen to know the original version of passenger phusion that was working before ... 3.0.7 ... is there a way to use that version instead?
[20:21:55] FailBit: targaf: render action: 'pages/render_404'
[20:22:07] arup_r: I removed distribution_lists.coffee from file, Ajax is happening. the https://gist.github.com/aruprakshit/f2d807a8c242b5df296d
[20:22:10] smathy: arooni, also, if you're really using passenger 3.0.7 then I don't even know if it supports location.ini and you probably need rack_env rather than rails_env. There were a lot of differences back then.
[20:22:17] habitullence: has joined #RubyOnRails
[20:22:31] arup_r: But before Ajax call I want to do some pre action.. which one should I use ?
[20:22:34] moeabdol1: has joined #RubyOnRails
[20:22:58] smathy: arooni, are you also using an old nginx version? I'm not entirely sure a new nginx will work with such an old passenger.
[20:23:25] smathy: arooni, anyway, are you really developing this app in ruby 1.8.7 ?
[20:23:28] targaf: thanks, failbit
[20:23:51] arooni: ahhh this all started because i upgraded my server from 12.04 to 14.04 ; i had previously installed a built from source version of nginx
[20:24:09] arooni: smathy, and i wouldnt say developing; just trying to get it to run nicely along other new apps i want to build (with newer versions of things)
[20:24:47] arup_r: It does POST .. but no params it sends.. shit what is happening here..
[20:25:32] dikaio: has joined #RubyOnRails
[20:27:59] smathy: arooni, ok, so yeah, I'd do what you did before on 12.04/
[20:28:09] _djbkd: has joined #RubyOnRails
[20:28:48] arooni: so can i run a new ubuntu version of nginx
[20:29:04] arooni: and just the old version of passenger + ruby?
[20:29:13] baweaver: has joined #RubyOnRails
[20:30:47] sdwrage: has joined #RubyOnRails
[20:31:59] arup_r: smathy: any idea why form_for not posting any data ?
[20:32:11] arup_r: no params at all
[20:32:33] smathy: arooni, I don't know, try that and fall back to using the old nginx if it doesn't work.
[20:32:35] drptbl: has joined #RubyOnRails
[20:32:46] smathy: arooni, just be aware that the old passenger needs the old configuration options.
[20:33:37] smathy: arup_r, nope, sorry.
[20:34:04] arup_r: https://gist.github.com/aruprakshit/f2d807a8c242b5df296d
[20:34:37] Trynemjoel: has joined #RubyOnRails
[20:36:10] CanTonic: has joined #RubyOnRails
[20:36:39] herbst: has joined #RubyOnRails
[20:36:42] lasker85: has joined #RubyOnRails
[20:36:52] superrorc: has joined #RubyOnRails
[20:36:55] lasker85: I'm trying to modify a f.select field to include a greater than and less than component. My current code: <%= f.select :price_lteq, [['Less than $70', '70'], ['Less than $40', '40'], ['Less than $25', '25']], :include_blank => "Include All" %>
[20:36:56] zlogan: has joined #RubyOnRails
[20:37:13] lasker85: How would I make price greater than and less than if price_gteq will allow a greater than serach?
[20:37:32] lasker85: Like allow the user to select between $40 and $70
[20:37:46] PlasmaStar: has joined #RubyOnRails
[20:38:08] sathish: has joined #RubyOnRails
[20:39:54] pjammer: has joined #RubyOnRails
[20:40:03] sathish: how do i create a resource under two models, Eg: @comment = @project.comments.build(comment_params) How do I make this insert user_id into db along with project_id
[20:40:30] Miron_: has joined #RubyOnRails
[20:40:45] bmurt: has joined #RubyOnRails
[20:41:11] FailBit: not sure about #build, I always used #new
[20:41:24] sadaf2605: has joined #RubyOnRails
[20:42:45] Ergo: has joined #RubyOnRails
[20:42:49] Macaveli: has joined #RubyOnRails
[20:43:54] baweaver: has joined #RubyOnRails
[20:49:13] CanTonic: has joined #RubyOnRails
[20:50:59] bronson: sathish: you can write that as Comment.new(project: myProject, user: myUser)
[20:51:16] bronson: well, and save it.
[20:51:23] sathish: bronson, thanks
[20:51:29] ngscheurich: has joined #RubyOnRails
[20:51:45] kallisti5: has joined #RubyOnRails
[20:52:01] weaksauce: anyone have rails tell you that you are not doing the syntax right but the syntax is the same since forever?
[20:52:02] kallisti5: anyone know a sane way to consolidate all the migrations into a single file?
[20:52:09] weaksauce: bundle exec rails g migration something
[20:52:15] smashr: has joined #RubyOnRails
[20:52:27] weaksauce: and then it prints out the usage table
[20:52:33] kallisti5: I have a long history and it is beginning to become unruly. I have a db schema which is sane
[20:52:52] weaksauce: kallisti5 you can move them into another folder
[20:52:55] arup_r: any body know why form_for not posting any params .... no data is coming after form submit
[20:55:47] kallisti5: weaksauce: hm.. could I take my schema.rb and move it into afile called "DATESTAMP_database.rb" ?
[20:56:01] kallisti5: (and save the historic migrations)
[20:56:19] defsdoor: kallisti5, dont they get added to your git repo ?
[20:56:36] kallisti5: defsdoor: the issue is I have migrations done long ago which don't work a lot of the time
[20:56:49] kallisti5: I can edit schema.rb easily to make the config sane.
[20:56:52] defsdoor: db.schema should be pushed
[20:56:59] kallisti5: defsdoor: I do
[20:57:03] defsdoor: so you have a verion history in source control
[20:57:25] bmurt: has joined #RubyOnRails
[20:59:38] TheShaun: has joined #RubyOnRails
[21:00:17] krisquigley: has joined #RubyOnRails
[21:02:59] KensoDev: has joined #RubyOnRails
[21:03:18] Grundell: has joined #RubyOnRails
[21:03:44] EminenceHC: has joined #RubyOnRails
[21:04:50] kallisti5: so. took db/schema.rb, moved to migrate/TIMESTAMP_rollup.rb. Edited top from "ActiveRecord::Schema.define(" to class Rollup < ActiveRecord::Migration
[21:05:16] kallisti5: now it works. Why doesn't rails document how to do that? Seems to be a good fix for projects who don't care about historic upgrade ability
[21:06:22] CanTonic: has joined #RubyOnRails
[21:06:48] Kingdutch: has joined #RubyOnRails
[21:07:02] weaksauce: kallisti5 migrations are intended to be temporary
[21:07:08] weaksauce: not the way you build a new app
[21:07:24] kallisti5: weaksauce: ah. so how does one automate that cleanup?
[21:07:45] FailBit: you don't clean up
[21:07:49] FailBit: migrations are also not temporary
[21:08:09] weaksauce: the schema is the canonical bit that you use to bootstrap a new instance of the app
[21:08:36] weaksauce: the migrations are temporary in the sense that you use them to bootstrap an app.
[21:08:37] kallisti5: migrations are upgrades, but messy historic migrations seem to always cause me a lot of issues
[21:09:05] markelite: has joined #RubyOnRails
[21:09:11] FailBit: so don't load historic ones
[21:09:26] FailBit: instead of running db:migrate to bootstrap, run db:schema:load
[21:09:43] Kingdutch: Is API documentation available for Rails 5? Specifically I'm looking for something that allows me to abstract out the `render json` calls so an API could return both JSON and XML instead of having json baked into every controller.
[21:09:47] kallisti5: FailBit: will that adjust tables in existing applications?
[21:09:53] cwright1986: has joined #RubyOnRails
[21:10:13] weaksauce: FailBit is right. schema load is not only faster but more up to date than running a ton of migrations.
[21:10:14] FailBit: no it will overwrite everything
[21:10:56] FailBit: the point is that you db:schema:load on a new instance of the app
[21:10:59] FailBit: and then migrate from there on out
[21:11:35] weaksauce: migrations == change, schema load == bootstrap
[21:11:52] FailBit: Kingdutch: use mime_responds
[21:11:59] CanTonic: has joined #RubyOnRails
[21:12:04] FailBit: respond_to do |format| .. etc end
[21:12:15] FailBit: format.xml { render xml }
[21:12:20] loechel: has joined #RubyOnRails
[21:12:22] FailBit: format.json { render json }
[21:12:30] FrankD: has joined #RubyOnRails
[21:12:58] kallisti5: I just realized my creative rollup will likely trash the running app :-(
[21:13:31] weaksauce: anyone have the rails command stop working on them and just return the usage of the rails new command?
[21:13:46] Kingdutch: FailBit: But if you use rail 5 with the --api flag then that is no longer available
[21:14:55] FailBit: then idunno
[21:15:12] FailBit: I would not assume that rails would remove mime_responds
[21:15:22] FailBit: (that's kind of bad(!))
[21:15:41] yfeldblum: has joined #RubyOnRails
[21:16:43] nfk: has joined #RubyOnRails
[21:16:51] ahmgeek: has joined #RubyOnRails
[21:17:25] FailBit: oh boy another school shooting
[21:17:30] FailBit: awesome, this country is amazing
[21:17:34] Kingdutch: FailBit: Well the --api flag actually has that behaviour. Rake routes still shows a [.format] option but every extension actually still return JSON
[21:17:44] eggie5: has joined #RubyOnRails
[21:17:50] FailBit: then you're screwed
[21:18:01] FailBit: I mean if it can't render any format except json...
[21:18:07] s2013: has joined #RubyOnRails
[21:18:11] lasker85: has joined #RubyOnRails
[21:18:33] s2013: k im having a weird issue.. locally the site works fine when using a mobile browser .. but when in production it seems like the stylesheet and js isnt loaded.. https://gist.github.com/ss2k/934808f8478966ef7497
[21:18:40] s2013: cant figure out wtf is going on
[21:20:25] pokoi: has joined #RubyOnRails
[21:21:15] Kingdutch: FailBit: I can probably tell it to render xml instead of JSON but that still happens at the controler level and it's etiehr or.. or custom logic, there should be a better way
[21:21:23] havenwood: has joined #RubyOnRails
[21:25:22] KensoDev: has joined #RubyOnRails
[21:25:27] ahmgeek: hey dears, this is the only controller I have in order to authenticate useres through Facebook, no pass, no mails login, FB only, the problem is sometimes users find themselves posting things as another users !
[21:25:28] ahmgeek: https://gist.github.com/ahmgeek/97c1af92f69f111fd5ae
[21:25:37] davidheward: has joined #RubyOnRails
[21:26:45] sankaber: has joined #RubyOnRails
[21:26:57] pokoi: I'm using Devise and trying to resend an invitation in case the user deleted the confirmation email but it looks like the invitation process works only for a logged user, is that correct? Is there a way for me to resend a confirmation email without a logged user?
[21:27:17] jgt: has joined #RubyOnRails
[21:27:37] boombadaroomba: ahmgeek, are you using the omniauth-facebook gem?
[21:27:39] rhizome: man i really feel like making a flowchart
[21:27:44] CanTonic: has joined #RubyOnRails
[21:27:48] ahmgeek: boombadaroomba: Yep.
[21:27:52] boombadaroomba: rhizome, make a flowchart on when to make a flowchart
[21:32:24] ahmgeek: any idea guys ?
[21:35:54] yardenbar: has joined #RubyOnRails
[21:36:31] eggie5: has joined #RubyOnRails
[21:38:44] pjammer: has joined #RubyOnRails
[21:39:05] cih: has joined #RubyOnRails
[21:40:44] nettoweb: has joined #RubyOnRails
[21:41:07] boombadaroomba: ahmgeek, are you using cancan?
[21:41:32] chills42: has joined #RubyOnRails
[21:41:41] ahmgeek: boombadaroomba: Nop.
[21:41:56] boombadaroomba: authentication and authorization. i'd start there
[21:42:00] Rohanezio: has joined #RubyOnRails
[21:42:31] cac: has joined #RubyOnRails
[21:42:55] CanTonic: has joined #RubyOnRails
[21:43:26] leex: has joined #RubyOnRails
[21:43:42] mrmylanman: has joined #RubyOnRails
[21:47:44] eggie5: has joined #RubyOnRails
[21:48:22] jwaldrip_: has joined #RubyOnRails
[21:48:55] Oog: has joined #RubyOnRails
[21:50:00] drptbl: has joined #RubyOnRails
[21:52:08] EminenceHC: has joined #RubyOnRails
[21:52:36] jwaldrip__: has joined #RubyOnRails
[21:54:01] Oog: has joined #RubyOnRails
[21:55:20] Oog: simple question but where do i get release notes...
[21:55:31] Oog: i have 4.2.1 how do i see what has changed to 4.2.4
[21:56:09] CanTonic: has joined #RubyOnRails
[21:56:23] havenn: has joined #RubyOnRails
[21:56:44] bricker: Oog: go to the release on Github
[21:56:56] bricker: then go into each library (activerecord, actionpack, etc.) and see CHANGELOG
[21:56:57] boombadaroomba: ahmgeek, was that it?
[21:57:32] _djbkd: has joined #RubyOnRails
[21:57:52] smathy: Oog, in case you want a higher level view, go here: http://weblog.rubyonrails.org/releases/
[21:58:01] FailBit: https://google.com/search?q=~>
[21:58:28] IFrank00: has joined #RubyOnRails
[21:58:39] ahmgeek: I don't know, the problem isn't with posting things only, it's about sometimes, after I log in, and went to another page, I find myself as another account !!
[21:58:45] ahmgeek: it's something with seesions ?
[21:59:02] creature: So I have a data set that I want to get in chronological order. If I have two models [a, b], then a.id < b.id does not mean that a.timestamp < b.timestamp. I also need to paginate through them across different requests, and the DB pagination is not the same as the app pagination. (ie. it's not a case of OFFSET 20 etc).
[21:59:17] ahmgeek: https://gist.github.com/ahmgeek/97c1af92f69f111fd5ae the code is here again
[21:59:25] Oog: minor upgrades from 4.2.1 to 4.2.4 shoudlnt cause problems right?
[22:00:16] smathy: Oog, point versions ought to always be backwardly compatible.
[22:00:22] bricker: Oog: there *shouldn't* be any breaking changes
[22:00:33] creature: I've got a stable ordering on my records - `timestamp DESC, id DESC`. But now I need to write my pagination query. So I can do `.where("timestamp < ? OR (timestamp = ? AND id < ?)", last_stamp, last_stamp, last_id).limit(20)`. But is there a better way?
[22:01:51] Oog: ok thanks
[22:02:04] yfeldblum: has joined #RubyOnRails
[22:02:29] diegoviola: has joined #RubyOnRails
[22:02:32] ellisTAA: has joined #RubyOnRails
[22:03:08] ellisTAA: if i check my source code, this select option is there, but i can???t see it in the UI ??? anyone know why? https://gist.github.com/ellismarte/b293b0d06ce96ccd290c#file-form-rb-L4
[22:04:57] lasker85: has joined #RubyOnRails
[22:06:12] baweaver: has joined #RubyOnRails
[22:08:07] wethu: has joined #RubyOnRails
[22:08:39] smathy: creature, just using limit and offset.
[22:09:42] ellisTAA: nvm it was a problem with materialize
[22:10:00] jwaldrip__: has joined #RubyOnRails
[22:10:12] creature: smathy: Sadly, the DB pagination isn't the same as the app pagination. Which I haven't explained clearly above, but it's hard to explain hypothetically without sounding nuts.
[22:10:42] smathy: creature, even harder to help you without going nuts ;)
[22:11:00] FailBit: nomnomnomnom
[22:11:20] creature: Basically, we have to ask another service "Is it OK to display this record?" and sometimes that service says "No" and we load another in its place. So if you see 7 items on a page, that might have been [1, 2, 3, 5, 6, 9, 10] etc. That is, we discarded 4, 7, and 8.
[22:11:52] CanTonic: has joined #RubyOnRails
[22:12:26] FailBit: the right way to do it is to denormalize that data into the models but :constraints:
[22:13:55] s2013: can someone tell me wtf is going on or what im missing.. https://gist.github.com/ss2k/c2587885b91a28b02ce4
[22:14:02] s2013: makes no f'n sense
[22:17:09] riotjones: has joined #RubyOnRails
[22:17:27] lasker85: has joined #RubyOnRails
[22:17:33] smathy: creature, so how would your weird where() clause above ensure that anyway?
[22:17:38] s2013: smathy any clue?
[22:18:16] yaymukund: has joined #RubyOnRails
[22:18:18] jpwrr: has joined #RubyOnRails
[22:18:30] weaksauce: I mean what does it print out?
[22:18:47] s2013: this is just an example.. basically i have a scope called never_logged_in which searches for user that never logged in
[22:18:53] one_zero: has joined #RubyOnRails
[22:18:53] s2013: but it returns 90% of the users which doesnt make sense
[22:18:57] s2013: it prints out false
[22:20:31] smathy: s2013, just show me the console of: User.find 29154
[22:20:44] lasker85: has joined #RubyOnRails
[22:20:57] FailBit: http://www.nytimes.com/aponline/2015/10/01/business/ap-us-experian-t-mobile-data-breach.html
[22:21:06] rushed: has joined #RubyOnRails
[22:22:19] s2013: nevermind i think ifigured out
[22:22:50] s2013: its last_sign_in_at .. not last_login
[22:23:41] VeryBewitching: FailBit: I bet you that was an inside job.
[22:23:44] s2013: last_login was a custom method.. i couldve sworn that was a default devise method
[22:24:11] FailBit: VeryBewitching: possibly
[22:24:32] FailBit: but that doesn't change the simple fact that critical companies almost invariably pick insecure ways to do things
[22:25:33] VeryBewitching: FailBit: I was doing work for a B2B a few years ago that worked in background investigations. One of their employees provided us with sample data (120,000 records) that include drivers license and SSN via an FTP server they forgot to create a password for.
[22:25:39] VeryBewitching: I kinda chuckled.
[22:26:04] ellisTAA: when i render a form, it is creating three input fields and putting them all on new lines. any suggestions on getting them all on the same line?
[22:26:05] FailBit: that's the kind of shit I would never allow
[22:26:17] FailBit: also >even having ftp enabled
[22:26:40] VeryBewitching: FailBit: They were a 100% windows shop. They were confused when I told them to setup sshd
[22:26:57] FailBit: see, it always comes back to this
[22:27:17] FailBit: is it that windows is innately insecure or that windows users are less competent or what
[22:27:30] VeryBewitching: FailBit: A bit from columns a and b I think
[22:27:53] SteenJobs: has joined #RubyOnRails
[22:27:54] VeryBewitching: FailBit: You can certainly secure Windows, but it's not the default stance of the OS to be locked down.
[22:27:58] VeryBewitching: Anyway, this is super OT
[22:28:37] FailBit: I can't stop myself from hating on windows sometimes
[22:28:46] FailBit: just for being a massive POS
[22:29:01] diegoviola: I worked at places where they were 100% windows shop, I was the only Linux person
[22:29:15] VeryBewitching: I've run Linux on my desktop at home since 99
[22:29:21] defsdoor: problem with windows is it exists to make money
[22:29:24] FailBit: I'm working at one at the moment
[22:29:24] bricker: Windows isn't a POS, it's just not as good at some things
[22:29:24] diegoviola: VeryBewitching: same here
[22:29:29] bricker: it's also better at a lot of things
[22:29:31] diegoviola: VeryBewitching: since 2000 here
[22:29:37] defsdoor: so it has to be constantly changing to get people to keep buying it
[22:29:46] diegoviola: bricker: windows is bad
[22:30:04] creature: smathy: Because they're ordered by (timestamp DESC, id DESC). So if we retrieve a batch where the timestamp is lower than Wibble.find(10) (the last result in our previous set), OR the timestamp's the same but the ID is lower, that it's a record we haven't seen yet.
[22:30:08] VeryBewitching: It's great for games, that's my stance on it.
[22:30:10] bricker: diegoviola: it's bad for some things
[22:30:15] bitkiller: has joined #RubyOnRails
[22:30:23] defsdoor: I'm old enough to remember the "Unix is dead" headlines when Windows NT launched....
[22:30:30] diegoviola: bricker: the bad outweights the good parts IMHO
[22:30:50] bricker: diegoviola: yeah but that's just your HO
[22:31:02] bitkiller: i've just got back to rails after 3 or 4 years
[22:31:21] bricker: bitkiller: welcome
[22:31:30] ellisTAA: time_select renders inputs for hour and minute on separate lines ??? do i have to use css to get them on one line or can i do it with rails?
[22:31:41] otacon-: has joined #RubyOnRails
[22:31:53] lasker85: has joined #RubyOnRails
[22:31:53] bitkiller: and having a probably stupid problem running an edge project
[22:31:56] defsdoor: EllisTAA, I always use a plain old text input
[22:32:39] bitkiller: the problem is with this line: https://github.com/rack/rack/blob/53d9351b36a560a816db0b8d132b9665e81e3420/lib/rack/handler/webrick.rb#L93
[22:32:44] ellisTAA: defsdoor: thanks
[22:32:54] bitkiller: ruby is 2.2.3
[22:33:06] VeryBewitching: defsdoor: As a last note, I remember fondly the IBM Linux commercials with Avery Brooks. :D
[22:33:19] defsdoor: EllisTAA, with prompt (and maybe some js) its pretty sensible
[22:33:33] VeryBewitching: k, time to find food, bbl
[22:34:01] ellisTAA: defsdoor: how do u feel about time_field
[22:34:13] a1fa: has joined #RubyOnRails
[22:34:30] a1fa: yellow.. i have an activerecord .where thats giving me some trouble
[22:34:39] defsdoor: EllisTAA, didnt know it existed but it looks ok
[22:35:05] a1fa: cars = Cars.where(type_id: '4')
[22:36:39] EminenceHC: has joined #RubyOnRails
[22:36:40] a1fa: not sure what i am missing but that one line of code is not being executed
[22:36:48] know: has joined #RubyOnRails
[22:37:15] a1fa: i have another .where above it, and it works just fine
[22:37:21] lasker85: has joined #RubyOnRails
[22:37:52] zlogan: has joined #RubyOnRails
[22:37:53] herbst: has joined #RubyOnRails
[22:37:59] Rohanezio: has joined #RubyOnRails
[22:39:04] kallisti5: anyone seen single assets not loading through asset pipeline?
[22:39:15] siaW: has joined #RubyOnRails
[22:39:56] defsdoor: VeryBewitching, this is my favourite IBM Ad - https://www.youtube.com/watch?v=x7ozaFbqg00
[22:40:40] lasker85: has joined #RubyOnRails
[22:41:00] a1fa: what am i missing?
[22:41:33] a1fa: this has me confused
[22:42:03] Radar: not being executed in what context?
[22:42:21] Radar: AR::Relation's query is not executed until .to_a or .each is called on the result
[22:42:46] annlewis: has joined #RubyOnRails
[22:47:00] mary5030_: has joined #RubyOnRails
[22:48:07] nopajj: has joined #RubyOnRails
[22:49:01] a1fa: Radar: that is probably my problem
[22:49:27] CanTonic: has joined #RubyOnRails
[22:49:31] a1fa: but.. i have if car.is_a?(Car)
[22:50:29] bePolite_: has joined #RubyOnRails
[22:51:13] leex: has joined #RubyOnRails
[22:51:50] martinbjeldbak: has joined #RubyOnRails
[22:52:03] loglaunch: has joined #RubyOnRails
[22:52:17] K0nserv-: has joined #RubyOnRails
[22:53:01] ernesto_jimenez: has joined #RubyOnRails
[22:53:45] bronson: has joined #RubyOnRails
[22:54:53] mrmylanman: has joined #RubyOnRails
[22:55:37] deavid: has joined #RubyOnRails
[22:55:55] a1fa: Radar: https://gist.github.com/anonymous/aecffd40debf6b58638b
[22:56:12] a1fa: err, typo is_a?(Car)
[22:59:24] baweaver: has joined #RubyOnRails
[23:02:11] CanTonic: has joined #RubyOnRails
[23:02:44] bitkiller: well, edge hasn't worked for me
[23:02:52] OnkelTem: has joined #RubyOnRails
[23:03:01] yfeldblum: has joined #RubyOnRails
[23:03:25] code1o6: has joined #RubyOnRails
[23:03:54] jenrzzz: has joined #RubyOnRails
[23:03:54] Fire1o6: has joined #RubyOnRails
[23:04:54] N0_dp: has joined #RubyOnRails
[23:05:39] htmldrum: has joined #RubyOnRails
[23:05:52] FrankD: has joined #RubyOnRails
[23:05:56] bricker: bitkiller: someone might be able to help if you explain your problem
[23:06:29] bitkiller: just bootstrapped a new app and run rails server
[23:07:22] bitkiller: some nil in the 'vs' in the line i posted above: https://github.com/rack/rack/blob/53d9351b36a560a816db0b8d132b9665e81e3420/lib/rack/handler/webrick.rb#L93
[23:08:26] bitkiller: "undefined method `split' for nil:NilClass "
[23:09:28] bricker: bitkiller: gist the full error and the command you're running
[23:09:53] _djbkd: has joined #RubyOnRails
[23:13:03] bitkiller: http://pastie.org/10455013
[23:13:08] diegoviola: has joined #RubyOnRails
[23:13:34] havenwood: has joined #RubyOnRails
[23:14:18] rickmasta: has joined #RubyOnRails
[23:15:38] Capela: has joined #RubyOnRails
[23:16:11] sanjayu: has joined #RubyOnRails
[23:16:32] allcentury: has joined #RubyOnRails
[23:18:33] arooni: has joined #RubyOnRails
[23:23:50] bronson: has joined #RubyOnRails
[23:23:52] CanTonic: has joined #RubyOnRails
[23:25:07] Radar: a1fa: You're again failing to show the complete context.
[23:25:17] Radar: a1fa: what is car defined as? Is it a local variable, or is it a method?
[23:25:22] Radar: Typically, is_a? takes a class
[23:25:28] Radar: And why are you using find_each?
[23:26:02] ivanskie: has joined #RubyOnRails
[23:27:15] julian_hello_: has joined #RubyOnRails
[23:27:18] mices: has joined #RubyOnRails
[23:27:55] lasker85: has joined #RubyOnRails
[23:28:17] mices: where is a repository of downloadable rails apps?
[23:29:15] rushed: mices: github~
[23:29:21] wldcordeiro: has joined #RubyOnRails
[23:29:49] a1fa: Car is a ActiveRecord
[23:30:03] mices: i googled downloadable rails apps and i didn't find any such repository can you give me more of the github path
[23:30:05] lasker85: has joined #RubyOnRails
[23:30:13] a1fa: Car is a ActiveRecord::Base
[23:30:28] rushed: mices: what are you looking for?
[23:30:38] RegulationD: has joined #RubyOnRails
[23:30:40] mices: whatever i can find
[23:30:54] rushed: mices: to do what?
[23:31:07] mices: to throw a domain name on
[23:31:27] mices: i don't care what it does ha ha
[23:31:57] rushed: mices: sounds like you're looking for something like http://www.squarespace.com then :)
[23:32:17] mices: heh really? cool thanks lemme check that
[23:33:47] mices: i don't think that's what i'm looking for
[23:33:55] mices: someone in this room told me there is such a thing
[23:34:12] tejasmanohar: has joined #RubyOnRails
[23:35:00] rushed: mices: you probably didn't expalin that you were just trying to park a domain
[23:41:07] ktchup: has joined #RubyOnRails
[23:41:08] jenrzzz: has joined #RubyOnRails
[23:41:39] baweaver: ...so you're trying to park domains based on github rails projects?
[23:43:59] annlewis: has joined #RubyOnRails
[23:44:21] mices: i'm saying people may develop rails apps and post them online for others to use
[23:44:29] rhizome: is there a way to do somethign like @obj.inspect(certain fields...)
[23:45:15] chipotle: has joined #RubyOnRails
[23:45:35] trautwein: has joined #RubyOnRails
[23:46:26] loc22: has joined #RubyOnRails
[23:46:29] mices: rushed: domain parking has nothing to do with it
[23:47:53] mices: to me domain parking is something i came across when i put a domain up for sale on flippa
[23:48:09] mices: they asked if i wanted to park the domain
[23:49:53] juliojulio_: has joined #RubyOnRails
[23:51:12] pjammer: has joined #RubyOnRails
[23:53:38] umgrosscol: has joined #RubyOnRails
[23:54:10] Josh_: has joined #RubyOnRails
[23:54:43] tejasmanohar: has joined #RubyOnRails
[23:54:54] lasker85: has joined #RubyOnRails
[23:58:23] tejasmanohar: has joined #RubyOnRails