CalvinnHobbes

Activity Graph

Page 1 of 1

2015-07-18

[06:47:57] CalvinnHobbes: has joined #RubyOnRails
[06:47:57] CalvinnHobbes: has joined #ruby
[13:32:55] CalvinnHobbes: Ping timeout: 250 seconds

2015-07-06

[04:06:36] CalvinnHobbes: Ping timeout: 256 seconds

2015-06-25

[01:36:24] CalvinnHobbes: has joined #RubyOnRails
[01:36:24] CalvinnHobbes: has joined #ruby

2015-06-24

[17:27:39] CalvinnHobbes: Ping timeout: 244 seconds

2015-06-22

[04:03:03] CalvinnHobbes: Ping timeout: 256 seconds
[05:51:41] CalvinnHobbes: has joined #RubyOnRails
[05:51:41] CalvinnHobbes: has joined #ruby

2015-06-18

[04:12:17] CalvinnHobbes: has joined #RubyOnRails
[04:12:17] CalvinnHobbes: has joined #ruby

2015-06-16

[07:15:48] CalvinnHobbes: Ping timeout: 244 seconds

2015-06-13

[02:46:04] CalvinnHobbes: Ping timeout: 245 seconds
[05:04:49] CalvinnHobbes: has joined #RubyOnRails
[05:04:49] CalvinnHobbes: has joined #ruby
[05:13:52] CalvinnHobbes: Remote host closed the connection
[05:14:14] CalvinnHobbes: has joined #RubyOnRails
[05:14:14] CalvinnHobbes: has joined #ruby
[06:38:34] CalvinnHobbes: Ping timeout: 276 seconds
[07:34:18] CalvinnHobbes: has joined #RubyOnRails
[07:34:18] CalvinnHobbes: has joined #ruby
[16:55:46] CalvinnHobbes: Ping timeout: 255 seconds
[17:09:10] CalvinnHobbes: has joined #RubyOnRails
[17:09:10] CalvinnHobbes: has joined #ruby

2015-06-12

[03:09:28] CalvinnHobbes: has joined #RubyOnRails
[03:09:28] CalvinnHobbes: has joined #ruby
[08:49:36] CalvinnHobbes: Ping timeout: 264 seconds
[08:57:30] CalvinnHobbes: has joined #RubyOnRails
[08:57:30] CalvinnHobbes: has joined #ruby

2015-06-11

[03:26:45] CalvinnHobbes: Ping timeout: 256 seconds
[03:28:27] CalvinnHobbes: has joined #RubyOnRails
[03:28:27] CalvinnHobbes: has joined #ruby
[20:42:03] CalvinnHobbes: Ping timeout: 256 seconds

2015-06-10

[01:32:51] CalvinnHobbes: has joined #RubyOnRails
[01:32:51] CalvinnHobbes: has joined #ruby
[01:37:29] CalvinnHobbes: Ping timeout: 256 seconds
[02:32:39] CalvinnHobbes: has joined #RubyOnRails
[02:32:39] CalvinnHobbes: has joined #ruby

2015-06-09

[15:37:24] CalvinnHobbes: Ping timeout: 246 seconds

2015-05-28

[04:05:45] CalvinnHobbes: Ping timeout: 240 seconds
[04:08:07] CalvinnHobbes: has joined #ruby
[20:28:05] CalvinnHobbes: has joined #RubyOnRails
[23:33:35] CalvinnHobbes: Hi all, if I want to eager/pre-load the associations on a model object that has already been found. What is the best way?
[23:34:09] CalvinnHobbes: this seems hacky: @model.comments = @model.comments.includes(:author)
[23:34:12] CalvinnHobbes: but it does work
[23:37:06] CalvinnHobbes: isn't that what is happening on the right side?
[23:40:51] CalvinnHobbes: yes thanks kinduff

2015-05-25

[04:48:02] CalvinnHobbes: has joined #ruby

2014-11-10

2014-01-19

2013-11-22

2013-11-20

[05:10:38] CalvinnHobbes: Hello all: I was wondering if it was bad practice to use devise methods signed_in?/current_user within models(non-User model). E.g. I want to set an association between the model and the current_user in a :before_create filter
[05:14:37] CalvinnHobbes: nm, I realized this is stupid

2013-09-30

[18:54:45] CalvinnHobbes: Have a general schema question: I have an app where I have data versus time, that I am eventually going to plot. Lets say temperature in celsius and revenue in dollars. Should I create two models/tables (Temperature, Revenue) or one model such as Data?
[18:56:55] CalvinnHobbes: oh intresting stuff, wasn't familar with that terminology/concept
[18:58:20] CalvinnHobbes: enum datatype is essentially named words that stand in for integers?
[19:00:58] CalvinnHobbes: thank you mcr-credil

2013-08-06

