« Back to channel list

#RubyOnRails - 27 September 2013

« Back 1 day Forward 1 day »
[00:01:51] smathy: pontiki, yep.
[00:05:42] jstrong: can someone help clear out a confusion I have?
[00:05:46] jstrong: http://weblog.rubyonrails.org/2012/2/25/edge-rails-patch-is-the-new-primary-http-method-for-updates/
[00:05:53] jstrong: on that blog the following is claimed:
[00:06:07] jstrong: ??? PUT does not allow partial updates to a resource. ???
[00:06:27] jstrong: what I'm confused about is that I've used PUT many times in the past to do partial updates to a resource. I understand that might classify as abuse of the PUT method
[00:06:37] jstrong: and not correspond to standards, but technically it's possible, right?
[00:07:14] jstrong: as the blog itself states, so what are the side effects to abusing PUT as PATCH, if any?
[00:25:16] RustyShackleford: I'm having trouble storing dates
[00:25:35] RustyShackleford: I'm using a time_select field in my form, but nothing gets saved
[00:25:52] RustyShackleford: in the date column, that is. everything else is working
[00:28:57] lpmusic: RustyShackleford: you should probably gist up the controller / view / model code
[00:29:46] RustyShackleford: http://pastebin.com/jTAHFwVR
[00:29:55] RustyShackleford: here is the view/form
[00:30:42] RustyShackleford: the "begins" and "ends" are a time column
[00:31:04] lpmusic: what does the controller look like?
[00:31:19] JustinAiken: anyone ever seen this? I have a migration that adds a column to a table, and a subsequent migration that depends on the first;
[00:31:20] JustinAiken: running it results in an 'unknown attribute' error, but if I rerun it it works okay - almost like it's running them too fast or something
[00:32:03] RustyShackleford: lpmusic, http://ideone.com/Q4uai3
[00:32:30] RustyShackleford: lpmusic, also I'm rereading my original statement. My issue is with the time fields, not date fields
[00:32:31] lpmusic: RustyShackleford: you forgot to permit :begins and :ends
[00:33:27] RustyShackleford: there are so many files...
[00:36:04] rehat: is there something built into rails to make a web call to another server's api or is there gem that makes this easy?
[00:36:20] RustyShackleford: okay that works. But the date is also being saved in the time column. Is that expected?
[00:36:21] lpmusic: rehat: there's ActiveResource (a gem in rails4 I think, used to be built in)
[00:36:36] lpmusic: RustyShackleford: using sqlite?
[00:38:10] lpmusic: RustyShackleford: sqlite column types (as far as I know) are just for show. It'll store whatever you try to shove in there
[00:38:13] RustyShackleford: i didn't realize that the database made a difference
[00:38:34] RustyShackleford: well my form only lets me choose HH-MM
[00:38:34] jaymiejones86: quick question for anyone, im using environment variables for my secret_token, eg secret_token = ENV['SECRET_TOKEN']
[00:38:52] lpmusic: that's my best guess as to what's happening. Is it just doing today's date?
[00:39:07] jaymiejones86: but for some reason, unicorn will not start up, because no key is set. I can see the environment variable in the shell, but its not getting through to rails, any ideas?
[00:39:21] RustyShackleford: yep, todays date
[00:40:21] lpmusic: RustyShackleford: that's my guess as to what's happening. You can always just "cast" it in the model or osmething with something like strftime("%H:%M")
[01:00:07] seoNinjaWarrior: If i have two tables, users and roles, and I set roles to "has_many :users" and users to "belongs_to :role". I can do Role.first.users and get an output, is there a way using only the relationships I've setup to do the opposite? To look up the role information using User.first ?
[01:01:49] kitwalker: seoNinjaWarrior: you can just as same do User.first.role
[01:02:30] seoNinjaWarrior: asdjlfasjkfdjasfdl Okay that makes complete sense but it's not working, must be a typo somewhere
[01:03:17] kitwalker: seoNinjaWarrior: check the migration. might be a typo with the model name (singular instead of plural or something like that)
[01:04:50] seoNinjaWarrior: thank, that's a huge help
[01:06:13] seoNinjaWarrior: kitwalker is awesome
[01:10:18] DoctorMonocular: anyone understand this issue? https://gist.github.com/PeteMichaud/55ffd3fec54a6d8540fc
[01:10:34] DoctorMonocular: not sure what I need to do differently to get the "receivings" working
[01:12:00] Radar: DoctorMonocular: what does pm.valid? say
[01:12:40] DoctorMonocular: https://gist.github.com/PeteMichaud/c69eaf30403aa5d6fc14
[01:12:51] DoctorMonocular: sameish thing as the save
[01:22:02] Radar: DoctorMonocular: so it's rolling back because the save failed
[01:22:06] Radar: DoctorMonocular: save a valid record :)
[01:22:13] DoctorMonocular: yes, I get that
[01:22:21] DoctorMonocular: what I don't get is WHY the record is invalid
[01:22:30] Radar: pm.errors
[01:22:38] DoctorMonocular: maybe I don't get the magic involved
[01:22:48] DoctorMonocular: the errors are "Receivings in invalid"
[01:23:05] DoctorMonocular: that's not really helpful -- what I know is that receivings essentially needs 2 things
[01:23:13] DoctorMonocular: a recipient and a receivable
[01:23:20] DoctorMonocular: I pass in the recipient id
[01:23:30] DoctorMonocular: and the receivable is already the parent
[01:23:59] DoctorMonocular: so it should go through, but obviously I don't fully understand how the nested create works for has_many :through
[01:24:45] DoctorMonocular: does it really take recipient_ids, look for the :through object type, and instantiate one of the receivings per id I pass?
[01:25:04] DoctorMonocular: does it know from "recipient_ids" that the value I passed is a recipient_id?
[01:25:39] DoctorMonocular: does the parent id and type get populated at the right time during that process (ie after parent save, before receiving save)
[01:27:00] DoctorMonocular: what I'm seeing from the log is that it knows those ids are user ids
[01:27:07] DoctorMonocular: so it grabs those users
[01:27:28] DoctorMonocular: then it tried to see if the receivings exist, but it does that wrong because the parent columns are both null, which isn't right
[01:28:06] DoctorMonocular: then it checks that the users it just got exist, which I don't understand
[01:28:37] DoctorMonocular: then it gets the author of the message (id 1), for a reason I don't understand
[01:28:45] DoctorMonocular: then it fails at that point, for a reason I don't understand
[01:32:47] advorak: I have an after_initialize, but I don't want it to run everytime I search a model (Post) ... I only want it to run if I am creating a new instance (ie. Post.new, but not Post.where( ) ) -- which callback should I be using?
[01:33:06] Radar: advorak: Why do you want it to run in the first place? What does it do?
[01:33:19] Radar: DoctorMonocular: show me the full code again.
[01:33:34] DoctorMonocular: https://gist.github.com/PeteMichaud/55ffd3fec54a6d8540fc
[01:33:41] Radar: DoctorMonocular: I don't get how the message relates to receivings
[01:34:23] DoctorMonocular: A Message has_many receivings, and has_many recipients :through receivings
[01:34:49] advorak: Radar, Post has_many :post_metas .. when Post.new is run, it creates a skeleton structure of a bunch of new post.post_metas
[01:35:06] DoctorMonocular: a receiving belongs to a recipient and a receivable (ie a message)
[01:35:43] Radar: advorak: But why? Can't you just define another method on the model that does that?
[01:35:48] Radar: advorak: why an after_initialize?
[01:36:07] Radar: What is so hard about calling one extra method? Callbacks are super hard to track down
[01:36:29] sevenseacat: callbacks are a pain
[01:36:42] Radar: DoctorMonocular: So how are the receivings invalid? Can you do pm.receivings.map { |r| r.valid? }
[01:37:44] DoctorMonocular: the receivables are blank
[01:38:14] jrobeson: guten tag Radar , sevenseacat
[01:38:29] DoctorMonocular: jrobeson: chopped liver over here
[01:38:43] Radar: jrobeson: hola
[01:38:54] Radar: DoctorMonocular: then how can they be invalid?!
[01:38:58] Radar: Lol rails
[01:39:02] advorak: Radar, I am working with a wordpress site that requires certain post.post_metas in order for it to function correctly (poor design). To change this is not an option. When a new post is created, if none of the post_metas are entered, I want to simply have a shell of post_metas that get saved by default with default values .....
[01:39:03] jrobeson: DoctorMonocular, sounds like you made your model into chopped liver :)
[01:39:31] jrobeson: oh wait.. no that's somebody else
[01:39:36] Radar: advorak: so make a method that creates those post_metas on any Post object
[01:39:49] madnificent: advorak: not sure, but wouldn't you want to create a method for that and add an after_create callback?
[01:40:35] advorak: madnificent, Radar, thank you :-) that should work ..
[01:40:37] jrobeson: still plenty more language greetings to go with ..
[01:41:07] jrobeson: sevenseacat, Radar : did you two take any language classes in school or otherwise use them regularly?
[01:41:08] DoctorMonocular: Radar: the receivings are being generated by nested attributes I'm supplying to a PrivateMessage.new class, so the receivings.receivable should be populated with the parent object that's creating the receivings, but they aren't. I don't know why?
[01:41:27] DoctorMonocular: I thought validating the presence of the receivable would force it to save first
[01:41:31] sevenseacat: jrobeson: i did italian in primary school and japanese in high school.
[01:41:34] DoctorMonocular: but... I guess not?
[01:41:49] jrobeson: that's neat sevenseacat
[01:41:52] sevenseacat: now i do german on duolingo >_>
[01:41:53] Radar: jrobeson: I took German in Primary, Chinese in high School
[01:42:02] jrobeson: smarty pantses :(
[01:42:07] DoctorMonocular: my daughter is taking chinese now, she likes it
[01:42:10] Radar: Never got exceptionally good at either of them. Considering doing German when things quieten down (lol)
[01:42:40] sevenseacat: i'm lucky that i know a few german native speakers that i can bounce things off
[01:42:46] jrobeson: i only took spanish.
[01:43:08] jrobeson: there were no language classes until high school in my area
[01:43:35] sevenseacat: compulsory over here to do a second language until year 10
[01:43:40] jrobeson: i figured that
[01:43:47] jrobeson: i bet it's common now for school kids
[01:44:08] DoctorMonocular: I took latin, german, greek, and spanish all in high school
[01:44:15] n_blownapart: linguistic question. I'm trying to create users in sql. The first user has user_id nil and no timestamps; and the next two were fine. thanks: http://pastie.org/8358917
[01:44:19] jrobeson: that's a lot of languages..
[01:44:24] DoctorMonocular: only one I actually learned worth a damn was spanish but that's because I lived in mexico, hah
[01:44:56] jrobeson: well spanish is still the most useful day to day in all the americas
[01:45:00] sevenseacat: n_blownapart: still got that password length validation?
[01:45:20] sevenseacat: 'myoho' isnt 6 characters
[01:45:35] jrobeson: sevenseacat, so you'd recommend duolingo?
[01:45:40] n_blownapart: dang you are a smart one sevenseacat . many thanks
[01:45:41] sevenseacat: jrobeson: very much so
[01:45:52] jrobeson: whoo.. time to brush up on my spanish
[01:46:00] sevenseacat: especially next month when they start doing crowdsourcing of language data to add more languages
[01:46:16] jrobeson: i'd like to learn a bit more japanese
[01:46:26] sevenseacat: im hoping that gets added real soon
[01:47:24] n_blownapart: jrobeson: japanese is brutal I lived there for a few years...
[01:48:05] sevenseacat: also, this http://blog.duolingo.com/post/53207277316/a-duolingo-proposal is awesome
[01:48:12] jrobeson: hmm.. ok.. so i have an actual rails question.. :( why would one prefer to use validates :my_association , length: { minimum: 2} vs validates :my_association_count_check
[01:48:13] thebobmarley: jrobeson: Let me help you: http://www.youtube.com/watch?v=-JhwxTen6yA
[01:48:40] jrobeson: a lot of people were recommending the later on stack overflow for no reason..
[01:50:17] jrobeson: the 2nd seems nicer to me when one isn't tryin to do anything too fancy, but perhaps there is some issue with it that that is unclear to me
[01:50:59] jrobeson: i just wanna make sure a game has at least two players when you start it
[01:51:58] jrobeson: and.. i think i just though of a reason ... i think i'd also like to make sure there is also at least one player on each team..
[01:52:04] parndt: that's pretty unfair to the solo game player market
[01:52:38] jrobeson: well the point of the game is the risk of getting shot.. otherwise people would just play lazertag and never paintball
[01:53:09] sevenseacat: i learnt my lesson from paintball
[01:53:16] parndt: aim better?
[01:53:29] parndt: temporarily
[01:53:32] parndt: life hurts
[01:53:34] RustyShackleford: also, you will always get owned by people with better guns
[01:53:40] parndt: I urge you to keep playing that
[01:53:40] sevenseacat: and more ammo
[01:53:40] RustyShackleford: which is what pissed me off more
[01:53:55] parndt: ahhh so you play on a field where everyone has the same guns
[01:54:02] jrobeson: well at least in this game, you ca'nt really run out of ammo, you can just pick them up off the ground
[01:54:10] RustyShackleford: the rental guns hurt way less than the rapidfire guns with double pressure
[01:54:23] sevenseacat: parndt: that doesnt exist over here, they charge you a packet for the ammo
[01:54:34] parndt: but you can buy in to games with unlimited ammo
[01:54:36] RustyShackleford: anyway it was fun
[01:54:43] parndt: it's more expensive obviously and a small risk for them
[01:54:44] RustyShackleford: the courses were great
[01:54:47] parndt: but oh so fun
[01:54:51] parndt: I hate running out of ammo
[01:54:55] parndt: I'm a miser
[01:55:14] jrobeson: it's basicalliy paintball, but with foam balls and a pressure sensor on the vests ..
[01:55:32] parndt: so paintball without risk
[01:55:32] pipework: But with paintball, you learn faster.
[01:55:44] parndt: risk makes it fun
[01:55:46] jrobeson: parndt, risk of what? getting hurt still hurts.. perhaps even more
[01:55:50] Radar: rhizome: grrrrrrrrr
[01:55:52] jrobeson: err gettuing hit still hurts*
[01:55:57] Radar: rhizome: "you're a tiger, baby!"
[01:56:06] parndt: Radar: rhizome: grrrrrrrrrrrrrrrrrrrrrrrrrrr
[01:56:07] RustyShackleford: paintball made me literally afraid
[01:56:12] dingus_khan: hi all, I'm trying to find a good resource and explanation of Rails 4's streaming aspect of ActionController--coming up empty handed with google
[01:56:18] pipework: As opposed to figuratively?
[01:56:25] RustyShackleford: the adrenaline rush made it way for fun
[01:56:27] jrobeson: dingus_khan, there are tons of them.. i just implemented it myself
[01:56:43] jrobeson: collected from various google postings
[01:57:00] dingus_khan: jrobeson: I'm happy for you, but I'm frustrated and I've not found the clear guide or explanation I've been looking for
[01:57:00] jrobeson: err blog postings found by google :(
[01:57:12] pipework: I never played with anyone good, but I used to own at paintball.
[01:57:13] jrobeson: dingus_khan, that just means you're not searching well enough :)
[01:57:16] pipework: Both inside and outside.
[01:57:21] jrobeson: dingus_khan, just search for actioncontroller::live
[01:57:29] parndt: there's a built in email validator in Rails eh?
[01:57:54] jrobeson: it's true there is no real guide, but the blog posts are enough to implement it
[01:58:23] krz: when dealing with nosql datastores. yall prefer to use an ORM/ODM (if available) or straight ruby driver?
[01:58:31] dingus_khan: the api reference is handy, but yeah, I was looking for something a little more in-depth...
[01:58:34] jrobeson: i always go wit hthe ORM/ODM
[01:58:35] advorak: madnificent, Radar, What's the difference if I use after_create or after_initialize ? in terms of your concerns for using callbacks?
[01:58:36] pipework: krz: Depends.
[01:58:43] jrobeson: dingus_khan, i didn't even look at the api.. i just looked at blog posts
[01:59:09] Radar: advorak: If you are going to continue asking about callbacks, then please do not direct your questions at me.
[01:59:10] jrobeson: particularly tenderlove's blog post, but his wasn't the only one .
[01:59:22] dingus_khan: ok, well that's already a better lead than I had before, so thanks for that
[01:59:27] Radar: advorak: I already told you *twice* now: callbacks are bad. Define a method to add the post_meta and call it when youn need to do that.
[01:59:28] pipework: advorak: The effing manual is a pretty good read. :D
[01:59:35] jrobeson: it should have came up if you would have searched for actioncontroller::live .
[01:59:47] pipework: Radar, I didn't know you bought into the no-callback cool aide.
[02:00:00] rhizome: NONE SHALL CALL
[02:00:04] jrobeson: it's 3rd link on the first page of the google results.. so it should have been at least on your first page dingus_khan
[02:00:05] Radar: pipework: Not completely. They have their time and place, and this is just simply not one of those.
[02:00:14] Radar: pipework: For instance, the adjustments crap within Spree needs a ton of callbacks.
[02:00:14] dingus_khan: I never actually searched for the ::live bit, I was looking more generally for works on streaming so I left that part out of the search terms, sigh
[02:00:14] sevenseacat: i need some new music
[02:00:24] Radar: sevenseacat: bastion soundtrack
[02:00:24] rhizome: aluk todolo
[02:00:32] Radar: pipework: read this: http://ryanbigg.com/2013/09/order-adjustments/
[02:00:33] jrobeson: dingus_khan, well there's plenty ways of streaming without actioncontroller::live
[02:00:52] sevenseacat: ACTION plays bastion soundtrack
[02:00:56] jrobeson: in fact, if you plan on bidirectional streams.. then i wouldn't recommend it
[02:01:12] jstrong: Radar: does your hate for callbacks stem from the callback hell that can occur when abused?
[02:01:22] advorak: Radar, I am using callbacks because I don't know any better.. you suggested that I use a method .. I'm just wondering what the difference between requiring calling a method everytime to set up what I want to set up and using a callback to do that .. I don't understand is all..
[02:01:24] krz: sevenseacat: piano guys
[02:01:30] dingus_khan: I guess I should mention that I'm not actually looking to stream any sort of serious data, I just want to make a Twilio app I made real-time, and I was going to fall back on learning what WebRTC was if this didn't pan out
[02:01:35] jrobeson: my callback hatred stems from .. they should be seperated from the model :)
[02:01:44] Radar: advorak: You're saying you don't want this callback called in ALL situations.
[02:01:57] Radar: advorak: Having a method to do the setup ONLY when you need it would avoid that situtation
[02:02:05] krz: hans zimmer is also pretty good classical
[02:02:05] Radar: I'm sorry, I thought it was exceptionally clear
[02:02:06] jstrong: sevenseacat: http://www.youtube.com/watch?v=z-z6n0gm918
[02:02:13] jrobeson: dingus_khan, well if you want 2 way twilio, use websockets not this .. perhaps via somethign like this https://github.com/ngauthier/tubesock/
[02:02:25] jrobeson: this == actioncontroller::live
[02:02:36] dingus_khan: sweet, thank you!
[02:03:11] jrobeson: dingus_khan, note i have not used or verified that approach .. it's just the way i was gonna go if i ever do need to communicate with my device
[02:04:00] dingus_khan: awesome, thank you jrobeson, I will investigate further or give and up try learning Meteor instead, lol
[02:05:46] advorak: Radar, I *think* I understand the purpose callbacks, now ... Though I don't get why there's an after_create and not an after_new_record_initialized :-P
[02:06:02] Radar: advorak: because sane people don't use callbacks :P
[02:06:02] pipework: advorak: Because you shouldn't think about records.
[02:06:05] pipework: Think about objects.
[02:07:01] jstrong: aren't rails validations essentially callbacks?
[02:07:20] advorak: that is a good point, jstrong ..
[02:07:37] Radar: jstrong: yes, they are
[02:07:38] advorak: pipework, My thick head isn't absorbing the different thinking ;-P
[02:08:00] pipework: Aren't all methods just callbacks to other methods that get called?
[02:08:15] jrobeson: i think using the callbacks is good way to prototype stuff
[02:08:42] pipework: Indirection and implicit action is faster than explicit and simple action?
[02:09:08] pipework: "We develop much faster with no less than 4 layers of indirection."
[02:09:33] jrobeson: it seemed pretty simple to me..
[02:09:52] pipework: Yeah, I can see that. It's pretty simple to make a large jumbled mess in a hurry.
[02:10:00] jrobeson: thus prototype..
[02:10:23] pipework: I prefer not to intentionally write crappy code for the sake of calling it a prototype.
[02:10:31] pipework: If I did, I'd be in ##php right now.
[02:10:59] advorak: pipework, and enjoying the joys of interfacing with wordpress from within active_record ..
[02:11:05] advorak: as I am doing ..
[02:11:11] jrobeson: if you say so.. it's pretty hard to just do such a thign in symfony 2 at all.
[02:11:15] jstrong: Radar: I guess what my point is that a huge part of Rails itself depends on callbacks. Callbacks can lead to insanity quickly but they *do* have their purpose.
[02:11:16] pipework: advorak: Isn't a bullet a cheaper way to go?
[02:11:19] jrobeson: you're pretty well forced to seperate everything
[02:12:18] pipework: Callbacks are great for not having to override methods or add another layer of indirection.
[02:13:07] advorak: pipework, life complicating rails or death? life with rails, of course ..
[02:13:09] pipework: But they're shit in that they allow you to make actions at a distance, they're hard to trace when they're not constantly reigned in and kept well under control.
[02:13:50] pipework: advorak: Dealing with anything but read-only wordpress database access is a recipe for making me want to quit life.
[02:14:20] advorak: pipework, :-) you'll LOVE the customizations, then!
[02:14:24] pipework: Callbacks are a complexity you pay for.
[02:14:30] advorak: (sarcasm, if that didn't come across that way :-) )
[02:14:36] pipework: advorak: :D
[02:14:42] jstrong: pipework: that's a good way of putting it
[02:14:45] pipework: You're disturbingly funny. I like you.
[02:14:51] advorak: function wins :-)
[02:14:53] pipework: jstrong: I try to keep a level head on me.
[02:15:12] pipework: Gotta have somewhere to sit, don't you know?
[02:15:22] jstrong: pipework: that's why I make sure every one of my models has an after_save callback that manipulates attributes on associated objects
[02:15:27] jrobeson: wordpress is better than zencart at least :(
[02:15:47] advorak: def method; end wins over callbacks, rather ..
[02:15:51] jstrong: pipework: to achieve that multi layered nuance deliciousness
[02:15:58] pipework: jstrong: When I'm feeling sexy, I use self-referential models with callbacks on their relations.
[02:16:07] advorak: Radar, pipework, you're pretty sharp ..
[02:16:28] pipework: Radar's no fool. I'm just an ignorant software engineer.
[02:16:32] pipework: Illiterate to boot.
[02:16:38] Radar: I've been doing this long enough now.
[02:17:37] jstrong: every time I see save(validate: false) somewhere a kitten dies
[02:18:27] pipework: Better than `def save_without_validation; save validate: false; end`
[02:18:52] advorak: Radar, pipework, WOW! Not using callbacks didn't make sense to me ... and then I didn't use a callback .. and now it makes complete sense ..
[02:19:11] advorak: pipework, you saved my life, it would appear...
[02:19:21] pipework: advorak: I hope it's worth it.
[02:20:02] advorak: pipework, for me, yes .. for you ... I'm sure at some point I will come up with a similarly complexified problem for you ...
[02:20:46] pipework: Might as well off myself while it's all still worth it. :(
[02:22:04] jstrong: I also see callbacks used a lot when setters would do the job
[02:23:02] bobbobbins: I'm using a gem(which uses savon) to do a bunch of soap stuff???and its mostly working well, but this last soap all i'm making???while it gets a response, savon is returning an error "Element or attribute do not match QName production: QName::=(NCName':')?NCName" Any idea what thats about? like i said, its read all the other xml files that were returned fine???so I'm not sure why it would die here
[02:23:12] pipework: after_receive :gimme, -> { self.other_attribute = self.update_other_attribute(self.whole_nother_attribute - 1) }
[02:23:19] bobbobbins: also, any way to get more info on that error???its not very descriptive
[02:24:41] jstrong: advorak: e.g. here's an example from a rails app i built 2-3 years ago when I was much greener https://gist.github.com/laspluviosillas/22c6067324e6512584b0
[02:25:16] jstrong: advorak: I ommitted the calculate_fee method but in that circumstance calculate_fee depended on an attribute called "duck_count"
[02:26:31] jstrong: advorak: the fee could've been calculated on the setter for duck_count instead of in a before_save. with the before_save I don't know the price of the model until right before it's saved to database
[02:26:32] pipework: I read "duck_cunt", was gonna ask what kind of effed up rails app you were writing, but then I thought better not to.
[02:28:53] advorak: jstrong, thanks! perfect example for a legitimate use of a callback. :-)
[02:29:07] pipework: I think he was sying it was a bad use.
[02:29:09] pipework: saying too.
[02:29:24] pipework: advorak: Learn service objects.
[02:29:31] jstrong: service objects are the best!
[02:30:02] pipework: Dude, I was in here telling people all about this shit for a long time and people were all, "You're insane. This isn't Java. We have callbacks, bro."
[02:30:15] jstrong: pipework: http://hasghari.github.io/2013/09/15/active-record-enhanced-query-objects.html
[02:30:17] jstrong: might be of interest
[02:30:44] pipework: That reminds me of a different post.
[02:31:32] jstrong: the syntactic sugar of ActiveRecord::QueryMethods#extending is pretty sweet
[02:31:40] pipework: You redefine all the activerecord methods to private methods and the only interface you get is the public methods you write that are relevant to the objects in hand.
[02:34:12] jstrong: advorak: one sec let me make my example better.
[02:36:05] jstrong: advorak: https://gist.github.com/laspluviosillas/22c6067324e6512584b0
[02:36:23] jstrong: OK. so in this particular model, fee depends on number of ducks (there are tons of other stuff that could be refactored there btw)
[02:36:52] jstrong: in my first example, I calculate the fee on a before_save callback. this is bad. why? because when my record saves is ultimately irrelevant for the fee calculation
[02:37:03] jstrong: fees are calculated on number of ducks not whenever the model decides to go to the database
[02:37:28] jstrong: as you can see in the first example you get some not-so-fun behavior. fee is 0 until the adoption is saved then presto! now the adoption has a fee!
[02:38:05] jstrong: in the second example fee is calculated *when it is relevant to calculate fee*
[02:38:23] jstrong: fee changes on duck count so we update the fee when duck count changes.
[02:38:41] jstrong: instead of in some random later phase that is ultimately completely irrelevant to fee calculation
[02:53:51] pipework: Wow jstrong, way to kill it.
[02:54:05] jstrong: I did go a bit overboard, yes.
[02:54:39] jrobeson: i think my career in chatroom tech support is nearly over.. now i just get too annoyed :(
[02:55:16] pipework: jrobeson: Remove your pants and imagine everyone else in the channel has to wear proper clothing.
[02:55:18] pipework: That's what I do.
[02:55:18] sevenseacat: are we annoying you >_>
[02:55:27] jrobeson: i think i'll start saying stupid crap like "back in my day"
[02:55:52] pipework: Was it a Tuesday?
[02:56:00] jrobeson: sevenseacat, well obviously not you :)
[02:56:01] sevenseacat: pipework is the kig of tuesdays.
[02:56:10] mva3212: Hey all, I'm trying to create a sign up page that has multiple steps, but want the content to slide right to left as it is complete instead of reload the whole page
[02:56:37] mva3212: is there a js library that does that or should I just try to use jquery to ease in
[02:56:45] zeknox: is there a way to search for a file within a zipped file without having to loop through each of them? Right now I can use Zip::ZipFile(zipped_file) do | file| but im looking for more efficient way
[02:56:50] pipework: vanilla.js should do the trick.
[02:57:18] jrobeson: perhaps i'm just getting jealous that they are all likely making a ton more money than iam and don't even know how to read source code..
[02:57:37] pipework: Which 'they'?
[02:58:07] jstrong: *shrugs* michael bolton makes more money than I do but what he does is not fun.
[02:58:37] jrobeson: pipework, people who come into open soruce project chatrooms for tech support
[02:58:50] jrobeson: especially in popular ones with already existing good docs..
[02:59:06] pipework: People who bother me are the ones who call channels 'chatrooms'.
[02:59:26] pipework: This ain't yahoo chat rooms, bru.
[02:59:28] jrobeson: if you say so..
[02:59:33] jrobeson: enjoy that life
[02:59:34] mva3212: pipework: I'm not all that javascript saavy...what part of vanilla JS would I want to look at
[02:59:41] pipework: jrobeson: I'm just bothering you to be silly.
[02:59:51] jrobeson: pipework, i'm not in a good mood IRL
[02:59:52] pipework: mva3212: The best way to fix that is to become savvy.
[02:59:59] mva3212: I'm trying :)
[03:00:10] pipework: jrobeson: Whenever I'm in a bad mood, I refrain from being sober.
[03:00:27] sevenseacat: jrobeson: we can be bad mood buddies today
[03:00:45] jrobeson: pipework, that'd be nice .. but getting blasted aint' cheap either :)
[03:00:50] mva3212: pipework: I can read/write it I am just not familiar with how to accomplish stuff like sliding content. Can you point me in a more focused direction
[03:01:08] jstrong: Radar: btw just for the record I'm pretty envious of Spree's robust sandbox generation.
[03:01:10] jrobeson: or whatever they say wherever you're from :)
[03:01:34] pipework: mva3212: jQuery.animate
[03:01:47] jrobeson: jstrong, it is nice, .. magical even
[03:01:54] mva3212: pipework: thx :)
[03:02:07] jrobeson: here have an instant store .. boom
[03:02:17] jrobeson: sevenseacat, sup with you then?
[03:02:24] mva3212: just learned about routing constraints today --- mind = blown
[03:02:25] sevenseacat: just work junk
[03:02:34] Radar: jstrong: why's that?
[03:02:44] jrobeson: sevenseacat, in general do you like your job?
[03:02:49] sevenseacat: most of the time.
[03:02:53] jstrong: Radar: because we don't have anything remotely close to adequate on the main application I'm working on :-) (we'll eventually get there)
[03:03:18] jrobeson: how about your colleagues?
[03:03:31] pipework: She gets to work on PHP!
[03:03:44] mva3212: are y'all rails developers by trade?
[03:03:59] pipework: Mostly by indentured servitude.
[03:04:14] mva3212: rails devs make good money ....
[03:04:46] pipework: We're paid so much that we're thrown into a deep depression doing anything else but rails.
[03:05:25] pipework: It's horrible, really
[03:05:59] mva3212: meh, I write embedded c++ and c# and I pretty much feel the same way :o
[03:06:13] mva3212: though rails is pretty ok too :)
[03:06:13] pipework: Dat embedded stuff gives me nerdons.
[03:07:33] jrobeson: sevenseacat, i've never actually worked on a team for paid work stuff, only open source projects
[03:07:54] pipework: jrobeson: Working on open source stuff is fun!
[03:08:03] advorak: jstrong, thanks. I'm thinking of adopting a duck, now .. :-)
[03:08:04] pipework: Especially when you're the only person who gives a damn.
[03:08:12] sevenseacat: my dream is to one day have my own profitable business from an app i wrote myself.
[03:08:15] jrobeson: pipework, i know.. if you're part of the team :) it's always nicer when projects are young before they get all closed off
[03:08:31] advorak: jstrong, it made it clear for me..
[03:08:43] pipework: jstrong: You made a fwend!
[03:08:48] jrobeson: when the core developers close themselves off in thier own little section
[03:09:13] jrobeson: happens too often .. i don't really find it compelling to get too involved in such enteprises
[03:09:23] pipework: Sometimes, if there is no community, closing yourself off is the only way to incubate a project and make it live.
[03:09:47] orangerobot: is there anyone who uses /has used ruby mine on ubuntu and would like to share some thoughts on whether it gets a good workflow going?
[03:11:11] jstrong: if people only read well built open source projects more
[03:11:15] jstrong: they'd answer so many questions they have
[03:11:15] pipework: If you like IDE's that's the way to go.
[03:11:33] jstrong: before consulting the internet on some question I go see how other popular devs have solved my problems by just looking at their code *shrugs*
[03:11:41] jstrong: the internet community*
[03:12:28] pipework: I just remove my pants and get down to business.
[03:13:08] jrobeson: i guess i just have to meet more developers in the flesh
[03:13:28] pipework: It's fun to meet them without wearing pants.
[03:13:33] orangerobot: pipework: i know there'll probably be a learning curve but if there's very good results then it's worthwhile. i'd like to know about gains in productivity from using RubyMine specifically
[03:13:46] sevenseacat: its an IDE. do you like IDEs?
[03:13:46] pipework: orangerobot: I use vim to great success.
[03:14:02] pipework: The most important part is deciding if you prefer an IDE or just a set of tools.
[03:14:21] advorak: jstrong, I have a problem where I often solve problems with complicated solutions ...
[03:14:25] mva3212: orangerobot: what IDe are you coming from?
[03:14:28] esparkman: don't waste time in a IDE
[03:14:33] orangerobot: mva3212: netbeans
[03:14:54] pipework: I bet you could probably learn how to code using the back side of an orangutan if you wanted, but it's important to know what you prefer.
[03:15:01] mva3212: orangerobot: i find sublimetext to be pretty full featured if you smash in a bunch of plugins
[03:15:13] mva3212: I didn't like rubymine
[03:15:20] orangerobot: mva3212: i use that too. i use sublime and netbeans
[03:15:28] mva3212: coming from eclipse/VS
[03:15:31] jrobeson: so far i've just been using vim
[03:15:48] pipework: IDE's have opinions that I don't agree with.
[03:16:28] jrobeson: i prefer to go with conventions.. so IDEs are theoretically good for me
[03:16:41] esparkman: orangerobot: learn vim....http://www.vimgenius.com/ a buddy of mine at Hashrocket did that.
[03:16:54] mva3212: vim has a pretty steep learning curve imo
[03:17:06] jrobeson: there are enough decisions to make in code, i'd rather have to make less in my tooling
[03:17:24] mva3212: esparkman: MY opinion ;)
[03:17:35] esparkman: your tools are....I would say......80% of your productivity
[03:17:57] jrobeson: 80% of productivity is in design.. not in actually typing things..
[03:18:05] pipework: http://vim-adventures.com/ is really fun.
[03:18:12] mva3212: 80% of my productivity is in your mom
[03:18:36] pipework: jrobeson: Most of my productivity revolves around being able to quickly expel ideas from my thinker to my storage media.
[03:18:38] esparkman: wow mva3212 that was extremely mature of you....
[03:18:59] pipework: mva3212: With that mom comments, you've convinced me that you're the sort who'd benefit from an IDE.
[03:19:07] esparkman: my mom says she is proud of you.... those ass spankings she gives you have paid off
[03:19:18] orangerobot: i know vim and use it often.. but i guess vim is most useful when you've left the mouse completely and you can type without looking at the keyboard (including numbers)... i haven't reached that level yet
[03:19:21] jrobeson: esparkman, you don't need to force vim on people..
[03:19:27] mva3212: I do like my IDEs
[03:19:34] pipework: jrobeson: But he do.
[03:19:45] pipework: It's good stuff, that modal editing and muscle memory.
[03:19:55] jrobeson: i use vim .. and it is good
[03:20:18] orangerobot: jrobeson: does it beat an ide in terms of productivity?
[03:20:27] jrobeson: i think that really depends on the project
[03:20:33] esparkman: being a developer has been full circle from IDE to and actual editor, I can say that IDE's are junk when using Ruby/Rails
[03:20:34] pipework: If the good lord had wanted us to never be in modes and just type whatever we wanted willy nilly, then he shoulda made vim not so fucking awesome.
[03:20:43] rhizome: touch typing is where it's at
[03:20:45] jrobeson: something like java .. i think an IDE would be good
[03:20:56] jrobeson: writing out all that crap would be annoying ..
[03:21:07] mva3212: I liked vim a lot when I was doing more C++ -- but higher level languages benefit greatly from IDEs
[03:21:11] jrobeson: in many of the popular frameworks
[03:21:20] pipework: jrobeson: Maybe it's a feature. Then you're resistant you only only write what you absolutely need.
[03:21:28] pipework: mva3212: I don't see why.
[03:21:39] jrobeson: pipework, but you absolutely need all those crazy xml files to run your projects :)
[03:21:50] pipework: The lazier you are, the more an IDE probably appeals to you.
[03:22:03] pipework: I, however, enjoy typing.
[03:22:25] jrobeson: my rails app is small enough that i can't imagine needing an IDE
[03:22:27] pipework: It's nice being able to wail out a bunch of code without auto completion.
[03:22:30] mva3212: pipework: object modeling, uml, built in refactoring/replication I'm sure you can do a lot of that with vim
[03:22:43] jrobeson: i have auto completiion in vim ..
[03:22:53] pipework: Object modeling is silly, uml is silly, automatic refactoring is silly.
[03:22:57] esparkman: ooooo and you can run your specs in the IDE!
[03:22:59] pipework: I've worked on some huge apps with only vim.
[03:23:11] jrobeson: how is object modelling silly?
[03:23:23] pipework: IDE's are about a development environment that's integrated rather than nebulous.
[03:24:09] pipework: jrobeson: Dynamically generating it from existing code is neat. But I don't need to sit and draw out objects and relations on a board.
[03:24:43] pipework: Flow of control and data itself is nice to have a handle on, but I still don't value object modeling much. Most people get stuck in 'thinging' their systems.
[03:24:46] jrobeson: ah i like generating the objct relations from my code
[03:25:11] jrobeson: i used rails_erd to build images from my model
[03:25:33] pipework: "well, we have persons, and courses, and teachers, and students, and grades, and quizzes"
[03:25:53] pipework: Imo, drawing that shit out is a bit too SDLC and for-the-managers(birds)
[03:25:56] jrobeson: the rails migration file was enough of a way to model an object, easy to type
[03:26:11] jrobeson: and it works from what you type :)
[03:26:18] jrobeson: without some intermediate format
[03:28:07] orangerobot: in my view i think vim is only good if you can keep you hands at the place and only move your fingers. but is that possible? i mean with the need to type number and special characters and all.... if i can't keep my hands in the same position then it breaks the whole flow... i might as well grab the mouse
[03:28:27] pipework: orangerobot: You're a weird cookie.
[03:28:30] orangerobot: and if you resort to the mouse then ides look a lot sexier
[03:28:40] pipework: I know every key on my keyboard, even the ones that are often less used.
[03:28:52] pipework: I use a DasKeyboard Ultimate blank key.
[03:29:19] bratsche: There are also keyboard layouts that are supposedly better for programmers.
[03:29:48] bratsche: I haven't used one, but a guy I work with uses one called neo or neo2 or something like that.
[03:29:55] orangerobot: well yes I would gladly substitute my caps lock key with control for instance
[03:30:10] mva3212: web developers are a weird bunch.
[03:30:28] pipework: Who are you talking about?
[03:30:40] mva3212: web developers
[03:30:42] pipework: ACTION isn't a wobdeveloper
[03:30:45] bratsche: All developers are weird.
[03:30:47] orangerobot: the thumbs too... the space bar doesn't need to be so large... a lot of wasted opportunities for idle thumbs
[03:31:06] mva3212: what do you write pipework
[03:31:25] pipework: mva3212: According to future me, shit code. :(
[03:31:28] orangerobot: thumbs are idle like 90% of the time. keyboards could definitely get a revamp for coding
[03:31:31] bratsche: I'm not a web developer at work, but I am in my free time I guess.
[03:31:35] bratsche: pipework: heh, nice.
[03:31:47] mva3212: same here bratsche
[03:31:55] pipework: Honesty will win you more laughs than you desire. :(
[03:32:02] bratsche: I work on desktop software right now I guess.
[03:32:06] sevenseacat: ACTION is a born and bred awesome web developer
[03:32:15] mva3212: i sit in a lot of meetings
[03:32:27] bratsche: Working on an IDE now.
[03:32:50] mva3212: sounds pretty sweet actually
[03:32:58] bratsche: Which is kind of funny since I've never really been much of an IDE user.
[03:34:06] pipework: sevenseacat: as long as not inbred.
[03:34:30] jstrong: it's hard to find good lightweight IDE's
[03:34:38] jstrong: you either go vim/sublime or eclipse/rubymine route
[03:34:53] bratsche: The IDE I work on isn't for Ruby.
[03:34:54] pipework: What's a lightweight IDE?
[03:35:12] mva3212: compared to visual studio everything is lightweight lmao
[03:35:27] pipework: http://www.icsharpcode.net/ ?
[03:35:45] bratsche: I used to always use emacs until I started doing Ruby, then I started using sublime and later started using vim.
[03:35:56] pipework: You should just integrate your own development environment to your tastes.
[03:36:01] mva3212: i like emacs =/
[03:36:14] pipework: If only they could get a good editor into their OS.
[03:36:17] pipework: Gnu is not a bootloader.
[03:37:06] jstrong: I'm really interested in that IDE adobe is developing built entirely on web technologies
[03:37:19] jstrong: because it's going to make cloud collaborative editing so awesome
[03:37:31] pipework: I use tmux here and there for pairing.
[03:37:46] pipework: Otherwise, I use git because I don't trust anyone in my workspace when I'm not there.
[03:38:13] bratsche: You should use git regardless. :)
[03:38:22] jstrong: pipework: we do efverything remote
[03:38:38] jstrong: pipework: cloud9 is the only thing that comes remotely close to allowing for good remote combined programming
[03:38:40] pipework: jstrong: I develop locally so I never need connectivity.
[03:38:53] pipework: jstrong: I wouldn't use it, it goes against my very moral fibers.
[03:39:34] sevenseacat: cloud collaborative editing? how does that work
[03:39:48] jstrong: ok i threw in the world cloud there because
[03:39:50] bratsche: lighttable seems like it will be pretty cool.
[03:39:52] jstrong: it makes everything sound that much more awesome
[03:39:53] pipework: sevenseacat: Google docs on teroids.
[03:40:08] jstrong: but yeah it's like google docs for code
[03:40:19] sevenseacat: does it integrate with my git repo and my test suite and all that
[03:40:24] bratsche: I think lighttable is mostly for clojure and javascript at this point though.
[03:40:27] pipework: The original author of c9 wanted to work with me on merging c9 into my cloud offering project.
[03:41:18] jstrong: I can't use c9 just because we did some insane stuff with our rails repository and nearly none of those cloud services are sophisticated enough to build.
[03:42:27] bratsche: Anyone working on any fun ruby/rails projects?
[03:42:37] pipework: Only when I'm drunk!
[03:42:45] pipework: So yeah, most of the time.
[03:44:29] zeknox: im trying to save an ActiveRecord model from a yaml file, but its not saving. however if I create a new model and copy the properties over except for id it works, how can I detach from the Active model entity effectively
[03:44:48] pipework: You'll want to show code.
[03:44:58] pipework: There's a small chance you may, in fact, be doing it wrong.
[03:45:43] pipework: Practically nonexistent.
[03:45:59] mva3212: bratsche: greenhouse monitoring and automation system with rails front end
[03:46:00] sevenseacat: but we have to ask anyway.
[03:46:17] pipework: mva3212: I think I heard that one before
[03:46:23] jstrong: I'm pretty sure he's doing it right and rails is doing it wrong pipework
[03:46:41] pipework: jstrong: If you knew DHH, you'd know that ain't be true.
[03:46:43] mva3212: pipework: it is possible -- I hang out in the channel occasionally
[03:47:51] mva3212: I think it is cool anyway --- not exactly turning a profit just yet but hopefully soon
[03:51:22] bratsche: mva3212: nice
[03:54:14] orangerobot: upon running gem install rails on ruby-head on rvm , "Parsing documentation for rails-4.0.0 Installing ri documentation for rails-4.0.0" is taking an awfully long time. is this expected?
[03:55:24] Radar: orangerobot: how long?
[03:55:44] orangerobot: about 5 minutes now
[03:55:55] Radar: seems excessive
[03:56:10] Radar: you can probably cancel that and try again with --no-ri --no-rdoc appended to the command
[03:57:36] orangerobot: Radar: hmmm.. thx.. went fast like a lightning now hehe
[03:59:50] Radar: All of that documentation is available online anyways
[04:00:00] Dreamer3: isn't returning false how you stop the chain with a before_filter?
[04:00:29] smockle: Has anyone here ever used the Autoprefixer gem? I added it to my Gemfile and ran `bundle install` and `bundle update`, but it doesn't seem to be working.
[04:00:48] ryanf: Dreamer3: no
[04:00:49] helpa: smockle: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[04:00:49] Radar: smockle: !debug
[04:00:54] Radar: ryanf: really?
[04:01:01] Radar: ryanf: pics or ban
[04:01:03] ryanf: you have to render or redirect
[04:01:09] ryanf: otherwise what should it send to the client?
[04:01:14] DoctorMonocular: is it possible to use pry to step through execution?
[04:01:18] Radar: ryanf: nada
[04:01:21] ryanf: DoctorMonocular: check out pry-debugger
[04:01:21] pipework: DoctorMonocular: Yeah, there's a pry-debug
[04:01:25] pipework: or debugger
[04:01:27] Dreamer3: ryanf: so it just ignores false if you don't redirect, that doesn't sound right
[04:01:42] Dreamer3: though i'm seeing it ignore false here, which is driving me nuts
[04:01:44] ryanf: I think people get confused about this because it's different from model callbacks
[04:01:44] sevenseacat: ACTION installs gems for app on ruby 2.1
[04:01:58] pipework: sevenseacat: Ooh, hipsterrific.
[04:01:59] ryanf: Radar: nada like no response of any kind?
[04:02:02] ryanf: that would be pretty weird
[04:02:07] Dreamer3: ACTION adds a redirect
[04:02:15] Dreamer3: and now it works
[04:02:27] Dreamer3: i guess i've never just returned false before without a response
[04:02:30] Dreamer3: i've never seen this
[04:03:12] Radar: ryanf: yeah, you're right. Sorry.
[04:03:21] ryanf: np, not like you banned me :)
[04:03:22] Dreamer3: yep he seems to be
[04:03:29] Radar: ./msg chanserv op #rubyonrails Radar
[04:03:30] Radar: Can be arranged ;)
[04:03:32] Dreamer3: so i just return a 404 and now it all works like magic
[04:03:34] Radar: https://gist.github.com/radar/6723942 <- proved it with
[04:03:42] Dreamer3: how many years have i been doing it and i didn't know that?
[04:03:43] Radar: Dreamer3: I thought you were good at this Rails thing?
[04:04:13] ryanf: that surprised me too when I found out about it. I think because a lot of people write filters that return false unnecessarily
[04:04:18] ryanf: because they're thinking of AR callbacks
[04:04:39] ryanf: or maybe in some ancient version of rails it wouldn't automatically cancel the request on render or redirect and you had to return false
[04:04:56] Dreamer3: false is supposed to stop the chain
[04:05:01] Dreamer3: it even says that in the logs i'm pretty sure
[04:05:07] Dreamer3: i see it al the time
[04:05:18] Dreamer3: one sec i can reproduce
[04:06:29] Radar: False does not stop the chain in my test
[04:06:33] Radar: render or redirect stops the chain
[04:10:16] yaymukund: ok, dumb question. why isn't my session_helper getting included in my controller? https://gist.github.com/yaymukund/4586daf6a5f7d922a9d5
[04:10:32] sevenseacat: because you're not including it and probably shouldnt be?
[04:10:39] sevenseacat: helpers are for views
[04:10:44] sevenseacat: hartl gets this so very wrong
[04:12:36] yaymukund: who's hartl? the docs suggest that the module is included in my controller: "By default, each controller will include all helpers."
[04:12:42] yaymukund: http://api.rubyonrails.org/classes/ActionController/Helpers.html
[04:12:52] rhizome: yaymukund: put that current_user junk in application controller
[04:13:16] Radar: yaymukund: all the controllers will include the helpers for the views.
[04:13:36] sevenseacat: yeah thats a bit misleading
[04:13:37] Radar: yaymukund: The methods from all the helpers are not available in controllers unless you violate the purpose of helpers and include them into controllers.
[04:13:59] yaymukund: Radar: ah, okay. I've always associated helpers with views, so I did find that surprising
[04:14:13] yaymukund: sevenseacat, rhizome, ditto. thanks all!
[04:14:40] yaymukund: (moving it to app_helper as suggested)
[04:14:47] yaymukund: err, app_controller*
[04:15:58] yaymukund: ha, thinko :p it's sleepy, and I'm coding after our office had our "new office" party
[04:16:07] yaymukund: this code is gonna be great
[04:16:48] sevenseacat: i suggest not coding.
[04:16:53] uberjar: is there a mixin I can use to get accepts_nested_attributes_for functionality for my database models which are not activerecord based ? Is this part of activemodel ?
[04:17:05] Radar: uberjar: Yes, it's called "coding it yourself"
[04:17:20] Radar: ACTION takes uberjar's training wheels and burns them
[04:17:30] uberjar: Iv'e been working on that.. sec
[04:17:45] uberjar: https://gist.github.com/anonymous/6724080
[04:18:30] uberjar: now I just have to figure out the right way to hook that into my model class
[04:18:57] uberjar: ok well I guess that means it's not an activemodel mixin
[04:19:18] uberjar: I will go finish my own implimentation.. sayanara
[04:19:58] Radar: uberjar: Typical module inclusion would do it.
[04:26:19] orangerobot: i've already installed a javascript runtime but I still see rails telling me it hasn't found it as I try to launch a server using rails server. http://pastie.org/8359117 any ideas?
[04:27:03] pipework: If you used an IDE, you'd not have these problems.
[04:27:34] pipework: orangerobot: Unfortunately, you'll need it in your bundle too.
[04:29:23] varfoo: how do i update an attribute within a hash?
[04:29:38] varfoo: something like.. a = {foo: 'bar'}
[04:30:02] varfoo: a.update_attributes({var: 'foo'})
[04:30:42] varfoo: pipework: could you give an example?
[04:30:54] pipework: varfoo: http://www.ruby-doc.org/core-1.9.3/Hash.html
[04:32:18] orangerobot: pipework: do you mean adding load Gem.bin_path('therubyracer', 'therubyracer') to my bundle file?
[04:32:43] pipework: orangerobot: Just add `gem 'therubyracer'` in your Gemfile.
[04:33:46] orangerobot: thanks pipework
[04:34:59] zeknox: fml....pry-debugger seg faults
[04:36:21] varfoo: pipework: thanks got it!
[04:38:13] arkiver: Hello. I am trying to get something working while migrating from rails2 to rails 3. Whenever my app crashes, I want rails to redirect to the home page and show a flash message that an error occured. My current code is this: http://pastie.org/private/qpmqgvgqkfvaxi9ylqbpvg
[04:38:23] arkiver: But it doesn't seem to work the way it does in the rails 2 app
[04:38:31] arkiver: How can I make it work in rails 3 ?
[04:38:42] arkiver: rhizome: yes crashes
[04:39:04] zeknox: rhizome: hell yeah, crashes entire web brick when it seg faults trying to type 'next' inside pry... good times were not had by all...
[04:39:05] arkiver: This is code is there in the application controller
[04:39:08] rhizome: what kind of crash? generally, if the app crashes, there is no redirect
[04:39:23] foucist: rhizome: i assume it's not a real crash :P
[04:39:30] foucist: probably the typical error message
[04:39:32] arkiver: If an object throws a nil value, 404s, etc
[04:39:35] foucist: "We're sorry, but something went wrong."
[04:39:57] arkiver: instead of 'we're sorry something went wrong' I want to just display the flash message
[04:40:10] foucist: arkiver: well you can set up the 404.html file and the route, i don't recall how to do that
[04:40:12] arkiver: or if a method is called on a nil object
[04:40:18] arkiver: stuff like that
[04:40:44] arkiver: it works like a charm in rails2. But just won;t budge in rails 3
[04:41:07] arkiver: I saw somewhere that the rescue_action_in_public method doens't work really well in rails 3
[04:51:36] s2013: is rails consulting for 4-6 weeks a common thing?
[04:52:01] zeknox: having issues extracting a zip archive recursively, it crashes when it hits the first folder, here is the code => http://pastie.org/private/xk8zgez7ndyrx1pbayzemq
[04:52:05] heartsentwined: hi all, I'm running into a problem with activerecord + mysql2 adapter + utf8mb4 encoding
[04:52:05] Radar: s2013: Subjective.
[04:52:09] helpa: heartsentwined: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[04:52:09] Radar: heartsentwined: !debug
[04:52:13] heartsentwined: described in http://donpark.org/blog/2013/02/16/rails-3-2-12-not-ready-for-mysql-5-5-utf8mb4
[04:52:20] jstrong: s2013: if you're a badass then sure.
[04:52:20] Radar: heartsentwined: that's not your blog post.
[04:52:25] s2013: whats the subjective part? common?
[04:52:27] heartsentwined: no that's not mine
[04:52:29] Radar: heartsentwined: please explain your problem.
[04:52:30] s2013: i was just curious
[04:52:42] heartsentwined: but it's the same thing, basically the schema_migrations table creates a (255) length column
[04:52:43] Radar: s2013: Different folks, different strokes.
[04:52:45] s2013: i know like in SAP/Oracle and stuff its pretty common
[04:52:54] heartsentwined: but utf8mb4 can only have one capped at 191 chars
[04:53:06] Radar: heartsentwined: solution: don't use mysql
[04:53:35] heartsentwined: no way around the schema_migrations table problem?
[04:54:05] s2013: stupid question but anyway to pass js variable into a rails code somehow?
[04:54:28] heartsentwined: or any pointer towards where I can monkeypatch the schema_migrations table?
[04:54:36] jstrong: whoa I didn't know Github can symlink to seperate repositories!
[04:54:40] jstrong: that's so neat
[04:54:54] Radar: heartsentwined: No. In ~8 years of doing Rails work, I've never seen this problem. I cannot recommend you any solutions at this time.
[04:55:10] heartsentwined: oh okay, thanks for your help anyway
[04:55:26] s2013: are you one of the original adopters of rails Radar ?
[04:55:38] Radar: s2013: lol
[04:55:50] Radar: I started doing Rails when it was 1.1.2
[04:55:53] s2013: when rails came out i thought it was a fad :\
[04:55:56] s2013: shouldve started then
[04:55:58] zeknox: having issues extracting a zip archive recursively, it crashes when it hits the first folder, here is the code => http://pastie.org/private/xk8zgez7ndyrx1pbayzemq
[04:56:03] Radar: http://rubygems.org/gems/rails/versions/1.1.2 "April 9, 2006."
[04:56:09] jstrong: s2013: it was ;)
[04:56:17] Radar: zeknox: Not sure how this is Rails related?
[04:56:30] Radar: zeknox: You'd probably get better help with your quesiton over in #ruvby
[04:58:03] zeknox: Radar: sorry, just thought someone would have experience over here
[04:58:08] s2013: im going to install rails 0.8.0 and build hello world and say ive used rails from the 0.8.0 version
[04:58:55] heartsentwined: oh I just thought of something, is it possible to override the default column length for a db adapter?
[04:59:16] heartsentwined: I bet "varchar 255" is hard coded somewhere but configurable?
[05:03:37] s2013: Jeuss Christ.. some people man
[05:04:04] s2013: "i cannot select multiple items. code is broken. wtf"... "did you hold down command key and select multiple items?"
[05:04:43] sevenseacat: to be fair, multi-selects arent intuitive
[05:05:18] s2013: but thats what they wanted
[05:05:18] jstrong: yeah they're pretty tricky
[05:06:03] s2013: its one thing if they dont understand something, another to send me an email in the middle of the night all panicking and shit
[05:06:24] sevenseacat: multi-selects arent common
[05:06:52] s2013: thats how the design was
[05:07:05] s2013: what other common way is there to select multiple items from a list
[05:07:34] sevenseacat: using checkboxes, or any of the bazillion js libraries out there that let you select multiple things easily
[05:07:50] sevenseacat: select2, chosen, etc.
[05:08:50] s2013: checkboxes for dozens of items? anyways, i know you like debating for the sake of debating but majority of places still uses multi select boxes, maybe not big sites but other ones do, and thier design had one as well. anyways its cool
[05:09:30] sevenseacat: i do like debating, when i know im right :P
[05:09:51] s2013: but anyways i am changing it to select2
[05:10:04] sevenseacat: 'omg wtf client is stupid' no, you didnt evaluate what they actually wanted
[05:10:05] thebobmarley: sevenseacat: Let me help you: http://www.youtube.com/watch?v=-JhwxTen6yA
[05:10:26] sevenseacat: and im not psychic and cant predict 'dozens of items'
[05:10:54] s2013: ok, i guess you saw the design so you know better than me
[05:13:39] sevenseacat: no i didnt, thats why i asked the question, was it actually what they wanted
[05:13:48] sevenseacat: because i know multi-selects are very uncommon
[05:14:05] sevenseacat: possibly you heard 'select multiple items' and just went 'i know, there's a HTML element for that'
[05:15:02] Radar: inbox zero at 3:30pm on a Friday
[05:15:07] Radar: This means I get to go to the pub now yes?
[05:15:51] Radar: \o/ \o/ \o/
[05:17:30] jstrong: that's pretty unfair
[05:17:32] Radar: A WILD EMAIL APPEARS
[05:17:36] jstrong: i feel like having a friday afternoon right now
[05:17:46] Radar: jstrong: if you lived in Australia it would be Friday afternoon
[05:17:50] sevenseacat: its friday afternoon and im still at work :(
[05:17:55] sevenseacat: for another four hours
[05:17:59] jstrong: you are enjoying your friday afternoon before I am
[05:18:03] jstrong: that's fundamentally unfair
[05:18:47] jstrong: sevenseacat: sorry about that
[05:18:48] sevenseacat: thats racist.
[05:19:42] Dreamer3: does jsfiddle not work on IE8?
[05:19:46] jstrong: sevenseacat: just out of curiosity what's your main job
[05:19:51] Dreamer3: why wouldn't that surprise me
[05:20:20] bratsche: I'm surprised to see someone surprised that something may not work in ie8. :)
[05:20:31] sevenseacat: jstrong: i'm a web developer
[05:20:44] sevenseacat: jstrong: at a company that does mostly rails things
[05:21:01] Encore: sevenseacat, sounds like a scam.
[05:21:34] arkiver: HI. I am getting this error: undefined local variable or method `id' for #<#<Class:0x0000000503ced8>:0x0000000679d028> what could it mean ?
[05:22:09] jstrong: arkiver: gist
[05:22:11] rvanlieshout: arkiver: the you're calling id somewhere
[05:22:16] rvanlieshout: and that id isn't defined as a var of method
[05:22:44] jstrong: you're calling id on a Class object instead of some ActiveRecord object most likely but unless you show code
[05:22:46] jstrong: no can help
[05:26:19] arkiver: jstrong: its sometwhere in this cdoe: https://gist.github.com/arkiver/183d246f506101c2fdda
[05:26:36] jstrong: arkiver: well when you have an error you have a stack trace that tells you the line
[05:26:42] sevenseacat: the error tells you where it is
[05:29:58] jstrong: you need to clean up your views a bit
[05:44:23] zeknox: how can i save a model without invoking the callbacks
[05:45:02] rvanlieshout: zeknox: you shouldn't
[05:45:14] rvanlieshout: cause that would just imply that your callbacks are wrong
[05:48:25] zeknox: rvanlieshout: roger that
[05:49:22] rvanlieshout: zeknox: make your callback aware of the situation so that it skips some tasks
[05:49:54] zeknox: rvanlieshout: yup, that requires logic, which i have little of
[05:58:55] zeknox: rvanlieshout: cool, got ir fixed!
[05:59:38] zeknox: rvanlieshout: i just did some validation in my controller action so I dont even use that callback anymore
[06:00:21] rvanlieshout: zeknox: validations shouldn't go in your controller though
[06:05:12] zeknox: rvanlieshout: sorry, didn't mean to say validations...
[06:09:18] RustyShackleford: so I have a starts and ends column for my Appointment model
[06:09:27] RustyShackleford: I want to make sure that you can't overlap appointments
[06:09:32] obiwanchinobi: how ugly is my conditional? any suggestions? https://gist.github.com/obiwanchinobi/5b3be5a9890f77907092
[06:09:42] RustyShackleford: looking ahead, there are multiple employees
[06:10:17] RustyShackleford: so appointments can overlap, so long as they are associated to different employees
[06:10:20] rvanlieshout: obiwanchinobi: you might want to change that to if postageapp_msg.deliver_email? and move your logic to there
[06:10:54] obiwanchinobi: rvanlieshout: so create a deliver_email? method and have my crappy condition in it?
[06:11:23] rvanlieshout: obiwanchinobi: then at least it only contains your conditions
[06:11:30] obiwanchinobi: rvanlieshout: good point
[06:12:16] obiwanchinobi: rvanlieshout: thanks :)
[06:12:16] Krishna: nested attributes edit is not working shows everytihng doubled of nested model values
[06:15:19] willbradley: i'm trying to calculate the total amount of time spent active, i.e. time diff between each activate and deactivate record in a table. any ideas? https://gist.github.com/zyphlar/6724722
[06:16:03] willbradley: basically i'm running out of ideas matching up each activate record with the next deactivate record while omitting any unmatched records
[06:17:18] Krishna: hello guys
[06:17:51] Krishna: accepts nested attributes is shows doubled when using the edit action, i am using rails4
[06:18:34] BrazenBraden: Krishna: you have a many-to-many involved?
[06:20:04] speedgrafic: Rails newbie here - I'm trying to think of the best way to create associations between three models. The first model is are Leads. Leads belong to Users. The third model, which I'm unsure of, is Packages - Packages are created by Users and assigned to Leads. What kind of association should I create between User->Packages and Lead->Packages?
[06:20:36] willbradley: doesn't matter who they're created by, does it?
[06:20:37] speedgrafic: Apologies for my inability to write coherently.
[06:20:51] BrazenBraden: speedgrafic: lead belongs_to packages
[06:20:54] willbradley: lead has_many packages
[06:21:12] BrazenBraden: speedgrafic: packages has_one lead
[06:21:22] BrazenBraden: speedgrafic: or whatever the many or one type stuff
[06:21:23] Krishna: <BrazenBraden> has_many relation
[06:21:24] willbradley: i dunno about that
[06:21:30] speedgrafic: @willbradley - that makes sense
[06:21:36] willbradley: will a single lead ever have more than one package?
[06:21:36] rhizome: willbradley: you're going to have to make some assumptions. best would be to have activate/deactivate in the same record
[06:21:49] willbradley: rhizome: yeah i know
[06:21:49] BrazenBraden: speedgrafic: user has_many leads, through: :package
[06:21:58] speedgrafic: No, a lead is created and belongs_to a single User, and that lead is assigned a single package
[06:22:00] willbradley: i can't go back and change the data tho
[06:22:05] BrazenBraden: Krishna: gist us a little code?
[06:22:11] rhizome: willbradley: and no updated_at?
[06:22:20] willbradley: rhizome: i hid it, it's always the same as created
[06:22:39] rhizome: well, just in case, you'll want to order by updated
[06:22:52] rhizome: then for each mac, walk the array
[06:22:55] willbradley: i'm reading this but my eyes are crossing lol http://stackoverflow.com/questions/8315320/pairing-of-login-and-logout-datetime-and-calculate-workingtime
[06:24:15] willbradley: walk the array, find the first activate, and if there's a successive deactivate then calculate the diff otherwise ignore
[06:24:25] willbradley: hard to think in loops sometimes
[06:25:12] rhizome: you'll want to check that it's the last element in the array, or toss it and go to the next activate if there are two in a row
[06:25:32] rhizome: that's where the assumptions come in
[06:25:54] rhizome: two activates in a row, you assume the first one is noise or unresolvable
[06:26:03] willbradley: yeah which should be taken care of
[06:26:05] rhizome: or the second ;)
[06:26:21] rhizome: "should be" == assumption :)
[06:26:21] willbradley: only when an activate is immediately followed by a deactivate should a time be calculated
[06:26:34] willbradley: fortunately this isn't for a nuclear plant, just fun stats
[06:30:50] Krishna: <BrazenBraden> my gist have a look nested attributes edit show multiple members in edit form https://gist.github.com/anonymous/6724833
[06:31:48] BrazenBraden: Krishna: You said you using rails 4?
[06:32:20] Krishna: <BrazenBraden> yes i am using rails4
[06:32:23] BrazenBraden: Krishna: Y u no like strong parameters? :P
[06:32:55] Krishna: <BrazenBraden> in my gem i add protected_attributes gem in gem file
[06:33:49] BrazenBraden: Krishna: I had the same problem as you not so long ago. The reason for it was that I was not building model objects to insert the params into so the objects were nil..
[06:34:22] BrazenBraden: in your update method.. perhaps something like:
[06:34:38] BrazenBraden: @project.members.build
[06:34:47] BrazenBraden: between the find and the if
[06:37:46] Krishna: <BrazenBraden>i had @project.members.build between and if again the same problem
[06:38:52] BrazenBraden: Krishna: can you update your gist with a sample of the params being sent to the update action?
[06:39:11] BrazenBraden: Krishna: what does params[:project] look likg?
[06:40:05] Krishna: <BrazenBraden> params[:project] are in my model project attr_accessible values
[06:42:30] BrazenBraden: Krishna: hang on.. your form is form the edit action.. is your form submitting to the update or create action?
[06:43:27] Krishna: <BrazenBraden> it is the update action
[06:43:35] BrazenBraden: Krishna: ok just checking..
[06:44:09] BrazenBraden: Krishna: I am not sure :(
[06:45:39] ljarvis: Krishna: what's the actual problem?
[06:46:56] ljarvis: your simple_fields_for makes no sense
[06:47:50] Krishna: <BrazenBraden>, <ljarvis>, https://gist.github.com/anonymous/6724940, my problem is when i use edit my members are increasing
[06:49:07] ljarvis: accepts_nested_attributes_for :members, :allow_destroy => true, :reject_if => proc { |a| a[:user_id].blank? }
[06:49:42] ljarvis: it's just inserting nil values which your model shouldn't allow, and it's your job to control that
[06:50:22] ljarvis: I still dont understand why you're not just using a multiple_select on a has_many :users
[06:51:30] BrazenBraden: if my query returns something like this: #<User::User:0x007fa48277a5f0> what do I have?
[06:51:41] ljarvis: BrazenBraden: an instance of User::User
[06:51:55] BrazenBraden: ljarvis: it contains data from the table?
[06:52:23] ljarvis: BrazenBraden: it contants a single user instance instantiated from data from your table
[06:52:30] BrazenBraden: I dont even know how I got this query right lol
[06:52:35] BrazenBraden: i think it probably looks like satan
[06:52:38] BrazenBraden: but hey.. works for now
[06:58:43] BrazenBraden: false alarm.. doesnt work
[06:58:54] mrstibbons: Hey. Is there a way to debug the initialization of the rails environment? especially the order in which files are included.
[06:59:00] BrazenBraden: its another one of those days in the office.. more tears everywhere
[06:59:05] mrstibbons: "included" - evaluated.
[06:59:37] pontiki: which is better: i have a bunch of subscriptions, and i want to update them in the background. one delayed job, or one dj per subscription?
[06:59:51] ljarvis: mrstibbons: no, you can check out the guide on the initialization process but can't do much about debugging it
[07:00:12] sevenseacat: pontiki: depends if some of them might fail - one job, the first one fails, none of the rest get processed
[07:00:24] sevenseacat: multiple jobs, if some fail, the rest still get done
[07:00:33] ljarvis: pontiki: maybe do them in chunks
[07:00:37] ljarvis: but yeah that's an issue
[07:00:52] pontiki: sidekiq seems to want many small jobs
[07:01:06] pontiki: problem is, many of them will hit the same server
[07:01:27] ljarvis: is it possible some could fail?
[07:01:33] mrstibbons: http://stackoverflow.com/questions/19038593/rails-4-engine-method-on-eigenclass-of-module-not-found this is my problem. Anybody an idea?
[07:01:52] ljarvis: I'd use sidekiq and split them myself
[07:01:56] mrstibbons: ljarvis: thanks, reading the guide now
[07:02:19] pontiki: that's how i'm leaning, ljarvis
[07:02:29] pontiki: yet i still want to stagger them
[07:02:42] pontiki: which is def. possible
[07:02:57] ljarvis: mrstibbons: you should require it yourself if you need something specific
[07:03:16] ljarvis: mrstibbons: but that'll skip rails autoloading (so reloading wont work)
[07:03:29] ljarvis: mrstibbons: not sure if require_dependency fixes that, though
[07:04:04] ljarvis: pontiki: I have something similar updating chunks of 250 records at a time, but they're unlikely to fail
[07:04:13] mrstibbons: ljarvis: could you elaborate on reuiqre_dependency?
[07:04:33] pontiki: the subscription updates are dependent on network connections, so they could fail
[07:04:42] Krishna: <ljarvis> even it is not working how to use multi_select
[07:04:56] mrstibbons: ljarvis: What is most confusing me is that it is working well in another app with the same setup, except that it is not an engine but a full app. And it was working just yesterday, before i upgraded
[07:05:24] mrstibbons: and it is a file that was generated by rails' generators. also confusing.
[07:05:37] ljarvis: mrstibbons: it basically means you have file x which depends on file y, if you use require_depndency rails will watch y and reload y and x if it updated
[07:05:50] ljarvis: mrstibbons: what file is it?
[07:06:11] ljarvis: pontiki: how many updates are we talking?
[07:06:21] pontiki: 50-ish per night
[07:06:36] mrstibbons: ljarvis: a module definition for namespaced-models where table_name_prefix gets defined
[07:06:49] ljarvis: sidekiq should poop them out quickly if your dependent code is thread safe
[07:07:17] ljarvis: mrstibbons: what rails version?
[07:07:21] pontiki: ljarvis: the problem is most of them will hit the same server, and i don't want to be rude
[07:07:29] jrobeson: ???????????? pontiki :)
[07:07:36] ljarvis: pontiki: servers can handle it :)
[07:08:55] mrstibbons: ljarvis: rails 4.0.0, ruby 2.0.0-p0, you can see the files and some additional information here: http://stackoverflow.com/questions/19038593/rails-4-engine-method-on-eigenclass-of-module-not-found
[07:09:54] mrstibbons: ljarvis: i have other files of the same kind defined and all is working well (let's say DynaState::Configuration.table_name_prefix -> 'dyna_state_configuration_')
[07:09:59] ljarvis: mrstibbons: sorry I have to go, im sure someone else will be able to help!
[07:10:13] pontiki: thanks, ljarvis
[07:10:27] pontiki: hi, jrobeson
[07:10:30] mrstibbons: ljarvis: thanks anyway :)
[07:10:55] jrobeson: fix u tests
[07:19:12] goleldar: which do you guys prefer for rails dev macbook air or pro?
[07:20:58] jrobeson: assuming any of us prefer macs :)
[07:21:26] goleldar: the battery life is insane on the air
[07:21:57] goleldar: you think something like a thinkpad with linux is better?
[07:22:38] sevenseacat: dont get a thinkpad, ever
[07:26:27] jrobeson: goleldar, well anything with with linux for myself :) although of course there are tons of folks involved in rails who would give you mac recommendations
[07:26:50] goleldar: here is an article on someone using a chromebook https://medium.com/what-i-learned-building/3aa868ce3fa0
[07:27:08] jrobeson: i wouldn't even try to do that.. it's still too underpowered and the screen is whack
[07:27:28] jrobeson: i'd get better results coding from an ipad i bet (not that ih ave one)
[07:28:31] jrobeson: now a chromebook pixel..i'm sure we could work something out :)
[07:28:57] jrobeson: but you could buy two different laptops for the price of that..
[07:31:29] sevenseacat: how much are they?
[07:31:32] Krishna: <BrazenBraden> @project.members.new the problem for doubling in edit is in new action in projects_controllers
[07:32:00] sevenseacat: my quick googling is telling me $1600 which is pretty damn reasonable
[07:32:08] goleldar: 1299 32gb / 1449 64gb
[07:32:21] BrazenBraden: Krishna: ahh yea :) glad you figured that out
[07:32:26] jrobeson: oh they are cheaper than original now :)
[07:32:28] sevenseacat: so.... half the price of a rMBP
[07:32:39] jrobeson: that wasn't the price they were originally .. it was over 2k
[07:33:22] Krishna: <BrazenBraden> but how to avoid that problem i am confuse
[07:34:04] BrazenBraden: Krishna: I think you need to build the members
[07:35:11] Krishna: <BrazenBraden> yeah i have changed to @project.members.build but edit has the same problem
[07:36:01] BrazenBraden: Krishna: not sure hey.. I just started learning about nested attributes 3 days ago :P
[07:42:04] BrazenBraden: instead of doing | sign_out user; redirect_to home_path; | could you do something like | sign_out user && redirect_to home_path; | ?
[07:42:19] rvanlieshout: BrazenBraden: that depends on what your sign_out returns
[07:42:31] BrazenBraden: its the devise helper
[07:42:37] BrazenBraden: just kills the session
[07:42:43] rvanlieshout: and what does it return?
[07:43:03] BrazenBraden: no se. what im trying to ask is if you can chain methods like that
[07:43:30] rvanlieshout: BrazenBraden: is it so hard to find out what it returns?
[07:43:35] Zesty: how come in rails3 I could rename a css sheet .scss, and use just standard background: url('file.jpg') and it would work
[07:43:43] Zesty: i just deployed and none of my images work on rails 4. if i inspect
[07:43:48] Zesty: the paths arent being updated
[07:43:51] rvanlieshout: Rails.logger.info "SIGN OUT: " + sign_out(user).inspect
[07:43:52] Zesty: to the proper versioned image filename
[07:44:05] sevenseacat: and so they won't, if you dont use rails helpers
[07:44:08] sevenseacat: in rails 3 and rails 4
[07:44:34] defswork: anyone using rails4 to develop applications - not public facing sites ?
[07:44:34] Zesty: I definitely have never used a helper in css in rails 3
[07:44:45] sevenseacat: what version?
[07:45:07] BrazenBraden: rvanlieshout: you getting too deep into it.. just method chaining.. doesnt matter what the methods are or what they return. just want to say "do this method and then do this method"
[07:45:26] sevenseacat: well yes it does matter what they return, if you want to use && to join them together
[07:45:28] rvanlieshout: BrazenBraden: what? it's not method chaining
[07:45:35] sevenseacat: and its not method chaining at all
[07:45:49] BrazenBraden: well, "chaining" would be the wrong word..
[07:45:53] sevenseacat: method chaining is like foo.bar.baz
[07:46:04] BrazenBraden: but you get what i mean? just a curious question that popped into my head
[07:46:30] rvanlieshout: BrazenBraden: i get what you mean and the return value is really really important here
[07:46:34] sevenseacat: BrazenBraden: if sign_out user returns false or nil, the second half will never get executed
[07:46:38] sevenseacat: boolean logic ftw
[07:46:43] BrazenBraden: if it doesnt return a bool then it will fail?
[07:46:56] BrazenBraden: alright, thats all i wanted to know.
[07:47:01] rvanlieshout: a bool wilt not fail no
[07:47:16] sevenseacat: so next time someone asks you a question, dont assume theyre interpreting you incorrectly
[07:47:21] rvanlieshout: BrazenBraden: it's the same as if user_signed_in? && foobar
[07:47:29] rvanlieshout: foobar only gets executed if user_signed_in? returns something true-ish
[07:47:32] jrobeson: defswork, would you not consider say the admin interface of a spree ecommerce site an application?
[07:47:42] BrazenBraden: rvanlieshout: okie
[07:47:44] jrobeson: if not, what's the difference?
[07:47:44] rvanlieshout: you're also allowed to just execute methods in that statement
[07:51:19] defswork: jrobeson, I'm thing more of a business in house system - we have a HR system here for example
[07:51:36] jrobeson: and how would that be any different than what i just mentioned?
[07:51:41] sevenseacat: thats still a public application no?
[07:52:02] jrobeson: there really isnt a difference between a public facing site and an application..
[07:52:31] jrobeson: because the spreed backend is only for admin users, so i don't see any difference between what you're talking about and what that is
[07:53:12] defswork: dunno - never see it
[07:53:29] jrobeson: defswork, basically your question doesn't have any usefulness
[07:53:42] jrobeson: fatfree crm is an application built on rails also..
[07:53:44] defswork: jrobeson, it has usefulness to me
[07:54:04] jrobeson: defswork, the problem is you're see a difference between a public facing site and a non public facing one that doesn't exist
[07:54:17] jrobeson: they are no different at all
[07:54:22] defswork: jrobeson, I was asking if there are any - I was asking if anyone here was developing such systems
[07:54:33] jrobeson: lots of people
[07:54:51] sevenseacat: we're all probably developing apps that hame some private area
[07:54:52] jrobeson: i even used one at my collective, we had a scheduling application for worker shifts
[07:54:55] sevenseacat: that isnt for the public to see
[07:55:52] defswork: I just thought it might be interesting to share some experience of developing similar applications
[07:56:14] defswork: I'm really not quite sure how you have somehow made it seem a stupid or invasive question
[07:56:31] sevenseacat: similar to what? something that isnt public facing?
[07:56:39] sevenseacat: every app ever built likely has an admin area that isnt public-facing
[07:57:51] jrobeson: defswork, i didn't say it was stupid, i said that the difference was irrelevant
[07:57:56] jrobeson: not that you are irrelvant :)
[07:58:34] defswork: sevenseacat, theres more to what I am thinking of than simple admin areas though. Internal process systems etc.. tend to have quite different demands to public facing. Things like report printing queues, more precide roles/permissions, more form/table based screens
[07:58:56] jrobeson: that's a totally different question
[07:59:10] sevenseacat: its also not different at all
[07:59:18] jrobeson: that's more like "has anybody built a reall complex rails site with this list of features"
[07:59:39] sevenseacat: any app can have those features, public facing or not
[07:59:57] defswork: is your intention to try humiliate me for not asking precise fact based questions ?
[08:00:12] NDD: I just upgraded from bootstrap 2.3.2 to bootstrap 3, it's great except that for some reason "Navbar" now forces link_to with text that contains more than one word onto a second line. Does anyone know why this is, or how I can overwrite it?
[08:00:35] defswork: I'll go somewhere and find like-situation people to chat with
[08:00:39] jrobeson: NDD, can you see the difference in some sort of debugger?
[08:00:43] defswork: here seems to be all about pissing on people
[08:00:44] jrobeson: like firebug..
[08:00:52] jrobeson: defswork, no.. we're trying to get to what you really want to ask
[08:01:22] jrobeson: you could look at twitter as an example (when they were built on rails)
[08:01:30] jrobeson: they had all that complex features
[08:01:39] defswork: I'm not asking anything - I don't have a problem to solve I just thought knowing some other people with similar experiences doing similar systems might be a) good to talk about and b) advantageous to share
[08:01:39] jrobeson: on their backside
[08:02:02] jrobeson: sure, and if you ask about the systems, people who know about them will answer
[08:02:12] jrobeson: if they in fact do know..
[08:02:33] NDD: <li><%= link_to 'Sign In', new_user_session_path %></li> displays on two lines, and <li><%= link_to 'SignIn', new_user_session_path %></li> displays on one line. The html they generate appears to be identical....
[08:02:37] defswork: jrobeson, IRC does not have to be 1) Ask question 2) Get reply - you know you can just chat
[08:03:09] defswork: fuck me - having a pint with you must be incredible
[08:03:28] jrobeson: there are probably better places for that, but i'm nto surewhere
[08:03:36] jrobeson: this room is almost entirely for support
[08:03:39] jrobeson: so that is the way it tends to go
[08:03:43] denym_: Hey there i have a model invoice that has_many line items, these line items belongs_to the invoice.... now i have another table invoice layout with some layouts these has_many invoices obviously... but if I do it so I cant call the layout with invoice layout I guess?
[08:03:50] defswork: "why are you talking about the quarterback, what is the presice think about him that you want to know!"
[08:03:54] jrobeson: like that question right there .. that's the norm here
[08:04:18] BrazenBraden: how can I pass custom params into a submit_tag? for instance, this is what I got now: = submit_tag "Activate User", {name: "activate[#{user.id}]"} and I would like to get the params[:activate] => {"1" => true} or something like that
[08:04:23] defswork: "look at that cute chick at the bar" "What is it about her you presicely want to know!!!"
[08:05:11] jrobeson: defswork, having a pint with me in a bar.. where a private conversation can happen.. is totally different than what this room is for..
[08:05:34] jrobeson: here it's almost all business
[08:06:25] defswork: jrobeson, it's whatever it wants to be - sharing life experiences is just as useful as knowing how to do x,y, z - and things can always be taken off channel
[08:06:25] jrobeson: NDD, look at in firebug, it's likely a css difference
[08:06:44] defswork: you should try #linux on ircnet
[08:06:56] NDD: never heard of firebug, I'll investigate that now....
[08:07:07] jrobeson: NDD, what browser do you use?
[08:07:58] jrobeson: NDD, if you use chrome, it already has some inspector thing
[08:08:08] NDD: i'm on Safari atm
[08:08:19] NDD: I've checked in Web Inspector
[08:08:33] NDD: the two lines generate identical HTML except for that one space
[08:08:51] jrobeson: i'd worry about hte css more than the html
[08:09:10] jrobeson: so you need something that will highlight the css for that element
[08:09:29] NDD: not very good with css, but it seems inevitable that I'm going to have to fight the bootstrap css
[08:10:00] jrobeson: NDD, the life of a web developer :(
[08:10:17] jrobeson: that sure took along time to get this freakin factory working :(
[08:10:24] jrobeson: i feel dumb like rock
[08:12:59] bartocc: what is the best way to extend a gem used in a rails app ?
[08:13:06] bartocc: to take advantage of class reloading, the easiest way is to add a file in the model dir, but this feels dirty
[08:13:10] NDD: =( ... wth bootstrap, what possible reason could there be for FORCING a line break in navbar text that the developer hasn't added themself?
[08:13:11] bartocc: I've also tried creating separate gems that I placed in the vendor dir, named "my_gem_ext"
[08:13:15] bartocc: this feels much more packaged and clean to me but has the drawback of forcing me to reload that rails app for each modification, and is a pain in the ass
[08:16:11] NDD: After upgrading to Bootstrap 3, they removed the flash[:notice] class and now the automatic Devise messages don't display properly. Does anyone know how to modify Devise to default to flash[:info] instead of flash[:notice]?
[08:17:40] defswork: NDD, why not just add :notice back ?
[08:18:13] defswork: NDD, or in your template render notice in info
[08:19:37] Macaveli: I just found pry-remote-auto -> https://github.com/jugyo/pry-remote-auto And it says to put "require 'pry-remote-auto'" above the class but when I do this I get: cannot load such file -- pry-remote-auto Is it possible to put it globally?
[08:19:44] Macaveli: Or what am I doing wrong
[08:19:53] NDD: I didn't know that was possible, or how that can be done?
[08:20:16] defswork: NDD, the rendering of flash is in your code somewhere - probably in your application layout
[08:20:16] i42n_: Hey, I created a ruby module and want to use a variable in there called @last_mod_time. However I think there might be a problem with storing the last_mod_time. Did I declare the variable wrong? https://gist.github.com/i42n/6725582
[08:25:15] Macaveli: I just found pry-remote-auto -> https://github.com/jugyo/pry-remote-auto And it says to put "require 'pry-remote-auto'" above the class but when I do this I get: cannot load such file -- pry-remote-auto Is it possible to put it globally?
[08:25:23] Macaveli: Or why do I get that error
[08:26:35] sevenseacat: did you do the installation part?
[08:32:38] NDD: <% flash.each do |name, msg| %> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button> <%= content_tag(:div, msg, class: "alert alert-#{name}") %> <% end %>
[08:32:44] NDD: how do i add :notice back in?
[08:33:31] elaptics: NDD: what do you mean add it back in?
[08:34:20] defswork: NDD, so check if name is :notice and change it to :info
[08:35:01] defswork: NDD in bootstrap you dont need that much markup
[08:35:38] sevenseacat: ah, bootstrap HTML
[08:35:44] sevenseacat: how i hate thee
[08:36:54] NDD: Got that flash fixed up,I hadn't thought to just add in a small conditional
[08:36:59] denym_: Hey there i have a model invoice that has_many line items, these line items belongs_to the invoice.... now i have another table invoice layout with some layouts these has_many invoices obviously... but if I do it so I cant call the layout with invoice layout I guess?
[08:37:14] NDD: thanks defswork and jrobeson
[08:38:40] defswork: NDD, just checking mine flash stuff and I do what you needed already - <%= name == :notice ? "success" : name %>
[08:39:38] NDD: yeah, I wrote basically the same thing myself, thanks
[08:40:59] i42n_: How can I have a class variable in a ruby module?
[08:42:29] clocKwize: guys, anyone know a good way to store a simple model as a json object in an ActiveRecord field? keeping types etc?
[08:43:00] clocKwize: This project is doing it in a crappy way, and it doesn't retype things, so I'm getting "true" as a string
[08:43:11] toretore: record.field = json
[08:43:44] toretore: JSON.parse(record.field)
[08:44:08] clocKwize: toretore??? yes, and when you do that from a request, values won't be casted like they are for active models
[08:44:29] clocKwize: the request comes in blah[x]=true, which makes params like {blah: "true}
[08:44:35] clocKwize: {blah: "true"}
[08:44:45] clocKwize: it needs to keep type info like active model does
[08:46:10] ljarvis: clocKwize: what determines the type of the "blah" field?
[08:46:20] ljarvis: clocKwize: if it's not a field on your model, there's no type definition
[08:46:31] clocKwize: ljarvis, nothing at the moment, I'm just wondering if there is some good way to do this
[08:46:55] toretore: clocKwize: if you give JSON.generate true, it will return true
[08:47:00] ljarvis: clocKwize: you need some kind of definition of what this object needs to look like
[08:47:11] clocKwize: ljarvis: I know
[08:47:17] ljarvis: toretore: he means passing objects as params are always passed as strings, so "true" and true become "true"
[08:47:29] toretore: then you need a mapping
[08:47:45] ljarvis: clocKwize: how about an associated model?
[08:47:55] ljarvis: clocKwize: seems like a good candidate for that tbh
[08:48:17] toretore: create a separate model class which casts the values properly
[08:48:21] clocKwize: yeah, this is probably the correct way to do it
[08:48:24] toretore: add a to_json and you're done
[08:48:35] clocKwize: but its not my project, and they currently store it in a hash, so I think it needs to work with that
[08:48:47] toretore: then you need a mapping
[08:49:00] ljarvis: clocKwize: add a custom serializer
[08:49:31] clocKwize: maybe, that is a good way
[08:59:28] willbradley: dohohoho. using ghetto queries and a bunch of loops, i've parsed ARP and RFID activity logs to reveal: https://twitter.com/heatsynclabs/status/383507246363463680 our hackerspace's members have no lives.
[09:00:10] willbradley: 272/365 days, 2077 / 5760 hours.
[09:00:39] rzsd: I ran gem install rb-fsevent -v '0.4.3.1' and im getting the following error . https://gist.github.com/anonymous/86d719be2d1cc41e01e0 .
[09:01:42] rzsd: Im running osx 10.8.5
[09:02:27] ljarvis: rzsd: why that specific version?
[09:02:53] ljarvis: i ask because there's like a million versions since
[09:03:17] rzsd: ljarvis: Its in the GemFile
[09:03:23] ljarvis: rzsd: so update it?
[09:03:25] denym_: I want to setup a model where an invoice has_one invoice_layout and invoice_layout has_many invoices.... with what schema should i go to do: invoice.invoice_layout ?
[09:03:53] ljarvis: invoice_layout_id on invoices table
[09:03:53] rzsd: ljarvis: so remove the version ?
[09:04:09] ljarvis: rzsd: set it to something newer, check on rubygems/github what versions they have
[09:04:28] ljarvis: denym_: and you want belongs_to not has_one
[09:04:29] workmad3: rzsd: or remove the version and do 'bundle update rb-fsevent' to get a later version
[09:04:50] ljarvis: fix the version to ~> afterwards
[09:04:56] denym_: but wouldnt it be invoice_layout.invoice then?
[09:05:07] denym_: or does it work both ways?
[09:05:11] ljarvis: denym_: no it would be invoice_layout.invoices
[09:05:28] ljarvis: denym_: invoice_layout has_many invoices, invoice belongs_to invoice_layout
[09:05:47] denym_: yeah but i want to achive to call the layout via the invoice
[09:05:57] ljarvis: invoice.invoice_layout
[09:06:01] ljarvis: like i said before
[09:06:09] denym_: so it works both ways :)
[09:06:24] ljarvis: if you add the associations to both models, yes
[09:07:09] denym_: ah ok, was hard to google this problem, thanks for that
[09:07:36] Krishna: collection select for form tag>
[09:07:56] ljarvis: Krishna: is that a question? and if so it needs to be better
[09:08:53] Krishna: <ljarvis> i used this shows an error <%= f.collection_select :content, collection: ["REGULAR","WEEKEND"] %>
[09:09:17] BrazenBraden: oh shame. sad friday in the office
[09:09:40] ljarvis: Krishna: f.input :content, collection: ["REGULAR", "WEEKEND"]
[09:09:42] workmad3: BrazenBraden: something to cheer yourself up with: http://www.youtube.com/watch?v=Dz3qqwXxYXc
[09:10:09] BrazenBraden: workmad3: not me who's sad. one of the ladies who works here.. her mother just passed away
[09:10:19] rzsd: ljarvis: checked on rubygems and set the version to 0.9.3. But still getting same error. My Gemfile is https://gist.github.com/anonymous/d8b52cca6ac48ddbf191
[09:10:31] Krishna: <ljarvis> this is for simple form but i need for form_tag?
[09:10:59] rzsd: workmad3: also tried removing the version and running bundle update rb-fsevent
[09:11:36] ljarvis: Krishna: i dont know i haven't seen your code?
[09:11:56] universa1: rzsd: did you look at the actual compile error?
[09:12:43] universa1: nm, misread the gist
[09:15:02] rzsd: ljarvis: workmad3: universa1: its working now :)..sorry, it was my mistake. I had the gemfile open in macvim and it was still referring to the master branch and i had set the new gemfile version in a different branch.
[09:15:26] rzsd: thanks to all
[09:19:24] jarr0dsz: hey everyone, im trying to refactor some conditional if statements in my views like https://gist.github.com/anonymous/4e6e918c7dd4285b418a
[09:19:45] jarr0dsz: any suggestions on how that could be improved? problem is it is used in 1 spot only so helper would not really do good but its still a messy solution
[09:19:54] ljarvis: jarr0dsz: params[:controller] == "users/registrations" && params[:controller] == "accounts" what will never return true
[09:20:00] ljarvis: maybe you mean ||
[09:20:02] jarr0dsz: i have lots of these in my view code to render certain stuff
[09:20:23] ljarvis: also you should use {controller,action}_name
[09:20:53] jarr0dsz: i know i can refactor the methods a bit to make it shorter but is there some rails way to refactor this kind of logic?
[09:21:05] jarr0dsz: like a better way to handle many logic in views and have cleaner more readable views in the end
[09:21:37] ljarvis: use a before_filter and set a flag? i hate all this kind of controller/action checking in views
[09:21:51] workmad3: jarr0dsz: use the 'current_page?' view helper
[09:22:05] ljarvis: that's not what he wants
[09:22:30] workmad3: ljarvis: yeah it is ;) 'if current_page?(controller: 'user/registrations')' etc
[09:22:39] jarr0dsz: ljarvis yes i look for better solution its to messy indeed but i need based on controller and actions to render certain stuff in my views
[09:22:52] jarr0dsz: workmad3 diden't knew about current_page look into that thanks
[09:23:09] workmad3: ljarvis: current_page? is a helper for checking if the given url options are the current page
[09:23:28] jarr0dsz: i recall seeing a railscast a way while back regarding complex logic in views but cannot find it back
[09:23:31] ljarvis: I know what it is
[09:23:35] ljarvis: but it doesn't save this mess
[09:23:50] workmad3: ljarvis: well.. nothing really saves his mess
[09:23:52] jarr0dsz: how do you guys handle complex view logic ? :P perhaps i should have just asked that hehe ;p
[09:24:31] universa1: jarr0dsz: first by rethinking the problem
[09:24:51] universa1: jarr0dsz: then i found presenters to be quite helpful to clean up views and have the functionality easily tested
[09:27:51] jarr0dsz: universa1: presenters! that seems the answer to cleanup the views, thanks a lot, the gist was still old code, im now refactoring everything after rails 4 upgrade
[09:28:47] ljarvis: such a love-hate relationship with presenters
[09:30:00] ljarvis: I've never used them consistently with a project, I've added them a few times and end up removing them
[09:31:14] universa1: using them more extensively in my current group and loving it so far, models don't contain view specific logic anymore, controllers are quite simple, and the logic is in places where you expect it
[09:32:05] ljarvis: oh models never contained view specific logic for me either, i just used helpers, but still cant decide which i prefer
[09:33:45] workmad3: depends on how much logic there is, IMO
[09:34:42] workmad3: if the translation from data model to view model is pretty complex, then I'd be looking at presenters, decorators, view-models... something (whether client or server-side, depends on the project again)
[09:35:11] workmad3: if it's pretty much 'splat this data onto the screen, maybe with some bits of common formatting', then I'll be looking at normal views and helpers :)
[09:37:36] cek: looking for a way to mock a remote service in my rails spec
[09:38:14] ljarvis: cek: use something like vcr
[09:39:46] workmad3: cek: vcr, webmock, fakeweb...
[09:43:41] denym_: ljarvis: thoug about the invoice <> layout thinbg with the belongs_to... So it would be enabled to assign multiple layouts to an invoice
[09:43:55] ljarvis: denym_: then you want habtm
[09:48:57] denym_: ljarvis: ah yes right, had a wrong thought... had the foreign key on the wrong table :)
[09:49:51] i42n_: Hey, I get an error I do not understand. My controller expects a module, but I do only use classes... https://gist.github.com/i42n/6726326
[09:51:14] workmad3: i42n_: can you add your controller code to that gist too please
[09:51:36] i42n_: workmad3: there you go: https://gist.github.com/i42n/6726344
[09:52:25] i42n_: workmad3: I access StreamHelper class. I do not know why it expects it to be a module. However it was a module before and I changed it to a class
[09:52:52] workmad3: i42n_: did you restart the server since then?
[09:53:24] i42n_: it does not even work locally
[09:53:29] workmad3: i42n_: oh... is stream_helper in app/helpers?
[09:54:00] i42n_: StreamHelper looks like this: https://gist.github.com/i42n/6726355 It is located in app/external_api
[09:54:16] workmad3: hmm... could still be the problem
[09:54:27] i42n_: workmad3: I checked with rails console and "$:" that app/external_api is in the path
[09:54:28] workmad3: i42n_: helper modules are included into the view when rendering
[09:54:40] workmad3: i42n_: and you can only include modules, not classes
[09:54:58] i42n_: workmad3: Maybe this fails because it is called *Helper.rb
[09:55:06] workmad3: i42n_: that's my suspicion ;)
[09:55:44] i42n_: workmad3: ok wait a second, I try to rename them...
[09:56:13] workmad3: i42n_: it doesn't seem like a good class btw... any reason you changed it from a module?
[09:58:39] i42n_: workmad3: renaming fixed the problem.
[09:59:03] i42n_: workmad3: I changed external_api_helper to a class because I have to store the last_mod_time as class variable
[09:59:38] workmad3: i42n_: why are you storing that as a class variable?
[09:59:46] workmad3: i42n_: you know it won't scale out like that, right?
[10:00:22] i42n_: workmad3: Actually I don't know why.
[10:00:33] i42n_: workmad3: how would you solve that?
[10:00:56] workmad3: i42n_: depends on why I'm storing it
[10:01:29] workmad3: i42n_: and what's already available for allowing some data to be shared between different app servers (memcached? database?)
[10:02:15] workmad3: i42n_: hell, in some cases, I might even stick something like a varnish cache between my app servers and the external server, to avoid having to put caching logic in my app :)
[10:02:18] i42n_: right now it is a single server with a single database. nothing to scell :)
[10:02:39] workmad3: i42n_: what are you using for an app server? unicorn? passenger?
[10:03:25] i42n_: passenger
[10:03:40] workmad3: i42n_: right... so using class variables in passenger is pretty dangerous if you want consistent behaviour
[10:03:57] workmad3: i42n_: because it depends on the spawn strategy whether all your request processes will see the same variables
[10:03:58] i42n_: I did this custom caching because simple caching the external api results did crash the server sometimes (if the external api fails)
[10:04:39] i42n_: I only want to renew the cache if the external api actually responds
[10:04:58] i42n_: so I have to check myself if the expire time exceeded
[10:05:17] i42n_: therefore I have to store somehow when the cache was filled the last time
[10:05:33] i42n_: How would you store that to support nice scaling?
[10:05:36] workmad3: i42n_: yeah... class variables aren't a good choice for that :)
[10:06:00] i42n_: workmad3: Ok, I got that. I am relatively new to rails, so what's the better way?
[10:06:08] workmad3: i42n_: either in the database or memcached, depending on what's already there... or as I said, I'd just slap a proper caching http proxy between myself and the API
[10:07:49] jrobeson: were there really other workmad's on freenode? :)
[10:07:54] workmad3: jrobeson: nope :)
[10:08:48] i42n_: workmad3: As I do not have much influence on the server setup right now, I prefer memcached.
[10:09:11] workmad3: i42n_: if you've already got memcached set up in your app, that's a good choice :)
[10:09:52] i42n_: workmad3: actually I use memory_store but this might be a good time to change that
[10:10:12] workmad3: i42n_: what I'd do there is something other than storing the last accessed time btw ;) I'd actually just store a key 'cache_fresh' (or something like that)
[10:10:22] workmad3: i42n_: and set the expiry on that key to the TTL you want for your cache
[10:10:45] jrobeson: workmad3, i just find people's choices of nicknames to be very interesting
[10:10:58] workmad3: jrobeson: mine was an auto-generate login for uni :)
[10:11:03] workmad3: *auto-generated
[10:11:14] workmad3: bah, my typing has been getting sloppy recently :(
[10:11:16] i42n_: workmad3: cool idea! thanks
[10:11:37] workmad3: i42n_: you might still need to handle the problem of cache-rushes
[10:11:44] jrobeson: and you decided to keep it.. so that does say something about you, and how you strive for consistency :)
[10:11:50] workmad3: i42n_: but if you're in a small-scale, that might not be too much of a problem :)
[10:12:01] workmad3: jrobeson: yeah... this is my 5th or 6th online handle :P
[10:12:04] workmad3: jrobeson: it just stuck
[10:15:00] i42n_: workmad3: thanks a lot for your help!
[10:16:41] jrobeson: but how nicks somebody like AntelopeSala d , dragonmantank, Miles8of9, banisterfiend, crazybanana, .. i always want to know why they use that nick ..
[10:16:57] jrobeson: my nick is super boring.. so that says something about me also :)
[10:17:08] workmad3: jrobeson: your nick is as boring as mine in reality ;)
[10:17:53] workmad3: jrobeson: as with the way mine was generated, you would be 'robesoj<digit>'
[10:18:13] jrobeson: i used to actually have "johnny" on freenode, but i didn't come to freenode for awhile.. so i lost it
[10:18:28] workmad3: hehe 'here's johnny!'
[10:18:48] jrobeson: sometimes i am in fact...... here
[10:20:48] jrobeson: sophomorical, i didn't realize you were here also ..
[10:21:11] jrobeson: or perhaps there also..
[10:23:45] jrobeson: workmad3, so you are in the uk?
[10:27:00] Krishna: can we write for each loop inside other for each loop
[10:27:19] tbuehlmann: Krishna, sure
[10:28:20] workmad3: jrobeson: yeah, I'm a UK guy :)
[10:28:31] Krishna: what is the uses of redis server?
[10:28:48] jrobeson: that's quite easily discovered on google
[10:30:43] helpa: Krishna: No use at all. Move along: http://sidekiq.org/ https://github.com/resque/resque
[10:30:43] workmad3: Krishna: !redis
[10:32:29] jrobeson: how is that right? redis does more than act as a queue..
[10:32:43] workmad3: jrobeson: sorry, I was just looking for quick examples
[10:33:01] helpa: jrobeson: Ruby on Rails doesn't scale - nothing to see here - move along. http://twitter.com/
[10:33:01] workmad3: jrobeson: !scale in the spirit of this :)
[10:33:28] jrobeson: why nto just link to the website then
[10:33:44] jrobeson: http://canrailsscale.com/
[10:34:20] workmad3: I have a suspicion the bot command was added before that
[10:34:38] workmad3: it was definitely added before twitter moved a lot of stuff away from rails :)
[10:34:57] Hates_: That site is nearly as old as rails itself
[10:35:07] tagrudev: Friday Friday
[10:35:26] helpa: tagrudev: http://youtu.be/kfVsfOSbJY0
[10:35:26] workmad3: tagrudev: !friday
[10:35:40] tagrudev: I need access
[10:36:17] jrobeson: the thoughtbot blog is ridiculous.. they are silly
[10:36:46] jrobeson: never seen anybody use this before "Fancytime!"
[10:38:49] workmad3: Hates_: ok, so yeah it looks like the site predates the bot
[10:40:37] tagrudev: but rails with mongo can scale
[10:40:47] helpa: node.js? no.js, but thanks anyways.
[10:41:26] jrobeson: we coudl all watch the funny video
[10:41:38] tagrudev: I am replaying rebecca
[10:41:58] workmad3: tagrudev: my boss threatened to somehow get me to watch the video today
[10:42:09] workmad3: tagrudev: and when I told my wife, she just said 'challenge accepted'
[10:42:21] jrobeson: which video?
[10:42:27] tagrudev: that's harsh
[10:42:42] workmad3: I then stupidly clicked a link from her this morning... she claims listening to the two opening bars counts
[10:42:49] helpa: jrobeson: http://youtu.be/kfVsfOSbJY0
[10:42:49] workmad3: jrobeson: !friday
[10:43:29] tagrudev: which seat should I take
[10:43:35] juo: saved by the google adverts
[10:43:50] workmad3: sometimes having a fast net connection sucks :( such as when the video starts playing before you can close the window
[10:43:53] jrobeson: who is rebecca black..
[10:44:00] tagrudev: oh boy http://answers.yahoo.com/question/index?qid=20110320071907AA29Bp4
[10:44:30] tagrudev: jrobeson, come on man that's like not knowing what the fox said
[10:44:51] jrobeson: i've heard the name before.. i guess she's some sort of pop singer?
[10:45:04] tagrudev: duh like the best singer ever
[10:45:14] workmad3: jrobeson: http://vimeo.com/21801768
[10:46:13] workmad3: jrobeson: she's a 0-hit wonder
[10:46:48] jrobeson: sounds like an album deal must be in the works
[10:47:39] tagrudev: brooker is #1 :D
[10:48:21] jrobeson: well those people are still asses though..
[10:48:39] jrobeson: yep.. just as i expected .. :)
[10:48:57] tagrudev: I am getting my Friday Rebeca Burger
[10:49:29] jrobeson: totally getting a record deal
[10:49:50] elaptics: tagrudev: what did the fox say?
[10:50:03] jrobeson: and who is the fox..
[10:50:13] tagrudev: ringdingigiding
[10:50:18] workmad3: jrobeson: nah, this was a few years ago now :) it was purely a hate campaign against a teenager that convinced her parents to fork out $2k on a shit music video
[10:50:42] tagrudev: actually elaptics the man has a new hit http://www.youtube.com/watch?v=PaEnaoydUUo
[10:50:53] jrobeson: the video wasn't that shite.. the song was though..
[10:51:17] workmad3: jrobeson: you could look up the literal video version ;)
[10:51:19] jrobeson: in that vein of music anyways..
[10:51:31] jrobeson: oh.. that wasn't? the youtube one linked earlier?
[10:51:56] workmad3: that was the correct video
[10:52:14] workmad3: a literal video is one where someone has re-done the song so that the lyrics match what is happening in the video
[10:52:26] elaptics: tagrudev: holy fuck
[10:52:43] tagrudev: yeah genius
[10:54:28] workmad3: elaptics: +1
[10:58:17] workmad3: tagrudev: heh :) 'still a better love story than twilight' in the comments
[10:59:29] vicmiclovich: hi folks; has anyone used a combination of GridFS and Mongoid (Rails) to store excel files; how would you get that excel file again? I've got the following snippet of code in a worker class of some kind http://pastie.org/8359735
[11:00:52] kke: 1) would you rather receive A: {"company": {"foo": 1}} or B: {"foo": 1} when doing GET /companies/:id? and 2) how about arrays, A: [{"foo": 1}, {???foo", 2}] or B: {"companies": [{???foo", 1}..]} or C: [{"company": {"foo": 1}}, {"company": {"foo", 2}}] or D: something else when doing GET /companies?
[11:01:01] kke: maybe i'll just google for best practices some more
[11:01:36] sevenseacat: i tend to go back and forth on that issue
[11:01:55] sevenseacat: just personal preference
[11:01:59] tagrudev: vicmiclovich, did you check that out http://stackoverflow.com/questions/11638095/retrieve-file-from-gridfs-and-pass-as-regular-iofile
[11:02:08] workmad3: kke: I don't like C for arrays, but otherwise I'm with sevenseacat
[11:02:30] jrobeson: kke, there is a rails api video for that. i saw it on youtube, everything was always always the same format whether collection of results or not
[11:02:34] sevenseacat: but definitely not C
[11:02:45] tagrudev: i prefer object rather than array - android easier handling
[11:02:57] workmad3: kke: if I have heterogeneous collections in the response, I'm more likely to go with side-loading rather than C (so {companies: [], employees: [], ...}
[11:04:33] workmad3: kke: thinking about it, I guess I'm more likely to go with A for objects and B for collections, due to it being easier to add side-loading into those styles :)
[11:04:55] clyfe: kke: rails-api from ember school (katz, valim) prefers qualifier ie. {"company": {"foo": 1}} arguably more future-proof
[11:05:28] clyfe: kke: dhh likes simplicity, so no qualifier, usually backbone folks use {"foo": 1}
[11:24:34] BrazenBraden: if one wants to execute some ruby code in a coffee file, can one rename the file to file.coffee.erb ?
[11:24:47] helpa: Why don't you try it and find out for yourself?
[11:25:36] BrazenBraden: well, i have tried it.. but it seems a bit weird..
[11:25:43] tagrudev: #tryitinproduction
[11:26:09] BrazenBraden: i mean.. is something like this legit? https://gist.github.com/d3e835d84e346c437440
[11:26:37] clyfe: BrazenBraden: file.coffee.erb can exec ruby code
[11:27:01] clyfe: BrazenBraden: no, since there's no view context there
[11:27:14] BrazenBraden: clyfe: alright.. thanks.
[11:27:23] BrazenBraden: ACTION pursues alternative pathways
[11:29:20] clyfe: BrazenBraden: https://gist.github.com/clyfe/6727227
[11:30:36] BrazenBraden: clyfe: okie.. busy perusing stackoverflow for some ideas on how to get my partial loaded into my view using after capturing a JS event..
[11:31:05] clyfe: BrazenBraden: just do an ajax
[11:31:09] BrazenBraden: clyfe: looks like ajax
[11:31:41] defswork: BrazenBraden, ajax get
[11:31:47] BrazenBraden: ajax to me is like fire with water
[11:31:53] BrazenBraden: just doesnt work together
[11:32:00] BrazenBraden: nm ajax, JS in general
[11:32:05] BrazenBraden: my arch nemesis
[11:32:28] defswork: http://api.jquery.com/jQuery.get/
[11:33:06] clyfe: 2004 was ajax, 2005-2006 was rails, 2007-2008 was mobile, 2010-2011 was js-heavy
[11:33:09] clyfe: what's the new cool thing?
[11:33:10] BrazenBraden: hmmm thanks.. will read through this
[11:33:26] tagrudev: the thing is coke
[11:33:46] BrazenBraden: could do with some of that.. needa wake up a bit
[11:33:49] clyfe: would be funny if it wouldn't be true
[11:34:06] rvanlieshout: was rails? was mobile?
[11:34:11] rvanlieshout: is rails, is mobile
[11:34:36] clyfe: yeah but it's no longer early adopter thing
[11:34:43] clyfe: on profits only from early adoption
[11:35:36] rvanlieshout: don't forget about the many disadvantages from early adoption
[11:37:11] sevenseacat: big thing nowadays seems to be javascript mvc
[11:37:59] rvanlieshout: i just don't like mvc in js
[11:38:07] ljarvis: i just don't like js
[11:38:07] rvanlieshout: well.. mvc is not really the problem
[11:38:13] sevenseacat: i didnt know a lot about it until i started reading into ember
[11:38:22] sevenseacat: i also hate js, but ember is pretty nice
[11:38:35] ljarvis: yeah i dont mind ember too much
[11:38:43] jeffmess_: Hi all. Have a rather interesting problem with loading gems through Rails. I have Axlsx gem installed in a rails app, using it via command line on production works fine but when going through the controller I get a NameError: uninitialized constant Axlsx. Weirdly enough, this works perfectly fine in development mode on my local machine. Has anyone experience anything like this?
[11:39:21] rvanlieshout: javascript has just to many undefined-types
[11:44:37] clyfe: jeffmess_: how do you deploy ?
[11:44:50] crashx: hi everyone
[11:44:55] crashx: trying to do something like that
[11:44:57] crashx: <%= link_to "Back", controller: "products", {:class => "btn btn-default"} %>
[11:45:07] crashx: but i have a syntax error
[11:45:08] crashx: any help?
[11:45:21] jeffmess_: clyfe: capistrano
[11:45:44] clyfe: jeffmess_: does it bundle install ?
[11:46:07] jeffmess_: clyfe: yeah, logging into the rails console on production and the gem works perfectly fine
[11:46:17] clyfe: ie require 'bundler/capistrano'
[11:46:57] clyfe: I'm thinking that the gem is not installed in prod, other than that no idea
[11:47:40] clyfe: crashx: <%= link_to "Back", { controller: "products" }, {:class => "btn btn-default"} %>
[11:48:01] clyfe: crashx: can do without a hash's curlyes only if the last arg (in ruby)
[11:48:16] crashx: clyfe: oh ty man
[11:53:05] denym_: fir multiple indexes per migration, do i have to do add_index per index or can i do it somewho inline?
[11:53:19] jeffmess_: clyfe: bundle list shows same version of gem as development
[11:53:48] universa1: denym_: with rails 4 for foreign keys you can do t.belongs_to :model, index: true
[11:53:49] jeffmess_: clyfe: thx anyway
[11:54:49] universa1: denym_: and you can always do something like [[:col, :col1], [:col, :col2]].each {|cols| add_index :tables, cols}
[11:55:08] BrazenBraden: how do you respond to the click event on an element but ignore the click event on items nested within that element. for example, i have a li that i want to respond to click on but there is an embedded checkbox i want the event to ignore.. https://gist.github.com/brazenbraden/a79f1987176cb927e22d
[11:55:20] denym_: created it via scaffold and scaffold still uses add_index in rails 4
[11:55:41] denym_: i know this belongs_to thing but was not sure about the difference
[11:56:01] maloik: I'm getting ArgumentError: invalid byte sequence errors when deploying. My colleagues dont get the same problem... weird thing is that when using locale on the server it's set to UTF8 the same as my own shell
[11:56:07] maloik: Anyone have any ideas ?
[11:57:12] universa1: denym_: rails g model test user:belongs_to | results in the migration: t.belongs_to :user, index: true
[11:58:09] universa1: denym_: using postgres, but the migrations should be the same anyways
[11:59:02] jeffmess_: BrazenBraden: event.preventDefault() will prevent the click, you can then trigger whatever u want afterwards
[11:59:29] denym_: universal: ah ok good to know, thanks for that
[11:59:45] BrazenBraden: jeffmess_: mm ok.. will check into that
[12:03:18] BrazenBraden: jeffmess_: I cant see how to use that
[12:05:18] jeffmess_: Brazen:Braden: on the click event you need to pass a function... .click (e) -> e.preventDefault; ...
[12:05:44] jeffmess_: http://api.jquery.com/click/
[12:06:13] jeffmess_: http://api.jquery.com/event.preventDefault/
[12:06:14] seba4: hi to all. Someone knows if there exists a good gem for xml diff. I tried with diff and nokogiri but i get some false changes
[12:06:24] seba4: i need to visualize changes..
[12:07:37] jeffmess_: BrazenBraden: ^^
[12:07:54] BrazenBraden: jeffmess_: found some resources..
[12:19:36] yaymukund: is there some way to do location: nil by defalt for all respond_with calls?
[12:20:08] yaymukund: I'm writing a rails api and mostly don't care about redirecting. I just want to render errors or the object
[12:23:59] yaymukund: I don't even respond_to :html, which seems like the only place where the redirect would be useful
[12:24:56] BrazenBraden: this is rubbish example of what im trying to do.. http://jsfiddle.net/mHLFk/
[12:25:08] denym_: strange when Im scaffolding something with user:belongs_to the forms for new-action gets a dropdown menu where i can select a user .... -.-
[12:25:54] denym_: <%= f.association :user %>
[12:25:55] BrazenBraden: nm, that example is broken
[12:25:57] denym_: thats weird
[12:28:43] denym_: This shoulnd be be this way i guess
[12:31:09] slainer68_FTW: [5] pry(main)> "POUET POUeT".titleize
[12:31:10] slainer68_FTW: => "Pouet Po Ue T"
[12:31:18] slainer68_FTW: why these weird spaces ?
[12:31:45] BrazenBraden: slainer68_FTW: its taking the change from small to caps as different words
[12:31:49] BrazenBraden: like camel case
[12:32:02] BrazenBraden: do to lowercase first then titleize
[12:32:41] slainer68_FTW: BrazenBraden: ok thx
[12:34:47] pskrz: slainer68_ftw: https://github.com/rails/rails/blob/master/activesupport/lib/active_support/inflector/methods.rb#L101
[12:35:07] pskrz: slainer68_ftw: actually here https://github.com/rails/rails/blob/master/activesupport/lib/active_support/inflector/methods.rb#L101
[12:36:25] jeffmess_: BrazenBraden: are you trying to maybe do this? http://jsfiddle.net/mHLFk/17/
[12:36:39] Tobias|: How can I define class level methods in a BaseModel class, similar to the way ActiveRecord::Base.new is defined?
[12:37:56] BrazenBraden: jeffmess_: kinda but no. to make it easier to distinguish the elements, make the second 'a' a 'button'. then, i would like the li and EVERYTHING within the 'li' to respond to the click event EXCEPT the button.
[12:37:59] yaymukund: ah the location is an http header. I do probably want to return that... hm
[12:38:30] AntelopeSalad: does anyone have experience deploying to a 512mb ram server?
[12:39:24] jan1337z: Imaging you have the models Person and Section - Person has many Sections ??? now you Want to create a Section and in the form you have a Select input field to choose the person??? I got all that but I can't think of a way write it into the db??? I can't use nested_forms right?
[12:41:11] AntelopeSalad: Tobias|: do you mean just a typical class level method?
[12:42:31] universa1: jan1337z: Section belongs_to :person => Section.new.person_id => f.select :person_id, ...
[12:42:42] helpa: jan1337z: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[12:42:42] universa1: jan1337z: !associations
[12:43:45] Tobias|: AntelopeSalad, I have a class level method 'lazy_new' defined on a bunch of my model classes which I'd like to move to a BaseModel class or similar
[12:44:26] AntelopeSalad: Tobias|: i'm still new to ruby but maybe you could do that with a module mixin?
[12:44:45] jan1337z: universa1, sorry??? thought in the wrong direction
[12:45:25] universa1: Tobias|: class BaseModel; def self.lazy_new; "blub";end;end class Inherit < BaseModel; end Inherit.lazy_new ?
[12:45:46] universa1: Tobias|: you could also let your BaseModel inherit from AR::Base
[12:46:56] AntelopeSalad: universa1: you prefer inheritance vs mixins in this case?
[12:47:39] universa1: AntelopeSalad: it depends. both are possible solutions
[12:47:59] AntelopeSalad: i'm still not really sure when to pick one or the other
[12:48:25] Tobias|: universa1, I might be extending this in the wrong way, but I end up with Rails trying to find a table named 'base_models'
[12:48:57] Tobias|: It could very well be because the class level model refers to 'self' as well
[12:49:11] helpa: Tobias|: 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.
[12:49:11] universa1: Tobias|: !code
[12:49:32] Tobias|: def self.lazy_new (hash = {}) self.where(hash).first || self.new(hash) end
[12:49:47] Tobias|: That's the entire method
[12:50:07] AntelopeSalad: that does seem like self would be replaced with the model that's it ran on, and then it gets converted to the table automatically?
[12:51:25] AntelopeSalad: Tobias|: check this out http://api.rubyonrails.org/classes/ActiveRecord/Inheritance/ClassMethods.html#method-i-abstract_class-3F
[12:51:52] AntelopeSalad: read the attributes right above the abstract_method description
[12:51:59] universa1: Tobias|: why not just: Team.where(name: 'Justice League').first_or_initialize ?
[12:52:47] AntelopeSalad: if make it an abstract class then it won't convert the model name to its matching table name
[12:53:15] Tobias|: The abstract_class? method looks like it's working, though .first_or_initialize is probably the correct way to do what I want
[12:54:26] Tobias|: Thanks AntelopeSalad and universa1 :)
[13:21:55] maloik: Does anyone know how to get remote environment variables using capistrano
[13:22:00] maloik: as in echo $LANG type stuff
[13:24:52] mcr-credil: do you need to actually retrieve them, or just use them?
[13:24:52] mcr-credil: in general, the login environment of the remote machine pretty bare.
[13:24:52] mcr-credil: because if you just need to use them, then just write shell commands that use them.
[13:29:53] jb41: how can i use ActionView::Helpers::NumberHelper methods in ruby script - outside of rails
[13:31:12] jb41: require 'action_view' doesn't solve it
[13:32:04] maloik: mcr-credil: was to debug
[13:32:09] maloik: figured it out
[13:32:20] maloik: not the solution i wouldve wanted but hey its friday and encoding can fuck off :(
[13:34:18] pontiki: jb41: might have to include it as well
[13:34:41] pontiki: require 'action_view'
[13:34:54] pontiki: include ActionView::Helpers::NumberHelper
[13:37:31] jb41: it also didn't work, i don't know why
[13:37:45] jb41: but i get such error: /usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rack
[13:38:05] AntelopeSalad: do you guys think 512mb ram on a vps is enough to run nginx+rails+postgres+memcached+solr? assume a fairly small data set (maybe 50mb total)
[13:39:01] pontiki: i don't know about such old rubies
[13:40:12] pontiki: AntelopeSalad: that should be okay if you don't expect a lot of requests at any point in time. is it burstable RAM or fixed?
[13:40:37] AntelopeSalad: pontiki: fixed
[13:41:00] AntelopeSalad: i planned to investigate in caching everything as much as possible when i got closer to deploying it
[13:42:09] pontiki: yeah, 50mb isn't much
[13:42:17] dopie: nigerianceo, yo!
[13:42:17] AntelopeSalad: if i managed to store most things in memory would it still have trouble with high concurrency/traffic?
[13:42:33] dopie: just woke up
[13:42:49] dopie: ill be doing the redactor thing around 2-3ish
[13:43:36] jstrong: AntelopeSalad: what's your concurrency traffic rate?
[13:43:55] jstrong: AntelopeSalad: Honestly instead of guessing you need to give it a test run and use blitz or a similar tool to stress test your server.
[13:43:56] AntelopeSalad: jstrong: enough to not explode if it were on HN for a few hours
[13:44:29] AntelopeSalad: which i guess would be maybe 15k uniques in a few hour time span?
[13:44:32] BrazenBraden: (rant start) i swear there is nothing more painful in this world than javascript!! (rant over)
[13:44:50] pontiki: ACTION throws a coldfusion book at BrazenBraden 
[13:45:07] BrazenBraden: pontiki: to what aim?
[13:45:14] pontiki: more painful
[13:45:23] jstrong: AntelopeSalad: before you go page caching everything just make sure your database is well indexed and your queries are running efficiently.
[13:45:25] BrazenBraden: you would do as much damage if you threw a "alert('hello world')" at me
[13:45:47] AntelopeSalad: jstrong: i've been using a few tools to monitor that, the db queries are setup well i think
[13:46:05] jstrong: AntelopeSalad: then just stress test it and see how it responds!
[13:46:15] AntelopeSalad: there are no n+1 queries, i'm using counter caches where i can, etc.
[13:46:39] pontiki: measurement is the key. data-driven decisions are the best.
[13:46:54] AntelopeSalad: that rack-mini-profiler is a really nice dev tool
[13:47:22] jstrong: what pontiki says.
[13:47:23] jstrong: https://www.blitz.io/
[13:47:42] pontiki: jstrong: i was boosting your signal :)
[13:48:10] AntelopeSalad: i will do that locally for sure
[13:48:19] AntelopeSalad: i was just hoping someone happened to deploy a similar setup
[13:48:38] jstrong: depends entirely on the rails app
[13:48:45] jstrong: 512mb is pretty thin and cutting it close even for small rails apps
[13:48:48] jstrong: but I've done it before
[13:49:01] AntelopeSalad: my concern was solr being thrown into the mix
[13:49:31] jstrong: also just use newrelic and their fantastic tools
[13:49:45] AntelopeSalad: yeah new relic seemed quite good
[13:49:59] AntelopeSalad: if i ever had a successful app i would totally pay for it
[13:51:18] AntelopeSalad: for the time being i just use that rack profiler in dev mode since it breaks down db queries and everything else
[13:52:34] Ergo^: AntelopeSalad: you could try writing a plugin for errormator that would send out db queries
[13:52:37] Ergo^: the api is open
[13:52:38] gerep: Hi all. I need help uploading a file. https://gist.github.com/gerep/6728899 On line 33 the source variable receives the file Base64.encoded64 as expected, but the line bellow where I set the self.document_file = source is not working
[13:53:13] gerep: If I debug and check for the self.document_file, after the attribution, it still has the old value, which is the file path
[13:53:50] jstrong: gerep: is this a remote image?
[13:53:53] gerep: And it should be the file source, not file path, what am I doing wrong?
[13:54:02] gerep: jstrong, no, local
[13:54:06] jstrong: gerep: what you are doing wrong is you are ??? half using carrierwave.
[13:54:15] gerep: jstrong, the file is created inside my tmp folder
[13:54:28] gerep: jstrong, hahah what am I missing?
[13:54:35] AntelopeSalad: Ergo^: errormator looks pretty good too for the free tier
[13:55:23] Ergo^: AntelopeSalad: (disclaimer: its my service), i dont have a dedicated euby plugin atm that would ping performance data to my service
[13:55:49] Ergo^: but you could just use json requests to send it to me using api directly
[13:55:59] Ergo^: you would get a lot of insight whats going on instantly
[13:56:35] jstrong: gerep: document_file_url = "yoururl"
[13:56:37] Ergo^: im mainly focused on python client atm
[13:56:40] jstrong: gerep: carrierwave will handle the rest
[13:56:51] Ergo^: to provide new relic like performance tracing
[13:57:02] gerep: jstrong, sorry, I don't get it =/
[13:57:14] jstrong: you are using carrierwave, correct?
[13:57:19] gerep: jstrong, yes
[13:57:46] jstrong: if you are using carrierwave you have to decide if you're going to it their way
[13:57:49] jstrong: or if you want to do it manually
[13:57:58] jstrong: carrierwave uploaders can read urls and download/process the files for you
[13:58:07] gerep: jstrong, But the file is uploaded, that's not the problem
[13:58:15] AntelopeSalad: Ergo^: how hard would it be to hook it up with rails to track db info?
[13:58:28] gerep: jstrong, the problem is that I can't get the file's source and save it to my database binary column
[13:58:37] jstrong: that's not how carrierwave works
[13:58:44] gerep: jstrong, hum, get it
[13:58:50] jstrong: carrierwave only stores a URL in the database
[13:59:03] jstrong: so either you use carrierwave and do it their way or do it manually
[13:59:25] sevenseacat: oh god why do people keep wanting to store files in the database
[13:59:28] sevenseacat: seriously, WHY
[13:59:29] Ergo^: AntelopeSalad: well, im not a ruby dev, but im sure there are some simple recipies to print out queries with their times, so you could use any of that and then write a simple ping service to my api
[13:59:33] Ergo^: should be trivial
[13:59:43] JPascal: why you need save files in db binary column?
[13:59:58] AntelopeSalad: Ergo^: nice, yeah that does seem extremely straight forward
[14:00:02] sevenseacat: name *one benefit* that it provides
[14:00:13] Ergo^: sevenseacat: because many years ago some shared hosting providers advertised unlimited database size, and limited disk quota
[14:00:24] Ergo^: sevenseacat: and people are not using their brains since then ;-)
[14:00:30] gerep: sevenseacat, I agree with you, the problem is that the application I'm working on is already doing it this way
[14:00:30] sevenseacat: thats good, but we're not in many years ago
[14:00:45] sevenseacat: gerep: then it already has a fucked-up way to do what you're trying to do
[14:00:46] jstrong: gerep: fix your data don't change your code to fit your data
[14:00:52] sevenseacat: use that, or fix it
[14:01:30] jstrong: sevenseacat: you should see filemaker, fun stuff there.
[14:01:40] jstrong: sevenseacat: in filemaker you can store buttons and navigation into database columns
[14:02:34] sevenseacat: that sounds like something i would want to kill with fire
[14:02:41] pontiki: lots of fire
[14:07:14] ReBa_: I have an error when trying to create a new user... When doing @user.save! it gives a Validation Error, but when I remove the bang! method I don't get any errors at all, it just redirects me to my form page: https://gist.github.com/RemiSpot/53d842a05b9c62d0a32a
[14:08:19] sevenseacat: well if its *redirecting* you anywhere, thats a good indication of the problem
[14:08:35] sevenseacat: it shouldn't be redirecting anywhere, it should be re-rendering the form
[14:08:59] sevenseacat: so, whats actually happening?
[14:09:14] ReBa_: No, I meant redirecting to the form (in fact... rerendering) and so I misexplained it
[14:09:34] sevenseacat: ah i see the problem
[14:09:50] ReBa_: So I fill in my users/new form --> press "Register" --> users/create --> form (without any validation errors)
[14:10:07] ReBa_: If I bang the @user.save method, it gives me the validation error page
[14:10:22] ReBa_: So there is a validation error... but I don't know exactly where I have to look for it
[14:10:22] sevenseacat: https://gist.github.com/RemiSpot/53d842a05b9c62d0a32a#file-user-rb-L25 gender can be false, yet gender is a required field
[14:10:51] sevenseacat: why is gender a boolean field?
[14:10:56] ReBa_: Yes, so false will in fact be seen as nil/not filled in?
[14:11:03] ReBa_: I thought that would be te easiest to do
[14:11:24] universa1: there is more then just male / female ;)
[14:11:34] sevenseacat: i love when people put the whole respond_to block in there when theyre not even using it
[14:11:43] sevenseacat: yay scaffolding
[14:11:44] tagrudev: false = men, true = women
[14:11:48] tagrudev: don't ask why
[14:12:03] sevenseacat: other way around apparently
[14:12:19] juo: if self.gender == "Male"; true
[14:12:34] adre: it's all about 1 and 0 :)
[14:12:34] tagrudev: so you've never argued a woman :D
[14:12:40] sevenseacat: so stick a debugger right before that save line, see what the user is, see what the errors are
[14:12:45] universa1: ReBa_: this seems like the wrong way to handle that:https://gist.github.com/RemiSpot/53d842a05b9c62d0a32a#file-users_controller-rb-L46
[14:13:16] ReBa_: universa1: Yeah, was busy implementing that though (or do you mean the begin/rescue block itself?)
[14:13:21] sevenseacat: that set_user method is kinda few wtfs in a neat little package
[14:13:46] ReBa_: I have to write the code for the rescue :)
[14:14:00] juo: what is the validation error on the user?
[14:14:01] universa1: ReBa_: @user = User.where(id: params[:id]) if you don't want a 404 page ...
[14:14:12] universa1: ReBa_: do not use exceptions for control flow.
[14:14:38] universa1: ReBa_: exceptions are someting unexpected, you obviously expect to not find a user.
[14:14:53] sevenseacat: that and why would you not be caring if you cant find the user, unless you're not even using the user
[14:15:05] ReBa_: I'm trying to follow (as I am still learning)
[14:15:11] sevenseacat: (which in a users controller is kinda odd)
[14:15:20] chichou: @universa1 @user = User.where(id: params[:id]).first maybe ?
[14:15:29] sevenseacat: you also dont even appear to be using this set_user method
[14:15:41] ReBa_: So in fact, I just have to make that there can't be an error on my control flow, right?!
[14:15:43] universa1: chichou: ohh yeah, pseudo-coding in irc is not good ;)
[14:15:58] ReBa_: And if there should be a problem, it should redirect to 404 page?
[14:16:51] universa1: ReBa_: no, if you expect to not find a user and want to do something with it, then use @user = User.where(id: params[:id]); redirect_to root_page, notice: "Ohh NOOOES!!!!" unless @user for example
[14:17:19] universa1: ReBa_: if you want a 404 error page just do User.find(params[:id]) , rails takes care of the rest.
[14:17:21] ReBa_: In stead of working with exceptions...
[14:17:38] workmad3: universa1: your example will never redirect ;)
[14:17:48] chichou: and for the principle of flow control by exception, even if I agree with you, I heard of something like "Easier to ask forgiveness than permission"
[14:17:51] universa1: workmad3: ahh damn, forgot the first again
[14:17:55] workmad3: universa1: :)
[14:18:15] universa1: ReBa_: that should be @user = User.where(id: params[:id]).first
[14:18:48] ReBa_: So to have everything (kinda) right to my application: Use 0/1 for gender and don't use the exception in the flow (because forgiving is beter?) --> now I have @user = User.where(id: params[:id]).first
[14:19:22] chichou: exceptions is the forgive part :)
[14:19:28] juo: User.find_by_id(params[:id])
[14:19:32] workmad3: chichou: you shouldn't do normal code flow-control with exceptions basically... so that's don't do things like stop processing a file by catching an EOF exception, don't do 0 detection in division by catching a divide-by-0 exception
[14:19:33] juo: is better
[14:19:36] momomomomo: So my colleague just brought up Canonical's Juju, which sets up environments for a given 'charm' which is created by the charm's vendors (ideally) - it looks kind of neat, is a little scary (name literally means magic), and will probably end up being a bit behind the actual release cycle of your desired app??? but it's pretty neat looking.
[14:19:40] momomomomo: https://www.youtube.com/watch?v=1yoIdgdqzLk;feature=player_detailpage
[14:19:56] chichou: no it's why I rescue only RuntimeException :)
[14:20:06] chichou: or StandardException if you prefer
[14:20:21] workmad3: chichou: standard exception would catch both those cases I mentioned
[14:20:34] BrazenBraden: the following little bit of jquery works except the alert "checkbox" gets thrown 3 times.. why? https://gist.github.com/brazenbraden/83dacd4738730331cf4a
[14:20:42] chichou: oh ok RecordNotFound exception so :p
[14:21:07] chichou: anyway, I don't know what impact exceptions have on ruby code
[14:21:15] chichou: beacause it's a goto like in fact
[14:21:16] workmad3: chichou: the 'ask forgiveness rather than ask permission' is really more to do with NoMethodError stuff in ruby... assume that what you need is there, and then throw an error when it isn't ;)
[14:21:21] ReBa_: So damn me :P I'm getting confused
[14:22:06] ReBa_: So if someone searches a non existing ID, I should just redirect (to a 404 page?) him in stead of using the exception construction?!
[14:22:09] chichou: and in compiled softwares you have to run rewind your stack to find the exception point and it's bad
[14:22:10] workmad3: chichou: it's a controlled goto... just like so much stuff in ruby
[14:22:17] gerep: sevenseacat, Hey :) I'll upload the images to S3, one doubt, https://github.com/carrierwaveuploader/carrierwave#using-amazon-s3 the fog_public = false will not allow search crawler to get my url? I'm worried because those documents have sensitive data about clients
[14:22:23] workmad3: chichou: and like so much in most languages
[14:22:53] sevenseacat: ReBa_: rails will by default render a 404 page if an RecordNotFound exception is raised
[14:23:21] workmad3: chichou: it's pretty similar in ruby... the stack unwinds until it reaches a handler for the exception or hits the top-level and aborts the program
[14:23:44] sevenseacat: gerep: um i dont know, but anyone with the URL could just access it unless you start getting fancy with expiring URLs
[14:23:50] chichou: yeah so it's quit performance killer
[14:24:03] gerep: sevenseacat, OK, thanks :)
[14:24:09] ReBa_: Okay, so in fact I don't need to catch anything, as Rails will catch it as it is configured by default
[14:24:13] workmad3: chichou: right, they're not exactly high performance things :)
[14:24:32] chichou: haha not wrong
[14:24:56] workmad3: chichou: I wouldn't say that makes them 'bad'... but it certainly drives home the point that you shouldn't use them for your normal program flow :)
[14:26:14] chichou: ok thanks for those precisions
[14:26:35] workmad3: chichou: they're better than some error mechanisms I've worked with... I've dealt with one 'awesome' one where you had to push objects to be freed onto a cleanup stack manually, and errors would 'leave' (which under the hood was really a raw goto)
[14:26:35] sevenseacat: BrazenBraden: need a bit more information
[14:27:00] sevenseacat: BrazenBraden: like, what HTML is it working on and what are you doing to get the checkboxes
[14:27:11] BrazenBraden: sevenseacat: coming right up
[14:27:49] maoko: Could someone please look into my mess? I'm trying to perform a query within a cached relation but ending up accessing the DB. Here is the method for creating a cache https://gist.github.com/maokomioko/b26445534adfc6341674 and the helper, which performs an additional query over the cache https://gist.github.com/maokomioko/26d690a4b7e8343d74a9
[14:28:07] BrazenBraden: sevenseacat: updated
[14:28:45] workmad3: maoko: when creating or editing a gist, do you see that little 'add additional file' button at the bottom? could you use it please? thanks :)
[14:29:15] sevenseacat: BrazenBraden: now i know why it's firing multiple times
[14:29:22] maoko: workmad3, ouch, completely forgot about adding the files. Sorry
[14:29:38] sevenseacat: but firstly, what are you clicking on to cause it
[14:30:44] sevenseacat: and this is unrelated but why on earth are you editing users via a form with method GET
[14:30:49] BrazenBraden: sevenseacat: well, there are two things i want the user to click on..
[14:30:57] BrazenBraden: either the general li which will load one users details
[14:31:02] sevenseacat: i didnt ask what you want the user to click on
[14:31:06] BrazenBraden: or the checkbox that will do nothing as it allows multiple selecrt
[14:31:08] sevenseacat: i asked what you clicked on to generate three alerts
[14:31:17] BrazenBraden: on the checkbox
[14:31:53] sevenseacat: the checkbox with id^=user_, which is in a list item with id^=user_ ?
[14:31:59] BrazenBraden: ( and sevenseacat, not editing them via get, just loading a partial.. that still has to come and once its working, it will be done via post)
[14:32:30] BrazenBraden: sevenseacat: oh...
[14:32:47] sevenseacat: just making a guess here
[14:32:57] BrazenBraden: lemme change the id and have a gander
[14:33:41] BrazenBraden: sevenseacat: ok.. the three has become 2
[14:33:45] BrazenBraden: sevenseacat: updating the gist now
[14:35:56] sevenseacat: now your JS doesnt make any sense
[14:36:04] sevenseacat: you're targeting the list items, not the checkboxes
[14:36:14] BrazenBraden: sevenseacat: that is correct
[14:37:23] sevenseacat: you should not be seeing any alerts at all
[14:37:38] sevenseacat: actually, the general alert
[14:37:53] sevenseacat: not a lot of context
[14:37:57] BrazenBraden: hmm no.. if i click the general li, i get the general alert once. if i click the checkbox, i get two checkbox alerts
[14:38:42] sevenseacat: that makes no sense, because e.target is the list item.
[14:38:50] sevenseacat: chuck a debugger in there and see what it is
[14:39:08] AntelopeSalad: what's the best way to conditionally run a scope? ex. only perform this where clause if a certain params value exists
[14:39:13] ReBa_: Thanks guys... changing that boolean to string :limit->1 helped for my gender "problem" and the advise concerning the 404 page is really appreciated :)
[14:39:18] BrazenBraden: the checkbox is nested within the list item though
[14:39:23] AntelopeSalad: is returning 2 different instance variables the only way?
[14:39:25] sevenseacat: i dont know what this code is trying to do, but its messed up
[14:39:36] BrazenBraden: sevenseacat: of course its messed up.. its mine :D
[14:40:02] BrazenBraden: sevenseacat: i would rather rip of my finger nails with pliers than mess with JS but alas, no choice :(
[14:40:39] sevenseacat: why? the code you're trying to write is dead simple
[14:40:52] sevenseacat: now what is your intention with it
[14:41:10] pontiki: devtools are your frenz
[14:41:13] workmad3: BrazenBraden: try changing line 3 of your coffeescript from '$("[id^=list_user]").click (e) ->' to '$("[id^=list_user] input[type=checkbox]").click (e) ->
[14:41:17] ryannielson: I have a form with the date time field, which I want the value to be formatted differently from the default 2013-09-28 06:00:00.000000. But when I try to set the value argument, I get n undefined method error, suggestions? https://gist.github.com/RyanNielson/6729625
[14:41:41] workmad3: BrazenBraden: also consider using classes or data-role attributes rather than ids for this sort of thing
[14:41:50] ryannielson: the time_picker format is "%Y-%m-%d %H:%M" BTW
[14:42:41] BrazenBraden: sevenseacat: ok. this is my intention... i have a veritcal list of users. if you click on the user list item (consists of a checkbox, avatar and name) it will ajax get the settings page for that specific user (tis is not clicking on the checkbox). now, if you want to edit ,multiple users at one time, you click the checkboxes instead. nothing happens with that until you click the "edit these users" button. then that l
[14:42:41] BrazenBraden: oads in a different page via ajax
[14:42:44] workmad3: BrazenBraden: hell, you could already just do '$(".list input[type=checkbox]") for your first selector, and '$(".list li")' for your second
[14:43:17] workmad3: BrazenBraden: use two different click handlers...
[14:43:37] workmad3: BrazenBraden: and e.stopPropagation() is your friend
[14:43:37] BrazenBraden: workmad3: its not a simple checkbox though as is wrapped in all sorts of extra junk thanks to the template we using
[14:43:40] advorak: I am working with a database with a column name 'guid' ... is this a reserved word of sorts for irb, ruby, or rails? When I attempt to update the column and save it I get "SystemStackError: stack level too deep\n\tfrom /home/advorak/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/workspace.rb:86"
[14:43:51] sevenseacat: clicking on the checkbox therefore shouldnt do anything
[14:43:53] BrazenBraden: and workmad3, already have stopPropogation in there
[14:43:57] advorak: (it might be something elsewhere, but that is the function I'm working with right now ..)
[14:44:04] sevenseacat: so the whole point of the handler targeting the checkbox is pointless
[14:44:07] BrazenBraden: sevenseacat: yes, it shouldnt.. the alert there is just to check that it is working
[14:44:39] sevenseacat: BrazenBraden: you have it in there, but you're not calling it
[14:44:56] sevenseacat: coffeescript isnt ruby, you need parens :P
[14:45:25] BrazenBraden: but... i have parents in my js :(
[14:45:36] workmad3: BrazenBraden: parens, not parents
[14:45:36] sevenseacat: e.stopPropagation == function() { somethingorother }
[14:45:48] workmad3: BrazenBraden: as in parentheses
[14:45:58] BrazenBraden: oh. right lol
[14:46:06] BrazenBraden: even though this is coffee?
[14:46:09] workmad3: BrazenBraden: yes
[14:46:16] BrazenBraden: this goes to show how much JS i know
[14:46:26] workmad3: BrazenBraden: e.stopPropagation gives you back the function object, in both JS and CS
[14:46:27] BrazenBraden: where is that trout?
[14:46:28] sevenseacat: so why are you jumping straight into coffee then :/
[14:46:42] toretore: coffee is for drinking
[14:46:47] toretore: while writing js
[14:46:58] BrazenBraden: but coffee is supposed to make js coding easier and quicker
[14:47:06] sevenseacat: not if you have no idea about js
[14:47:06] BrazenBraden: just like sass makes css easier
[14:47:08] workmad3: BrazenBraden: it can do... once you know what the fuck you're doing
[14:47:14] pontiki: ACTION passes around the bushmills to add to the coffee for writing JS
[14:47:30] toretore: i'll take it neat plz
[14:47:49] workmad3: BrazenBraden: would you claim that sass makes CSS easier if you don't know how CSS works?
[14:47:50] pontiki: one irish coffee sans coffee and cream for toretore coming right up
[14:47:51] BrazenBraden: i need a stiff drink
[14:47:56] sevenseacat: i still need an ember project, i've done sweet fuck all tonight
[14:48:09] evansparkman: hehe.....that's the funniest quote I have read in a bit
[14:48:13] pontiki: the world *needs* another todo list manager
[14:48:15] toretore: cream & whisky, mmm
[14:48:17] pipework: sevenseacat: You want to work on ember?
[14:48:18] BrazenBraden: sevenseacat: i have "coded" 11 lines of js in 4 hours
[14:48:34] sevenseacat: pipework: i want to work with ember
[14:48:39] evansparkman: BrazenBraden: sounds like you need to study up more then :)
[14:48:44] BrazenBraden: i think im gonna go home and get drunk alone in my room
[14:48:45] toretore: BrazenBraden: it would be sooooo much easier if you went and actually learnt js
[14:48:46] evansparkman: ember looks really cool
[14:48:52] pipework: sevenseacat: You cray, gurl
[14:48:54] BrazenBraden: fine fine.. i get the hint.
[14:49:03] sevenseacat: pipework: i so cray.
[14:49:05] BrazenBraden: just wish i could plug myself in like in the matrix
[14:49:10] BrazenBraden: upload all that crap into my brain
[14:49:17] AntelopeSalad: yikes, how can i manually perform a callback on an action that does not trigger it?
[14:49:28] toretore: AntelopeSalad: elaborate
[14:49:29] AntelopeSalad: i'm using update_all and it does not update my counter cache, no idea how to fix this
[14:49:31] sevenseacat: actions trigger callbacks?
[14:49:38] workmad3: BrazenBraden: unluckily for you, this isn't the 90's anymore... JS isn't a copy-paste snippet toy language anymore... modern sites require you to know what you're doing
[14:49:46] toretore: AntelopeSalad: !codw
[14:50:04] AntelopeSalad: toretore: update_all does not run active record callbacks or validations
[14:50:07] BrazenBraden: workmad3: yea.. i used to get sites up back in the day by just downloading a .js and copy pasta some code
[14:50:08] helpa: 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.
[14:50:10] pipework: I copy paste all day bruv.
[14:50:19] BrazenBraden: never had a clue what i was doing... but i got lightbox and other such things working no prob
[14:50:26] toretore: i only have 1.5 hands to write with
[14:50:26] dopie: anyone here able to edit the CSS for CKEditor???
[14:50:51] dopie: i do a stylesheets/ckeditor/contents.css and nothing works
[14:50:58] pipework: toretore: Where are the other two hands?
[14:51:16] BrazenBraden: aight chaps, im gonna call it there for today.. you get 2 days of wonderful peace and quiet from me. then monday starts again...
[14:51:42] toretore: spend the weekend learning js like a real programmer
[14:51:52] AntelopeSalad: toretore: there's not much to look at http://pastie.org/8360210
[14:52:17] toretore: AntelopeSalad: that's not how you paste code
[14:52:37] BrazenBraden: toretore: i look at code all week.. now is time to rest the brain and absorb the little i have learnt
[14:53:06] workmad3: AntelopeSalad: no, update_all won't create active-record objects. It's there purely for doing a bulk-update that doesn't need any active-record niceness
[14:53:20] AntelopeSalad: workmad3: i know, i'm asking how i can get around that
[14:53:24] toretore: AntelopeSalad: what does your counter do?
[14:53:29] workmad3: AntelopeSalad: don't use update_all
[14:53:31] toretore: i've never used it
[14:53:32] AntelopeSalad: it's the built in rails counter
[14:53:36] optimus55: toretore: curious, what's js like a real programmer? are you talking about without jquery?
[14:53:41] AntelopeSalad: it just caches the record count to a column
[14:53:57] AntelopeSalad: and with activerecord if you .save something it updates the counter for you
[14:54:00] toretore: optimus55: i mean understanding how js actually works
[14:54:15] toretore: AntelopeSalad: i don't understand what it's counting
[14:54:16] AntelopeSalad: workmad3: i'd gladly not use if you can think of a reasonable way to do it otherwise
[14:54:28] workmad3: AntelopeSalad: load the records out the db, update and save
[14:54:28] optimus55: toretore: gotcha
[14:54:30] AntelopeSalad: toretore: it's counting the number of posts that belong to xyz category
[14:54:34] toretore: oh, number of posts in category
[14:54:52] AntelopeSalad: so the problem is, let's say i move 15 posts from foo to bar
[14:55:02] AntelopeSalad: foo will still have 15 as the count value when it should be 0
[14:55:11] toretore: well, you're going to have to update it manually then
[14:55:24] toretore: or not use update_all
[14:55:28] AntelopeSalad: will manually updating it be worse than doing what workmad3 recommends?
[14:55:58] toretore: it you're moving like a million posts, then update_all is much faster
[14:56:01] AntelopeSalad: i planned to use update_all in a lot of other places because it seemed awesomely easy to bulk change 1 column
[14:56:18] Joel: Apache, rack, rails app, the usual. When I hit a dynamic page I'm getting the red text "We're sorry, but something went wrong." The rails production.log isn't updating, and I'm not getting any errors in the apache log, thoughts on how to troubleshoot more?
[14:56:38] AntelopeSalad: at least for cases where the values are somewhat controlled
[14:56:44] workmad3: AntelopeSalad: it's fine... as long as you don't need anything to happen in the rails app when you use it
[14:56:52] toretore: Joel: which rack server?
[14:56:53] workmad3: AntelopeSalad: in this case, it turns out you do
[14:56:59] rehat: Hi, if I have a route like '/book/book_id/author/author_id/marke_read' when I user one of the helper paths do I need to supply the ids for book and author? if I do, does the order I pass them matter or will rails figure it out?
[14:57:00] sevenseacat: and this is why callbacks can be a PITA
[14:57:13] AntelopeSalad: it really makes me sad that i can't use update_all
[14:57:17] workmad3: AntelopeSalad: so your options are to either load stuff into AR and let it handle stuff, or re-implement the counter_cache stuff yourself
[14:57:21] sevenseacat: rehat: yes, and you need to supply them in the order they appear in the URL.
[14:57:33] rehat: sevenseacat: ok thanks
[14:57:38] AntelopeSalad: workmad3: any idea how hard it would be to reimplement counter_cache?
[14:57:41] helpa: rehat: http://guides.rubyonrails.org/routing.html - Rails Routing From the Outside In - Rails Guide - by Mike Gunderloy
[14:57:41] sevenseacat: rehat: !routing
[14:57:45] workmad3: AntelopeSalad: and as you don't know what category has moved from where, that's likely to mean you need to recalculate *all* your caches each time
[14:58:04] Joel: toretore: passenger
[14:58:15] toretore: Joel: i think passenger has its own log
[14:58:19] AntelopeSalad: workmad3: i do know both the old and new category values before anything gets touched in the db
[14:58:23] Joel: toretore: will look,t hanks
[14:58:30] workmad3: AntelopeSalad: sure... if you load that data *out* of the db
[14:58:53] workmad3: AntelopeSalad: which is the main thing that using update_all is saving you from ;)
[14:59:00] AntelopeSalad: hmm you're right
[14:59:07] workmad3: (well, and the AR model creation overhead)
[14:59:08] Joel: toretore: by default passenger logs to web server's default error log :\
[14:59:09] AntelopeSalad: there's no way to know which counter to decrement
[14:59:12] AntelopeSalad: without asking the db
[14:59:29] AntelopeSalad: unless i sent it as an argument in a hidden field?
[14:59:33] workmad3: AntelopeSalad: you said yesterday this was a small app mainly for yourself?
[14:59:40] sevenseacat: an update_all under the hood is literally just doing an UPDATE posts SET category_id = 12 WHERE ids in ?
[14:59:47] sevenseacat: you cant do callbacks on that
[15:00:01] maoko: Is it possible to cache an array, which is the result of multiple queries?
[15:00:02] AntelopeSalad: workmad3: sort of, it's something for myself at the moment
[15:00:04] workmad3: AntelopeSalad: just load the posts, do stuff in AR :)
[15:00:25] workmad3: AntelopeSalad: you can optimise that later if it turns out that you need to bulk-move millions of categories at once
[15:00:36] workmad3: s/categories/posts
[15:00:46] AntelopeSalad: i planned to limit it to the number of records returned in my data grid
[15:00:50] AntelopeSalad: which is 50 atm
[15:01:04] workmad3: hardly onerous
[15:01:14] AntelopeSalad: so just loop through and use AR right?
[15:01:19] workmad3: pretty much, yeah
[15:01:21] AntelopeSalad: even if there's 5,000 posts it should be no problem?
[15:01:32] AntelopeSalad: in case i decide to add in a "omg change everything" option at some point
[15:01:38] enricostn: hi! I'm working on my first Rails engine and I'm in trouble testing my controller: when I run the following test, the third example fails because he gets a 500 as response, while it should get a 404 (route does'nt exists) https://github.com/enricostano/siringa/blob/master/test/controllers/siringa_controller_test.rb
[15:01:59] workmad3: AntelopeSalad: worry about that if you actually do it
[15:02:17] sevenseacat: why do we not have a command for that
[15:02:23] workmad3: sevenseacat: yagni
[15:02:40] enricostn: so, if I run the dummy app and point to /siringa/load I get a 404... but when I do the same in the test I get a 500
[15:03:20] enricostn: it seems that it ignores the routes check in the test
[15:03:30] AntelopeSalad: the docs say something about Event.decrement_counter and Event.increment_counter
[15:03:39] ssb123: anyone have a good solution for running page specific js?
[15:03:43] sevenseacat: controller tests have nothing to do with routes
[15:04:03] enricostn: sevenseacat, really?
[15:04:24] sevenseacat: and why do so many people always want to do page specific javascript
[15:04:58] toretore: <script>pags specific js</script>
[15:05:02] enricostn: could you please point me to some doc explaning that?
[15:05:15] ssb123: <script>not the right way to do it</script>
[15:05:26] clocKwize: anyone know how I can override the path image-url resolves to in assets:precompile?
[15:05:58] workmad3: sevenseacat: because they think that it's better to have lots of small JS that they don't need to contain properly in the page than load it all once and check whether it needs to run based off the page content
[15:06:50] sevenseacat: so many http requests, so much wasted time
[15:07:22] ssb123: I want it in one file... the question is the best way to scope it.
[15:07:42] workmad3: ssb123: ah, ok :) I tend to do it through jquery selectors
[15:07:44] sevenseacat: scope it by the page you're calling it on?
[15:07:47] ssb123: if ( $("#element_1").length > 0 ) {
[15:07:56] toretore: use classes
[15:08:05] workmad3: ssb123: such as $("#element_1").click(function{})
[15:08:08] toretore: $('.classname').each(...)
[15:08:13] sevenseacat: or rather, not by the page its on, but by the content it needs to operate on
[15:08:17] toretore: or w/e in jq
[15:08:37] toretore: and use capturing at the body level
[15:08:37] workmad3: ssb123: with most jquery stuff, you don't need to check length > 0 first... just set the handlers/do whatever, and if the collection is empty, nothing will be done
[15:09:14] ssb123: I think I get it. Thansk.
[15:10:40] enricostn: sevenseacat, that's because with controller tests we just call (with get, post, etc) the actions without checking the routes, right?
[15:10:59] sevenseacat: your controller doesnt care if any routes actually route to it or not.
[15:11:27] ssb123: Done. That was wayyy to easy.
[15:12:08] enricostn: sevenseacat, right, so maybe I should use defensive code in actions that expect params. right know I only rely on routes
[15:12:36] enricostn: here for instance https://github.com/enricostano/siringa/blob/master/app/controllers/siringa/siringa_controller.rb#L5
[15:13:05] sevenseacat: well no, not really
[15:13:21] enricostn: here If I call the load action without passing a param I'll get an error related to to_sym
[15:14:37] ryannielson: I have a form on an external site that submits using AJAX to my rails site. Problem is, when they have fields that put stuff like "Ryan's" in it gets turned into "Ryan\'s" when sent to rails and saved in the database. Is there anyway to change this back to "Ryan's"? Ideally for the whole params hash?
[15:15:43] toretore: ryannielson: how do you know it does that?
[15:15:59] Criten: ryannielson, it should just work. it normally auto unescapes
[15:16:02] Criten: when you print it
[15:16:16] Criten: it escapes it just to prevent sql injection
[15:16:23] ryannielson: toretore: When I look in the database it's saved as Ryan\'s instead. Probably because when I submit from the external site I'm using .serialize() jQuery method on the form.
[15:16:35] Criten: ryannielson, it's a feature built into the AR
[15:16:54] ryannielson: criten toretore: So it's actually being escaped by jQuery itself.
[15:16:54] toretore: ryannielson: you need to determine where exactly is gets changed
[15:16:56] workmad3: ryannielson: how are you checking it in the database?
[15:17:28] Criten: ryannielson, but the data goes to your rails site to be put into the db
[15:17:36] Criten: and active record escapes it
[15:17:46] Criten: you can't have ' in sql languages
[15:17:50] Criten: because it's used in the language
[15:17:55] Criten: so they escape it
[15:17:57] ryannielson: workmad3: Well I have a database back-end, and also and client side front end on this external site. Both are putting Ryan\'s in the text field after saving. On the database UI If I then change it to Ryan's and save again, it saved fine and the issue is corrected.
[15:18:13] toretore: ryannielson: you need to determine where exactly is gets changed
[15:18:17] Advocation: is it still common practice that nested routes shouldn't go more than 1 deep?
[15:18:33] toretore: if you have to ask, then yes
[15:19:20] sailias: ActiveResource is getting developer love again, anyone still avoiding it and using httparty or restclient or are we comfortable with using it again. thoughts?
[15:19:25] ryannielson: toretore: on submission, jQuery is URL encoding it to Ryan%5C's it seems, and the POST url containing that is being submitted to rails.
[15:21:33] toretore: ryannielson: well, then you have to make jquery not do that in the first place
[15:22:11] toretore: usually this sort of stuff is caused by double escaping
[15:24:12] ryannielson: toretore: That could be the case. The external site is a wordpress site. The front-end basically submits the form to the wordpress back-end, which then submits it to the rails site. So maybe the wordpress side is escaping as well. I'll have to look into that. Thanks
[15:24:47] AntelopeSalad: workmad3: what do you think about limiting a validation at the model level to not run based on if a specific method called it?
[15:31:12] peter_lee: I'm curious, what aspects of testing or test automation intrigue the most as developers?
[15:31:48] ljarvis: peter_lee: i think that would require a survey
[15:32:03] DaniG2k: guys anyone have any idea how to use famfamfam for flag icons with a bootstrap 3 navbar dropdown?
[15:32:07] peter_lee: Yah, Ruby seems to have many testing frameworks
[15:32:08] DaniG2k: they seem to get all messed up
[15:32:19] pipework: peter_lee: They're not hard to write.
[15:32:35] ljarvis: peter_lee: they're not 'aspects' of testing, they're products
[15:32:56] pipework: peter_lee: There's a lot of different testing libraries, yeah.
[15:33:10] pipework: peter_lee: My favorite aspect of testing is testing.
[15:33:42] DaniG2k: ACTION hates testing
[15:33:58] peter_lee: Aww, why do you hate testing?
[15:34:11] DaniG2k: it already takes long to make an app
[15:34:22] DaniG2k: let along make one in three languages with locales and all
[15:34:30] DaniG2k: testing is just the last thing i need :P
[15:34:37] universa1: DaniG2k: imho testing doesn't make it really take longer...
[15:34:47] universa1: have fun spending hours in the browser trying things...
[15:34:48] pipework: It does when you're not used to testing.
[15:35:02] DaniG2k: ACTION is not used to testing
[15:35:10] universa1: pipework: yeah, but you get faster quickly.
[15:35:27] pipework: universa1: Most people probably do, if they put sufficient effort into it.
[15:35:32] peter_lee: Do you feel testing your app upfront cuts down on costs in the long run?
[15:35:36] universa1: pipework: ;)
[15:35:45] DaniG2k: i dont see the point of testing when youre developing
[15:35:51] pipework: peter_lee: It helps me not break features moving forward, at least.
[15:35:55] DaniG2k: because you still have to make the app
[15:35:59] DaniG2k: test when the app is done
[15:36:00] universa1: peter_lee: no clue on the costs, but i always hate myself when i skipped tests and i've to fix something
[15:36:12] pipework: DaniG2k: You seem to be a fan of SDLC.
[15:36:17] DaniG2k: whats that
[15:36:18] peter_lee: Are you doing TDD?
[15:36:19] pipework: Always Be Testing
[15:36:20] universa1: peter_lee: and then click through the whole app manually just to see if i didn't break anything
[15:36:22] makerop: is testing faster than just working in a browser?
[15:36:26] pipework: DaniG2k: !g SDLC
[15:36:33] ljarvis: makerop: yes
[15:36:35] pipework: makerop: It's less repetitive to do.
[15:36:55] pipework: Testing in a browser requires repetition.
[15:36:58] peter_lee: Yes,I like TDD
[15:36:59] universa1: computer are good at doing stuff repeatedly, humans not so much ;)
[15:37:11] pipework: I'd rather have the computer repeat. I've got better things to do.
[15:37:16] peter_lee: I'm a tester, so hence why I'm asking :)
[15:37:21] rhizome: testing in the browser, otherwise known as "writing javascript"
[15:37:32] pipework: Or clicking.
[15:37:36] DaniG2k: i hate all these acronyms -_- i like to build stuff and test when its done so taht i dont have to keep rewriting my tests over and over as my app evolves
[15:37:36] pipework: Lots of clicking and typing.
[15:37:37] peter_lee: So test automation?
[15:37:42] peter_lee: That's what I specialize in
[15:37:48] pipework: DaniG2k: SDLC is an enterprise acronym.
[15:38:24] peter_lee: Testing upfront will help catch issues in your architecture down the road
[15:38:52] rhizome: peter_lee: pretty much. look at guard
[15:38:53] peter_lee: As a tester, it's so hard to incorporate tests after the code has been written
[15:39:18] pipework: Testing after the fact is guessing about what is. Testing before is saying what should be.
[15:39:19] universa1: writing tests also help me in writing better encapsulated/isolated code. they are for me like another person looking over my shoulder and thinking about my code
[15:39:36] DaniG2k: interesting
[15:39:41] universa1: which is the biggest benefit for me
[15:39:43] DaniG2k: i might try doing more tdd in the future
[15:39:44] existensil: eh. its not that hard. good way of documenting a system i'm not familiar with
[15:39:47] Joel: I just want to double check to make sure I haven't missed something. With the asset pipeline, there is no way to have a manifest file per method, is there? Just by controller, correct?
[15:39:50] workmad3: DaniG2k: if you needed to rewrite the tests then you also needed to redo your manual testing
[15:40:04] peter_lee: I'd like to present to my dev team the benefits of testing so I'm curious to find out what other devs think about testing
[15:40:13] digitalcake: does anyone have some good links for BDD with rspec only. I'm finding I do a lot of projects with no client help and cucumber is just too much over head.
[15:40:26] pipework: Joel: 'per method'? No. But you can have a layout per view or a stylesheet link tag and a javascript link tag per view.
[15:40:36] DaniG2k: guys right now i have a validator that looks a bit stupid to me for one of my models
[15:40:39] universa1: peter_lee: in the #ror world many will at least encourage some form of test first / test driven development
[15:40:39] DaniG2k: validates_numericality_of :proficiency, greater_than: 0, less_than: 5, only_integer: true
[15:40:43] pipework: They can refer to a different manifest for each view.
[15:40:45] DaniG2k: is there a way to just make this at the database level?
[15:40:54] Joel: pipework: yeah, of course, was just trying to keep it "consistent"
[15:40:55] peter_lee: Yes, that is super
[15:41:04] peter_lee: I came from the .NET world :(
[15:41:09] rhizome: DaniG2k: what do you mean, "at the database level"?
[15:41:14] peter_lee: Testing had been non-existant for a long time lol
[15:41:15] pipework: Rubyists are fanatical about testing historically. Not all of them though, it's just a cultural thing.
[15:41:27] pipework: DaniG2k: Database functions and triggers, sure.
[15:41:36] DaniG2k: rhizome: right now my schema for that field reads t.integer "proficiency", limit: 255
[15:41:46] workmad3: peter_lee: my last gig was entirely about getting a team developing an API up to speed on BDD stuff and helping write supporting code for them and their testers :)
[15:41:48] DaniG2k: im wondering if I can limit it there directly
[15:42:11] peter_lee: Cool workmad3, how did it go?
[15:42:21] rhizome: oh. that depends on what db you're using, and would be a better questino for #your_database
[15:42:22] pipework: He was mad at work.
[15:42:41] workmad3: peter_lee: pretty well, contract got renewed so I could continue with writing some more tools for them (it ended a month ago now)
[15:43:07] workmad3: peter_lee: it was at a nice little organisation called the BBC too :)
[15:43:16] peter_lee: haha even nicer!
[15:43:18] universa1: workmad3: ;)
[15:43:38] DaniG2k: workmad3: bbc uses rails?
[15:43:41] pskrz: workmad3: that sounds interesting, i wouldn't mind hearing more
[15:43:48] DaniG2k: workmad3: is it for the entire website?
[15:43:53] pipework: DaniG2k: Yup.
[15:43:56] workmad3: DaniG2k: no, they don't use rails for their site :(
[15:44:09] pipework: workmad3: Some portion of BBC does.
[15:44:27] makerop: what do you guy suse for testing?
[15:44:29] pipework: Err sinatra?
[15:44:33] workmad3: pipework: they have quite a lot of testing tools written in ruby
[15:44:34] pipework: makerop: drug.
[15:44:42] pipework: workmad3: They also use something rack-based.
[15:45:01] pipework: I know a dev who worked on rack stuff for the BBC.
[15:45:15] workmad3: pipework: some bits, maybe... but their deployment platform doesn't let them use ruby past 1.8 atm
[15:45:40] pipework: workmad3: I wouldn't know. I do know they at least use some rack stuff. I guess probably sinatra, but my dev friend was writing some middleware.
[15:45:49] workmad3: the tool I wrote for them was rails though (running on AWS)
[15:45:56] DaniG2k: is sinatra any good?
[15:46:19] rhizome: yes, it is "any good"
[15:46:36] pipework: DaniG2k: Fuck yes.
[15:47:11] pipework: It's better when you have a good grasp on ruby.
[15:47:33] DaniG2k: pipework: why's that?
[15:47:41] pipework: DaniG2k: Because it's not rails.
[15:47:42] workmad3: sinatra is good if you want something lightweight and have a good grasp on ruby and HTTP mechanics
[15:47:43] makerop: is cucumber a good place to start for testing?
[15:47:55] pipework: makerop: If you like the idea. I use rspec.
[15:48:09] workmad3: makerop: I wouldn't suggest starting with cucumber
[15:48:09] ljarvis: makerop: no
[15:48:16] pipework: Soon, I'll be switching to minitest, because it's nice being able to not have extra dependencies.
[15:48:17] ljarvis: my god cucumber is never a good start
[15:48:22] rhizome: makerop: no. only when necessary.
[15:48:22] workmad3: makerop: decent cucumber use is pretty hard
[15:48:30] bricker`LA: makerop: imo, cucumber is too convoluted and will just confuse you
[15:48:44] pipework: makerop: Do you have any testing experience yet?
[15:48:50] makerop: pipework, very basic
[15:48:58] pipework: makerop: What have you used? What have you liked?
[15:49:02] makerop: Ive been wanting to start learning/integrating it though
[15:49:08] pontiki: cucumber is for product owners and business analysts to write feature stories, and devqa to fill in to automate acceptance testing
[15:49:15] pontiki: OPINIONS R US
[15:49:19] pipework: It's for more than that, but it still sucks.
[15:49:22] toretore: makerop: use something simple to start with like minitest
[15:49:30] bricker`LA: pontiki: but nobody in the universe has every used it like that
[15:49:34] pontiki: you can use it for all sorts of stuff
[15:49:51] toretore: > product owners write tests
[15:50:04] digitalcake: does minitest support outside in testing?
[15:50:04] rhizome: yes, i would love to read an actual case study of nondev cucumber use
[15:50:04] AntelopeSalad: workmad3: this solution still doesn't work btw, now the counter cache is a negative number
[15:50:06] pipework: pontiki: I still have plans to use it for a live todo-list of features.
[15:50:19] workmad3: AntelopeSalad: that's probably because your counter cache got out of sync
[15:50:23] pontiki: pipework: that's kind of a cool use
[15:50:36] workmad3: AntelopeSalad: try resetting your database
[15:50:43] AntelopeSalad: workmad3: ok, that makes sense
[15:51:04] pipework: pontiki: Yeah, I want to be able to mount a rails engine or rack app at a particular mountpoint and have a nice page of features. Green for delivered 'working' features, red for broken, grey for new. etc.
[15:51:05] makerop: ill check out minitest thnaks
[15:51:05] workmad3: rhizome: have you read 'Specification by Example'?
[15:51:08] DaniG2k: workmad3: when did you start programming?
[15:51:18] pipework: makerop: You should answer my two questions.
[15:51:29] workmad3: DaniG2k: depends on when you start counting
[15:51:47] rhizome: workmad3: i'm guessing it might be what i'm looking for? :)
[15:51:56] pipework: pontiki: I was also thinking about occasionally popping up a little bubble asking users "Do you want this feature?" and other types of questions, which could help gauge what features matter.
[15:52:02] makerop: pipework, http://railscasts.com/episodes/275-how-i-test
[15:52:09] makerop: thats basically what Ive run through, and read the rubyguide on testing
[15:52:13] makerop: nothing too extensive
[15:52:19] levberlin: Hi Guys, if anyone wants more personalized Rails help, I'm doing free videochat/screenshare sessions. Just visit https://onscreenexpert.com and search "lev" or "rails". It's free, but feedback on the site is welcome :)
[15:52:19] pontiki: i'm not really so down on cucumber. i like using aruba for testing cli scripts
[15:52:32] pipework: makerop: Ah I see. Neat. So, if I were you and I had everything to do over again, I'd honestly learn minitest first.
[15:52:39] pontiki: and i like using cuke+capy for driving external web testing
[15:52:41] pipework: makerop: Rspec is neat. It's a BDD-friendly test framework.
[15:52:43] workmad3: rhizome: somewhat ;) it's summaries of a fair few case studies run by the author around various 'living documentation' systems built around either cucumber-style scenarios or wiki-style fitnesse systems
[15:52:54] pipework: But minitest comes with ruby and it's got neat stuff like minitest::spec
[15:53:12] DaniG2k: omg the images on that site suck
[15:53:50] workmad3: DaniG2k: if you count when I first started playing with code... around 23ish years ago when I first started playing with BASIC? (I was 5 :) )
[15:54:05] pipework: He's still five in the ways that matter. :(
[15:54:09] DaniG2k: workmad3: right
[15:54:09] pontiki: i'm wondering how using onscreedexpert avoids the internet
[15:54:10] jcromartie: so, this Rails app is served up under a subdirectory
[15:54:12] peter_lee: I like the idea of Cucumber, the business people writing the stories and accpetance criteria which is supposed to integrate nicely into test suites. In my experience, it hasn't quite worked that way.
[15:54:20] pontiki: since it's for when the internet doesn't help....
[15:54:22] DaniG2k: workmad3: i have this theory that people who are awesome at stuff started really young
[15:54:28] jcromartie: peter_lee: I've NEVER seen a "business person" read or write Cucumber
[15:54:36] pontiki: peter_lee: i'm sorry, i was being a bit snarky
[15:54:36] rhizome: workmad3: it would seem like a company that was able to implement a cuke-down implementation over a long period would be somewhat famous for it
[15:54:42] makerop: DanielRb, thats a bad theory imo
[15:54:42] jcromartie: it's a total waste of time
[15:54:46] jcromartie: (in my experience)
[15:54:49] pipework: jcromartie: You have to hold them down and beat them.
[15:54:57] makerop: DaniG2k, rather...thats a bad theory
[15:55:03] DaniG2k: makerop: ok
[15:55:06] workmad3: peter_lee: the way things tend to work best seems to be if a BA, a dev and a tester collaborate on the scenarios
[15:55:16] peter_lee: Yes, I agree
[15:55:22] pipework: DaniG2k: People who are awesome at stuff may have started young, sure.
[15:55:36] makerop: you just have to do something every day to become awesome at ti
[15:55:43] makerop: it's not much more complicated than that
[15:55:48] jcromartie: so, Rails app under subdirectory, like /my-app/..., the problem is relative URLs in precompiled assets
[15:55:52] pontiki: the thing about people who are awesome is that many of them did not start out that way, but persisted at practice
[15:55:56] jcromartie: in the JS there are paths like "/projects/foo"
[15:55:56] JoshBrown: Hey guys, what's the best way to learn Rails?
[15:56:08] workmad3: peter_lee: that way you get devs keeping things sane on a technical level, saying what can and can't be realisticly done, testers who are good at spotting how to actually verify things work, and the BA making sure the language of your scenarios is in the business domain :)
[15:56:16] pontiki: gosh if that question doesn't get asked about a million times a day
[15:56:25] pontiki: JoshBrown: it depends.
[15:56:40] jcromartie: I was thinking I could put some code in the app layout that sets a JS global variable with a URL prefix, and then the JS assets could use that variable to build URLs.
[15:56:54] workmad3: makerop: doing something every day doesn't really help you become awesome at it
[15:57:15] DaniG2k: workmad3: exactly
[15:57:15] workmad3: makerop: if that was the case, then there would be a lot more great coders
[15:57:17] peter_lee: That sounds like the perfect environment, sign me up :)
[15:57:18] pontiki: https://www.google.com/#q=what+is+the+best+way+to+learn+rails
[15:57:40] AntelopeSalad: workmad3: is there a way to do this without resetting the entire db?
[15:57:41] workmad3: peter_lee: it's a fair bit of overhead and time commitment though :)
[15:57:51] AntelopeSalad: i can't update the column in the console manually for some reason
[15:57:52] makerop: workmad3, ok, sorry, should have said, conscientiously trying to get better at something every day
[15:57:58] peter_lee: I worked in a Microsoft envirnoment my last project and it was totally opposite lol
[15:58:02] workmad3: makerop: yeah :)
[15:58:17] peter_lee: QA was seen as the evil empire
[15:58:22] DaniG2k: i dont think i wanna work with computers anymore -_-
[15:58:29] DaniG2k: i like coding but more as a hobby
[15:58:37] pipework: DaniG2k: sounds like a plan.
[15:58:44] peter_lee: They were "trying" to implement TDD but didn't work
[15:58:46] DaniG2k: doing it 8 hours a day is a killer
[15:58:56] peter_lee: Totally different from ruby workplace
[15:59:09] pipework: I'm that poor sod who works 6 hours at his day job and then goes home and works the rest of the day. All coding, or at least on the computer.
[15:59:24] workmad3: pipework: pfft, lightweight :P
[16:00:08] workmad3: pipework: 6 hours a day on your day job? bah :P
[16:00:13] peter_lee: So it seems, developers want to know how these testing tools can help them?
[16:00:15] pipework: Nothing lightweight about getting your work done in 2-4 hours and hanging out for a couple just for posterity.
[16:00:57] pipework: ACTION isn't at a startup, doesn't have to work to 12am on day job work just to hope to keep his job
[16:01:03] DaniG2k: k im out l33t coD3rz
[16:01:08] pipework: DaniG2k: dun die
[16:01:09] DaniG2k: :) take care!
[16:01:15] DaniG2k: pipework: thanks you too
[16:01:23] pipework: I'll do my best for you!
[16:01:28] olivier_bK: do you know how to mount a mount point in docker ?
[16:01:36] pipework: olivier_bK: Probably the wrong place for that.
[16:01:57] pipework: The mountpoint is the destination, btw.
[16:02:07] pipework: You mount something onto a mountpoint.
[16:02:25] pontiki: sorta like a saddle on a horse :>
[16:13:03] gabeodess: is it possible to cancel a #save in the after_create callback?
[16:13:16] gabeodess: I've tried returning false in my method, but doesn't seem to do anything
[16:13:21] gabeodess: using rails 3.2.11
[16:14:00] rhizome: to rollback the save?
[16:14:07] gabeodess: rhizome: yes
[16:14:20] rhizome: after_save is after save.
[16:16:29] tbuehlmann: rhizome, raising an exception should do the trick
[16:16:39] rhizome: ot: what's the term for two sets that do not intersect?
[16:17:38] tbuehlmann: rhizome, relatively prime
[16:17:39] dbcclarke: hey guys, what is the difference is a file with the extension .html.haml and .html.erb ?
[16:17:39] rhizome: tbuehlmann: i don't know for sure, but i would think it would just cancel the callback stuff. i'd imagine in the name of encapsulation that AR hands off to it after persisting.
[16:17:52] tbuehlmann: naw, that's after_commit
[16:17:53] dbcclarke: difference IN*
[16:18:06] rhizome: dbcclarke: template processor
[16:18:11] tbuehlmann: raising in after_save will rollback the transaction
[16:18:19] rhizome: hum. interesting.
[16:18:34] tbuehlmann: at least that's in rails 4, no idea about 3
[16:18:37] dbcclarke: rhizome: im writing my view file...so I can use either one?
[16:21:20] jstrong: I think the real question is
[16:21:28] jstrong: why the heck do you want to cancel a save in an after_save hook
[16:21:41] rhizome: tbuehlmann: looks like an exception (AR::Rollback is mentioned) is the only thing that will undo the save
[16:21:53] pipework: Cancelling callbacks, lul.
[16:21:58] jstrong: hey there you are
[16:22:02] jstrong: i was waiting for you to jump in on that
[16:22:22] dllama: hi guys, quick question. if my app requires a local ssl cert, can i place that somewhere inside the app and load the path into an ENV variable?
[16:22:22] rhizome: watch the learning happen!
[16:22:25] pipework: You'll have a better time if you just think of callbacks as fire and forget.
[16:22:42] rhizome: i like to have a good time
[16:22:54] pipework: Otherwise you'll be in a pseudo-mutex hell of indirect message passing.
[16:23:07] jstrong: tbuehlmann: so you could do a rollback but I almost feel bad saying that because you should restructure your code to not require an after save cancel
[16:23:12] pipework: I'd use a service here for sure.
[16:23:15] jstrong: tbeuhlmann: why do you need to cancel an after save callback?
[16:23:29] tbuehlmann: jstrong, thank you, but it's not me needing help here
[16:23:49] rhizome: this seems to be a decent illustration: http://tech.taskrabbit.com/blog/2013/05/23/rollback-after-save/
[16:23:50] jstrong: pipework: I know, let's call it AfterSaveCallbackCanceller!
[16:24:02] rhizome: which, effectively, looks like reinventing validations
[16:24:14] jstrong: tbuehlmann: fair enough
[16:24:15] rhizome: reimplementing, at least
[16:24:23] pipework: Where I come from, this is called a 'bad idea'.
[16:24:32] rhizome: indeed /omar
[16:24:34] pipework: But I'm from the west coast of the U.S., we're weird.
[16:24:47] rhizome: you have thc in your blood
[16:25:02] pipework: I was born with a hemp rope for an umbilical cord.
[16:25:20] rhizome: uhm...bilical
[16:27:19] jstrong: I'm trying to think of a scenario in which rolling back an after save is required
[16:27:37] jstrong: it's not coming to mind
[16:27:59] tbuehlmann: I had one, just recently
[16:28:40] jstrong: heh mind sharing? I'm genuinely interested
[16:28:57] tbuehlmann: not sure what exactly, but something like: I need the id of the record to create associated records. but if they are not valid (or something else), rollback that whole thingy
[16:30:05] rhizome: seems like that could be wrapped up in the save itself
[16:30:07] jstrong: yeah that would only happen if you are building associated records parallel to your main record
[16:30:11] pipework: yaymukund: It sounds like a problem of not doing enough work up front.
[16:30:16] pipework: tbuehlmann: ^
[16:30:28] jstrong: which isn't a good model.
[16:30:38] pipework: Egh, it's just extra work for no reason if it doesn't work.
[16:30:51] pipework: "Throw it in the DB! If it ain't work, we'll just roll it back."
[16:30:52] jstrong: that can entirely be avoided by populating the associations in the record you're saving. when you save the main model it'll cascade down the associations and save those two.
[16:30:52] thebobmarley: jstrong: More love, less hate: http://www.youtube.com/watch?v=CHekNnySAfM
[16:31:36] yaymukund: how can I use mongoid to perfomr an atomic pull and push at the same time?
[16:31:40] makerop: real basic question, i just scaffolded, adn am running a test
[16:31:41] makerop: https://gist.github.com/anonymous/6731291
[16:32:02] makerop: why wouldn param not found show up, when I dont have any validation on the model?
[16:32:09] jstrong: tbuehlmann: p = Post.new, p.notes.build(invalid data). p.save
[16:32:27] jstrong: tbuelhmann: rails will save both the built note and the post object in one transaction and rollback if there's any validation errors
[16:32:43] makerop: params.require
[16:32:53] dopie: Anyone use inline editing with CKEditor?
[16:39:52] tbuehlmann: just found it. I had to clone some other records after_create. and if there's going something wrong, I'm screwed. so I decided to just raise right there. but you are right, one could have built the associations beforehand
[16:43:20] dopie: any CKEditor users here?
[16:43:52] rhizome: you're looking for #ruby-lang
[16:44:19] rhizome: spelling doesn't count on irc, but it does when joining channels
[16:44:26] webchat-hacker: ruby on ailz is terrible
[16:44:41] rhizome: you're just showing off for your friends
[16:44:54] gerep: webchat-hacker, why is it terrible?
[16:45:12] gerep: webchat-hacker, so what you suggest?
[16:45:27] gerep: webchat-hacker, pYthon
[16:45:42] gerep: webchat-hacker, so what are you doing here?
[16:46:05] gerep: webchat-hacker, no, still wrong, it's Python, with Y and no G at the end :)
[16:46:07] rhizome: midterms went badly for this one, i guess
[16:46:08] pipework: webchat-hacker: Python has weak lambdas, I can't take it seriously. It's good for teaching people who are new to programming.
[16:46:11] webchat-hacker: RUBYONRAILS IS CRAO
[16:46:21] yaymukund: is there a way to call mongodb update method (or Moped::Query's update) on a record directly without having to got through the session[:users] dance?
[16:46:36] pipework: webchat-hacker: They typically get all excited about python and think it's the best thing ever, which is awesome, but often misdirected.
[16:46:46] gerep: webchat-hacker, so type this /part and then /join #python, will be a lot happier :)
[16:47:10] pipework: webchat-hacker: Ruby is better than python.
[16:47:17] gerep: webchat-hacker, Ruby is a language, not a person, so it makes no sense cursing it :)
[16:47:24] pipework: webchat-hacker: Get better lambdas.
[16:47:48] Scient: yeah ruby is bad, thats why i dont use it
[16:47:51] rhizome: the first time i got kicked from a channel i did the same thing in compuserve cb
[16:47:51] Scient: i only use rails
[16:48:07] pipework: Ruby is for adult programmers. It's reasonable that you don't like it, being a python user, I'd say you're still in your infantile stage.
[16:48:08] gerep: Scient, hehe
[16:48:33] pipework: Rails is dead, long live ruby.
[16:48:41] dllama: can anyone please take a look @ https://gist.github.com/mvoloz/0655bf0409c677387d5d ??? i'm trying to get post results, but instead am seeing a 302 response. and i dont know how to get Net::HTTP to follow the 302 redirect.
[16:48:54] webchat-hacker: SYCK MY COCK RAILZ FAGS
[16:49:36] pipework: If webchat-hacker is representative of the python community, this explains why their code is so terse and illegible.
[16:49:39] workmad3: ACTION hangs a 'please do not feed the troll' sign around webchat-hacker's neck
[16:49:44] gerep: webchat-hacker, hahaha, that's your best opinion about ruby or rails?
[16:49:50] rhizome: dllama: lern2google http://stackoverflow.com/questions/6934185/ruby-net-http-following-redirects
[16:49:55] yaymukund: dllama: there seem to be a lot of ways to make Net::HTTP follow a redirect if you google around. have you tried this: http://stackoverflow.com/questions/10453892/how-can-i-get-system-net-http-httpclient-to-not-follow-302-redirects
[16:49:56] gerep: webchat-hacker, cursing it's users? makes no sense at all
[16:50:18] gerep: webchat-hacker, instead of messing around with people, show them the better side of what you're trying to prove ;)
[16:50:35] workmad3: gerep: lol, you're trying to reason with a troll
[16:50:40] dllama: thanks guys, but my response code isn't showing me any info at all, just says 302
[16:50:41] pipework: He's a troll, he's not trying to convince anyone, he's just getting attention.
[16:50:42] gerep: workmad3, its funny :)
[16:51:08] gerep: pinage404, a that's what makes it fun :) let's see how long he can take it
[16:51:14] gerep: pinage404, sorry, wrong message
[16:51:15] Tarential: gerep: That is like the definition of "feeding the troll".
[16:51:21] gerep: pipework, a that's what makes it fun :) let's see how long he can take it
[16:51:31] workmad3: pipework: btw, my problem with python is that the code isn't terse enough (and yet is still illegible)
[16:51:42] pipework: webchat-hacker: It's true.
[16:51:46] gerep: workmad3, that's true
[16:51:56] gerep: Tarential, you're right, I'll stop it :)
[16:52:01] pipework: webchat-hacker: import this right up your ass.
[16:52:10] yaymukund: I feel like I've been transported to an aol chatroom haha
[16:52:23] pipework: Courtesy of our troll of the moment.
[16:52:23] workmad3: yaymukund: did AOL chatrooms have /ignore? :)
[16:52:53] pipework: No, they had whiny 14 year old girls posing as 18 year old girls who were really 34 year old men. This was before NSA and Chris Hansen.
[16:53:05] billiam: Not-quite-a-rails-question: I'm trying to step debug rails (running via webrick), and running into a Timeout::Error: 'execution expired
[16:53:17] dllama: nm that, thank you for the 2 links!
[16:53:20] billiam: Anybody happen to know where that timeout might be defined/configured?
[16:54:28] rhizome: billiam: what are you using to step?
[16:54:30] webchat-hacker: RUBY ON RAILZ IS BAD
[16:54:34] dbcclarke: Why do i get this error: Missing template books/index, application/index with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}. Searched in: * "/Users/DC/Documents/projects/myapp/app/views" ? I have an index.html.haml file in the views
[16:54:50] billiam: rhizome: rdebug-ide + rubymine/remote debugging.
[16:54:54] workmad3: pipework: what really upsets me is that trolls just don't try anymore
[16:54:59] workmad3: pipework: well, apart from you
[16:55:08] pipework: workmad3: I try too hard.
[16:55:18] rhizome: the Q8 posse seems to have fallen out
[16:55:32] dopie: can anyone help me with ajax calls
[16:55:34] pipework: dbcclarke: Do you have a books directory in app/views/ ?
[16:55:37] Tarential: I never troll people. I make sarcastic comments coupled with inside jokes that only I get.
[16:55:38] pipework: dopie: Only the good lord.
[16:55:43] dbcclarke: pipework: ya
[16:55:44] billiam: Oh, the project appears to be using the rack-timeout gem, for some reason, forget I said anything.
[16:55:46] rhizome: dbcclarke: guessing you don't have haml installed
[16:56:01] pipework: dbcclarke: Does it have an index file with .html.erb in that directory?
[16:56:13] AntelopeSalad: rails is smart enough not to update records where the value doesn't change right?
[16:56:20] dbcclarke: rhizome: oh ok do i do do "gem install haml"?
[16:56:23] workmad3: AntelopeSalad: yes
[16:56:24] Tarential: AntelopeSalad: yes.
[16:56:27] dbcclarke: pipework: no i have "index.html.haml"
[16:56:30] webchat-hacker: RAILSIS PIECE OF SHITE
[16:56:32] pipework: webchat-hacker: Are all pythonists a waste of money, time, and effort, or just you?
[16:56:33] Tarential: AntelopeSalad: But not hstore.
[16:56:38] pipework: dbcclarke: You don't have haml-rails installed.
[16:56:44] rhizome: dbcclarke: look into using Gemfile
[16:56:58] pipework: dbcclarke: In your gemfile, add 'haml-rails' to the assets group
[16:56:58] Tarential: AntelopeSalad: It seems to update hstore columns every time.
[16:57:13] dopie: https://gist.github.com/staycreativedesign/6731639
[16:57:17] AntelopeSalad: Tarential: ok, i'll keep that in mind if i ever use hstore
[16:57:30] webchat-hacker: HAM RAIL!! NIGGERS
[16:57:32] AntelopeSalad: this was just updating records only if a certain column changed
[16:57:34] workmad3: Tarential: the ActiveModel::Dirty module doesn't seem to work particularly well with postgres's hstore, json and array type attributes atm
[16:57:37] webchat-hacker: DEAD BODY ON RAILS
[16:57:48] dbcclarke: pipework: is there a certain version?
[16:57:59] pipework: dbcclarke: The latest it installs.
[16:58:07] pipework: webchat-hacker: Now you're just turning me on.
[16:58:11] dbcclarke: pipework: ok nice
[16:58:23] webchat-hacker: FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK
[16:58:24] thebobmarley: webchat-hacker: Mad? You just got to listen to me! http://www.youtube.com/watch?v=6yXRGdZdonM
[16:58:28] webchat-hacker: FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK
[16:58:29] thebobmarley: webchat-hacker: I know the feeling.
[16:58:33] webchat-hacker: FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK
[16:58:33] workmad3: pipework: you don't need haml-rails anymore
[16:58:34] thebobmarley: webchat-hacker: Mad or frustrated? I can help: http://www.youtube.com/watch?v=gODh1nsHlPg
[16:58:36] pipework: I really hope thebobmarley is a bot.
[16:58:37] webchat-hacker: FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK
[16:58:38] thebobmarley: webchat-hacker: Whoa! Sounds like you could use some Bob Marley: http://www.youtube.com/watch?v=gODh1nsHlPg
[16:58:40] pipework: workmad3: Realy now?
[16:58:40] webchat-hacker: FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK
[16:58:41] thebobmarley: webchat-hacker: More love, less hate: http://www.youtube.com/watch?v=CHekNnySAfM
[16:58:43] webchat-hacker: FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK
[16:58:44] thebobmarley: webchat-hacker: Let me help you: http://www.youtube.com/watch?v=-JhwxTen6yA
[16:58:47] webchat-hacker: FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK
[16:58:48] thebobmarley: webchat-hacker: I know the feeling.
[16:58:50] webchat-hacker: FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK
[16:58:51] thebobmarley: webchat-hacker: Don't worry, be happy! http://www.youtube.com/watch?v=Oo4OnQpwjkc
[16:58:51] niko: webchat-hacker: please stop
[16:58:53] webchat-hacker: FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK
[16:58:55] thebobmarley: webchat-hacker: More love, less hate: http://www.youtube.com/watch?v=CHekNnySAfM
[16:59:11] workmad3: pipework: you haven't for a while... in fact, the haml-rails gem is now just a set of generators, not the stuff to bind haml in as a template renderer :)
[16:59:22] Tarential: that is an interesting script, thebobmarley
[16:59:31] pipework: workmad3: neat. I don't haml, 'tis the devils work.
[16:59:47] enricostn: What's the best way to create a directory in Rails path ( e.g. tmp/blabla ) from an initializer generator?
[17:00:53] workmad3: enricostn: look up the thor actions docs
[17:01:14] evansparkman: you're silly pipework
[17:01:29] evansparkman: you can't see past the ginger mist in your eyes
[17:01:36] workmad3: enricostn: e.g. something like this :) http://rdoc.info/github/wycats/thor/master/Thor/Actions#empty_directory-instance_method
[17:01:54] pipework: If the good lord had wanted us not to write html, he'd not have let our editors get so good at it.
[17:02:46] Tarential: ah, god wanted us to -- the best argument for erb I've ever heard! :P
[17:03:19] enricostn: workmad3, thanks! for example I could put it here https://github.com/enricostano/siringa/blob/master/lib/generators/siringa/install_generator.rb
[17:03:32] yaymukund: in mongoid, is there any easier way to perform an atomic push and pull simultaneously on a record: https://gist.github.com/yaymukund/dd7b5554d52e9001e0e5
[17:03:52] enricostn: but in a new method or directly in the class?
[17:04:07] workmad3: enricostn: in a method
[17:05:10] enricostn: workmad3, but will it be executed when I run rails g gemname:install ?
[17:05:25] AntelopeSalad: is first_or_create the new/modern way to do find_or_create?
[17:05:58] helpa: enricostn: Why don't you try it and find out for yourself?
[17:05:58] workmad3: enricostn: !try
[17:05:59] foucist: does it make sense to have two differing git repositories for the same site, when one is for developing on linode w/ nginx/unicorn, and the other is for production on rackspace? these are already existing, and it's annoying me, not sure how i'm supposed to deal with two different gt repositories with changes for each server.. and still end up with the same code for the actual site
[17:06:19] workmad3: foucist: seems a bit odd to me
[17:06:28] pipework: Tarential: I just know that I'd rather be fluent in html than some other language that compiles to HTML. At least, until one or two actually rise to the top and are victorious.
[17:06:40] foucist: workmad3: it's bizarre :/
[17:07:00] rhizome: foucist: seems like environments would be the key, plus deployment targets
[17:07:01] jcromartie: seriously, it kind of sucks that I can't use URLs in precompiled assets when I deploy to a subdirectory??? :(
[17:07:10] pipework: Typing it isn't hard, and I can make use of all HTML's shitty tricks without pause or issue because my templating language's parser doesn't like it.
[17:07:15] workmad3: jcromartie: sure you can
[17:07:25] jcromartie: workmad3: how?
[17:07:26] workmad3: jcromartie: you just need to use the asset-pipeline url helpers
[17:07:34] jcromartie: they don't know about the subdirectory
[17:07:39] AntelopeSalad: i don't think i've written a closing html tag by hand in many many months
[17:07:43] workmad3: jcromartie: they do if you're using them right
[17:07:48] workmad3: jcromartie: how are you trying to use them?
[17:07:49] jcromartie: because it's passed to Rack via Passenger
[17:07:49] Tarential: pipework: Power to you. I've been typing html for most of my life, so I was pretty happy to find out there was a more succinct replacement.
[17:07:50] thebobmarley: jcromartie: Let me help you: http://www.youtube.com/watch?v=-JhwxTen6yA
[17:08:11] workmad3: jcromartie: ah, that sort of subpath... that's a bit more difficult
[17:08:32] jcromartie: workmad3, yeah not just like adding a scope in routes.rb
[17:09:03] foucist: rhizome: well for example one of the repositories has unicorn crap in it, but production is apache/passenger..
[17:09:38] jcromartie: relative_url_root seems to be deprecated
[17:17:57] rhizome: foucist: environments, environment-sensitive initializers, asset groups, etc.
[17:18:27] jcromartie: OK so if I set RAILS_RELATIVE_URL_ROOT for assets:precompile, then the paths are generated correctly by the asset pipeline helpers
[17:18:27] thebobmarley: jcromartie: Mad or frustrated? I can help: http://www.youtube.com/watch?v=gODh1nsHlPg
[17:18:39] tubbo: Tarential: i'm with you, man. i don't think i'll be forgetting how to type angle brackets and end tags any time soon. i'm still writing the tags, just without the fluff
[17:18:45] rhizome: thebobmarley: please stop
[17:18:56] dllama: is there anyway to make a net:http request look like its a javascript enabled browser? ( tried googling not finding any results and could possibly be searching for the wrong thing)
[17:19:00] tubbo: Tarential: but it does require a bit of comfort with your browser's dev tools package...so you can go in and actually look at the markup after it's been generated.
[17:19:15] tubbo: dllama: why do you want to do that?
[17:19:30] jstrong: i can see thebobmarley is broken
[17:19:33] rhizome: i've gone from using content_tag for everything to writing tags again
[17:19:40] dllama: because i need to parse info from a site that requires a javascript enabledf browser
[17:19:41] Tarential: tubbo: I do my css work right in the browser most of the time nowadays :P I love the dev tools
[17:19:49] tubbo: rhizome: is thebobmarley a bot that just searches for SCREAMING CASE? :D
[17:20:02] EminenceHC: thebobmarley: Your artificial intelligence is awful mahn!
[17:20:09] jstrong: it searches for over two swear words and sends a bob marley link
[17:20:26] jstrong: apparently it doesn't like jcromartie's face or something, dunno.
[17:20:35] pskrz: asset asset
[17:20:48] jstrong: you are so intelligent bob marley
[17:22:01] tubbo: that's hilarious
[17:22:34] EminenceHC: Is pipeline a swear word?
[17:22:36] tubbo: rhizome: wow, content_tag for everything? that's nuts!
[17:22:38] EminenceHC: pipeline pipeline
[17:22:42] tubbo: EminenceHC: he's not here
[17:22:45] tubbo: but also no
[17:22:57] tubbo: unless you're talking about the name of a gay S&M club
[17:23:35] jstrong: i'll fix bob marley
[17:23:40] tubbo: jstrong: haha is he your bot?
[17:23:57] jstrong: i was messing around with radar's helpa code and was like "hey this sounds like fun"
[17:24:13] jstrong: but it didn't really quite work because apparently everyone on rubyonrails is actually very nice and never says bad things!
[17:24:18] jstrong: never say*
[17:24:34] RustyShackleford: so I'm using fullcalendar (jquery plugin). For some reason the calendar doesn't show when I first load the page
[17:24:41] RustyShackleford: but if I refresh it loads fine
[17:25:29] pskrz: rustyshackleford: possible race condition in your js?
[17:26:15] EminenceHC: jstrong: he always thinks people are mad when the are not :P FUCKING IDIOT SON OF A BITCH
[17:26:26] EminenceHC: jstrong: and then I say something like that and... nothing
[17:26:32] jstrong: he left the room
[17:26:38] jstrong: since people didn't appreciate his music
[17:26:38] EminenceHC: jstrong: ahhh smoke break
[17:27:10] EminenceHC: jstrong: it requires a certain level of sophistication
[17:28:51] jstrong: asset asset
[17:33:48] cpruitt: Trying to use FactoryGirl for the first time. I'm getting a weird error. factory :inspyre_user do works fine, but factory :invalid_inspyre_user, :class => InspyreUser do generates a uninitialized constant InspyreUser (NameError). It's the same model class in both cases. Is there something I'm missing?
[17:36:00] malusalexandru: hi. any idea if form_tag supports a datepicker on a text_field? tried unsuccsessfully
[17:36:14] malusalexandru: i am using ruby on rails 3.2
[17:36:22] helpa: cpruitt: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[17:36:22] tubbo: cpruitt: !gist
[17:36:48] tubbo: malusalexandru: datepicker is a JS thing. you can make a text_field support a datePicker but you have to configure that yourself.
[17:37:01] tubbo: text_field just generates an <input type="text">, nothing special.
[17:37:21] malusalexandru: yup, tried using jquery-ui-rails gem
[17:37:39] malusalexandru: https://gist.github.com/maimutza/6683983
[17:37:57] cpruitt: tubbo: Not much more to it. First factory works fine. Second gets a no name error. https://gist.github.com/cpruitt/a64d71132bc0ff93105e
[17:38:25] nettoweb: can someone help me with this problem http://stackoverflow.com/questions/19041456/rails-2-and-permalinkfu-iconv-cropping-special-chars-only-on-production-server ?
[17:38:49] scyllinice: I'll be surprised if anyone helps with Rails 2 anymore
[17:38:58] tubbo: malusalexandru: looks good to me...as long as the JS is called after the <input> is rendered (which will happen in a DOM-ready). check your browser console for errors.
[17:39:08] tubbo: scyllinice: i work on rails 2 every day wut wut
[17:39:23] scyllinice: tubbo: One of the last few that do
[17:39:30] tubbo: i hope that will be over soon
[17:39:39] tubbo: we're sort-of forming a rebellion here
[17:40:12] tubbo: but unfortunately we have to make a case for why the rails 2 app should be abandoned in favor of a full rewrite
[17:40:55] rhizome: tubbo: hope you've read this: http://www.joelonsoftware.com/articles/fog0000000069.html
[17:41:11] tubbo: rhizome: yup. and joel doesn't know what the fuck he's talking about ;)
[17:41:27] Joel: Sometimes I hate having my name in this industry :)
[17:41:44] tubbo: Joel: maybe you should stop writing esoteric blog posts then
[17:41:56] tubbo: get off my software joel!!!
[17:42:06] RustyShackleford: does rails feel like legos to you?
[17:42:13] RustyShackleford: I'm just sticking pieces together
[17:42:17] tubbo: rhizome: by "rewrite"...i'm not sure exactly how it's going to be.
[17:42:18] dbcclarke: How do I convert this to .html.haml? -> http://pastie.org/private/b2oab8lunpfaozvemijnjw
[17:42:26] RustyShackleford: i don't need to innovate anything
[17:42:34] scyllinice: nettoweb: Honestly it seems like something with the server software itself
[17:42:37] tubbo: rhizome: my gut reaction tells me to upgrade the rails 2 app but it may not be possible.
[17:42:58] pskrz: dbcclarke: https://github.com/haml/html2haml
[17:43:11] tubbo: rhizome: the idea here is that the rails app powers the actual product, which for the most part has not changed. but the way our business works means that we're looking at changes in 5-10 year increments, not 1-2 year increments, which is how the web works.
[17:43:12] scyllinice: nettoweb: My guess is that the staging server is not the same software as the production server. Versions differ somewhere
[17:43:21] tubbo: we're making hardware, with the rails app acting as a kind-of firmware to the appliance.
[17:44:00] tubbo: rhizome: but at this point, we're reaching the break-even point where the money lost by developing this aging product is not outweighing the money gained by continuing to maintain and market the old appliance.
[17:44:10] scyllinice: tubbo: Are new features added regularly?
[17:44:16] dbcclarke: pskrz: do I put that in the assets group?
[17:44:20] tubbo: scyllinice: yeah, but we wait a long time between releases.
[17:44:37] tubbo: scyllinice: and it's not so much "features" as compatibility upgrades and such.
[17:44:49] rhizome: keeping pace with hw revisions?
[17:45:08] scyllinice: tubbo: You could always make the case that getting further behind means you can't leverage existing code that others have written. You have to do everything yourselves, which costs money
[17:45:16] pskrz: dbcclarke: gem install html2haml , use it as a command line tool
[17:45:20] tubbo: like, the user won't see any diffs but if some company buys like 50 of our appliances at a few grand each and they want H.264 encoding, we put in H.264 encoding.
[17:45:53] tubbo: scyllinice: all of it costs money...especially since it has no tests, dev time on each individual feature/fix is enormous compared to normal rails apps.
[17:46:03] tubbo: just because you have to manually regress to figure out if you broke anything
[17:46:04] rhizome: well there's your problem!
[17:46:13] tubbo: if that's not outweighing how much we're MAKING from the product
[17:46:15] tubbo: it means nothing
[17:46:32] tubbo: the only thing it means is i get paid an absurd amount of money to do something a kid could be doing
[17:46:37] rhizome: could be product-level design flaws
[17:46:43] tubbo: oh there's tons of them
[17:47:06] tubbo: but the issue is, it's not up to me or anyone else on dev.
[17:47:19] tubbo: we're not in the field, we don't know what our customers want. all we know is how to build things properly.
[17:47:27] rhizome: naturally. it does sound like a rearch should drive the rewrite
[17:47:33] tubbo: oh yeah, absolutely.
[17:47:44] tubbo: but the rewrite needs to happen. in 2 years this product won't be valuable to anyone.
[17:48:41] rhizome: what's the field?
[17:50:01] tubbo: rhizome: like, other companies. we have a guy who's kind-of like a hybrid between a salesman and a developer. he knows enough about programming to read logs and understand shit, as well as debug and solve problems in other locations.
[17:50:14] rhizome: sales engineer
[17:50:15] tubbo: rhizome: but he also knows enough jargon to go to these companies and have them buy our shit
[17:50:27] tubbo: pretty much. i think we call him a field engineer
[17:50:49] tubbo: rhizome: it's basically the solution for the problem of how to debug client boxes when you don't have SSH access?
[17:51:16] jcromartie: does anybody have an elegant solution to paths for AJAX requests in JavaScript assets when the app will be deployed to a subdirectory?
[17:51:18] tubbo: might not even be connected to the internet
[17:51:38] rhizome: huh, curious.
[17:52:01] tubbo: haha yeah right? it's a real weird problem to work on!
[17:52:22] tubbo: rhizome: we have this one client where we pre-program the box to run for 3 years straight
[17:52:35] tubbo: because many of the installations are in areas where they can't connect the box to the local network at all.
[17:53:04] tubbo: and a lot of the companies don't have the resources to set up Wi-Fi or a local network in the first place
[17:53:08] rhizome: so like a console?
[17:53:23] tubbo: rhizome: pretty much. it's a set-top box for televisions.
[17:53:36] tubbo: it's designed to run a TV station
[17:54:09] momomomomo: What TV station doesn't have internet? At least in radio, everything was moving into automation via internet or satellite delay
[17:54:16] momomomomo: with a heavy reliance on internet for stop-gaps
[17:55:30] s2013: if i want to let an admin create a devise user, how would i do that?
[17:55:43] s2013: can i do it like regular user create method?
[17:57:51] momomomomo: s2013: Do you have an Admin model and a User model
[17:57:55] momomomomo: or just one User model
[18:00:08] smathy: RustyShackleford, you using Rails4 and/or turbolinks?
[18:00:23] smathy: Oh damn, sorry - I was scrolled back.
[18:00:29] RustyShackleford: what is turbolinks?
[18:00:52] RustyShackleford: i thought perhaps thats whats messing things up
[18:01:00] smathy: RustyShackleford, ttps://github.com/rails/turbolinks
[18:01:05] smathy: Oops??? https://github.com/rails/turbolinks
[18:02:02] scyllinice: Aka the thing most of the people I know remove immediately from new Rails 4 apps
[18:02:10] smathy: RustyShackleford, basically it's something which uses XHR to just load a new <body> and <title> when someone clicks on a link, so your JS is never reloaded.
[18:02:12] RustyShackleford: my project is not very complicated
[18:02:22] RustyShackleford: turbolinks on the other hand seems really complicated
[18:02:38] scyllinice: It is. Lots of existing JS libraries don't work with it without tweaks
[18:03:03] scyllinice: The fact this has to exist is why Turbolinks is a fail for me: http://reed.github.io/turbolinks-compatibility/
[18:03:14] tubbo: it's optional
[18:03:24] tubbo: and not meant for use on apps that already have a JS structure
[18:03:33] tubbo: it's really to just get a little more speed out of basic html apps
[18:03:37] smathy: RustyShackleford, turbolinks is on by default in Rails4
[18:03:47] smathy: RustyShackleford, it could easily be the cause of the symptoms you describe.
[18:03:51] RustyShackleford: so I just need to remove it from my gemfile
[18:04:01] smathy: Yes, that's the simplest option.
[18:04:14] RustyShackleford: and from some entries in <head>
[18:04:22] RustyShackleford: anywhere else I need to edit?
[18:04:24] scyllinice: And get it out of application.js
[18:04:27] smathy: (I think it's a mistake to have it enabled by default, FWIW)
[18:05:17] malusalexandru: hey tubbo, looked on the console more carefully, I have an error with the function in application.js
[18:05:17] malusalexandru: Uncaught SyntaxError: Unexpected token )
[18:05:27] malusalexandru: https://gist.github.com/maimutza/6683983
[18:05:47] tubbo: malusalexandru: $(".datepicker" )
[18:05:50] tubbo: extra space
[18:06:14] smathy: RustyShackleford, in case it needs to be said, after removing it from your Gemfile you should run `bundle install` again.
[18:06:34] RustyShackleford: i was gonna ask if theres anything special I need to do to remove a gem
[18:06:35] smathy: RustyShackleford, and restart your Rails app.
[18:06:45] tubbo: smathy: i thought it was just #gem "turbolinks" in the gemfile
[18:07:08] RustyShackleford: onto the next problem!
[18:07:11] smathy: tubbo, you should update your Gemfile.lock too.
[18:07:47] tubbo: smathy: hehe i have a template that rewrites my Gemfile entirely :)
[18:07:55] tubbo: so i haven't actually been affected by this
[18:08:00] tubbo: and i never use turbolinks. ember.js all the way
[18:08:30] smathy: tubbo, scyllinice is right too, you should remove the require from your JS manifest too.
[18:08:47] tubbo: i probably did
[18:08:51] tubbo: i mean it's certainly never called
[18:08:57] tubbo: ember.js would explode if i had turbolinks on
[18:09:44] smathy: I actually love turbolinks, and we use it extensively, but it's a mindfuck if you don't understand it and plan your app accordingly. I think it's stupid to have it part of the default.
[18:10:41] scyllinice: smathy: Where is the extensive documentation on how to use it? I haven't found it
[18:11:06] s2013: momomomomo, just an user model with an admin role
[18:12:22] smathy: scyllinice, not sure why you're asking me that - did I say that there was extensive documentation somewhere?
[18:12:51] scyllinice: smathy: No, but you said you love it and use it. So I figured you would know where the good documentation is
[18:13:10] smathy: scyllinice, well I understand what it's doing, so the README is plenty for me.
[18:13:14] momomomomo: s2013: The best way might be to follow http://stackoverflow.com/questions/4331686/in-rails-how-to-have-an-admin-section-and-then-controllers-within-the-admin-s
[18:13:26] scyllinice: smathy: Alright. Fair enough
[18:13:31] smathy: scyllinice, in fact, I'd already rolled my own work-a-like of it in a previous app.
[18:13:33] s2013: let me check momomomomo thakns
[18:27:11] gerep: My S3 properties's listing my region like this: Region: Sao Paulo. What should I put as my region when configuring Fog for Carrierwave?
[18:29:07] makerop: can somone reccomend a good book on getting started wtih testing?
[18:29:12] makerop: "the rspec book"?
[18:30:06] smathy: gerep, I'd guess "s3-website-sa-east-1" - from here: http://docs.aws.amazon.com/general/latest/gr/rande.html
[18:30:21] smathy: ???but I'm not sure how Fog works for S3.
[18:30:33] gerep: smathy, thanks
[18:30:35] smathy: It might want the Zone ID instead.
[18:30:42] tubbo: smathy: agreed.
[18:30:44] smathy: ???or the full hostname.
[18:30:45] tubbo: on turbolinks
[18:31:19] smathy: tubbo, yeah, of all the Rails4 decisions, that's the one that says "New user? FUCK YOU" the loudest.
[18:32:08] smathy: gerep, oh, based on a different table on that same page it's actually probably: "sa-east-1"
[18:32:16] tubbo: smathy: if i ever get core-team commit access, i'm going to add that line to the top of a `rails new` command output
[18:32:21] tubbo: "Generating new Rails app..."
[18:32:24] tubbo: "new user? FUCK YOU!!!!!!!!!!!!!!!!!!!!!!!!"
[18:32:27] foucist: there's these methods @user.full_name & @user.full_name_last_first but full_name_last_first is pissing me off, would you name it any differently?
[18:32:30] dbcclarke: OK, can someone help me? I can't get this to work in my views... -> http://pastie.org/8360711 ... it prints exactly whats int he file...i dont see any "form"
[18:32:45] smathy: tubbo, we need that Linus meme with DHH's face photoshopped.
[18:32:48] tubbo: ACTION envisions DHH adding his name to a blacklist somewhere
[18:33:13] foucist: tubbo: yeah, DHH goes for the understated 'fuck you' after all :P
[18:33:17] dobry-den: makerop: i think screencasts are a good way to get the feel for testing.
[18:34:03] smathy: dbcclarke, looks like a combination of haml and erb - which are you using?
[18:34:06] Sep1: hi guyis, I am trying to deploy a Rails app to Amazon EC2 with using Capistrano, but every time when I try it, the deployment process fail - and I got this error message: https://gist.github.com/anonymous/6a992f0fd202daa2ed31 - does anyone has a tip how to fix this issue?
[18:34:28] DoctorMonocular: I am a genius (ok not really). I'd been banging my head against the wall for like 8 hours on this bug, and no help was to be found, so I bit the bullet and walked through the active record internals until I understood what was going on, made a subtle change to my code based on what I learned, and it worked, bug solved. I even came up with a couple alternatives that would've worked
[18:34:44] pskrz: sep1: need to start your unicorn
[18:34:51] smathy: DoctorMonocular++ the answer is always in the source
[18:34:52] foucist: DoctorMonocular: woah, where'd the monologue come from :P
[18:35:08] dobry-den: they ran out of characters
[18:35:10] dobry-den: was there more?
[18:35:10] smathy: DoctorMonocular, you'll be submitting pull requests soon.
[18:35:19] AntelopeSalad: why are some of the ids nil after running .create? http://pastie.org/8360716 , i'm trying to seed some junk data
[18:35:37] dobry-den: AntelopeSalad: are they actually in the db?
[18:35:38] scyllinice: AntelopeSalad: Check for validation errors
[18:35:44] smathy: AntelopeSalad, change it to create! and maybe you'll find out.
[18:35:57] dbcclarke: smathy: im using haml
[18:36:01] AntelopeSalad: i'm running a Rake::Task["db:reset"].invoke first , so i don't think so
[18:36:04] AntelopeSalad: i'll try with !
[18:36:09] dobry-den: iirc create! throws exception on failed create so it'll be more obvious
[18:36:09] smathy: dbcclarke, ok, so <%= is not haml.
[18:36:35] AntelopeSalad: ah, some of them have descriptions that are too long
[18:36:46] bratsche: Sep1: You need to check if unicorn is running first probably.
[18:36:47] dbcclarke: smathy: ok, im "trying" to use haml
[18:37:10] Sep1: bratsche looking for how to check that
[18:37:11] dbcclarke: smathy: what changes do u suggest i make, to get this to work?
[18:37:12] scyllinice: dbcclarke: Then it's just = form_tag
[18:37:14] AntelopeSalad: my next question was going to be how would i make this task more efficient?
[18:37:15] dopie: https://gist.github.com/anonymous/684a618aaf9e5c28d6c3
[18:37:18] scyllinice: No <% and no ended %>
[18:37:20] Sep1: bratsche (I thought it's running automatically)
[18:37:29] dopie: what am i doing wrong here
[18:37:31] AntelopeSalad: i plan to seed a db with like 5,000 posts, running 5k queries with x.times seems unreasonable
[18:37:33] smathy: dbcclarke, (a) maybe start with ERB, and (b) http://haml.info/ is pretty clear on the haml equivalent of the ERB you have
[18:37:35] bratsche: Sep1: Hang on, I can share some code with you.
[18:37:48] dobry-den: dbcclarke: if you'r trying to use haml, then you need to change all those `<%= ... %>` to just `= ...`
[18:37:49] Sep1: bratsche thank you a lot
[18:37:59] scyllinice: dopie: What are you experiencing?
[18:38:00] dopie: https://gist.github.com/anonymous/684a618aaf9e5c28d6c3
[18:38:09] pskrz: dopie: rename your file to index.html.erb
[18:38:28] scyllinice: dopie: find_by returns 1 category
[18:38:33] dobry-den: dbcclarke: I would just use Erb if Haml is confusing. Erb is much more obvious if you're new to both of them.
[18:39:04] dopie: i do have a category name criminal defense
[18:39:21] dopie: you mean i cant use that in a
[18:39:24] dopie: each block
[18:39:30] scyllinice: It's not an array
[18:39:42] scyllinice: Category.where(name: 'criminal defense') you could
[18:40:08] dobry-den: AntelopeSalad: Don't seed it through individual 5000.times { Post.create(...) } -- That's incredibly slow. Instead, build up a large datastructure (maybe 1000 elements at a time) and bulk-create.
[18:40:11] dopie: scyllinice, got it
[18:40:16] bratsche: Sep1: https://gist.github.com/bratsche/f7811bbd5576a1c072b8
[18:40:22] dopie: ha! worked
[18:40:30] smathy: ???or find_all_by_name
[18:40:31] dobry-den: Or create the 5000posts the naive way, but then dump the db so you can just import it (fast)
[18:40:43] scyllinice: smathy: Also correct
[18:40:56] Sep1: bratsche I suppose this should go to the deploy.rb, right?
[18:40:57] dopie: scyllinice, ok... what if I have nested ....
[18:40:57] smathy: (although I hate dynamic finders)
[18:40:57] scyllinice: I don't like those finders
[18:41:05] AntelopeSalad: dobry-den: right, bulk creation is what i'm trying to figure out atm
[18:41:09] dopie: I have categories/subcats/subsubcats
[18:41:09] scyllinice: ACTION high fives smathy
[18:41:24] bratsche: Sep1: Also, refresh.. I added more to it.
[18:41:28] dopie: how would i search for categories/subcats
[18:41:34] smathy: scyllinice, I draw the line at "_and_" - any time I see that I reject the pull request.
[18:41:45] smathy: scyllinice, I tolerate the single field ones.
[18:41:46] bratsche: Sep1: You'll need to adapt it to whatever you're doing, or fill in some blanks. I didn't copy the whole file in there.
[18:41:48] Sep1: bratsche thank you, I am gonna try it
[18:42:58] bratsche: Sep1: But you can see remote_process_exists? and unicorn_is_running? and how that's used in kill_unicorn
[18:43:34] Sep1: bratsche yes, just updating it to my needs
[18:44:01] dobry-den: AntelopeSalad: I dont know if AR has an obvious semantic like Post.create_all([...]). I recmmend just using the DB's low level dump/import. For postgres, that'd be the COPY command.
[18:44:29] AntelopeSalad: dobry-den: i think i can just create an array of Posts
[18:44:48] AntelopeSalad: and use create as normal, didn't test it yet but a SO answer is marked correct with that
[18:45:35] dobry-den: AntelopeSalad: I personally create a CSV of values and just import it into my db.
[18:45:37] dbcclarke: dobry-den: ok so to this? -> http://pastie.org/8360736
[18:45:46] gerep: smathy, it worked :)
[18:45:49] scyllinice: Sep1: Opsworks is a pretty decent system for deploying on EC2, btw. It's all Chef
[18:45:53] gerep: smathy, on S3 using Fog :)
[18:45:55] AntelopeSalad: dobry-den: yeah, it seems after further research the db has to support it
[18:46:00] dobry-den: AntelopeSalad: which db
[18:46:13] AntelopeSalad: i'm using sqlite atm but i plan to use postgres soon
[18:46:18] dobry-den: dbcclarke: nah there cant be any html. <p>hello</p> becomes %p Hello
[18:46:22] AntelopeSalad: will probably mess with postgres tomorrow
[18:46:40] Sep1: scyllinice bratsche I am just checking my set up of unicorn in deploy.rb - https://gist.github.com/anonymous/6ab637c7edac109ec3d5 - it should be basically the same as posted "bratsche"
[18:47:09] dobry-den: AntelopeSalad: ah, yeah. Postgres in dev will be a good move especially since sqlite is more lenient that postgres is with queries.
[18:47:48] scyllinice: Sep1: -QUIT is a better signal for stop. It'll let it try to die gracefully
[18:47:51] scyllinice: -9 is kinda harsh
[18:49:17] AntelopeSalad: dobry-den: i am doing some date sorting that involves postgres-specific queries too
[18:49:36] dobry-den: ah, like interval syntax?
[18:50:15] dobry-den: when i was first bit with the "always use the same db in dev & prod" a-ha moment, a simply group_by query that worked in sqlite didn't work in postgres.
[18:50:20] dobry-den: doesn't take much to diverge
[18:50:26] AntelopeSalad: dobry-den: .group("DATE_TRUNC('year', published_at)").count
[18:50:39] Sep1: scyllinice??bratsche it basically looks like the file "unicorn.pid" is broken??? can I delete it?
[18:50:58] AntelopeSalad: i was doing a group_by in ruby and some people said it was slow so i converted it to doing it in the db
[18:51:35] bratsche: Sep1: It sounds like it doesn't exist or you were passing the wrong filename to kill
[18:52:59] Sep1: bratsche ok, in the directory is this file: "unicorn.pid.oldbin", not "unicorn.pid"
[18:53:07] Sep1: can I delete it?
[18:53:10] dobry-den: AntelopeSalad: (i meant .group()). as far as doing the DATE_TRUNC in the ruby layer or db layer, there's also the issue of premature optimization.
[18:53:25] Sep1: but I had no idea how is it possible
[18:53:32] Sep1: the different extension
[18:53:47] AntelopeSalad: dobry-den: yeah it was, it seemed simple enough to research and implement though
[18:53:57] dobry-den: i'd probably have done that
[18:54:43] dobry-den: it's funny because at certain scale you end up pulling calculation out of the database back into the app layer since you can scale up to N appservers but not N database servers.
[18:55:21] dobry-den: and at small scale, it's faster to put it in the db layer
[18:55:30] AntelopeSalad: dobry-den: i'll be happy if i ever reach that point heh, i'll worry about that when i get there
[18:55:36] dobry-den: right, right
[18:56:05] AntelopeSalad: i think it won't really matter in the end though
[18:56:12] dobry-den: it won't, i just like talking about it
[18:56:18] AntelopeSalad: because that aspect will likely be cached anyways, it won't be hitting the db much
[18:56:55] AntelopeSalad: it was for a yearly archive so it might be updating once a day at most
[18:57:17] dobry-den: yeah, it doesnt really matter how you do it at that rate
[18:58:36] AntelopeSalad: i wish i could easily see the sql output of this rake task to see if it's doing 100 queries or 1
[18:59:02] jcromartie: any reason why asset_path would not output a path to the precompiled asset in production?
[19:00:10] jcromartie: so, this is weird
[19:00:16] jcromartie: app is hosted in a subdirectory on production
[19:00:35] jcromartie: asset_path outputs "/subdir/foo.jpg" instead of "/subdir/assets/foo-$hash.jpg"
[19:00:38] dbcclarke: does this mean that theres no "title" column? -> undefined method `title' for #<Book id: nil, created_at: nil, updated_at: nil>
[19:01:11] scyllinice: dbcclarke: Looks like there is not
[19:01:33] dbcclarke: ok..how do i make one...?
[19:02:05] scyllinice: dbcclarke: Have you run through any of the Rails tutorials available on the internet?
[19:02:38] dbcclarke: scyllinice: ok. nevermind.
[19:03:00] scyllinice: dbcclarke: Did you remember how to do it? :)
[19:03:24] dbcclarke: scyllinice: no. im looking up how to do it online.
[19:04:07] scyllinice: dbcclarke: Ok. Migrations and such should be in any tutorial that you go through. I was hoping you'd remember them
[19:04:37] smathy: gerep, great news.
[19:04:52] momomomomo: s2013: How'd that work out?
[19:05:08] s2013: i just created a regular user create form
[19:05:18] s2013: i think the link you sent was more about how to create an admin panel
[19:05:19] momomomomo: with the admin namespace, right?
[19:05:25] s2013: yeah that stuff was already done
[19:05:32] s2013: admin namespace, roles, authorizaiton, etc.
[19:05:34] momomomomo: ~~ you don't want your regular users to be able to create other users, right?
[19:05:50] s2013: i thought i had to do something special to create devise users, turns out its just a regular user creation form
[19:06:08] s2013: but yeah i added a filter to make sure only admins can access it
[19:06:12] momomomomo: right, and use whatever you're using for your admin roles to determine whether or not an admin can go there
[19:06:33] s2013: but i do have a quick question. i moved the filter method into application_helper and now it cant access it
[19:06:42] s2013: should it be in application_contorller?
[19:06:43] s2013: controller*
[19:06:56] ryannielson: I'm using shoulda to test and ensure_length_of only seems to work on strings, not on has_many relationships. Does shoulda have a way to test this that I'm missing? Or do I just have to write it manually.
[19:07:01] AntelopeSalad: dobry-den: do you think in general this idea of making a separate rake tasks for development seeds is the way to go? leave the seed file for real legit data that needs to be added in production?
[19:07:27] s2013: momomomomo, moving it to application controller helped but one sec
[19:07:45] s2013: https://gist.github.com/ss2k/511251dd008a1041a601
[19:08:50] momomomomo: s2013: and the error is?
[19:09:07] dobry-den: AntelopeSalad: dunno. I think different seed methods are good. there's also the idea of having an idempotent seed file that only seeds if it must (like for production)
[19:09:13] s2013: i dont remember. i fixed it by moving it to application_controller.rb
[19:09:18] s2013: it was in application_helper.rb before
[19:09:33] dobry-den: but i never used seeds much in prod. mostly in dev when im in hack-it-til-i-make-it mode and want quick teardown/rebuild cycle
[19:09:41] scyllinice: ryannielson: What are you trying to test? That the association exists?
[19:09:43] s2013: i guess im still confused about what goes in application_helper vs application_controller
[19:09:46] momomomomo: I see - if you had a method missing error, it could be that you tried to call your authenticate admin method from somewhere in the controller
[19:09:54] AntelopeSalad: that's sort of where i am at now dobry-den, thanks see ya
[19:10:04] scyllinice: s2013: Helpers are for view stuff
[19:10:11] momomomomo: application helper = views usually
[19:10:18] ryannielson: scyllinice: The association must have 2 or more items, so testing the length of it. Shoulda has a ensure_length_of method, but it only works on strings.
[19:10:18] s2013: simple enough
[19:10:19] momomomomo: application controller = controller stuff
[19:11:23] scyllinice: ryannielson: Right. That's to test validates_length_of for a text field
[19:11:57] ryannielson: scyllinice: Ya, I was hoping there was a shoulda test I was missing for it, just to simplify things without having to create some stuff myself.
[19:12:11] scyllinice: ryannielson: Yeah, there isn't. That's not a common thing to require
[19:12:30] scyllinice: It's usually have one or have many, not have 2 or more
[19:12:37] dbcclarke: scyllinice: do i need a "= end_form_tag" at the end of the form?
[19:12:41] ryannielson: scyllinice: I suppose it's not as common as a string length haha. Thanks for your help.
[19:12:55] scyllinice: dbcclarke: No
[19:22:00] levberlin: Hi Guys, if anyone wants more personalized Rails help, I'm doing free videochat/screenshare sessions. Just visit https://onscreenexpert.com and search "lev" or "rails". It's free, but feedback on the site is welcome :)
[19:23:23] crashx: hi everybody
[19:23:31] scyllinice: levberlin: Who did the video?
[19:23:47] crashx: i am trying to display an image using paperclip
[19:23:53] crashx: i am doing this at the moment
[19:23:53] crashx: <%= image_tag @product.image.url(:medium) %>
[19:23:56] crashx: to show the image
[19:24:12] crashx: but paperclip is always looking for a "missing.png" image
[19:24:19] crashx: that i don't have and that i don't want to display
[19:24:20] crashx: any help ?
[19:24:39] rhizome: @product probably doesn't have an image
[19:25:22] levberlin: scyllinice: clearly nobody talented, just us :)
[19:26:00] scyllinice: levberlin: Hah
[19:26:23] levberlin: scyllinice: the design will improve with time!
[19:26:56] scyllinice: levberlin: It's not bad
[19:27:04] arietis: how do i process links with parameters?
[19:27:19] arietis: i mean ???/?param=value
[19:27:31] rhizome: define "process" "links" and "parameters" i.e. use more words
[19:28:04] levberlin: scyllinice: thanks
[19:28:05] arietis: i wanna return records with param = value
[19:28:11] scyllinice: levberlin: You need a page that explains what the expert has to do
[19:28:35] scyllinice: levberlin: You mention vetting, but you don't say how. I assume that info is available after signup, but I haven't done that
[19:30:05] levberlin: scyllinice: Thanks, that helps. We're working on an FAQs page and need a 'how it works' for experts and users. Thanks for the feedback!
[19:30:45] dopie: hey whatever i put in the application controller can be accessed by the whole application correct?
[19:31:13] levberlin: scyllinice: but we basically ask for a description, github links, a little background to make sure you're not bogus, then we approve you.
[19:31:42] scyllinice: dopie: Whole application means more than just controllers
[19:31:48] scyllinice: I don't think you asked your question right
[19:31:52] dopie: no i didnt
[19:32:14] dopie: I want @drug_list = Crime.where(crimeheader_id: "1") to be available everywhere in my site where I can call it anywhere
[19:32:58] scyllinice: Please don't
[19:33:16] pipework: dopie: This isn't PHP.
[19:33:29] dopie: pipework, i know that
[19:33:31] pipework: You don't just call shit anywhere you damn well please. You put shit where it belongs and you are damn well happy about it.
[19:33:31] toretore: you say "everywhere", but you don't mean everywhere. explain where you want it
[19:34:01] dopie: I have 3 controllers and I want it to be available for the 3 controllers
[19:34:16] toretore: not specific enough
[19:34:17] cek: wondering wheere are mock_model, double and all that defined.
[19:34:31] pipework: dopie: You can use a model if that fits your need, otherwise you can use something in lib.
[19:34:37] cek: trying to use them in examplegroup instance and can't get it working
[19:34:43] toretore: *only* those 3, or do you just happen to have 3 and you mean "all'/
[19:35:03] dopie: no i have 4
[19:35:11] dopie: i want them only in 3
[19:35:27] toretore: write a module, then include it in those 3
[19:36:12] toretore: it's difficult to answer vague questions without code, so that's probably not the best way
[19:36:19] dopie: no i can see it is not
[19:37:34] arietis: how do i show different page for / and /?param=value?
[19:37:37] toretore: arietis: you're being much much worse than dopie here in explaining your issue
[19:37:46] dopie: hold on lemme gist it
[19:37:58] pipework: arietis: You shouldn't do that.
[19:38:11] arietis: pipework: why not?
[19:38:18] toretore: arietis: thus, nobody has any idea what you're talking about
[19:38:22] pipework: If it's a different page, use a different url. If it's different data, but the same resource, then that's different.
[19:38:32] toretore: and that's why you're not getting any replies
[19:38:48] scyllinice: pipework: You mean you don't send all your requests to one controller?
[19:39:01] scyllinice: pipework: I mean, PHP does it with index.php, so it might be the right thing to do
[19:39:05] pipework: scyllinice: I don't know what that's supposed to mean.
[19:39:13] pipework: Or if you're being sardonic.
[19:39:54] AntelopeSalad: anyone up for trying to figure out a friday afternoon edge case error?
[19:40:01] arietis: pipework: so if i wanna get page with data from index page i should show another controller with data processed using my parameters?
[19:40:04] pipework: I'm still wearing pants, no.
[19:40:04] scyllinice: AntelopeSalad: Gist it up
[19:40:06] bricker`work: AntelopeSalad: ohh ohh meee meeeee!!
[19:40:09] greenride: What does the `ignore do` block do in FactoryGirl?
[19:40:20] pipework: arietis: Describe what you want to be able to do.
[19:40:26] helpa: arietis: 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.
[19:40:26] toretore: arietis: !code
[19:40:37] pipework: greenride: documentation
[19:40:57] AntelopeSalad: i'm using a counter cache to output a count of posts per category -- but i'd like the adjust the count in the public blog views such that the count only factors in posts that are published
[19:41:12] scyllinice: greenride: https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md#transient-attributes
[19:41:15] AntelopeSalad: i have a feeling there won't be a pretty fix to it :<
[19:41:53] arietis: there is no code yet, i'm just teying to understand how to process links like <a href="./?letter=A">A</a>
[19:41:54] webdestroya: AntelopeSalad: why not just make another column that does a published_count ?
[19:42:08] toretore: AntelopeSalad: 1) have two counter caches 2) use sql count
[19:42:12] AntelopeSalad: webdestroya: can you do conditional counter caches? i'm using the built in one
[19:42:23] webdestroya: AntelopeSalad: no, dont use counter_cache, just make your own
[19:42:31] scyllinice: arietis: Those are query params and they show up in the params hash
[19:42:36] toretore: arietis: you should read the guides
[19:42:40] webdestroya: and add an after_save to the models so that it stays in-sync
[19:42:41] helpa: arietis: http://guides.rubyonrails.org/ - Ruby on Rails guides. Recommended reading.
[19:42:42] toretore: arietis: !guides
[19:42:42] AntelopeSalad: i just realized something though, how does this sound
[19:42:54] AntelopeSalad: i'm using pagination which already gets the count
[19:43:01] AntelopeSalad: couldn't i just subtract the total from the count?
[19:43:07] arietis: i didn't found anything related to query params in guides :)
[19:43:19] webdestroya: AntelopeSalad: that's still another sql query
[19:43:20] toretore: arietis: contoller one
[19:43:25] webdestroya: so might as well just do 1 query to get what you need
[19:43:27] AntelopeSalad: webdestroya: the count is already done tho
[19:43:35] platzhirsch: If pre-processing takes too long in a Rails controller, then the only way to make it more responsive is to delegate the pre-processing to a HTTP command and fetch it with JavaScript, isn't it?
[19:43:42] webdestroya: so you need to do another sql query
[19:43:49] arietis: toretore: thanks
[19:43:49] webdestroya: i see what you mean
[19:44:05] AntelopeSalad: kaminari gives you @posts.total_count , i could just do @posts.total_count - the cached amount
[19:44:06] toretore: arietis: http://guides.rubyonrails.org/action_controller_overview.html#parameters
[19:44:18] AntelopeSalad: or the other way around oops, my brain is fried heh
[19:44:29] nettoweb: Guys, I'm using the 'permalink_fu' gem to friendly urls, in me local app is everything ok??? but when I deploy to production the URLs with acccents are removed instead of replaced with ascii caracters. someone know why?
[19:44:54] AntelopeSalad: thanks though, that solution would never have came up in by itself, i only thought of that once you mentioned sql query
[19:45:12] rhizome: platzhirsch: what do you mean?
[19:45:25] scyllinice: nettoweb: Did you compare your staging environment and production environment to find any differences?
[19:45:45] bauerbob: hey there. i try to define methods in a dynamic way. here's what i've tried: https://gist.github.com/thorstenhirsch/8802bed9b12633432bf1 - however, irb returns an error for line 19 ("syntax error, unexpected keyword_end, expecting end-of-input")
[19:45:55] s2013: my users have 3 different roles. admin/manager/staff but its one model
[19:46:18] s2013: i want managers to have staffs. but its the same model. i know yo ucan do a join on the same model
[19:46:20] AntelopeSalad: webdestroya: i just realized something though, i have the category count in a view that only shows 1 post -- this is going to be a problem
[19:46:21] platzhirsch: rhizome: The data I want to display in a view needs preprocessing, that seems to take up too much time, now I don't want to let the user wait all the time until the next page is loaded
[19:46:25] s2013: using class_name i guess
[19:46:28] pipework: s2013: self-join model.
[19:46:33] pipework: There's documentation on it.
[19:46:41] s2013: yeah i know. but my question was.i still need a join table right?
[19:46:48] s2013: stupid quesiton i know and im 99.9% sure of the answer
[19:47:19] toretore: bauerbob: what do you expect it to do?
[19:47:22] rhizome: platzhirsch: it really depends on what you're trying to do
[19:47:55] bauerbob: toretore, the code should create the dispatching method: levelometer
[19:47:58] platzhirsch: rhizome: display files to import, these files have their metadata attach at their head, thus I need to parse it beforehand (the preprocessing)
[19:48:16] toretore: bauerbob: why do you think it should do that?
[19:48:21] bauerbob: toretore, when i call levelometer('Football', foo, bar) it should call Football.levelometer(foo, bar)
[19:48:31] dopie: https://gist.github.com/staycreativedesign/6734209
[19:48:42] dopie: toretore, does that help
[19:48:59] rhizome: platzhirsch: and the files are...where?
[19:49:04] platzhirsch: rhizome: local
[19:49:30] bauerbob: toretore, well, i want to add instance-specific methods for the different entries in sports (which is ActiveRecord-backed)
[19:49:43] nettoweb: scyllinice: few changes from development.rb to production.rb: perform_caching
[19:49:51] rhizome: platzhirsch: so you're having to wait for the upload to complete?
[19:50:04] scyllinice: nettoweb: I meant at the OS level
[19:50:08] platzhirsch: rhizome: no, the parsing of the file header information
[19:50:09] toretore: bauerbob: i understand that, but what makes you think the code on l19 shoud work?
[19:50:19] s2013: pipework, so i need a join table right?
[19:50:33] toretore: dopie: define the method on app controller and helper_method :it
[19:50:36] platzhirsch: For imports I would probably use something threaded
[19:50:38] scyllinice: nettoweb: You pasted that Stackoverflow question earlier
[19:50:39] pipework: s2013: I don't know. Look up how to do a self-joining model.
[19:50:40] nettoweb: scyllinice: i dionk know how to do this??? I only checked the locale of my centsos vm
[19:50:42] rhizome: platzhirsch: still not understanding. you have kind of an xy problem here
[19:50:51] toretore: dopie: and do some memoization
[19:50:53] nettoweb: scyllinice: seems ok: utf-8
[19:50:57] bauerbob: toretore, it doesn't - i know. but how can i fix that?
[19:50:58] dopie: wtf is that
[19:51:02] platzhirsch: rhizome: Sorry for being so unclear
[19:51:10] bauerbob: toretore, looks like a syntax problem to me - not a logical problem
[19:51:29] bauerbob: dopie, cache
[19:51:37] toretore: bauerbob: you're just pulling code out of your ass and expecting it to work ;)
[19:52:08] toretore: bauerbob: look into Module#define_method
[19:52:08] bauerbob: uhm... yeah... i'm pulling this code out of my ass for 2 days now. it begins to hurt... ;-)
[19:52:37] toretore: bauerbob: learning > trying random shit until it works
[19:53:00] mva3212: is there a way to get the remote_port out of the http headers on a request
[19:53:19] mva3212: I don't see it in the request
[19:53:53] nettoweb: scyllinice: But when I log in SSH and try "PermalinkFu.escape(News.last.title)" in production??? it works
[19:54:26] nettoweb: scyllinice: yeah, was an friend that asked
[19:54:35] toretore: bauerbob: read up on how modules, classes and instances are related, then become familiar with the methods in Module, Class and Object
[19:54:49] toretore: and you'll have a much easier time
[19:55:00] toretore: with this metaprogramming nonsense
[19:55:02] scyllinice: nettoweb: So it works in production but not on your local machine?
[19:55:26] scyllinice: Pragprog has a relatively good book on metaprogramming
[19:55:38] toretore: they also have
[19:55:39] bauerbob: toretore, alright, so i'm going to use symbols... but i don't see parameters in the method definition. how can i use them?
[19:55:42] helpa: http://rubycentral.com/book - Programming Ruby is a free online book on Ruby.
[19:55:45] rhizome: platzhirsch: you can access selected files via javascript, so then just snarf the metadata and use that
[19:56:19] toretore: bauerbob: i'm not going to program this for you; you don't understand what you're doing, so you need to learn
[19:56:24] rhizome: toretore: bad URL
[19:56:40] toretore: i can'y update, only the radar can
[19:56:49] rhizome: NONE SHALL PASS
[19:56:53] ducknorris: howdy fellas
[19:57:01] platzhirsch: rhizome: huh? Selected files? Since when can JS access files locally?
[19:57:10] nettoweb: scyllinice: works in local??? but in production only in console logged via SSH??? the website (live) doesnt work
[19:57:26] scyllinice: nettoweb: That's weird
[19:57:29] rhizome: platzhirsch: http://www.html5rocks.com/en/tutorials/file/dndfiles/
[19:57:56] platzhirsch: rhizome: ah the File API ok, got it
[19:57:57] rhizome: platzhirsch: when they're selected in a file dialog, just not by file:// url
[20:00:14] bauerbob: toretore, http://pragprog.com/book/ruby/programming-ruby <-- that's the book you're talking about, right?
[20:00:35] scyllinice: Helpa needs an update
[20:03:00] nettoweb: scyllinice: but its happing??? its wird. I'm using PermalinkFu.escape(field) is it right?
[20:04:01] dobry-den: Which forum-post layout style do yall prefer generally? http://dl.dropboxusercontent.com/spa/quq37nq1583x0lf/shb2d30o.png
[20:06:19] toretore: bauerbob: yup, that's the one
[20:08:02] nettoweb: scyllinice: seem that we dont have iconv: >> require 'iconv' => false
[20:08:03] toretore: Radar || wmoxam ^^
[20:08:14] ass-groper: RADAR CAN SUCK MY BIG HARD COCK
[20:08:30] scyllinice: Radar: Didn't know you had such a rabid fan base
[20:09:10] bauerbob: yay, i found a piece of the puzzle: "define_method(:foo) do |*arg|" ...actually it's pretty straight-forward :-)
[20:09:34] toretore: until you realize what define_method actually does
[20:10:08] dobry-den: nettoweb: yeah iconv removed from 2.0
[20:11:27] tubbo: dobry-den: i like this style http://imgur.com/nUwIigd
[20:11:44] nettoweb: dobry-den: Im using still ruby 1.8.7
[20:11:44] tubbo: nettoweb: iconv is only in 1.8
[20:12:02] tubbo: nettoweb: i haven't been able to figure out your issue. is permalink-fu the current version?
[20:12:05] dobry-den: i think it's just deprecated (warnings) in 1.9
[20:12:36] dobry-den: tubbo: yeah, me too. the userinfo on the left makes the actual text flow together instead of being punctuated with people's avatars.
[20:12:47] nettoweb: tubbo: I take today again from repository
[20:13:18] tubbo: nettoweb: this one? https://github.com/technoweenie/permalink_fu/ "Last update, 4 years ago" :)
[20:13:31] tubbo: nettoweb: but that's probably a good thing because you want an old version that essentially works with 1.8.7 and rails 2
[20:15:17] tubbo: nettoweb: your 1.8.7, iirc, was a bit out of date. have you tried updating to p374?
[20:15:34] malusalexandru: tubbo: can you please check upon this new gist? with the datepicker issue.. tried everything I could find..still won't work..any idea which one is good to use?
[20:15:35] malusalexandru: https://gist.github.com/maimutza/6734489
[20:15:47] s2013: is it better to add attributes in a form via hidden form field or do it in controller
[20:16:20] tubbo: malusalexandru: lol pretty much every single one of those has a problem
[20:16:25] dopie: toretore,
[20:16:50] tubbo: malusalexandru: i think you need to check out codeschool's jQuery tutorials to see what you're doing wrong. it doesn't seem like you understand javascript very well.
[20:17:35] tubbo: malusalexandru: make sure you're paying attention to errors in your terminal (`rails server`) as well as the browser console
[20:17:42] tubbo: that's where errors will typically show up
[20:18:05] tubbo: like this one: `$(function() { $(#starts_at).datepicker(); });
[20:18:10] tubbo: that's definitely wrong
[20:18:13] dopie: there we go
[20:18:14] dopie: https://gist.github.com/staycreativedesign/6734543
[20:18:14] malusalexandru: yup, the first gist I gave to you..I removed all the errors until some remained with cannot call method sendrequest
[20:18:42] tubbo: malusalexandru: another issue here is that you're calling #starts_at, but you never made an element with id="starts_at"
[20:18:56] nettoweb: tubbo: but its working locally
[20:19:00] tubbo: malusalexandru: jQuery (actually it's Sizzle) as well as CSS use '#id' to designate ids
[20:19:11] tubbo: nettoweb: you're running the EXACT same 1.8.7? (check the patch level)
[20:19:26] scyllinice: dopie: searches doesn't run automatically
[20:19:40] malusalexandru: <%= text_field_tag :starts_at, '19/04/1990', :class => "datepicker" %> << so I guess the id is not set here?
[20:20:00] scyllinice: dopie: If you want it to run on each request, you would put it in a before filter
[20:22:08] nettoweb: tubbo: local: ruby 1.8.7 (2012-02-08 MBARI 8/0x6770 on patchlevel 358) [i686-darwin12.4.0], MBARI 0x6770, Ruby Enterprise Edition 2012.02
[20:22:29] nettoweb: tubbo: production: ruby 1.8.7 (2012-02-08 MBARI 8/0x6770 on patchlevel 358) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2012.02
[20:22:59] malusalexandru: how can I specify the id for a text_tag field?
[20:23:02] tubbo: nettoweb: heh, only diff seems to be the implementation. why are you using REE?
[20:23:18] tubbo: malusalexandru: try doing text_field_tag :name_of_text_field, :id => 'name_of_text_field'
[20:23:34] crashx: hi guys, i am using paperclip to upload image, but when i send my post form and i retrieve my data, i have only the image, not the other data
[20:23:51] tubbo: malusalexandru: yeah just the name and default value. the hash @ the end is html options, so you can just do :id => 'yourID' to get an ID
[20:23:59] jstrong: tubbo taking support I see.
[20:24:00] crashx: here is my create controller
[20:24:04] crashx: def create
[20:24:04] crashx: @product = Product.new(params[:product])
[20:24:07] crashx: if @product.save
[20:24:09] crashx: redirect_to @product
[20:24:12] crashx: render 'new'
[20:24:16] tubbo: nettoweb: that's not MRI 1.8.7, that's REE, a slightly different implementation of ruby
[20:24:22] tubbo: crashx: don't paste code into irc
[20:24:25] tubbo: or you will be k-lined
[20:24:26] nettoweb: tubbo: well, i donk know.. I'm trying to upgrade my rails version too??? but its anothing thing
[20:24:27] dopie: scyllinice, is :before_action a rails 4.0??
[20:24:42] nettoweb: tubbo: that could be the problem?
[20:24:45] scyllinice: dopie: Yeah. That's what they renamed before_filter to
[20:24:46] tubbo: nettoweb: try upgrading just from REE to 1.8.7. REE was abandoned a long time ago.
[20:24:48] jstrong: dopie: pretty easy to find out
[20:25:02] dopie: yeha doing it on 3.2
[20:25:09] dopie: i use a :before_filter than???
[20:25:13] tubbo: nettoweb: it would at least be a good idea to upgrade to 1.8.7-p370 because that's the closest thing you're gonna get to a supported/decent version of Ruby. staying on 1.8.7 intentionally is a security risk.
[20:25:20] scyllinice: dopie: before_filter :searches will do it
[20:25:36] WhatAboutBen: Can someone give me a hand with something? ive made something intending to be a form for users to sign up to a newsletter. when they sign up it works fine and writes to the database. then they get directed to a second page with a back button. when they try to go back to index i get an "undefined method `permit' for nil:NilClass"
[20:25:59] tubbo: jstrong: 4:30pm on a friday, seems like these lazy programmers have a deadline or something
[20:26:01] malusalexandru: tubbo: tried doing that as well, still an empty text field..
[20:26:11] malusalexandru: will look at the console again..
[20:26:13] tubbo: malusalexandru: errors in console?
[20:26:16] malusalexandru: sorry to keep bothering you
[20:26:26] tubbo: malusalexandru: also make sure you revert back to the original implementation. that would have worked without the sapce.
[20:26:29] nettoweb: tubbo: I'll try thanks
[20:26:37] tubbo: nettoweb: np man, lmk if you have any more trouble with it.
[20:26:42] scyllinice: tubbo: It's called "Question Driven Development"
[20:26:44] tubbo: nettoweb: there may be some other places you can go
[20:26:53] scyllinice: tubbo: If I ask a question every step of the way, someone will write it for me
[20:27:03] tubbo: scyllinice: yeah but it will be shitty
[20:27:12] justanotherjason: WhatAboutBen: add foo.permit unless foo.nil?
[20:27:20] tubbo: nettoweb: i can't remember if the people providing LTS for Rails 2.x also provide support for Ruby 1.8.x
[20:27:37] tubbo: nettoweb: they probably WON'T support REE though haha
[20:27:44] tubbo: so you should upgrade that asap
[20:27:53] WhatAboutBen: justanotherjason: okay thanks I'll try that
[20:28:42] rhizome: REE is unnecessary for 1.9+
[20:28:56] nettoweb: tubbo: I'm trying to upgrade, but first I have to go to rails 3 ;/
[20:29:10] scyllinice: nettoweb: I think your time is better spent doing that
[20:29:23] nettoweb: scyllinice: me too
[20:29:45] nettoweb: scyllinice: but there's some errors that I need to fix???my app is live
[20:30:15] tubbo: rhizome: that's why it was never made for 1.9 :P
[20:30:19] tubbo: REE is all 1.8.x
[20:30:32] tubbo: actually i think it's *just* 1.8.7, it's basically 1.8.7 except modified slightly for performance
[20:32:20] malusalexandru: tubbo: reverted to my original code, replaced :class with :id=>"datepicker", still won't work.. I have 26 errors in console, they're all Cannot read property of a FusioChart that is working, cannot call method sendrequest of undefined, cannot read property onrequest of undefined
[20:32:51] malusalexandru: they're n include.post and preload and with the vm bindinf for chrome.extension not available
[20:32:55] rhizome: well look at that. 1.8.6 & 1.8.7
[20:34:03] malusalexandru: I've tried the example from episode 213 of ryan from railcasts.com and it works
[20:34:08] malusalexandru: but that's for form_for
[20:34:27] tubbo: malusalexandru: don't replace it, add it.
[20:34:37] malusalexandru: no, I tried adding
[20:34:43] tubbo: malusalexandru: you said you replaced it
[20:34:49] tubbo: malusalexandru: what the hell is "FusioChart"?
[20:35:06] malusalexandru: fast typing and s*t
[20:35:31] tubbo: malusalexandru: that doesn't really help much...why are you getting errors for FusionChart?
[20:35:58] tubbo: malusalexandru: none of those things seem like they're relevant
[20:36:05] vim_shim: I'm looking to create a short (6 character) unique confirmation for orders in my project. Anybody have any good tricks for this?
[20:36:09] WhatAboutBen: Hi guys, I've created a simple page with a newsletter sign up form on the page. All i need it to do is direct the user to a "thankyou" page when they click submit and back to home by a button on the thankyou page. I have done it all but somethings not right. Can someone spare some time to assist? Thanks!
[20:36:14] malusalexandru: it doesn't recognize a function convertColor for fusionChart
[20:36:34] malusalexandru: in it's main FusionCharts.js
[20:36:49] tubbo: malusalexandru: i think you need to step back a little bit and learn you some javascript. this isn't going to go anywhere.
[20:37:11] justanotherjason: vim_shim: (0???6).map { (65 + rand(26)).chr }.join
[20:37:14] tubbo: malusalexandru: you clearly don't understand how to debug your problems or even what your problem is. and it's actually nothing to do with rails, it's everything to do with jquery-ui
[20:37:40] tubbo: malusalexandru: at this point the "rails" part is taken care of. you now know how to set a class/ID on a given <input> tag, which is all you need outside of jQuery. all you have to do is select the right element.
[20:37:47] nettoweb: tubbo: well I change to 1.8.7 buts still with problem???its funny because before change from ubuntou to centos, its working
[20:38:16] tubbo: malusalexandru: one interesting tip...the JS Console in your browser is a REPL. so you can do $('.datepicker') in there and see if you get anything back. if your response is "[]" (empty), that means jQuery couldn't find any elements that matched the selector
[20:38:40] tubbo: malusalexandru: just a little tip to help get you by...not sure if the JS tutorials tell you that. but you should really check out CodeSchool's jQuery tutorial though. right now.
[20:39:01] tubbo: nettoweb: yeah...maybe it has something to do with the way it's compiled? if you're reliably diffing the two versions...
[20:39:06] tubbo: that kind of thing shouldn't happen
[20:39:11] malusalexandru: thanks, that's where I started using Rails..in the Rails for Zombies tutorials
[20:39:18] malusalexandru: appreciate the time
[20:39:33] tubbo: malusalexandru: no problem! JS is a beast and hard to conceive when you're starting out, but it's a fun language and you'll eventually figure it out
[20:41:18] differentSmoke: total Rails newbie here, have a simple question: when I make associative relations (has_many, belongs_to, etc) do I have to create migrations by hand or is there a command that creates them for me? more importantly, if I want to CHANGE one I already have, do I have a command for that? THANKS!
[20:41:51] jrobeson: yes, and yes ..read up on the migrations guide..
[20:41:53] jrobeson: it's all there
[20:42:07] nettoweb: tubbo: well I dont know how to diff the two enviroments SO. but maybe I ask to a friend
[20:42:30] helpa: differentSmoke: http://guides.rubyonrails.org/migrations.html - Migrations Guide by Frederick Cheung
[20:42:30] bricker: differentSmoke: !migrations
[20:43:10] differentSmoke: bricker: I read that. Well, skimmed, but I still did not get that part
[20:43:28] differentSmoke: bricker: or more like, I get that I have to write them by hand, I'm just doublechecking.
[20:43:49] another_eddie: Hi everybody... speaking of migration, what's the right (more idiomatic) way to add a has_many relation to a model? add a column "other_ids" will suffice?
[20:44:06] rhizome: other_id:integer
[20:45:03] another_eddie: rhizome: thanks, but it hasn't be "other_ids"? because I'm expecting an array of ids?
[20:46:52] rhizome: another_eddie: the foreign key goes in the belongs_to model
[20:47:49] vim_shim: justanotherjason: Thanks. :)
[20:48:56] another_eddie: rhizome: I see... so, for example Book and Chapter... Chapter belongs_to Book (rails g migration add_book_id:integer) then in Book, has_many :chapters...
[20:49:29] another_eddie: and in ChapterI can add attr_accessible :book_ids ?
[20:49:32] justanotherjason: and in chapters belongs_to book
[20:50:40] another_eddie: justanotherjason: thanks... with just one migration to add the book_id in chapter I add this relation.
[20:51:19] malusalexandru: tubbo: thanks for your help, gonna switch to codeschool tutorials.. have a great day!
[20:51:47] justanotherjason: another_eddie: http://guides.rubyonrails.org/association_basics.html
[20:52:18] another_eddie: justanotherjason: ^_^ thanks again... I're right
[20:53:06] justanotherjason: another_eddie: no prob
[20:54:45] Sc0rp10n: is it important to learn coffeescript for Rails?
[20:55:11] justanotherjason: mos def handy to know
[20:55:22] justanotherjason: and wayy better than writing js
[20:56:02] Sc0rp10n: can you use it with jquery though?
[20:56:13] justanotherjason: it just compiles to js
[20:56:22] justanotherjason: so works with all js libraries
[20:57:10] Sc0rp10n: and you can't use it outside of rails right?
[20:57:33] justanotherjason: ??? it compiles to js
[20:57:39] Sc0rp10n: oh is it like a gem or something?
[20:57:50] Sc0rp10n: where is the compiler for coffeescript?
[20:57:51] makerop: it's a programming language
[20:58:35] makerop: but yes, it has a gem that you include
[20:59:13] lurraca: Hi, I have a question about cancan? Can i restrict an specific field? Something like can :write, Forum, except: [:name]
[21:00:08] jstrong: lurraca: you wouldn't do that in CanCan
[21:00:14] jstrong: lurraca: strong parameters will do the trick for you
[21:01:45] lurraca: jstrong: What I actually want to achieve is to restrict the ability to update an specific attribute depending on the roles. Should I do that on the controller?
[21:01:56] makerop: jstrong, can you elaboratE?
[21:01:57] jstrong: lurraca: yes are you using rails 3 or rails 4
[21:02:05] makerop: how does strong params do that, when talking about roles?
[21:02:22] makerop: ie, if oyu want to allow the admin role to edit, but not customer
[21:02:24] jstrong: makerop: you change the strong parameters based on the role
[21:02:56] jstrong: if current_user.admin?
[21:03:09] jstrong: params.permit(:role)
[21:03:26] jstrong: http://edgeapi.rubyonrails.org/classes/ActionController/StrongParameters.html
[21:03:41] jstrong: makerop lurraca: ^^'
[21:05:05] thedexican: having trouble installing libv8 (3.11.8.4) on a fresh Mountain Lion install. every solution i've seen on SO isn't working. seems to be GCC compler related (Xcode 5). anything obvoius jumping out at anyone?
[21:05:16] jacobat: makerop: There's a nice Railscast on Strong Params showing that
[21:05:43] justanotherjason: thedexican: are you using homebrew?
[21:05:43] lurraca: strong jacobat makerop: will check the Railscast.
[21:05:48] makerop: ah, i am familiar with strong params
[21:05:56] thedexican: I have homebrew installed
[21:06:00] makerop: i just wasn tsure how it would work with ability
[21:06:34] lurraca: jacobat: which one it is? do you remember?
[21:06:43] thedexican: but I think it's using the Xcode compiler
[21:06:58] justanotherjason: did you install command line tools?
[21:07:02] justanotherjason: from within xcode?
[21:07:03] tubbo: thedexican: `brew doctor` to see what you're missing
[21:07:17] jacobat: lurraca: http://railscasts.com/episodes/371-strong-parameters
[21:07:24] thedexican: I did install command line tools (via prefeences/downloads)..
[21:08:00] justanotherjason: what error are you getting?
[21:08:53] thedexican: Installing libv8 (3.11.8.4)
[21:08:53] thedexican: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
[21:08:55] thedexican: Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
[21:08:56] thedexican: Unable to find a compiler officially supported by v8.
[21:08:56] thedexican: It is recommended to use GCC v4.4 or higher
[21:09:29] thedexican: $ brew doctor
[21:09:30] thedexican: Warning: /usr/bin occurs before /usr/local/bin
[21:09:31] thedexican: This means that system-provided programs will be used instead of those
[21:09:32] thedexican: provided by Homebrew. The following tools exist at both paths:
[21:09:47] AntelopeSalad: is it not possible to execute erb in coffeescript files? i put .erb at the end but it fails
[21:10:07] nettoweb: tubbo: is there a way to check if iconv is installed in my centos os?
[21:10:54] tubbo: nettoweb: how would you check that on ubuntu? (i have no idea)
[21:11:06] tubbo: justanotherjason: 1.8.7
[21:11:40] nettoweb: tubbo: i never checked
[21:11:43] dopie: why isnt htis working
[21:11:51] dopie: <%= link_to cat.name.upcase, category_crimeheaders_path %>
[21:11:58] dopie: No route matches {:controller=>"crimeheaders"}
[21:12:04] tubbo: dopie: `rake routes | grep crimeheaders`
[21:12:24] tubbo: dopie: alsooooo you're not passing a category_id into there, so how will it know which category to hit?
[21:13:39] dopie: rofl im more than rusty
[21:13:44] dopie: whats worse than rusy
[21:17:06] thedexican: fixed the home-brew path issue. but bundler seems to still want to use Xcode compiler. is this what I should change?
[21:28:41] ggherdov: hello. I am following the tutorial at http://guides.rubyonrails.org/getting_started.html#creating-the-blog-application
[21:28:41] ggherdov: when I do "rails server" it gives me the help for the command "rails", as if it didn't understand "server": http://bpaste.net/show/KLzUSj9gNylsDX1csjVQ/
[21:28:41] ggherdov: I mean, the same as if I run "rails blah". What's wrong ?
[21:29:08] EvilEpoch: Warm Greetings to all, I am The EvilEpoch.
[21:29:24] ggherdov: EvilEpoch: hello.
[21:29:40] EvilEpoch: Greetings to ggherdov from The EvilEpoch.
[21:30:11] AntelopeSalad: ggherdov: what happens when you run: rails --version
[21:30:43] ggherdov: AntelopeSalad: I get a shiny "Rails 4.0.0"
[21:31:39] AntelopeSalad: what if you type: which rails , what's the output?
[21:32:09] ggherdov: AntelopeSalad: "/home/ggherdov/.rvm/gems/ruby-2.0.0-p247/bin/rails"
[21:32:28] AntelopeSalad: it's identical for me too, minus the username
[21:32:31] Salve: ggherdov: You aren't using rvm?
[21:33:07] AntelopeSalad: i think i see the problem
[21:33:08] ggherdov: Salve: probably I am. I followed this for installing ruby:
[21:33:15] AntelopeSalad: are you sure there's a rails project to even run?
[21:33:29] AntelopeSalad: maybe it's in a directory inside of where you think it is?
[21:33:51] ggherdov: AntelopeSalad: did " rails new blog" just before, but did not "cd blog". should I ?
[21:34:11] AntelopeSalad: i think so, you should be in the same dir as the gemfile
[21:34:40] ggherdov: AntelopeSalad: "cd blog" made it happen. sorry for the noise.
[21:35:13] AntelopeSalad: i ask probably 5 questions an hour :D
[21:37:08] mwlang: what are the best ways to see what's going on behind the scenes while rails is starting up and before it finally displays the Listening on port 3000 line?
[21:37:39] mwlang: I'm trying to figure out why its taking 4 minutes for my Rails to start up on a fresh project that I've hardly begun adding any code to.
[21:38:05] mwlang: for what its worth, Sinatra is similarly slow starting up.
[21:38:49] mwlang: the the nutty part is there's plenty of resources (cpu, ram, swap...)
[21:41:30] rhizome: mwlang: create another plain project and compare
[21:44:17] mwlang: rhizome: I can do that, but not hopeful considering I have the same issue with a freshly created sinatra project.
[21:44:36] mwlang: what I'm really asking for is what profilers are there out there today?
[21:44:53] mwlang: I haven't profiled since Ruby 1.8.7 circa 2008ish
[21:45:55] tubbo: mwlang: dtrace? http://tenderlovemaking.com/2011/06/29/i-want-dtrace-probes-in-ruby.html
[21:46:16] tubbo: mwlang: thanks to tenderlove (a ruby committer), i think dtrace is available in 2.0 http://magazine.rubyist.net/?Ruby200SpecialEn-dtrace
[21:46:19] tubbo: dtrace probes*
[21:48:59] mwlang: tubbo: perfect! yes, this is what I was after.
[22:02:43] comjf: whats the best way only precompiling the assets that have changed. I'm using capistrano and the assest complication takes 6+ hours. I've seen a few tutorials but none for rails 4
[22:03:05] tubbo: comjf: https://github.com/ndbroadbent/turbo-sprockets-rails3
[22:03:11] tubbo: comjf: good luck getting it working though :)
[22:03:18] comjf: haha really?
[22:03:45] tubbo: yeah i couldn't get it working...and my compile times aren't over an hour :)
[22:03:48] comjf: doesn't that say rails3?
[22:03:48] tubbo: so i gave up
[22:03:51] tubbo: comjf: yes
[22:04:22] comjf: I thought it was auto built into the new rails 4 pipeline but it clearly isn't working out of the box
[22:04:36] comjf: so I figured Id ask here if anyone was able to get it to work with 4
[22:04:39] tubbo: comjf: i was not aware of that
[22:04:53] AntelopeSalad: is there a nicer way to eval this condition? if published == "true" || published == "false"
[22:07:17] n_blownapart: hi anyone feel like explaining some active record stuff to me? interested in how "sanitizing input" works . thanks: http://pastie.org/8361150#
[22:08:47] n_blownapart: ^^ also how a SQL injection attack works and how this code prevents it.
[22:08:48] workmad3: comjf: the things that the turbo-sprockets gem *does* are in the rails 4 pipeline
[22:09:04] workmad3: comjf: with the net result that a) the gem doesn't work with rails 4 and b) you don't need it anyway
[22:09:37] tubbo: comjf: you may be observing a different problem
[22:09:40] tubbo: than what you think
[22:10:18] Boohbah: AntelopeSalad: if published can never be anything but "true" "false" or nil, you could say 'unless published.nil?'
[22:10:27] tubbo: n_blownapart: it escapes the query string before adding it to the query, similar to a self-made string cleaning class in PHP for example
[22:10:42] workmad3: tubbo: if you're using postgres it doesn't escape the query string
[22:10:52] workmad3: tubbo: it uses prepared statements, which don't need escaping ;)
[22:11:02] AntelopeSalad: Boohbah: i don't think it's possible for it to be nil, it's coming from an http request -- but the constraint is it has to be true or false only
[22:11:14] tubbo: n_blownapart: that's why rails has to "know" which values to put in its place
[22:11:21] workmad3: (not sure if the mysql adapter uses prepared statements yet... I know there were some issues with it initially :) )
[22:11:35] tubbo: workmad3: that's cool, never knw that
[22:11:36] rhizome_: AntelopeSalad: published == "true" || "false"
[22:11:46] workmad3: tubbo: got introduced in either 3.1 or 3.2 :)
[22:11:49] terrellt: workmad3: I don't think so. I don't think any of the AR adapters do.
[22:11:58] workmad3: terrellt: postgres one does
[22:12:07] AntelopeSalad: rhizome_: that's what i have basically
[22:12:08] terrellt: workmad3: When did that get added?
[22:12:15] workmad3: terrellt: I just said, 3.1 or 3.2
[22:12:20] workmad3: terrellt: can't remember exactly which :)
[22:12:24] terrellt: workmad3: Sorry, came in kinda late.
[22:12:54] terrellt: workmad3: I was rather sad to see the MySQL adapter not use 'em.
[22:12:55] rhizome: AntelopeSalad: that's what you'll have to do for exact strings
[22:13:08] n_blownapart: tubbo: thanks. how does rails know to put the data where the ? is ..? (I'm pretty much a beginner)
[22:13:27] AntelopeSalad: btw i'm having a real problem trying to refactor code, i see all sorts of patterns but i don't know how to dry it up
[22:13:37] workmad3: terrellt: I remember noticing the log statements when using a beta version (I think it was on 3.2) and thinking 'hmm... those look like prepared statements? does AR finally use them?'
[22:14:06] AntelopeSalad: i feel like i have to validate stuff twice (once as a validate rule and once outside) and also some methods are similar but not quite as simple as replacing a variable or 2
[22:14:19] DoctorMonocular: tricky routing thing, dig it: https://gist.github.com/PeteMichaud/c486bae76f08ed292c4c
[22:14:37] comjf: workmad3: so I'd assume after I do a cap deploy.. it finishes after 6 hours of precompiling the assets... that the next time I run it, it will only recompile the assets that have changed?
[22:15:00] workmad3: comjf: should do
[22:15:08] workmad3: comjf: although a 6 hour compile time... that's intense
[22:15:09] comjf: workmad3: because it outputs a lot less data (only like 20 lines) but it's running on 5 hours now
[22:15:11] terrellt: workmad3: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L536 Sexy. Happy to see it.
[22:15:46] comjf: workmad3: well I'm also working on amazon cloud medium instance which is still pretty crappy.
[22:16:11] workmad3: comjf: are you planning on pushing your assets to S3 and using cloudfront?
[22:16:42] workmad3: comjf: if so... have you considered compiling locally (and using something like node.js rather than therubyracer)?
[22:17:03] terrellt: workmad3: Just dug back in tags - looks like 3.1.0 added it. =D
[22:17:08] workmad3: terrellt: :)
[22:17:22] comjf: for production we're going to push to S3 and cloudfront yes, but I'm just working on getting staging set up right now
[22:17:31] workmad3: terrellt: 4.0 adds in support for postgres hstore, json and array data types too ;)
[22:17:46] terrellt: workmad3: Oh snap. https://github.com/rails/rails/blob/v4.0.0/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb#L479
[22:17:51] workmad3: (assuming you're using 9.2+ anyway)
[22:18:06] comjf: workmad3: capistrano should auto use shared/assets right?
[22:18:27] workmad3: comjf: I think so, but not certain
[22:18:49] workmad3: comjf: assuming you're using the assets recipe in capistrano rather than rolling your own, anyway
[22:18:52] comjf: workmad3: my only thought is it isn't and that's why it's taking forever, but I don't want to stop it to look haha
[22:18:58] comjf: yeah I am using the recipe
[22:19:06] terrellt: workmad3: I guess MySQL -does- use prepared statements - ever since 3.1 as well.
[22:19:15] workmad3: terrellt: fun :)
[22:19:18] terrellt: Not sure how i missed that.
[22:20:38] vim_shim: my capistrano deploy's take like 30 seconds.
[22:20:39] terrellt: workmad3: Also, yes, well aware of the extra love the pg adapter gets. Alas, our infrastructure doesn't support it.
[22:20:41] workmad3: terrellt: hmm, the 3.1.0 tag only seems to have an exec_without_stmt
[22:21:12] terrellt: workmad3: https://github.com/rails/rails/blob/v3.1.0/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb#L851
[22:22:15] workmad3: ah, they restructured a bit in 4.0.0 :)
[22:22:30] bricker: Has anybody used this? http://jejacks0n.github.io/mercury/ How does it stack up to CKEditor?
[22:22:39] terrellt: bricker: No, but isn't it -cool-?
[22:22:45] workmad3: comjf: how many assets do you guys have? :/
[22:23:28] bricker: Oh nevermind, it's different than CKEditor "t expects that an entire page is something that can be editable"
[22:23:41] comjf: workmad3: a lot. It takes about 45 minutes on our local machines, 6+ on aws medium
[22:23:52] terrellt: bricker: I seem to remember being able to assign a div to apply it to.
[22:24:17] workmad3: comjf: have you considered compiling locally and pushing the compiled assets to aws?
[22:24:38] terrellt: Not to mention figuring out why you have so many assets. Geez.
[22:25:11] comjf: workmad3: that would make our continuous integration/deployment even more messy, but it might be necessary
[22:25:38] terrellt: comjf: Why? Just an extra step in your capistrano recipe that runs asset precompiling locally and then ships 'em up.
[22:26:20] comjf: terrellt: I don't run cap deploy from my laptop, I run it from an AWS build server that get called by travis-ci
[22:26:52] workmad3: yeah, I'm also curious how you've managed to get to even a 45min compile time...
[22:27:12] comjf: but i guess that would be a better idea at least, if we could have 1 beefy build server that does it locally then ships it off to the app-servers
[22:27:32] comjf: workmad3: I really have no idea. I'm newish here and am the CI/CD guy, not a developer
[22:28:04] workmad3: comjf: fair enough :) just something like a rough idea of the count of files in app/assets would be useful ;)
[22:28:14] comjf: workmad3: Its a site that builds websites though so there are a LOT of templates themes etc that other people can select fro
[22:28:42] comjf: can I do that without precompiling?
[22:28:52] workmad3: yeah, app/assets in the source directory
[22:28:59] workmad3: (or at least, one of them :) )
[22:29:12] bricker: arg I'm looking for this blog system I came across a few months ago - it's basically just a giant wysiwyg, a hosted service, the whole page is the editor
[22:29:18] bricker: it was really pretty
[22:29:24] bricker: anybody know what I'm talking about?
[22:29:37] workmad3: bricker: a heaping pile of unusable garbage? </troll>
[22:30:00] workmad3: bricker: alternatively... blogger?
[22:30:24] bricker: it's kind of like squarespace
[22:30:26] bricker: but for blog posts
[22:31:12] workmad3: comjf: still... at a guess, I suspect that each of the templates is likely to be compiling its own sets of all the assets, which could explain things
[22:31:47] comjf: workmad3: 9239 files
[22:31:48] comjf: 477 directories
[22:31:51] workmad3: comjf: however... do you know if you're using therubyracer or nodejs for compiles?
[22:32:28] comjf: workmad3: I believe node.js but I can check
[22:34:10] rhizome: local precompile is going to be best
[22:34:13] workmad3: comjf: still... 9k files probably explains it
[22:34:53] rhizome: or disable asset pipeline
[22:35:08] workmad3: rhizome: I suspect they're pretty invested in it by now :)
[22:35:22] comjf: rhizome: won't that make the site crawl if I do that?
[22:35:27] rhizome: however, if you're the ci/cd guy, isn't the "messy" your actual job? :)
[22:35:52] comjf: rhizome: it can be done certainly. But we're talking about locally being on a virtual machine
[22:36:12] rhizome: welcome to the heartbreak of external dependencies for core functionality
[22:36:21] workmad3: comjf: asset minification is pretty disk IO heavy... AWS boxes are pretty poor on disk IO, iirc
[22:36:40] rhizome: plus aws med is pretty small in hw terms, no?
[22:36:40] workmad3: comjf: ideally, you want a beefy asset compiler that has nice fast SSD disks and some decent CPU power
[22:36:56] comjf: workmad3: I was curious about that. Didnt know if it was more cpu, ram or IO
[22:37:01] comjf: so you're saying it's IO
[22:37:14] rhizome: would be a good benchmark for someone to publish
[22:37:17] workmad3: comjf: or hell, get a decent server with 16gb+ RAM in it and set up a 4gb ramdisk partition
[22:37:20] rhizome: i.e. not me
[22:37:30] workmad3: comjf: it has to fully read all the files off the disk
[22:38:07] comjf: I'm just curious on why it's taking the same amount of time
[22:38:14] comjf: when I've changed like 10 assets
[22:38:24] workmad3: comjf: frequently multiple times as it runs them through various filters
[22:38:47] comjf: I thought it would have to recompile those files and use the old files for everything
[22:39:00] rhizome: it's gotta figure out what those 10 changes touched, which is probably the same process as more changes.
[22:39:42] workmad3: it can figure out some of that a bit quicker than a full recompile
[22:40:09] rhizome: it's also kind of a young feature, so i'm sure efficiencies could be made
[22:40:33] workmad3: but if you changed 10 files, and that causes a couple of your big compiled assets to change, then those need to be completely recompiled and re-minified
[22:41:01] comjf: makes sense
[22:41:03] rhizome: relevant: http://xkcd.com/303/
[22:41:33] workmad3: yeah, there's probably scope for stuff like that (such as keeping some form of source-mapping around, and keeping intermediate files around, similar to .o files with C/C++
[22:41:41] comjf: so it sounds like the best idea is to get custom hardware for managing the builds
[22:42:07] rhizome: well, if you can precomp locally, then you can push that to your repo and be done with it (guessing)
[22:42:18] workmad3: rhizome: that's still a 45min task apparently
[22:42:29] rhizome: yeah, well
[22:42:43] workmad3: and I guess it would depend on how often those change
[22:43:37] workmad3: comjf: I'd suggest trying to get your hands on an SSD at a minimum, see if that helps (or see about setting up a ramdisk on your machine if you have plenty of RAM)
[22:44:06] workmad3: comjf: see whether it does help your compile times, and by how much
[22:44:15] comjf: well thank you guys, it was very helpful
[22:44:27] comjf: if you're curious I could come back next week and share my finding
[22:44:43] rhizome: that would be cool
[22:44:49] workmad3: comjf: write up a blog post with them too :D
[22:44:53] comjf: are you guys normally here?
[22:45:12] workmad3: rhizome: why sadly?
[22:45:19] comjf: I'm getting involved in the rails world more and more now so I assume I'll be on here quite a bit listening in
[22:45:29] rhizome: just a little friday humor
[22:45:39] helpa: rhizome: http://youtu.be/kfVsfOSbJY0
[22:45:39] workmad3: rhizome: !friday humor?
[22:45:47] rhizome: though i'd rather be in hawaii
[22:46:09] comjf: made my first rails project for this company to kick off deployments. Its a simple rails_api project but it was awesome to get working (redis, sidekiq, devise authentication)
[22:46:11] rhizome: you wash your keyboard out with soap right now mister
[22:46:19] workmad3: had to try to get one last person in before it turned midnight here ;)
[22:47:15] workmad3: rhizome: also, if I wash my keyboard out with soap, that'll make all the tasty crumbs in it taste bad
[22:47:40] rhizome: snack backup
[22:48:07] workmad3: rhizome: secondary snack backup... the beard is primary snack backup :)
[22:48:56] rhizome: taste retainer
[22:49:18] rhizome: fingers are cache
[22:53:23] soixante: Hi???. anyone here use sidekiq ?
[22:53:42] helpa: soixante: 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.
[22:53:42] workmad3: soixante: !used
[22:54:15] soixante: when a job fails, does it go back on the queue ?
[22:54:43] webdestroya: i believe so, i think it will retry it a few times
[22:55:16] soixante: so that would explain why sometimes the enqueued number goes up , i guess
[22:55:36] bastilian: soixante: https://github.com/mperham/sidekiq/wiki/Error-Handling
[22:55:44] dopie: https://gist.github.com/staycreativedesign/6736366
[22:56:01] dopie: how can i set the ids of category and crimeheaders while still in their views
[22:56:05] dopie: so my side section can work
[22:57:39] bastilian: dopie: the same way you set @drug_list
[22:57:47] bastilian: in the controller
[22:57:55] dopie: in the application controller
[22:58:12] dopie: but when i do a
[22:58:18] bastilian: uh???. you are in the app controller. no. no.
[22:59:13] soixante: bastilian: thank you, that's a nice guide i didn't notice before.
[22:59:19] bastilian: dopie: you should have a categories and crime controller controller
[22:59:51] bastilian: dopie: that is where you put actions.
[23:00:05] bastilian: you should not put actions in the application controller
[23:00:47] dopie: wumm mwhat
[23:00:52] tpayne84: I am building a super simple app to help me learn Rails??? as far as I can tell I have everything setup as it should be??? I have the pertinent parts of the model / controller / routes.rb file all put together paste bin if anyone would take a look at it to help me figure out what I am doing wrong I would greatly appreciate it. Chain of events leading to error: I create a new Deck, then try to add cards to the deck.
[23:00:52] tpayne84: this is where the error comes in ''ActiveModel::ForbiddenAttributesError in CardsController#create' ???I am a newbie to Rails, so any help is appreciated
[23:00:54] dopie: so my ApplicationController is wrong
[23:01:39] bastilian: dopie: yes, the ApplicationController is the parent class of every other controller. it should only hold stuff like filters or helpers you include for all other Controllers.
[23:01:49] dopie: well yeah
[23:01:52] dopie: its a helper for my controller
[23:02:10] dopie: im using that so i dont have to setup drug_list for all 3 of them
[23:02:12] bastilian: it is the parent class of all other controllers.
[23:02:29] ner0x: Why does has_secure_password require bcrypt-ruby 3.0.0 specifically. We can't use 3.1.* ?
[23:03:43] bingo: rubyonrails is a bitch.
[23:03:52] bastilian: dopie: ah, now i see it, sorry. check for category params and crimeheader in the searches filter.
[23:04:20] dopie: bastilian, how would i do that?
[23:04:33] bingo: fucking bitch
[23:05:41] bastilian: dopie: @category = Category.where(id: params[:category_id]) if params[:category_id]
[23:05:48] bastilian: in the searches method
[23:08:58] tpayne84: @bastilian http://pastebin.com/mM3c9VsY care to give a quick look to the question i mentioned a min ago? It is telling my the error is on the def create method @card = @deck.cards.build(params[:card])
[23:10:07] tpayne84: sorry have updated link to paste: http://pastie.org/8361284
[23:12:32] bastilian: tpayne84: you have to allow certain parameters when mass assigning. take a look at: http://guides.rubyonrails.org/action_controller_overview.html#strong-parameters
[23:13:07] tpayne84: @bastilian thanks for the tip, I will go check out the documentation on it
[23:13:14] bastilian: you are welcome.
[23:22:26] V8Energy: I got this in my migration t.string :url, unique: true ...yet it allows me to add items with identical url. What am i doing wrong?
[23:25:32] jrobeson: V8Energy, you have to use add_index.. it's in the docs
[23:25:40] V8Energy: roger. thanks
[23:26:01] wolffenstein: how would I add this to my Rails project? http://www.dzone.com/snippets/ruby-extending-mechanizes
[23:26:32] foucist: V8Energy: can also validates uniqueness in model
[23:26:47] V8Energy: but that would be less efficient, right?
[23:26:59] Tarential: V8Energy: Right.
[23:27:25] bastilian: V8Energy: but it makes sure no invalid data is sent to the db.
[23:27:55] V8Energy: which i would need to return a proper error
[23:27:56] rhizome: man, there is so much opportunity for better screencasts
[23:28:13] V8Energy: then I don't really need to add unique in the migration, right?
[23:28:30] Tarential: V8Energy: I would validate in the DB too.
[23:28:57] barce: wolffenstein: in your lib directory
[23:30:18] wolffenstein: barce: did, no effect
[23:37:11] tpayne84: @bastilian you still around?
[23:39:19] tpayne84: So i read the docs and tried to implement the whitelist for strong params. But I can't seem to figure it out??? I believe that it is because the implementation that I am trying to use is nested @deck.cars.build(params[:card]) ??? i tried adding params[:card].permit(:card) as well as the individual properties but still cannot get it
[23:40:05] tpayne84: Is there something I need to do differently since my implementation is nested?
[23:40:48] RushingFitness: Anyone have an idea as to why this string is truncating the number 0 in the first character position upon save? https://gist.github.com/rushingfitness/6736675
[23:40:49] bastilian: tpayne84: you have to set the nested attr in the model: http://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html
[23:42:53] tpayne84: @bastilian no I hadn't, but just added it and still find that I am getting the ForbiddenAttributesError
[23:43:05] RushingFitness: Nevermind, it was the number_field attrubute. Sorry if I wasted anyones time
[23:46:44] netrunner_: I am using rails 3.2 and i need to make a timetable for a students and also teachers will be assigned to this timetable in a certain time, i cannot find any guide lines in order to making this timetable
[23:47:01] bastilian: tpayne84: hm??? weird??? you could go for the more painless solution and try this gem: https://github.com/rails/protected_attributes
[23:47:53] tpayne84: @bastilian I am all about painless, but I would like to know what is causing it as well (I like to understand the errors in addition to fixing them)
[23:50:20] bastilian: tpayne84: can you give me an updated piece of your code
[23:50:37] bastilian: and maybe the full stack trace of the error.
[23:50:40] tpayne84: sure, gimme one min
[23:53:33] tpayne84: @bastilian https://github.com/tpayne84/flash_card
[23:54:48] bastilian: tpayne84: and the stacktrace of the error?
[23:55:04] tpayne84: @bastilian http://pastie.org/8361355