[04:44:57] CalvinnHobbes: hello all! is there something special about the before_destroy that prevents a model that is about to be destroyed from updating its parent?
[04:47:43] CalvinnHobbes: I set up a method that gets called by :before_destroy. The method does an update on on the parent of the model. When I go to rails console it shows the update being called in SQL and then the delete being called in SQL, then it returns the model that was deleted
[04:49:02] CalvinnHobbes: Yakko: pretty much. The parent keeps a count of how many children it has. When of the children is about to be deleted, I want to decrement the parent's count
[04:49:49] CalvinnHobbes: manually... that must be the wrong way
[04:50:26] CalvinnHobbes: ok, thank you!
[04:50:53] CalvinnHobbes: so railscasts is like the rails version of lmgtfy :)
[04:53:05] CalvinnHobbes: yakko: because there are so many ajax screencasts?
[04:53:27] CalvinnHobbes: or because ajax is basic?
[04:54:40] CalvinnHobbes: ah sweet, 32 pages of results... now I have some stuff to learn
[06:34:07] CalvinnHobbes: radar: so its like on big order of operations test?
[06:35:37] CalvinnHobbes: Rader: and then what?
[06:36:11] CalvinnHobbes: I know... I thought I had the capacity to type out Radar... I was wrong

2013-08-04

[00:00:05] CalvinnHobbes: I came up with a function in the controller but there has to be an easier or smarter way
[00:05:34] CalvinnHobbes: sorry this was a major fail in phrasing. C belongs_to A & B
[00:07:53] CalvinnHobbes: gwillen: yes. So should I write a method that returns the appropriate where depending on whether params contains a id for "A" or "B"
[00:10:26] CalvinnHobbes: right so based on my routes I get params[:B_id] or params[:A_id]
[00:10:36] CalvinnHobbes: and I can differentiate between the two types of id
[00:14:50] CalvinnHobbes: sergiocampama: ok so I wasn't too far off
[00:14:59] CalvinnHobbes: sergiocampama and gwillen: thanks!

2013-08-03

[23:51:53] CalvinnHobbes: hi all! What is the proper way to do filtering, particularly filtering by an associated model? I've read scopes and "where", but they seem to be out of date or not the proper way to do it?
[23:57:29] CalvinnHobbes: sergiocampama: A has_many C, B has_many C. B belongs_to A & C. On the index function of Cs controller, I am trying to get all B when you provide the id to either an "A" or a "C"
[23:57:55] CalvinnHobbes: sorry, when you provide the id to either an "A" or a "B"
[23:58:17] CalvinnHobbes: ugh I completely screwed that up
[23:59:18] CalvinnHobbes: "On the index function of Cs controller, I am trying to get all "C" when you provide the id to either an "A" or a "B" in the params"

2013-07-30

[06:53:47] CalvinnHobbes: Is it bad form to create a different type of model within a Model. E.g. if ModelA has_many ModelB is it a bad idea to have methods in ModelA that build ModelBs?
[06:54:33] CalvinnHobbes: Controller better?
[06:55:58] CalvinnHobbes: isn't the has_many a coupling in itself? in my case if B can't exist without A, there is an inherit coupling?
[06:57:52] CalvinnHobbes: I was going to use the build function but just call that within a method of ModelA
[07:00:04] CalvinnHobbes: Yes, perhaps I am being too short sighted regarding re-usability
[07:01:54] CalvinnHobbes: no lines longer than 12?
[07:05:18] CalvinnHobbes: I'll just describe it. I have product and users can vote on it. I need to make sure users only vote once, and products keep track of how many positive or negative votes they got. So Votes belongs_to users and products. Currently I am doing the voting logic in the controller, but I was going to move it to the Product Model
[07:09:14] CalvinnHobbes: OffTheRails: haha, so that seems a bit over my head. Can you gimme a sentence or two about what you mean? I only have run into redis when I was setting up gitlab and im not quite sure what it does
[07:19:01] CalvinnHobbes: OffTheRails: with or without redis?
[07:20:18] CalvinnHobbes: is it a NoSQL type of thing? I am new... and have only be working with this stuff for ~4 mos trying to learn in my off time
[07:20:52] CalvinnHobbes: yes I was reading about those earlier
[07:22:30] CalvinnHobbes: coutner cache columns just store the previous count query, correct? I saw a few gems with conditions. I'll probably try to implement it wihout a gem for the learning experience
[07:23:37] CalvinnHobbes: That's roughly what was thinking when I started, but I wasn't sure
[07:24:02] CalvinnHobbes: haha exeactly TwinkleHood
[07:25:10] CalvinnHobbes: OffTheRails: I as writing tests for Product.vote_with_user when I thought "maybe I am doing this wrong"
[07:27:08] CalvinnHobbes: OffTheRails: great, thank you. Much appreciated for the advice when I am feeling lost
[07:27:46] CalvinnHobbes: I'll put learn redis on TODO list
[07:31:30] CalvinnHobbes: I'm not following: why is that direct access so powerful?
[07:34:59] CalvinnHobbes: TwinkleHood: this : https://blog.linode.com/2013/04/16/security-incident-update/ ?
[07:38:00] CalvinnHobbes: Well thats a pretty weird screw up for them
[07:43:22] CalvinnHobbes: The question is, is DO any better since they are a much newer product than linode
[07:44:08] CalvinnHobbes: thats what I am saying, newer in the sense that they just aren't big enough or enough time passed to be exploited
[16:51:22] CalvinnHobbes: would someone be willing to help me out with a failing rspec test? I can't figure out why it is failing because everything seems to work alright in rails console. I have a pastebin
[16:51:54] CalvinnHobbes: http://pastebin.com/sB39QCKv
[16:53:04] CalvinnHobbes: ok here is the pastie: http://pastie.org/8190621
[19:38:47] CalvinnHobbes: can someone tell me how to properly implement ActiveModel::Dirty on a ActiveRecord::Base class? I just want the changed/changes methods?
[19:39:43] CalvinnHobbes: interactionjaxsn: yes that
[19:40:20] CalvinnHobbes: when I am in Rails console, Vote.new.respond_to?(:changed?) => false
[19:46:55] CalvinnHobbes: interactionjaxsn: why won't it work with new?
[19:52:01] CalvinnHobbes: interactionjaxsn: ah I got it now... it does make sense

2013-03-24

[18:29:54] CalvinnHobbes: if I have a client side js that calculates a hidden form value, should I have a server side function that checks/recalculates the value? Otherwise I can't test it with capybara?

2013-03-22

[21:08:45] CalvinnHobbes: I'm on rails 3.2: how do I define a stylesheet for a single page. E.g. home page has its own style sheet. I'm using sass, btw
[21:16:55] CalvinnHobbes: So is there no way to specify a single scss/css file in the asset pipeline for a single page (controller action)? Should I just make the css part of the controller's css file?
[21:18:21] CalvinnHobbes: but how would make the pipeline pick that file only for the given action?
[21:20:27] CalvinnHobbes: ok got it, thanks!

2013-03-21

[00:04:47] CalvinnHobbes: how do you create temprary variables in a form that will be manipulated by controller to eventually fill in model variables? I.e. I was two serperate selectors one for height ft, the other height inches. I want to pass these two numbers, do a conversion, and have the model store only height(cms)
[00:07:14] CalvinnHobbes: right, but when I goto edit, it gives me an error saying height_in doesn't exist for the model. Which it doesn't
[00:07:44] CalvinnHobbes: is it because I am using form_for?
[00:08:53] CalvinnHobbes: ok thanks.. ill go read that doc

2013-03-20

[19:22:45] CalvinnHobbes: quick question: I have a before_filter that appears to be filtering out actions properly for get requests (index/edit) but none of my put requests are being properly filtered. At least according to my rspec tests. Does anybody know why this would be?
[19:23:14] CalvinnHobbes: put requests for update, and delete
[19:47:37] CalvinnHobbes: One more try: I have a before_filter that appears to be filtering out actions properly for get requests (index/edit) but none of my put requests are being properly filtered. At least according to my rspec tests. Does anybody know why this would be?

2013-03-10

[08:37:23] CalvinnHobbes: Whats the best way to set up a database that has this model: Data Type A and Data Type C are a Many-To-Many relationship. However, each "A" has a certain amount "C". I.e. say I need to know that a specific type of "A" has 3000 "C", where should that be stored?
[08:41:32] CalvinnHobbes: sorry Im not communicating well. How would you store extra information about a specific many-to-many relationship? As a third column in the pivot/join table?
[08:43:48] CalvinnHobbes: ah thanks guys
[08:44:03] CalvinnHobbes: danneu: yeah it was a poorly phrased example
[08:44:50] CalvinnHobbes: so it is ok to have more than just the two keys in a bridge/join table? For some reason I thought that was bad practice
[08:48:09] CalvinnHobbes: ah that is a perfect example of what I was thinking of. Thanks danneu!

2013-02-26

[20:07:40] CalvinnHobbes: is it possible for embedded ruby to alter html in an embedded ruby page that exists outside of <% %>. As a trival example, could you make a gem or call that modified text within a paragraph block?
[20:11:48] CalvinnHobbes: I want to do a "dynamic" find and replace on text... but I suppose the best way would be to store the text as an AR/Model and then do it. No point in having it be static in a view?
[20:12:06] CalvinnHobbes: even if the page's text is static
[20:25:20] CalvinnHobbes: greghoggard: use the "website" version