« Back to channel list

#RubyOnRails - 18 April 2013

« Back 1 day Forward 1 day »
[00:02:11] Leighton: erpuds: can you give us any other data on what it is doing?
[00:02:48] erpuds: the page source is empty
[00:03:17] erpuds: i followed that setup guide and added an index action to the app controller to satisfy the routes
[00:06:08] Leighton: erpuds: Well that's no good, are you able to get the "HelloEmber ready!" message in the log as in step 4 to show it's working?
[00:06:58] erpuds: i'm going to try creating a new controller and route to it
[00:07:02] pipework: I'm so too sober for this
[00:09:44] emocakes: meh turbolinks
[00:11:06] fatfreddie: Anyone know when Rails 4 is getting released?
[00:11:33] sam113101: when it's ready
[00:11:55] fatfreddie: Seems like it's been in beta since last april
[00:12:04] modsognir: sam113101: laugh zero loud?
[00:12:06] jaymiejones86: Whats wrong with Rails 3?
[00:12:15] erpuds: pipework: never do rails sober
[00:12:21] fatfreddie: Rails 3 doesn't have turbolinks
[00:12:30] jaymiejones86: fatfreddie also a lot of the Rails 4 features have been extracted into gems, which you can use in your Rails 3 projects
[00:12:34] emocakes: trollol is back
[00:12:39] WhereIsMySpoon: https://gist.github.com/Jarob22/5408840 I've put all of the appropriate here (I think) for my problem, which is that when I press the Create Tournament entry button, nothing gets displayed on the webpage. When I look into the database using 'sqlite3 development.sqlite3' then '.schema' nothing shows
[00:12:51] emocakes: fatfreddie it does if you include the gem
[00:12:58] jaymiejones86: emocakes teehee
[00:13:13] fatfreddie: But Rails 4 has it by default
[00:13:24] fatfreddie: And it cleans up vendor plugins...
[00:13:37] jaymiejones86: fatfreddie you can do that yourself in your rails 3 project
[00:14:04] fatfreddie: I'll just wait until when DHH says it's ready
[00:14:31] emocakes: have you made some offerings fatfreddie
[00:14:38] emocakes: DHH likes offerings being burnt
[00:15:29] jaymiejones86: offerings such as small children who leave rocks on your lawn that get crunched on by your mower...everytime
[00:15:37] Leighton: fatfreddie: like an unused WinXP copy, or a lamb or whatever
[00:15:57] jaymiejones86: LOL Leighton WinXP
[00:16:04] WhereIsMySpoon: Leighton: lol xD
[00:16:10] Leighton: has to be unused though
[00:16:19] WhereIsMySpoon: poor fatfreddie
[00:16:52] fatfreddie: I have an unused copy of WindowsME
[00:17:13] WhereIsMySpoon: fatfreddie: D: burn it please
[00:17:21] parndt|away: to a fresh CD because we all want a copy
[00:17:24] jaymiejones86: burn all the wandows
[00:17:26] fatfreddie: But it's unused tho
[00:17:39] jaymiejones86: unused for good reason
[00:17:39] WhereIsMySpoon: parndt|away: lol :D
[00:17:40] danabrit: ACTION can't tell who's punking whom
[00:18:09] sunya7a: Hi, could someone tell me why the following isn't printing line 11. http://pastie.org/7637697 when i switch line 9 with 10 it works but leaves me with a persistent user in the test database
[00:18:14] jaymiejones86: <insert random ashton kutcher joke here>
[00:18:20] WhereIsMySpoon: who's ashton kutcher?
[00:18:23] danabrit: http://www.youtube.com/watch?v=sShMA85pv8M
[00:18:28] fatfreddie: I'm dead serious, I have a copy of WindowsME, still in decent condition
[00:18:37] sunya7a: i think factory girl is setup correctly...when i run rails console in test environment it seems to work correctly
[00:18:39] emocakes: he might accept it
[00:18:50] jaymiejones86: WhereIsMySpoon http://en.wikipedia.org/wiki/Punk'd
[00:19:12] jaymiejones86: fatfreddie I'm dead serious, burn it, send it to hell
[00:19:13] danabrit: sunya7a: your line 10 is commented out
[00:19:46] fatfreddie: Why? It may be worth something
[00:20:04] jaymiejones86: sunya7a if you just want to fake a user object, use build instead of create, otherwise database cleaner gem to clear out the db for your test runs
[00:20:14] fatfreddie: Haven't checked, but WindowsME was a special version of Windows, so it may have collectors value
[00:20:31] jaymiejones86: fatfreddie id rather run window 3.11 than Me
[00:21:15] brownies: it's all about windows 2000 man
[00:21:15] danabrit: lol jaymiejones86
[00:21:23] jaymiejones86: fatfreddie and it was special, in a very retarded crashing way
[00:21:24] sunya7a: danabrit: right...when i switch 9 and 10 it leaves me with a persistent user...i want it to run the way it is written now...but it fails saying that user is undefined local variable
[00:21:47] fatfreddie: I miss windows
[00:21:56] sunya7a: jaymiejones86: the problem is that i want to test my login .. i think i'd need to create user for that no?
[00:22:32] jaymiejones86: fatfreddie ahh your locked in a basement I see
[00:22:52] fatfreddie: Well, now that I think about it, not really
[00:23:28] jaymiejones86: fatfreddie your not locked in a basement? you said you missed windows
[00:23:39] sunya7a: danabrit: isn't let a function in rspec? .. it doesn't throw any errors when i remove user.fname...so i think the syntax at least is correct
[00:23:51] danabrit: sunya7a: i don't know. i don't use rspec.
[00:24:22] sunya7a: danabrit: that leaves me thinking that the call to factorygirl returns nothing perhaps...but in console under test environment factorygirl creates a user properly...with that same syntax...so i think that's correct
[00:24:27] sunya7a: danabrit: what do you use for your testing?
[00:24:34] fatfreddie: I miss windows man, but 20 minute boot times became a pain
[00:24:40] danabrit: sunya7a: shoulda.
[00:24:51] jaymiejones86: sunya7a why are you using let in the first place?
[00:25:22] jaymiejones86: sunya7a if your just using that user object within that test, just use user =
[00:25:31] sunya7a: jaymiejones86: i'm following the railstutorial...he seems to like using it for it's 'memoize' capability i guess
[00:25:35] erpuds: Leighton: created a fresh app and good to go
[00:25:51] Leighton: erpuds: weird, what was different?
[00:26:08] jaymiejones86: sunya7a that is correct
[00:26:28] sunya7a: jaymiejones86: ok...problem is ...when i use user= after the test is over I'm left with a user in the db
[00:26:53] jaymiejones86: sunya7a and you dont want the user in the db? use database_cleaner gem, which clears the test DB
[00:26:53] fatfreddie: Anyone know if ChromeOS is good for dev?
[00:27:00] erpuds: Leighton: wish i knew
[00:27:07] jaymiejones86: fatfreddie I hear DOS is good for dev
[00:27:16] sunya7a: jaymiejones86: well...i don't want the user because the next time i run the test it'll fail uniqueness validation....
[00:27:24] WhereIsMySpoon: https://gist.github.com/Jarob22/5408840 ok so if I change in the new.html.erb the "entry.name" or "entry.links" to just 'asd', on localhost:3000/tournament_entries/new i get lots of 'asd' on the page which is all of the tournaments showing, but if I leave it as they are, the entry.name etc dont seem to show
[00:27:37] WhereIsMySpoon: why aren't the entry.whatever things working?
[00:27:44] WhereIsMySpoon: as you can see in the gist, they're marked attr_accessible
[00:27:46] jaymiejones86: sunya7a in your factory you can use Faker gem and sequences to avoid that issue
[00:27:52] sunya7a: jaymiejones86: when I use let() it seems to not create a permanent user...is that supposed to happen with let?
[00:28:25] jaymiejones86: sunya7a well your still telling factory girl to create the user, so it should still be persisting the user in the db to my knowledge
[00:28:45] Leighton: erpuds: that stuff is crazy when it happens. Did you change any of your app naming?
[00:30:16] sunya7a: jaymiejones86: hm....in the tutorial he uses FactoryGirl.create and it doesn't create a user in the db permenently...maybe i'm missing something obvious =/
[00:31:27] jaymiejones86: sunya7a maybe im missing something, im fairly new to testing, I thought FG create would still create the actual object, hmm
[00:32:02] V8Energy: i am trying to parse json using JASON.parse but it doesn't work. here's what the variable looks like: "{\"json_class\":\"Fortune\",\"tags\":[\"fortunes\"],\"quote\":\"You should g o home.\",\"link\":\"http://iheartquotes.com/fortune/show/46962\",\"source\":\"f ortune\"}"
[00:32:03] sunya7a: jaymiejones86: it does do it when i do `user = FactoryGirl.create` for sure...i've tried that several times
[00:32:28] sunya7a: jaymiejones86: I think it doesn't when you do let(:user) {FG.create} .... maybe because it's just in memory =/ i'm not sure
[00:33:03] sunya7a: Does someone know? Is FactoryGirl.create when used in let(:user) supposed to create a permanent user in the test db or not?
[00:33:08] jaymiejones86: sunya7a possibly, it must somehow reroute the create to a build, interestings.
[00:33:26] Leighton: fatfreddie: haven't used it personally, but the filesystem is read only unless you switch to dev mode. It seems like a possible bucket of issues. Here's a link I found which may be helpful http://kalinchuk.com/?p=59
[00:33:33] WhereIsMySpoon: V8Energy: why do you have all those \?
[00:33:38] WhereIsMySpoon: you dont need to escape quotes in json
[00:33:55] sunya7a: jaymiejones86: what do you mean with reroute to a build?
[00:34:01] V8Energy: WhereIsMySpoon: sorry, that's what it looks like: {"json_class":"Fortune","tags":["codehappy","pete_incavigila"],"quote":"\"People think we make $3 million and $4 million a year. They don't realize that most of us only make $500,000.\" -- Pete Incavigila, baseball player for the Texas Rang ers.","link":"http://iheartquotes.com/fortune/show/12367","source":"codehappy"}
[00:34:07] brownies: JASON.parse ... heh, nice.
[00:34:24] V8Energy: JSON sorry ^_^
[00:34:24] pipework: erpuds: If you have to rails, don't do it sober.
[00:34:28] modsognir: $500,000.. boo hoo
[00:34:41] WhereIsMySpoon: that parses in an online parser
[00:34:48] WhereIsMySpoon: so your parser is wrong
[00:35:13] V8Energy: WhereIsMySpoon: the error is: ArgumentError: can't get const Fortune: uninitialized constant Fortune
[00:35:33] jaymiejones86: sunya7a well if you do build instead of create, it creates the object, but does not persist it to the database
[00:35:34] modsognir: executing JSON
[00:35:52] sunya7a: jaymiejones86: oh ... FG's build method...right
[00:35:56] jaymiejones86: sunya7a so maybe let for some reason stops create for saving the data, making it function like you have performed build…but i dont think thats right
[00:36:16] WhereIsMySpoon: V8Energy: no idea
[00:36:18] sunya7a: jaymiejones86: well...may...but i think that would be unlikely =/
[00:36:29] jaymiejones86: sunya7a yea my thoughts exactly
[00:36:41] sunya7a: Anyone here that uses Rspec heavily?
[00:36:59] WhereIsMySpoon: https://gist.github.com/Jarob22/5408840 ok so if I change in the new.html.erb the "entry.name" or "entry.links" to just 'asd', on localhost:3000/tournament_entries/new i get lots of 'asd' on the page which is all of the tournaments showing, but if I leave it as they are, the entry.name etc dont seem to show
[00:37:01] sunya7a: question about rspec with factorygirl
[00:37:01] WhereIsMySpoon: why aren't the entry.whatever things working? as you can see in the gist, they're marked attr_accessible
[00:38:52] jaymiejones86: WhereIsMySpoon I just made a comment
[00:39:27] helpa: sunya7a: Rather than guru hunting and asking if someone has used this or that, just ask your question with as much detail as possible. Even if someone hasn't used X Y or Z, there's a high chance someone can help, but only if they have details to work with.
[00:39:27] Radar: sunya7a: !guruhunt
[00:39:47] WhereIsMySpoon: jaymiejones86: you mean TournamentEntry.all.each?
[00:39:57] jaymiejones86: WhereIsMySpoon whoops yes
[00:40:10] WhereIsMySpoon: jaymiejones86: still doesnt work
[00:40:17] pipework: Your face doesn't work.
[00:40:25] Leighton: WhereIsMySpoon: you can also put that in the controller and just call it in the view
[00:40:29] WhereIsMySpoon: pipework: really?
[00:40:32] jaymiejones86: hmmm add entry.inspect, see what shows up, or better yet, what does your test tell you?
[00:40:44] modsognir: pipework: ah, you're finally drunk enough for this
[00:40:55] pipework: modsognir: You are correct, captain.
[00:41:17] WhereIsMySpoon: jaymiejones86: entry.inspect prints out the entries, and all of the fields are nil o.o
[00:41:21] Leighton: approaching the ballmer peak, no doubt
[00:41:36] modsognir: Leighton: nope, well into faces
[00:41:51] WhereIsMySpoon: jaymiejones86: even though i've been putting in values
[00:42:22] Leighton: modsognir: it's okay, my face doesn't work either
[00:42:37] jaymiejones86: WhereIsMySpoon so its printing out nil values for each, eg entry.name is nil
[00:42:56] parndt|away: WhereIsMySpoon: jaymiejones86: TournamentEntry.find_each
[00:42:59] WhereIsMySpoon: jaymiejones86: http://pastie.org/7638251
[00:43:31] WhereIsMySpoon: parndt: eh? the problem is that the entry's fields are nil
[00:43:37] WhereIsMySpoon: not that we cant find them
[00:43:38] jaymiejones86: WhereIsMySpoon well thats why your entries arent showing, they are nil
[00:43:43] parndt: I am just optimising your find and enumeration
[00:43:45] parndt: nothing more
[00:43:52] sunya7a: When using Rspec with FactoryGirl, when running let(:user) { FactoryGirl.create(:user) }, I am getting an undefined method or local variable on user...the code is here: http://pastie.org/7638253
[00:43:53] WhereIsMySpoon: jaymiejones86: yes, but that's weird cause i've been creating them with values
[00:44:22] Radar: WhereIsMySpoon: your puts should be inside an example
[00:44:25] jaymiejones86: WhereIsMySpoon something else is going wrong, your values are not being persisted to the db
[00:44:34] WhereIsMySpoon: Radar: sorry, what?
[00:44:40] Radar: Oops, wrong noob
[00:44:46] sunya7a: WhereIsMySpoon: for this noob
[00:44:56] Radar: sunya7a: You need to put that in an example: it "does something" { puts user.fname }
[00:44:58] WhereIsMySpoon: jaymiejones86: the form should do that with the Format: <%= f.text_field :format %> <br />
[00:45:39] sunya7a: Radar: i've tried that ...same result =(
[00:46:13] jaymiejones86: WhereIsMySpoon well the form is not saving the parsed data properly, check whats being sent, really should have tests for all this
[00:46:53] sunya7a: Radar: I think the problem is that for some reason FactoryGirl isn't returning anything...which doesn't make sense to me...when i run the same line in console (under test environment) it returns my user
[00:47:12] Radar: sunya7a: Bullshit. Show me the code with your example.
[00:48:04] jaymiejones86: Radar getting serious lol
[00:48:32] Radar: jaymiejones86: I'm always serious.
[00:49:08] jaymiejones86: Radar hence the superman getup?
[00:49:44] jaymiejones86: all hail flying Radar
[00:50:48] WhereIsMySpoon: superman getup?
[00:50:53] sunya7a: Radar: like this ? http://pastie.org/7638307
[00:50:57] jaymiejones86: WhereIsMySpoon https://github.com/radar
[00:51:17] Sykamore: Anybody mind if I as a noob question? #Railsnoob is empty
[00:51:42] Radar: Sykamore: TIL #railsnoob exists.
[00:52:07] Radar: sunya7a: You need to use it, not another describe.
[00:52:12] Leighton: Sykamore: ask away for sure
[00:52:23] Radar: sunya7a: describe/context just sets up contexts for your tests. it/example actually defines real tests
[00:52:56] Sykamore: I want to make a new landing page for a rails site. I found application.html.haml and found another landing page in views/home/page.html.haml that I want to duplicate and then change info on
[00:53:16] momomomomo: Sykamore: http://guides.rubyonrails.org/layouts_and_rendering.html
[00:53:22] Radar: sunya7a: I'd recommend going through some RSpec documentation like http://rubydoc.info/gems/rspec-core/frames and https://www.relishapp.com/rspec before continuing.
[00:53:44] WhereIsMySpoon: jaymiejones86: also what do you mean by "checking what's being sent"? how do I do that?
[00:53:56] WhereIsMySpoon: jaymiejones86: i've checked the sqlite3 db, it's all nil values there too
[00:54:02] WhereIsMySpoon: so it's the input that's the problem
[00:54:22] Sykamore: Thanks momomomomo, I will check it out
[00:54:28] jaymiejones86: WhereIsMySpoon you could use pry before you save/create and then inspect the params your sending
[00:54:59] momomomomo: BetterErrors is good too
[00:54:59] WhereIsMySpoon: ACTION googles
[00:55:02] jaymiejones86: WhereIsMySpoon eg your telling an entry to be created with params[:something] but actually you needed params[:somethign_else]
[00:55:23] sunya7a: Radar: okay i will...one more question though...when using let(:user) { FactoryGirl.create(:user) } should there be a permanent user in the db or does using let somehow prevent persistence?
[00:55:34] jaymiejones86: momomomomo yea great gem, but it looks like the params that is being used to create the entry is not correct, so no error, just sending nil values
[00:55:59] WhereIsMySpoon: @tournamentEntry = TournamentEntry.new(params[:tournamentEntry]) is what im using atm
[00:56:24] Leighton: Sykamore: do you need both versions? You could always just point the root to whatever view you're into- in your routes.rb
[00:56:43] jaymiejones86: WhereIsMySpoon yup but what does params[:tournamentEntry] contain, it might not have the hash of values you require, hence why no values are being saved
[00:56:47] momomomomo: Leighton: He's looking to create layouts, I believe
[00:57:12] WhereIsMySpoon: jaymiejones86: sorry for my ignorance, but how do i find out?
[00:57:18] Sykamore: Leighton: It's going to be for a/b testing, so I need to duplicate the first page, but change info. The new page will be accessed by a sub-domain, i.e. mySite.com/newPage
[00:57:45] Sykamore: so both pages will be pretty similar, but different text and colors
[00:57:54] WhereIsMySpoon: blue with yellow stripes
[00:57:55] jaymiejones86: WhereIsMySpoon so in your controller where you save the tournament entries, use the pry and or pry-remote gem to allow you to check
[00:58:46] WhereIsMySpoon: ACTION googles how to use pry
[00:59:05] Sykamore: I have my local environment set up and running, however the sub-domains don't work locally like they do on the live server.
[00:59:21] jaymiejones86: WhereIsMySpoon pry and pry-remote are fantastic
[00:59:26] WhereIsMySpoon: oh this is done by bannister
[00:59:28] fryguy: Sykamore: time to set up local dns (or add stuff to hosts file)
[00:59:45] WhereIsMySpoon: where has he gone o.o
[00:59:57] Sykamore: fryguy: you mean instead of using 'rails server' to test locally?
[01:00:04] wookiehangover: whats the best way to create an association between 2 models if you only have a property of 1 of the models but its not an id?
[01:00:06] Leighton: Sykamore: ah okay, yeah if you're looking to change colors, css things, you may want to have two layouts to grab the appropriate css files. You may also be interested in lvh.me
[01:00:22] fryguy: Sykamore: sure
[01:00:24] momomomomo: wookiehangover: http://guides.rubyonrails.org/association_basics.html
[01:00:35] wookiehangover: momomomomo: thanks, really helpful
[01:00:42] Sykamore: Leighton: cool, I'll check that out
[01:01:11] WhereIsMySpoon: wookiehangover: read it first before you sarcasm someone's help?
[01:01:14] wookiehangover: I'm obviously axing a question in IRC because this use case isn't well covered in guides
[01:01:28] wookiehangover: this is not, in fact, my first day
[01:01:31] momomomomo: wookiehangover: I disagree, I believe it's there
[01:01:31] Sykamore: fryguy: I already have a local setup with XAMPP (on Mac) and I edit my vhosts file for easy urls for local testing. i.e. local.mysite.com
[01:01:31] Cakey: sanity check guys
[01:01:32] Cakey: https://gist.github.com/keikun17/5409034
[01:01:38] WhereIsMySpoon: wookiehangover: you'd be surprised how many people don't do that
[01:01:53] s2013: how can you tell what action you are in from the view?
[01:01:56] s2013: is it params[:action] ?
[01:01:57] WhereIsMySpoon: Cakey: isn't it => ?
[01:02:04] Sykamore: fryguy: Can I do that with the rails app the same as, say, WordPress? Where all I need to do is define DB creds and boot it up?
[01:02:09] Leighton: Sykamore: for sure, in short it's a simple DNS trick, but it just points domains and subs to localhost, so you can do subdomain.lvh.me:3000
[01:02:13] Cakey: WhereIsMySpoon: 1.9 hash syntax
[01:02:15] Scient: s2013: no, its action_name
[01:02:19] wookiehangover: so I have a property that's not the ID, and I'm asking what the best (or most idiomatic, whatever) way to make the associations
[01:02:20] fryguy: Sykamore: not really
[01:02:36] s2013: is that used ever?
[01:02:42] s2013: i mean im sure ever. but is it used often
[01:03:09] WhereIsMySpoon: Cakey: {key.with.dot: "blah"}
[01:03:41] Cakey: nope, doesn't work. that's the 2nd attempt in the gist
[01:03:54] WhereIsMySpoon: "keys are limited to something like /^[a-zA-Z_][a-zA-Z0-9]*$/"
[01:04:09] Cakey: personally, i love the hashrocket.
[01:04:13] Cakey: just curious
[01:04:14] WhereIsMySpoon: from http://stackoverflow.com/questions/2134702/ruby-1-9-hash-with-a-dash-in-a-key
[01:04:29] Cakey: ok, good think to know i am not going insane
[01:04:31] modsognir: Cakey: pretty much just basic characters only
[01:04:47] WhereIsMySpoon: can't have dots in it :D
[01:06:15] momomomomo: wookiehangover: http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html
[01:07:04] r0bgleeson: what's the diff between here & #rails ?
[01:07:14] sevenseacat: one has cool people, one doesnt
[01:07:17] DylanJ: #rails sucks
[01:07:22] r0bgleeson: BINARY CHOICE
[01:07:23] Cakey: one has people
[01:07:49] r0bgleeson: it's a bit confusing
[01:08:20] r0bgleeson: same deal with #ruby & #ruby-lang
[01:08:53] Sykamore: Radar: i see you visited the abyss of #Railsnoob
[01:09:09] Sykamore: Radar: one day, it may be full
[01:09:12] axilaris: hi guys... is there a query i can use to list last 10 item ... if i use .last then its only last record... if i use .limit(10) ... it will get the first 10
[01:09:58] Radar: sunya7a: sorry, got distracted by pesky work
[01:10:12] Radar: axilaris: order("id DESC").limit(10)
[01:10:14] axilaris: hmm...maybe .reverse_order
[01:10:16] Radar: sunya7a: You will need to clear out your database using DatabaseCleaner
[01:10:17] Cakey: Radar: looks like i'm not the one dealing with hashes today
[01:10:26] Radar: Cakey: Yuuup
[01:10:30] Radar: Cakey: also lol at using 1.8.7
[01:10:42] wookiehangover: momomomomo: so overriding the generated method so I can pass the other property?
[01:10:53] axilaris: radar.... order("id DESC").limit(10) --- isnt this first 10 records ?
[01:11:12] sevenseacat: axilaris: first 10 of a reverse-order list
[01:11:14] momomomomo: wookiehangover: I have no idea what context you're talking in
[01:11:26] Radar: axilaris: sigh
[01:11:38] Radar: axilaris: Seriously need to spend some time thinking before typing.
[01:11:42] wookiehangover: momomomomo: cool thanks for throwing docs at me then
[01:12:05] axilaris: brain a bit messed up
[01:12:28] momomomomo: You're extremely welcome. The answer is right there, but you've been aggressive here, and I'm out of patience for ya. You didn't even explain what method you want to override.
[01:12:31] Radar: axilaris: imo the only excuse for stupidity when it comes to coding is if you're a manager
[01:12:41] axilaris: ios, android, rails, s3, heroku, altogether
[01:12:54] sevenseacat: sounds normal
[01:13:03] Radar: And wookiehangover ragequits
[01:13:04] Radar: How mature!
[01:13:12] Radar: momomomomo: welcome to the fold.
[01:13:34] momomomomo: That's such a bummer
[01:13:51] Radar: It gets easier after your first time
[01:14:04] danabrit: no good deed goes unpunished
[01:14:24] axilaris: by the way... whats best place to host rails ? what r u guys using ?
[01:14:50] danabrit: axilaris: depends on the app.
[01:15:02] axilaris: heroku is not cheap though
[01:15:06] danabrit: axilaris: Rimuhosting for some, Heroku for others.
[01:15:07] axilaris: well... photo sharing
[01:15:10] fryguy: digital ocean is probably decent
[01:15:16] axilaris: mobile photo sharing
[01:15:18] Leighton: axilaris: I've got some VPS stuff going, is that what you mean? Heroku is good sometimes if you don't need much customization, but it's money
[01:15:22] axilaris: something that scales
[01:15:28] Radar: !webscale
[01:15:34] WhereIsMySpoon: we went from hosting rails to photos
[01:15:47] axilaris: vps... not so easy to scale...
[01:15:55] axilaris: i guess heroku is the best bet
[01:16:01] axilaris: aint cheap though
[01:16:16] WhereIsMySpoon: free for personal use
[01:16:40] axilaris: good for prototyping... but one dyno already cost 30usd +
[01:16:53] r0bgleeson: i always found their prices to be high
[01:16:54] axilaris: have no idea how this dyno works still
[01:16:57] axilaris: since im not paying
[01:17:15] fatfreddie: axilaris: Don't use Heroku, use Cloud66 + DigitalOcean
[01:17:21] r0bgleeson: and AFAIK, it doesn't auto scale for you. last I heard it had APIs to ask for more resources but when/how that happens is left up to you
[01:17:24] fatfreddie: $5/month for 1GB
[01:17:36] danabrit: store your photos on amazon aws then you can have heroku for free. :D
[01:17:46] axilaris: fatfreddie...thanks..i'll look into it
[01:17:56] axilaris: im storing all my photos in S3
[01:18:03] r0bgleeson: rking: precise quit message :p
[01:18:03] danabrit: fatfreddie: so you're a rails hosting expert now? 20 minutes ago you were advocating windows ME :-P
[01:18:05] fatfreddie: Make sure you use Cloudfront
[01:18:18] axilaris: hmm...cloudfront cost money as well :)
[01:18:36] fatfreddie: Spend money to make money
[01:18:36] axilaris: S3 not too bad for the moment
[01:18:38] jaymiejones86: elasticbeanstalk scales
[01:18:56] jaymiejones86: axilaris heroku first though
[01:19:01] jaymiejones86: esp if its a small app
[01:19:04] fatfreddie: Cloudfront is dirt cheap...pennies cheap
[01:19:24] rking: r0bgleeson: I try to apologize with each /quit; it generates noise that gets inflicted on the poor people just trying to read text.
[01:19:42] r0bgleeson: rking: very thoughtful of you
[01:19:57] fatfreddie: elasticbeanstalk is expensive with EC2.....Cloud66 + DigitalOcean = 1/3 price
[01:20:01] r0bgleeson: rking: the trees used to burn thos idle CPUs wont thank you though ;)
[01:20:38] axilaris: hmm... fatfreddie...u r kinda right
[01:20:43] axilaris: few pennies more
[01:20:46] Radar: fatfreddie: Nice ban evasion you've got going on there.
[01:21:02] jaymiejones86: fatfreddie but Cloud66 and DO doesnt auto scale
[01:21:04] Radar: fatfreddie: Did I say you could speak?
[01:21:13] emocakes: Rdar, why dont you just do host ban?
[01:21:44] Radar: Good thinking!
[01:22:23] r0bgleeson: somewhere on the internet, a VPS is being logged into, and an IRC client is starting…
[01:22:23] Radar: fatfreddie: P.S. An apology for your earlier behaviour would be most welcome.
[01:24:22] danabrit: r0bgleeson: like roaches… you just squash em when you see em.
[01:24:24] Radar: fatfreddie: Come back in a week.
[01:24:28] danabrit: can't firebomb the whole house.
[01:26:22] WhereIsMySpoon: where is banisterfiend these days anyway
[01:26:39] WhereIsMySpoon: oh this is rails
[01:26:47] WhereIsMySpoon: he's over in #ruby o:
[01:26:55] r0bgleeson: he's in #pry
[01:27:00] r0bgleeson: im talking to him now
[01:27:14] WhereIsMySpoon: he used to be in #gosu
[01:27:29] r0bgleeson: he doesnt do much with games anymore
[01:27:57] r0bgleeson: but #pry is a cool channel in its own right :)
[01:31:23] WhereIsMySpoon: require 'pry' ; cannot load such file -- pry
[01:31:33] WhereIsMySpoon: i've put pry in my Gemfile and done a bundle install
[01:32:09] cardoni: Have you tried installing it manually?
[01:32:39] WhereIsMySpoon: cardoni: i can but the bundle said it installed pry successfully
[01:33:00] WhereIsMySpoon: cardoni: just did a gem install pry, still getting error
[01:34:00] cardoni: I've used Pry, it's fucking awesome. Give me a few minutes I'm a go research something and see how I got to work myself
[01:34:16] cardoni: No problem
[01:34:47] s2013: is show_action used often in general?
[01:35:08] danabrit: s2013: show_action?
[01:35:32] danabrit: s2013: is that a gem?
[01:36:24] s2013: no it shows which action you are in, in the view
[01:36:41] danabrit: s2013: i've never heard of show_action
[01:36:44] s2013: me neither
[01:36:51] s2013: someone here mentioned it
[01:36:54] danabrit: s2013: so what made… ahhh.
[01:37:07] s2013: but how do you show what action you are in?
[01:37:14] danabrit: params[:action]
[01:37:18] s2013: thats what i said
[01:37:20] Radar: fatfreddie: Final warning.
[01:37:27] Radar: I'm reaaaall serious.
[01:37:35] Radar: If anyone in here even suggests you might be trolling, it's goodbye.
[01:37:57] sam113101: he might be trolling
[01:38:19] s2013: sorry its action_name danabrit
[01:38:33] Radar: sam113101: doubtful
[01:38:35] danabrit: s2013: ahhhhh.
[01:38:53] s2013: <s2013> how can you tell what action you are in from the view? <s2013> is it params[:action] ?<Scient> s2013: no, its action_name
[01:39:03] s2013: anyways are either of them used often?
[01:39:10] Radar: s2013: both params[:action] and action_name will work
[01:39:18] danabrit: s2013: it's either controller.action_name or params[:action]
[01:39:23] danabrit: dammit! Radar typed too fast
[01:39:52] danabrit: s2013: and they're used somewhat. dunno that i'd say "often", but on occasion. sometimes you use them for conditional logic on shared views, frex
[01:40:27] s2013: ah ok. cause i never knew that. i went to this place for a rails internship and they asked me that question, i had no clue how to answer it
[01:40:51] danabrit: s2013: there's always more to learn.
[01:41:01] s2013: yeah ofcourse. hence the unpaid internship
[01:41:03] danabrit: s2013: maybe the key answer would've been "i don't know, but i can find out"
[01:41:28] s2013: yeah i told them i am not 100% sure as i havent come across it or used it yet but i have a lot to learn still
[01:42:35] danabrit: s2013: did you get the internship?
[01:43:16] Radar: Anyone know how to get the lookup path from an I18n.t call?
[01:43:43] Radar: Say I have this translation: I18n.t(:action, :scope => "spree.actions") How do I get "spree.actions.action" out of that?
[01:45:17] s2013: not sure. they said they will give me a small project to work on or osmething and see how i code
[01:45:33] Radar: Or better question: how can I make sure translations within my I18n files are being used?
[01:45:41] s2013: they are a startup that was recently funded but they ran out of money so they are going for second round of funding
[01:45:59] danabrit: Radar - you mean in a spec?
[01:46:15] Radar: danabrit: Yeah, ideally.
[01:46:19] danabrit: s2013: be careful of that...
[01:46:27] Radar: I want a list of all i18n translations which aren't referenced during a spec run
[01:46:32] Radar: Kind of like code coverage, but for my translations.
[01:46:39] Radar: And I want a list of all translations which don't have keys in the .yml.
[01:46:48] s2013: yeah i am not doing this for money i just want to learn rails better thats all
[01:47:13] s2013: and i figured best way to learn rails is work on projects and work with someone who knows what they are doing
[01:47:26] s2013: the founder has few years of rails experience so i figured he would be a good guy to learn from
[01:47:34] danabrit: Radar - ohhh i see what you mean. sadly, i don't know. i thought you were just asking about one particular key, and was going to suggest you put some obvious test translation and check for that on the view that uses that key.
[01:48:09] danabrit: s2013: possibly…. possibly not. i wish you good luck, in any case.
[01:48:53] danabrit: Radar: http://stackoverflow.com/questions/8660613/how-can-i-identify-unused-i18n-keys
[01:49:24] Radar: danabrit: Looks good.
[01:49:37] danabrit: Radar: for half the problem, anyway
[01:50:42] s2013: danabrit you are in indiana right?
[01:50:57] danabrit: s2013: yes.
[01:51:44] s2013: ever thought about moving to the bay area or nyc?
[01:52:07] danabrit: s2013: hell to the no.
[01:52:20] danabrit: s2013: too expensive, and not a good place to raise kids.
[01:52:22] s2013: btw even with my very, very little knowledge of rails i was offered two full time jobs. thats how much its in demand now
[01:52:35] danabrit: then i should start applying again.
[01:52:49] fryguy: s2013: depending on where you are, it's pretty trivial to get a job in tech right now. no idea why you'd work for free
[01:52:50] danabrit: i applied for what seemed to me like a dream job, and got shot down. i'm gun shy now
[01:53:02] jaymiejones86: s2013 jeeze i need to move there
[01:53:12] danabrit: (figuratively. not shy about real guns at all)
[01:53:29] s2013: yeah you are from texas danabrit right?
[01:53:36] danabrit: i know if i were willing to relocate it would be much easier. but i'm not.
[01:53:39] danabrit: s2013: yep.
[01:53:57] s2013: fryguy my main goal is to learn. i basically emailed 3 companies that posted rails job ad asked them if i can just come in and learn some stuff and work with them.. 2 of them offered me full time jobs.. but i dont want to take those cause i want to learn first
[01:54:17] danabrit: s2013: where are you located?
[01:54:28] fryguy: s2013: just take the job
[01:54:30] danabrit: yeah, lot of tech jobs there.
[01:54:31] fryguy: and learn on the job
[01:54:38] fryguy: that's what I did when I started rails a couple of months ago
[01:54:40] s2013: and nyc is an awesome place to raise kids. i was raised here
[01:54:45] danabrit: nyc is probably about the last place in the US i'd want to live.
[01:54:56] danabrit: fun to visit. but i'd go absolutely crazy living there
[01:55:10] jaymiejones86: i wanna live in Nebraska
[01:55:16] danabrit: s2013: not for the kind of upbringing i want for them
[01:55:18] s2013: i am pretty sure im wanted in nebraska
[01:55:32] waseem_: Alaska, anyone?
[01:55:32] s2013: i got a speeding ticket (bs) and never paid it
[01:55:39] slash_nick: sure waseem_
[01:55:47] s2013: danabrit i went to school in texas (hook'em)
[01:55:48] slash_nick: sounds better than ny
[01:55:55] danabrit: s2013: :) good state.
[01:56:24] fryguy: nyc is too expensive and I don't think salary scales enough compared to other situations
[01:56:41] s2013: fryguy i have my own small business so i need to focus on that too and if i take a job that means im committed to them which i cant be
[01:56:53] s2013: fryguy nyc isnt that expensive, depends wehre you live
[01:57:05] s2013: i lived in sydney for a year.. i paid $1300/mo for a small room. not the apt just one room in an apt
[01:57:19] fryguy: s2013: i'd say it's universally more expensive across the board than living near boston/cambridge
[01:57:20] danabrit: s2013: i'm glad you're happy there. i wouldn't be.
[01:57:33] Cakey: curious, how much is the average lunch in nyc?
[01:57:49] s2013: anywhere from $3-$25
[01:57:52] Cakey: k how much do you spend on ave
[01:58:18] s2013: not even.. probably around $5. i just get a sandwich from a deli
[01:58:19] slash_nick: I usually skip lunch of eat on the job anyway, in which case I save receipts
[01:58:25] danabrit: Cakey: now ask what s2013 pays for rent.
[01:58:36] s2013: well our mortgage is $3,200
[01:58:44] danabrit: s2013: and what does that get you?
[01:58:52] Cakey: i... i... i don't even know what mortgage is
[01:58:55] s2013: i think for a ny house its not that bad
[01:59:01] s2013: we bought it 10 years ago
[01:59:02] Cakey: ACTION google define:mortgage
[01:59:06] Cakey: !define mortgage
[01:59:09] s2013: has 7 bedrooms
[01:59:12] waseem_: s2013: Which borough?
[01:59:22] s2013: manhattan dont have houses
[01:59:26] s2013: only apartments
[01:59:36] danabrit: my mortgage is exactly half of yours, s2013
[01:59:37] slash_nick: wait a mortgage on an apartment?
[01:59:45] s2013: no mortgage on a house
[01:59:53] danabrit: slash_nick: they do have apartments you can buy, though
[01:59:54] s2013: but you also have mortgages on condos too if you want to
[02:00:07] danabrit: that's not just nyc, though, to be fair
[02:00:09] s2013: i think the avg decent condo is $750k-$1m
[02:00:18] danabrit: i rest my case.
[02:00:19] s2013: in manhattan probably a lot more
[02:00:27] jaymiejones86: housing is ridiculously cheap in the US compared to Australia
[02:00:33] s2013: its ridiculously cheae
[02:00:38] s2013: i paid $650/month for 2 br apt in austin
[02:00:49] danabrit: austin's not cheap.
[02:00:51] s2013: jaymiejones86 are you in australia?
[02:00:59] s2013: which part?
[02:01:05] s2013: i studied in sydney uni
[02:01:10] jaymiejones86: s2013 just south of the gold coast
[02:01:39] s2013: i spent a week in surfers paradise. very nice
[02:01:48] fryguy: s2013: yah that's 2x what boston area would be, I don't think I could double my salary without moving into finance
[02:01:55] jaymiejones86: s2013 eh yea surfers is alright
[02:02:13] s2013: fryguy boston is reaely expensive too isnt it
[02:02:18] fryguy: s2013: no
[02:02:23] danabrit: fryguy: not what i heard
[02:02:31] danabrit: yalll have quarter-mil parking spaces
[02:02:45] s2013: boston/ny/sf is usually ranked the most expensive in the us
[02:02:53] sunya7a: Radar: no worries...i understand what you meant earlier...although it's still not entirely clear to me why the user variable that i create with let isn't available until i'm within the scope of a test.
[02:03:00] axilaris: hi,,,can u guys teach me how to use the rails console... i tried >rails console, then, >User.all --- nothing happens
[02:03:04] fryguy: ACTION looks outside at his driveway that fits 4 cars in it on a sidestreet with plenty of parking on the street too.
[02:03:04] waseem_: s2013: LA as well.
[02:03:13] s2013: axilaris what happenes when you type rails console
[02:03:15] Radar: sunya7a: You're not within the scope of a test... damn it man.
[02:03:18] s2013: i didnt find LA that expensive
[02:03:28] Radar: sunya7a: You're within the context of another describe. You're using "describe" when you should be using "it"
[02:03:36] s2013: fryguy are you in the city though? cause if you go a little outside of the city ny is cheap
[02:03:39] axilaris: s2013...how do i make a query in the console ?
[02:03:42] Radar: axilaris: Really.
[02:03:47] Radar: axilaris: Nothing happens. Nothing at all?
[02:03:52] jaymiejones86: axilaris just like you would normally
[02:03:57] s2013: how are you accessing the console?
[02:04:08] fryguy: s2013: no i'm not in the city
[02:04:12] axilaris: well... it has something printed out
[02:04:18] s2013: well then you can have something reaely cheap in upstate
[02:04:18] slash_nick: axilaris: that's something
[02:04:19] waseem_: axilaris: You need to sacrifice two goats to the Rails Console God.
[02:04:29] axilaris: Mongoid::Criteria selector: {} ...
[02:04:30] s2013: or (i want to vomit thinknig about it) Jersey
[02:04:44] sunya7a: Radar: i'm saying that it doesn't work until i'm within the test...i get that...but it's weird to me that is doesn't work when I can use the user variable to start defining things in a before clause...(like the railstutorial does)
[02:04:53] Radar: sunya7a: Show me the code, please.
[02:05:04] Radar: axilaris: Well then that's something, isn't it?
[02:05:12] Radar: axilaris: So it did something... which is the opposite of "nothing"
[02:05:17] axilaris: radar... ok...
[02:05:18] sunya7a: Radar: actually now that that i think about it ... it does make sense...the before gets called everytime I enter the scope of a test...so actually it is inside the test
[02:05:24] sunya7a: Radar: one sec..let me pull it up
[02:05:34] axilaris: radar... well... i was a bit expecting it to execute well...
[02:05:45] Radar: axilaris: It did execute.
[02:05:59] s2013: fryguy how long have you been doing rails?
[02:05:59] Radar: axilaris: sounds like you should read http://mongoid.org/en/mongoid/docs/querying.html
[02:06:05] fryguy: s2013: 3 months
[02:06:08] sunya7a: Radar: like here...http://pastie.org/7638851
[02:06:14] s2013: and you are working full time?
[02:06:18] fryguy: s2013: yah
[02:06:25] s2013: nice, may i ask how much they offered?
[02:06:36] sunya7a: Radar: it looked to me like the before was outside of the scope of the test...but it isn't...i see that now
[02:06:46] Radar: sunya7a: as far as I know that code is correct
[02:06:48] axilaris: hmm... ok... it works with some other command like User.count
[02:07:14] sunya7a: Radar: it is...i'm saying i understand now why that code works and what I wrote didn't
[02:07:14] axilaris: so its mongoid specific ... nowonder User.order("id DESC") doesnt work
[02:07:23] jaymiejones86: axilaris are you sing mongo? you might need to require the gem that allows you to interact with mongo
[02:07:42] axilaris: jaymie... u mean i need a gem for the console ?
[02:07:44] richardjortega: i want to do dynamic dispatch on the following request: using @object, find that @objects class name and then use that name as the method call for current_user.#{@object.class.name.pluralize} << @object. but this doesn't work
[02:08:00] sunya7a: Radar: also when factorygirl is used with let() it doesn't create a permanent entry in the db...so i guess that's another reason to use let
[02:08:13] jaymiejones86: axilaris well in your application are you connecting to a mongo db? I thought you needed some gem that allows you to use mongo in a rails app...
[02:08:26] sunya7a: Radar: factorygirl.create() i should say
[02:08:41] Radar: sunya7a: No, it DOES create an entry in the database.
[02:08:47] V8Energy: guys i am trying to do something hacky. I want to create a form tag of which action attribute will change based on which record the user clicks. i am trying to create the form without using the helpers. i am changing the action attribute using jquery so in the end it looks like this action="models/id.js" and the method is put. also data-remote is "true". in the end it executes the
[02:08:47] V8Energy: update.js.erb, and the record updates just fine. I am just wondering if this is the best approach.
[02:08:53] Radar: sunya7a: It's cleaned out with DatabaseCleaner or use_transactional_fixtures
[02:08:54] helpa: V8Energy: Your line was too long and was cut off. Try splitting it into more appropriate bite-sized chunks but remember the enter key is not the space bar.
[02:08:54] Radar: V8Energy: !tldr
[02:08:55] axilaris: jaymie... yes...my app is connected to mongodb... and i do have the gem
[02:09:02] helpa: V8Energy: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[02:09:02] Radar: V8Energy: !e
[02:09:05] Radar: V8Energy: !omg
[02:09:11] danabrit: sunya7a: seriously, i have seen the DatabaseCleaner suggestion given to you no fewer than three separate times now
[02:09:13] axilaris: http://stackoverflow.com/questions/13145611/rails-ruby-nomethoderror-undefined-method-order-for-array0x718c278 this probably the reason why .all may not work
[02:09:13] V8Energy: guys i am trying to do something hacky. I want to create a form tag of which action attribute will change based on which record the user clicks. i am trying to create the form without using the helpers.
[02:09:14] V8Energy: i am changing the action attribute using jquery so in the end it looks like this action="models/id.js" and the method is put. also data-remote is "true". in the end it executes the update.js.erb, and the record updates just fine. I am just wondering if this is the best approach.
[02:09:18] Radar: V8Energy: No need to repaste.
[02:09:41] Radar: Just saying that your line is too long and to keep it in mind for future that you shouldn't post such long shit.
[02:09:44] Radar: V8Energy: Also, show us your code.
[02:10:04] erichmenge: richardjortega: And that's surprising? :)
[02:10:30] richardjortega: erichmenge: i just learned the words dynamic dispatch and now i'm trying to read it in metaprogramming ruby
[02:10:31] danabrit: erichmenge: good evening!
[02:10:33] richardjortega: not a damn clue about this
[02:11:04] erichmenge: richardjortega: I think you're looking for http://ruby-doc.org/core-2.0/Object.html#method-i-send
[02:11:15] erichmenge: danabrit: Hi danabrit!
[02:11:40] richardjortega: erichmenge: i'm reading that now
[02:12:22] richardjortega: using the whole symbol thing too makes sense
[02:13:05] richardjortega: erichmenge: but can that send method accept '<<' a push from an object to its current collection of objects?
[02:13:34] erichmenge: richardjortega: methods don't accept methods, objects respond to methods
[02:13:49] erichmenge: richardjortega: send returns an object
[02:14:24] r0bgleeson: richardjortega: yeah, [1].send :<<, 2
[02:14:45] V8Energy: Radar: don't know if it was a good idea to post the code, it's a little messy: http://pastebin.com/NmmVKRGK
[02:14:48] Radar: ACTION coughs
[02:14:53] Radar: ACTION uncoughs
[02:15:04] Radar: V8Energy: Come on bro. You know better than to use pastebin now.
[02:15:06] V8Energy: I was simply wondering if my approach was OK based on my description
[02:16:03] V8Energy: http://pastie.org/private/nvrhpoml0nzwpubwzbir5g
[02:16:48] r0bgleeson: no ruby bot here :[
[02:17:41] Radar: erichmenge: hi.
[02:17:48] erichmenge: Radar: Hi!!!!!!1
[02:17:57] Radar: V8Energy: And please split up your files into separate sections so it's easier to read.
[02:18:09] helpa: ain't nobody got time for that! - http://www.youtube.com/watch?v=bFEoMO0pc7k&feature=youtube_gdata
[02:18:13] V8Energy: i seperated them with ============ lol
[02:18:17] V8Energy: there are sections? cool
[02:18:20] Radar: V8Energy: !sections
[02:18:24] helpa: V8Energy: Please section your pasties using the syntax of "## section header", for more information see this: http://skitch.com/radarlistener/9d6i/new-pastie
[02:18:24] Radar: V8Energy: !section
[02:18:35] Radar: Ugh, need to remove that Skitch.
[02:20:16] V8Energy: yea adding ## didn't help lol
[02:20:17] V8Energy: http://pastie.org/private/orj2bbvtc33iq0wpq7ksza#1,4,8,34
[02:20:40] Radar: V8Energy: Did you add == or ##?
[02:20:52] V8Energy: i must be tired
[02:20:56] Radar: V8Energy: Looks to me like you're using == and not ##.
[02:22:10] V8Energy: an achievement: http://pastie.org/private/scitkr4dp0vm04yfsigqxg
[02:23:52] danabrit: blessyerheart
[02:24:13] axilaris: mongoid has lots of limitation... cant use .limit as well in the query http://stackoverflow.com/questions/9688007/mongoid-limit-parameter-ignored
[02:24:45] axilaris: well... can use .limit...but if use with some additional extensions..it wont work
[02:27:31] helpa: Don't you mean lolgoid?
[02:27:49] Joshsz: Hey folks, routing question. If I want my restful path helpers to work with my SEO-friendly routing scheme, is there an easy way to do it? I'm currently debating overriding url_for or hash_for_#{helper_method}
[02:27:51] parndt: helpa is so darn opinionated
[02:28:04] parndt: Joshsz: https://github.com/norman/friendly_id
[02:28:06] axilaris: well... i tried .limit... it doesnt even return the exact count number
[02:28:14] Joshsz: parndt: not using AR
[02:28:37] parndt: what are you using?
[02:28:41] Joshsz: I had to make it difficult ;)
[02:28:43] Joshsz: MongoMapper
[02:28:44] Radar: V8Energy: That's a lot of code to look through.
[02:28:51] axilaris: should i have just stick to normal databases thenn to try something new like mongo
[02:29:04] Radar: V8Energy: what am I supposed to be looking like?
[02:29:09] Radar: axilaris: Yay, wisdom has found you!
[02:29:21] parndt: nobody wrote a mongo adapter for it
[02:29:23] axilaris: radar : nice hit on me :)
[02:29:48] Radar: Mongo databases don't need permalinks because their data doesn't stay around long enough to be called "permanent"
[02:29:50] axilaris: radar: i thought mongo is hot and been there sometime...
[02:29:55] erichmenge: parndt: friendly_id has no dependencies
[02:29:59] Radar: axilaris: It's a toy database.
[02:30:14] Radar: Or rather, experimental... not quite a toy. I would say MySQL is the toy database.
[02:30:21] Radar: The only real database is PostgreSQl.
[02:30:24] erichmenge: Radar: Oh no you didn't!
[02:30:40] erichmenge: Radar: You can't spell LAMP without MySQL.
[02:30:44] V8Energy: Radar: i have a table with bunch of records. when i click on the row, i am changing each field to a text input and i am modifying form's action to match the record's update route. is it the right way to do this?
[02:31:05] Yakko: erichmenge: make it a LNRP
[02:31:08] parndt: erichmenge: yeah but I'm pretty sure it calls to AR
[02:31:09] axilaris: limit, desc these are basic... mongoid oh mongoid
[02:31:13] parndt: or are you saying it works on aything
[02:31:14] parndt: that'd be nice
[02:31:22] Radar: erichmenge: You can't spell LAME without it either.
[02:31:25] erichmenge: parndt: I dunno, was just curious and looked at the gemspec
[02:31:32] erichmenge: find it suspect there are no dependencies listed
[02:31:35] Radar: V8Energy: Seems like quite a lot of work for me to review all that code :\
[02:31:44] erichmenge: Radar: Do it!
[02:31:44] Yakko: erichmenge: do you use friendly_id ?
[02:31:49] parndt: erichmenge: it's possible it just has no dependencies
[02:32:01] V8Energy: Radar: I know lol
[02:32:11] Radar: V8Energy: And you want me to do it for free?
[02:32:12] erichmenge: parndt: Could be.
[02:32:15] parndt: oh wow I'm listed as an author
[02:32:16] Radar: Not going to happen.
[02:32:21] danabrit: V8Energy: Radar works for Vegemite
[02:32:22] axilaris: shitman... if i cant limit... cpu will go crazy
[02:32:24] Joshsz: afaict though friendly_id operates on to_param, no?
[02:32:31] V8Energy: Radar: no. I've accomplished it already. I was just wondering if it's the right way to do it or not.
[02:33:11] parndt: erichmenge: it depends on thread :P https://github.com/norman/friendly_id/blob/master/lib/friendly_id.rb
[02:33:14] Radar: axilaris: limit and desc are available on SQL databases too.
[02:33:33] erichmenge: parndt: I meant gem dependencies :P
[02:33:40] erichmenge: and you know it.
[02:33:40] parndt: erichmenge: it has no hard dependencies because you're supposed to add them when you add particular parts like i18n
[02:33:48] parndt: like if you want i18n then you add it to your Gemfile and then use it
[02:33:49] axilaris: radar... ofcourse it should be in any sql...
[02:33:52] parndt: we're not bundling it
[02:33:58] axilaris: https://github.com/mongoid/mongoid/issues/1100
[02:34:01] Radar: axilaris: So what's the big idea?
[02:34:07] axilaris: i wonder what version of mongoid im using
[02:34:08] Radar: axilaris: Why are you stressing so much?
[02:34:09] parndt: erichmenge: this of course tells me we should have extracted those parts into other gems with hard dependencies
[02:34:17] erichmenge: parndt: correct.
[02:34:28] axilaris: radar... stressed because i may have picked the wrong choice
[02:34:38] axilaris: radar... need more wisdom from u
[02:34:40] parndt: erichmenge: of course we were discussing what to do with it earlier today
[02:34:45] parndt: I'll bring that up next time we talk
[02:34:51] erichmenge: parndt: orly? Big changes?
[02:35:26] Radar: axilaris: Cool. My rate is $150/hr.
[02:35:27] parndt: erichmenge: not really
[02:35:39] parndt: erichmenge: extracting globalize3 dependency out into its own gem
[02:35:45] axilaris: ok there is 2 choices it seems mongoid vs mongomapper
[02:35:45] parndt: so that it doesn't slow down the main gem
[02:35:53] parndt: vs postgresql with hstore
[02:35:55] axilaris: wise to move to mongomapper
[02:36:19] Joshsz: axilaris: I like it but it maps well to my brain
[02:36:35] axilaris: http://stackoverflow.com/questions/1958365/mongoid-or-mongomapper
[02:36:42] axilaris: crazy... too many pros and cons
[02:37:02] helpa: axilaris: What you just asked could be classed as subjective. Subjective questions often start flamewars, which are tedious and boring. Try all the available options and see which one suits you the best.
[02:37:02] Radar: axilaris: !subjective
[02:37:19] Radar: axilaris: Please just use a SQL database. There's much more better resources/documentation on those than there is about Mongo databases.
[02:37:22] Joshsz: that usually means pick one and learn it
[02:37:36] axilaris: down with my nosql try ?
[02:38:05] danabrit: ACTION needs to remember the !subjective command
[02:38:07] Radar: axilaris: That's what we've been saying now for... *counts the days*
[02:38:32] Radar: Since the 10th April.
[02:38:34] axilaris: i can see that ... truly frustrated .... hmm
[02:38:41] Radar: So 8 days.
[02:38:45] parndt: if you don't understand nosql don't use it
[02:38:48] axilaris: not so difficult to change over though
[02:39:26] axilaris: question is still "why not" ... i need to try a bit more...
[02:39:31] erichmenge: axilaris: It should be I'd think. The design would be much different.
[02:39:43] erichmenge: Hopefully you don't design your non-relational schema in a relational way, and vice versa
[02:40:02] axilaris: im doing alot of flat rows with mongo..since less relation...speed is the thing
[02:40:08] erichmenge: if you can switch back and forth I think you're not really utilizing your DBMS correctly.
[02:40:12] axilaris: trying chatting up in #nosql
[02:40:39] axilaris: erichmenge... yeah...
[02:40:48] erichmenge: axilaris: Have you considered just using Redis where necessary?
[02:41:07] axilaris: well... need to check out this 2 stuff...limit, desc.... pulling latest records... some where with these combination
[02:41:24] axilaris: just to verify some normal use cases are working...
[02:41:35] axilaris: sigh if there is a way
[02:42:14] erichmenge: ACTION doesn't know who axilaris is talking to
[02:42:23] aamax: hi all. I'm trying to debug an issue i have on my heroku deployment with bootstraps image gallery. it works fine on my local install in dev mode so i thought I'd try to run it in production mode. I precompiled the assets on my local machine but it doesn't seem to be finding any of the assets - no images, css, etc at all. i don't usually run in production mode on my local dev box. what am i doing wrong? I'm just starting by using "ra
[02:42:23] aamax: ils s -e production"
[02:42:28] sevenseacat: ACTION doesnt know what axilaris is doing
[02:42:59] rhizmoe: ACTION is in derp mode
[02:43:47] Radar: erichmenge: same
[02:44:39] sevenseacat: ACTION likes turtles.
[02:44:42] rhizmoe: aamax: you have to precompile assets on the far side, too
[02:44:54] rhizmoe: unless you're committing your local precompile
[02:44:56] erichmenge: sevenseacat: what kind?
[02:45:07] Radar: aamax: config.assets.enabled is set to false in config/environments/production.rb.
[02:45:16] Radar: aamax: Which means your local server won't be serving assets.
[02:45:29] Radar: aamax: This is the default setting and I would recommend not changing it.
[02:46:46] aamax: Radar, thanks. i precompiled the assets before I tried to run so public/assets is populated with a boatload of "stuff". what else do i need to do?
[02:47:01] erichmenge: aamax: Rails won't serve assets.
[02:47:04] Radar: aamax: Run a local apache/nginx server and serve it through that/
[02:48:04] erichmenge: I think pow will serve files out of public as well
[02:48:24] erichmenge: aamax: Why are you wanting to run in production mode locally anyway?
[02:48:27] aamax: ok. I think I may set the config value to try and debug this and then set it back. I don't have the time right now to figure out all dev ops stuff for apache or nginx. it seems to be working this way - just need to fix my s3 info
[02:48:49] aamax: erichmenge, trying to debug an issue i'm having when i deployed to heroku (that works fine in dev)
[02:48:58] rking: https://github.com/rails/rails/blob/3-2-stable/railties/lib/rails/generators/app_base.rb#L85-L86 # pretty gnarly. Just sayyin
[02:49:01] aamax: seemed like a good idea
[02:49:16] erichmenge: rking: lol prok
[02:49:30] Yakko_: aamax: so you're tring to set up nginx/apache locally to simulate heroku?
[02:49:31] s2013: where is the best place to store all your api keys?
[02:49:34] rking: In their defense, that's gone in the latest rails
[02:49:50] helpa: s2013: What you just asked could be classed as subjective. Subjective questions often start flamewars, which are tedious and boring. Try all the available options and see which one suits you the best.
[02:49:50] erichmenge: s2013: !subjective but I use environment variables
[02:50:11] aamax: Yakko_, no - i was just trying to run webrick locally in production mode as a first attempt at trying to duplicate the problem
[02:50:32] Yakko: aamax: rails s -e production
[02:50:46] Yakko: does it work for ypu?
[02:50:47] erichmenge: Yakko: we've been over that part.
[02:50:48] s2013: i dont think its subjective though because you wouldnt obviously store them in models or views right?
[02:51:05] aamax: Yakko, yup, that's what i was doing. it works now (after making the setting change Radar mentioned earlier)
[02:51:10] erichmenge: s2013: Oh I thought you meant for configuration. What are you talking about?
[02:51:28] Yakko: aamax: you should always listen to Radar
[02:51:33] helpa: Decent at giant Jenga.
[02:51:44] s2013: lets say you use bunch of apis, and you have api keys. i stored them in application controller but i was told thats not the right place
[02:52:03] erichmenge: s2013: Oh so it is what you're talking about. Yeah that's a bad place for them.
[02:52:12] s2013: so where should i store them?
[02:52:15] aamax: Radar, is my Oracle. ;D
[02:52:28] erichmenge: s2013: I use .rbenv-vars to set environment variables
[02:52:40] erichmenge: and then fetch those as needed in the API wrapper's configurations
[02:52:51] Joshsz: parndt|away: FWIW, this solved my problem: http://arjanvandergaag.nl/blog/generating-fancy-routes-with-rails.html
[02:53:01] Radar: bbl lunch
[02:53:18] miso1337: I have to cancel an appointment today so I can go drinking with my boss
[02:53:20] Bravebellows: is it sad that I have to check my git status to see where my life is heading?
[02:53:20] Yakko: s2013: Settings = YAML.from_file('config/settings.yml') #make a custom config file and override it in production right after deploying
[02:53:27] miso1337: working in a japanese company = sucks
[02:53:36] erichmenge: s2013: You probably don't want to commit api keys to your repository, so I keep that file only on the production server
[02:54:01] Bravebellows: I recommend 1Password
[02:54:37] Yakko: s2013: example, I always use the same dev keys for the fb api, but I change it in production :)
[02:54:44] erichmenge: Bravebellows: It's okay. I feel like all of the password management apps are lacking in some way or another.
[02:54:46] brownies: miso1337: but i bet the miso soup is great?
[02:55:17] Bravebellows: erichmenge: I moved from SplashID to 1Password, it's day/night difference especially with Dropbox sharing
[02:56:34] quazimodo: hey everybutty
[02:56:36] miso1337: brownies: yeah it really is. it's more the ratio of ingredients though. equally good miso can be found in california.
[02:57:00] Bravebellows: ACTION has a butt but doesn't feel ying about it...
[02:57:34] miso1337: erichmenge: I use LastPass and it's super
[02:57:48] sevenseacat: ACTION doesnt believe in password managers
[02:58:03] s2013: just use the same base password
[02:58:08] s2013: and modify it a bit depending on the site or whatever
[02:58:08] Bravebellows: browser password saving features should be disabled permanently
[02:59:43] Bravebellows: same base password? Bad idea, once a cracker figures out the base, it's much more less effective than a random password
[03:00:10] s2013: yes but 99.99% of the time you arent specifically being targeted
[03:00:38] miso1337: s2013 that in itself is the worst security possible because your pattern can be guessed
[03:00:41] s2013: can rails send email from localhost btw
[03:00:44] sevenseacat: password resets are my friend.
[03:00:58] quazimodo: seven sea smooch
[03:01:11] Bravebellows: You don't need to be targeted specifically, it's pretty much automated
[03:01:39] miso1337: i have groups of passwords
[03:01:43] s2013: yeah and they wont be manually going through your passwords
[03:01:52] miso1337: throwaway sites, forums
[03:01:57] amh345: i've got a large amount of data im pulling from the db. many many queries.
[03:01:59] miso1337: new webapps
[03:02:09] Bravebellows: s2013: they don't need to, they'll just target emails since that's where password resets usually go
[03:02:14] miso1337: then a group with unique cryptic per site like EC sites, banking, etc
[03:02:26] amh345: chrom is now saying "No data received". but i cant find a single error in rails log or my web server log.
[03:03:01] miso1337: i know too many forum admins to trust any forum with a password that's valuable
[03:03:05] s2013: k. anyways rails cant send email from localhost right?
[03:03:06] brownies: amh345: show us the logs, at least.
[03:03:07] miso1337: they sell lists to spammers
[03:03:07] amh345: is there anywhere that im missing that would say why the page isnt loading?
[03:03:18] amh345: btw, this is a production server.
[03:03:22] mrpennyworth: anyone install openjdk6 on osx
[03:03:33] Yakko: Bravebellows: they're like religion, everybody points fingers, but they were an important to get us where we are with the masses
[03:03:33] fryguy: s2013: you'd need to set up a mailserver, but sure
[03:03:59] s2013: k cause im using devise and i have to confirm an email for the user account to work
[03:04:01] s2013: not sure how to do that
[03:04:27] amh345: brownies: im downloading the log now. it's a large file.
[03:04:35] sevenseacat: s2013: use devise confirmable. its built in.
[03:04:42] s2013: i have config.action_mailer.default_url_options = { :host => 'localhost' }
[03:04:45] s2013: yes thats what i did
[03:04:55] s2013: i meant that i cant confirm it because emails arent being sent
[03:04:58] s2013: since im on localhost
[03:05:23] sevenseacat: use something like mailcatcher
[03:05:51] sevenseacat: http://mailcatcher.me/
[03:06:12] aamax: well, my idea worked: I can duplicate the problem i was having. the bootstrap gallery doesn't work right in production mode. unfortunately it isn't throwing any errors in the server log or in the js console
[03:06:17] s2013: k one sec
[03:06:21] aamax: so i'm not sure why (yet) :)
[03:06:39] amh345: i've checked the log… or tailed it. and i saw nothing at all in there that showed a timeout. or even an error.
[03:06:50] sevenseacat: amh345: whats your problem
[03:07:10] amh345: in mysql i run show full processlist and see the query run and stop.
[03:07:27] s2013: sevenseacat can i manually confirm the link?
[03:07:38] s2013: i mean confirm the account since i can grab the confirmation token from the db
[03:07:45] sevenseacat: why would you?
[03:07:49] amh345: sevenseacat: as of yesterday chrome started saying " no data recieved -Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data." when i hit my stats page.
[03:07:54] s2013: because im creating test account
[03:08:01] s2013: and it sends the confirmation email right
[03:08:06] amh345: im fairly certain it's because the queries are fairly massive.
[03:08:11] sevenseacat: use mailcatcher.
[03:08:13] s2013: yeah all the email is , is a link
[03:08:33] s2013: i understand but i mean can i still manually do it too? if i did what would be the url devise uses do you know?
[03:08:34] sevenseacat: how do you know the email is working unless you actually use it?
[03:08:35] amh345: i increased the timeout in database.yml to a ridiculous amount - but it made no difference.
[03:09:07] sevenseacat: use mailcatcher. move the hell on.
[03:09:20] sevenseacat: amh345: what do your logs say?
[03:09:21] louism2_: Hey guys, I am having an issue getting a form to submit via ajax when using 'data-remote=true'. If I set up the form as a 'form_for @model_object' it works. If I set it up as a generic form that routes to controller#action is submits as html. Here is the code that doesn't work: https://gist.github.com/louism2/5407427 . Any help would be greatly appreciated.
[03:10:00] amh345: sevenseacat: that's the problem for me. the logs when i tail them say nothing about an error. unless the tail is really delayed. i've just finished pulling the log- but it's 500 megs.
[03:10:00] sevenseacat: louism2_: makes sense, what is your create action supposed to render?
[03:10:12] sevenseacat: amh345: thats nice. tell us what they say.
[03:11:23] amh345: ugh. i cant open the log. out of memory error.
[03:11:40] amh345: im going to tail it again in production. then ill gist that.
[03:12:06] Radar: louism2_: you're not including jquery_ujs in your JavaScript for that page. Entire HTML output please.
[03:12:18] Radar: louism2_: Also: holy crap indentation.
[03:12:31] louism2_: sevenseacat: Maybe I don't understand but how does the controller action have anything to do with how the request is made?
[03:12:48] rhizmoe: amh345: probably want to turn off live queries if they're large. just cron the results every 5min or whatever, turn it down
[03:13:24] parndt: Joshsz: :|
[03:13:33] sevenseacat: louism2_: your form submits to a controller, right?
[03:13:56] louism2_: sevenseacat: yeah
[03:13:58] parndt: Joshsz: probably call parameterize on it to avoid commas etc
[03:14:12] sevenseacat: louism2_: and your controller renders a view right>
[03:14:57] louism2_: sevenseacat: yes
[03:15:21] sevenseacat: louism2_: so what is your create action supposed to render? because at the moment its looking for a create view
[03:15:27] sevenseacat: and not finding one, so it errors
[03:16:37] louism2_: sevenseacat: the request to the create action is being made as a html request, not a js request. I understand that the action is looking for a corresponding view
[03:17:00] sevenseacat: louism2_: show us the full logs plz
[03:17:22] amh345: here's the the relevant data from production.log https://gist.github.com/anonymous/5cd41a1d962127d16705
[03:17:38] amh345: Completed 200 OK in 66576ms (Views: 34655.8ms | ActiveRecord: 31890.2ms)
[03:18:01] Radar: 60 seconds.
[03:19:11] sevenseacat: what on earth are you doing that takes 60 seconds
[03:19:18] amh345: i've increased the timeout in database.yml to a ridiculous amount- but it still comes back as "No data received"
[03:19:38] sevenseacat: amh345: sounds like you need to cut that time down.
[03:20:16] amh345: sevenseacat: running calculations across a joins. and summing some values in another table thats about 150k rows.
[03:20:35] amh345: i dont believe it's ther 150k rows causing the delay.
[03:20:57] Radar: amh345: Please move those calculations out of the action and into a background task that updates something like Redis.
[03:20:58] amh345: it's the sums on the joins i think
[03:21:15] Radar: amh345: Don't make those calculations in process. Make them in a background job and then it'll be lightning quick to display that page.
[03:21:17] amh345: the calcs are in a scope right now.
[03:21:28] amh345: ok, redis.
[03:21:56] sevenseacat: stats pages are definitely something that should be calced and cached, not dynamic
[03:22:09] amh345: i had setup redis before before my 3.2 upgrade. but never ended up using it as 3.2 performed way faster. until now with all the data.
[03:22:12] sevenseacat: but either way, 60 seconds is an extroardinarily long time
[03:22:13] Radar: now srsly, bbl lunch
[03:22:46] amh345: up until a few days ago it was loading in about 10 seconds. now it's shot up like crazy.
[03:25:23] amh345: i would have thought increasing the timeout in database.yml would have at least allowed them to display
[03:26:19] sevenseacat: well youve given us very little to go on
[03:26:28] sevenseacat: your logs say the page renders successfully in 60 seconds
[03:26:48] sevenseacat: if chrome gives up and times out before that,thats chromes problem
[03:27:05] amh345: yeah. i know. not a lot to go on. i was really hoping for an error either in rails or nginx.
[03:27:15] sevenseacat: amh345: its not a rails or nginx problem.
[03:27:20] amh345: and it's not just chrome. FF and safari too. lord knows about IE
[03:27:21] sevenseacat: its a chrome problem.
[03:27:30] amh345: oh. you think it's a browser default timeout.
[03:27:38] amh345: ahhh. ok.
[03:27:42] amh345: thanks for confirming that.
[03:27:58] sevenseacat: im not confirming anything, im putting forward a theory based on minimal information
[03:28:18] amh345: got it. 1000% certain it's browser.
[03:28:37] sevenseacat: so the simple solution is, make the action quicker
[03:28:52] sevenseacat: whether you cache figures, or simplify html
[03:30:33] amh345: i've not done caching before.
[03:31:07] louism2_: radar: here is that gist with the full html. jquery_ujs is being loaded. Also, I know it works as I can make the ajax request if I change the form to a form_for @model_object as opposed to just a generic form_tag
[03:31:44] s2013: hmm mailcatcher isnt working. ~~> ERROR: Something's using port 1025. Are you already running MailCatcher?
[03:33:53] sevenseacat: thats a new one
[03:34:00] sevenseacat: what have you got on port 1025?
[03:36:29] s2013: nothing that i k now of
[03:36:48] sevenseacat: you should probably look.
[03:40:50] Radar: louism2_: I don't see a gist.
[03:47:53] s2013: sevenseacat sorry just saw the msg. how do i check? i have nothing on it
[03:48:04] sevenseacat: what OS are you on?
[03:49:27] s2013: windows 7
[03:49:30] louism2_: Radar: https://gist.github.com/louism2/5407427
[03:49:57] Radar: louism2_: bro, fix your indentation. It's tragic.
[03:50:18] Radar: I don't know why it's not submitting like it should be.
[03:51:05] emocakes: ACTION is listening to "Dancing Queen" by Wing, from the album Dancing Queen By Wing via Spotify.
[03:51:09] emocakes: do you like Wing Radar?
[03:51:17] emocakes: http://open.spotify.com/track/4ncJE9VLX71mLACpnKD4AC
[03:51:19] sevenseacat: oh lol windows
[03:54:19] Cakey: /nicklist screen
[04:01:39] louism2_: Radar: I don't know what the hell is going on with the indentation. Thanks anyways.
[04:02:47] Radar: louism2_: My guess is tabs and not spaces
[04:03:30] s2013: radar in your book on the chapter where you install devise and do user sign up, i did all that but how do i confirm the user?
[04:05:26] Radar: s2013: You would need to send the user an email.
[04:06:12] Radar: s2013: that's usually handled by Devise. Email's covered in a later chapter, I think 9 or 10.
[04:06:15] s2013: yes but if im on localhost how do i do it? i installed mailcatcher
[04:06:22] s2013: but its not working and i cant figure out how to get it to work
[04:06:47] Radar: I don't know, sorry.
[04:07:51] emocakes: could i get an autographed copy of the book if i wire you some money radar?
[04:07:54] emocakes: something like
[04:07:55] emocakes: to emocakes
[04:08:03] emocakes: from Ryan (Radar)
[04:08:07] emocakes: then your signature
[04:08:11] Radar: emocakes: how much money?
[04:08:18] emocakes: how much does the book retail worth?
[04:08:29] emocakes: plus some money for auspost
[04:08:34] emocakes: and a voucher for dan murphys?
[04:09:11] Radar: This is sounding better and better.
[04:09:30] Radar: Book retails for $50 on Manning's site.
[04:09:44] emocakes: what is the book about btw?
[04:09:47] emocakes: I don't evn know
[04:09:51] Radar: I don't know.
[04:09:55] amh345: so i temporarily fixed the stats by loading current week as default.
[04:10:02] emocakes: but at least I know you are open to it
[04:10:06] Radar: On Amazon's site it's $32.
[04:10:14] emocakes: how much you get from that
[04:10:26] emocakes: provided its a given that publishers generally screw you
[04:10:57] amh345: in respect to this caching deal. obviously it's all specific to how your data is laid out. but is there a gem or a go-to place for details on how to setup caching?
[04:11:23] emocakes: remind me not to write a book Radar
[04:11:52] Radar: emocakes: From LeanPub I get 90%.
[04:12:03] amh345: i thought about redis, but i dont think it's going to work for me as the clients need "INSTANT DATA NOAW" and at the rate this data renders at-- i'd need to offset redis by like 2 minutes.
[04:12:05] Radar: Manning it's 10% then after 5000 copies it goes up to a whopping 12.5%
[04:12:06] emocakes: how much does leanpub sell for?
[04:12:14] Radar: $15 now, $20 when I'm done.
[04:12:32] Radar: amh345: How long do the queries take to complete? You could still run background jobs.
[04:12:35] amh345: wait. so you arent getting rich off this book?
[04:12:44] Radar: amh345: No. Getting rich is never the plan.
[04:12:53] emocakes: its getting your name out there
[04:12:57] sevenseacat: if you write books to get rich, you're doing it wrong
[04:13:02] emocakes: +1 sevenseacat
[04:13:17] amh345: Radar: at this moment compiling 'all time stats' which is about a month and a half takes about 1.5 mins.
[04:13:55] amh345: i might be able to get away with rendering stats i think they'll need.. and then letting them submit for more data.
[04:13:59] sevenseacat: thats some seriously messed up queries
[04:14:11] amh345: but thats really presumptuous and always backfires on me.
[04:14:22] Radar: amh345: Ok then. What I would do is have a background job that runs every 5 minutes and updates the stats. That can account for some lag in the processing.
[04:14:37] Radar: amh345: And really, you could even make that simpler by tracking when the last time was that you did a count and then only counting from there
[04:14:59] amh345: ah. so i'd have a compiled stats table or something.
[04:15:06] amh345: and that's what they search on.
[04:15:07] Radar: "or something" yes
[04:15:29] amh345: i like it. thanks for the tips.
[04:15:41] amh345: sevenseacat: im sure that structure isnt the best. but it really is a lot of data.
[04:16:16] sevenseacat: amh345: 150k rows isnt a lot of data.
[04:16:19] amh345: i've managed to optimize on the upgrade (no longer need a crazy powerful db server or app server)
[04:16:22] emocakes: http://i.imgur.com/W5JCT3D.png
[04:16:42] amh345: sevenseacat: that's only one table. and it's the simple table.
[04:18:00] amh345: the bulk is coming from joining customers on orders. sorting net on quanitities pricing and shipping. and then the same for gross. then joining prod ids on product table.
[04:18:23] amh345: the then pairing sessions on the actual stat visit table.
[04:19:04] amh345: even hitting running the queries in mysql command line tables ages.
[04:19:24] sevenseacat: then you need some better indexing
[04:19:37] sevenseacat: or something. but without code, we cant help you.
[04:20:04] emocakes: amh, have you tried nosql?
[04:20:09] emocakes: its cloudscale ready
[04:20:17] sevenseacat: emocakes: dont troll
[04:20:27] amh345: the code could be optimized for sure. but i think it's indexing and such i need to look at.
[04:20:29] emocakes: what db server amh345
[04:20:43] amh345: mysql 5.5 innodb
[04:21:06] emocakes: are you doing the data manip in the db or in rails?
[04:21:29] amh345: the majority is done in scopes.
[04:21:33] amh345: err methods
[04:21:49] amh345: but there are some hacks done in rails. nothing severe though
[04:22:04] emocakes: hmm, have you tried, gasp, SP's?
[04:22:15] emocakes: and yah, make better indexes
[04:22:25] emocakes: get a sql explain and go into #mysql with it
[04:22:30] amh345: stored procedures ?
[04:22:35] emocakes: some mysql boffins could probably halp better
[04:22:45] sevenseacat: SPs are squick
[04:23:08] amh345: i havent done stored procedures in rails.
[04:23:18] emocakes: I use postgresql
[04:24:14] sevenseacat: Raddix64: hola
[04:24:30] amh345: 'people' (stackoverflow) are saying stored procedures in rails aint that great. lose benefits of AR and such
[04:24:32] Raddix64: Thanks sevenseacat
[04:24:51] emocakes: amh345, so, the majority of the time is coming from what? the query?
[04:25:15] emocakes: because if you have this one query which is taking up heaps of time, you might split it up into smaller queries and do the joining in code
[04:25:38] sevenseacat: emocakes: ew!
[04:25:49] emocakes: sevenseacat it works sometimes
[04:25:49] sevenseacat: the db is *always* quicker and more efficient than code
[04:25:53] Raddix64: I guess I have a convention question. I'm in need of a CSV import ability and I figure it'll either need to go in it's own controller, or in the controller of the thing I am importing a bunch of. What would you folk recommend?
[04:26:03] emocakes: we are talking mysql here sevenseacat ;)
[04:26:55] emocakes: just saying what I have had experience with
[04:26:57] tomo`: I get 503 error after deploying my production app with capistrano. Any idea how I can fix it?
[04:27:11] sevenseacat: tomo`: by seeing what the problem is and fixing it?
[04:27:12] emocakes: with postgresql though, I got no problem with query speed, even if they are complex
[04:27:21] sevenseacat: yeah well, lolmysql
[04:27:25] emocakes: using some of the native db functions help alot
[04:27:31] amh345: emocakes: there's no single query taking up a lot of time. there are probabaly 9ish methods across all the models that in some way or another join.
[04:27:34] tomo`: sevenseacat: you mean I should check the error log files?
[04:27:38] amh345: like, there's a where method.
[04:27:39] sevenseacat: tomo`: for a start
[04:27:40] emocakes: kind of amazed of all the db functions you can do
[04:27:46] tomo`: sevenseacat: thanks!
[04:27:59] emocakes: oh then amh345, then try and make a nice sql query for all of it
[04:28:22] emocakes: code will help
[04:28:26] emocakes: care to share your code
[04:28:31] amh345: yeah. ill post it.
[04:28:34] amh345: im prepping it now.
[04:29:17] amh345: when your'e saying nice sql query.. you're talking about raw sql?
[04:29:20] amh345: emocakes: ^
[04:29:43] emocakes: well if arel can't get it for you the way you want, then yeah, raw sql doesnt hurt
[04:30:22] amh345: it's worth a shot! hah.
[04:30:36] amh345: shouldnt take that long to refactor.
[04:30:44] emocakes: https://gist.github.com/kernel-io/5410139
[04:30:49] emocakes: i had something like before
[04:30:52] emocakes: worked a treat
[04:32:53] emocakes: https://gist.github.com/kernel-io/5410150
[04:33:00] amh345: ill give it a go. i also want to try radars suggestion of compiling the data every so often with a cron.
[04:33:10] emocakes: yup, that would be a smart idea as well
[04:33:23] amh345: although im unsure if he meant to dump it to another table or not. i think that's what he meant.
[04:33:32] emocakes: put it in a different datastore
[04:33:45] emocakes: its only temp data
[04:34:21] amh345: hmm yeah. true. i've not used redis for much of anything past a test with reque.
[04:35:23] amh345: here's a nice little article http://dev.mensfeld.pl/2011/11/using-redis-as-a-temporary-cache-for-data-shared-by-multiple-independent-processes/
[04:36:41] w32stuxnet: hi guys, when I use respond_with it isn't outputting the ID of the object which is supposed to be output
[04:37:30] amh345: thanks for the info emocakes. much appreciated.
[04:37:42] amh345: at least i have some next steps.
[04:41:28] helpa: w32stuxnet: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[04:41:28] Radar: w32stuxnet: !debug
[04:41:33] krz: http://pastie.org/7639827 why ?
[04:41:40] Radar: krz: because
[04:42:21] Radar: w32stuxnet: You should know better by now than to come here and ask questions without code.
[04:50:53] krz: radar why is it complaining about view_renderer
[04:55:08] Radar: krz: already told you
[04:55:28] Radar: krz: I've never worked with presenters so I really have no idea.
[04:59:39] helpa: http://guides.rubyonrails.org/association_basics.html#the-has_one-associatio
[05:10:56] helpa: (ノಠ益ಠ)ノ彡┻━┻
[05:15:11] Radar: pretty much
[05:15:21] axilaris: Radar, sevenseacat, all ... finally dumping mongoid... moving over to pg
[05:15:32] Radar: axilaris: thank you
[05:15:42] axilaris: just gave up
[05:16:15] Radar: It's ok to do that. You're still learning Rails and it's best to not confuse yourself with too many new things.
[05:16:32] sevenseacat: i dislike mongoid greatly
[05:16:47] thmz: morning!
[05:16:50] otters: it's also good to use pg
[05:17:08] lgarvey: sevenseacat: do you dislike mongo or mongoid?
[05:17:09] Radar: good morning thmz
[05:17:14] axilaris: maybe when bigdata is more mature... not workable for a small dude
[05:17:18] sevenseacat: lgarvey: mongoid.
[05:17:43] thmz: agree with Radar! Rails is big enough as it is! hehe
[05:17:51] lgarvey: sevenseacat: I always used mongomapper, everyone else seemed to jump on mongoid though
[05:18:22] sevenseacat: that being said, i dont see any real use cases for document databases in web apps. none that i've built, anyway
[05:19:22] lgarvey: I've built a system that relied pretty heavily on map reduce, mongo was a good fit for that
[05:19:23] Radar: Truth be told, I use MongoDB for the book review tool I wrote. It works fine for that purpose.
[05:20:12] axilaris: lgarvey...u'ved got lots of data ?
[05:20:14] sevenseacat: oh it works fine for a lot of purposes, but postgres or anything relational would work just fine for that purpose too
[05:20:35] lgarvey: axilaris: I was making a system to do television ratings calculations
[05:20:56] lgarvey: axilaris: so it was ~1million data points per day
[05:21:02] axilaris: lgarvey...k
[05:21:40] axilaris: might consider a mix later...pg and mongo
[05:21:59] sevenseacat: if you need it, do it. chances are, you won't.
[05:22:01] lgarvey: axilaris: just get comfortable with rails using postgres or mysql first
[05:22:24] sevenseacat: choose the simplest plan of attack. adjust later if *necessary*
[05:22:28] krz: 1m data pints per day? isn't that too heavy on mongo?
[05:22:33] krz: points*
[05:22:40] axilaris: not taking any chances now
[05:22:40] lgarvey: krz: not at all
[05:22:52] krz: thats considered big data already
[05:22:58] rylwin: Is it true that Mongo drops data? Or was that a nasty rumor someone was spreading on HN?
[05:23:01] krz: mongo isn't the best solution for big data
[05:23:27] lgarvey: krz: it worked extremely well for the purpose I was using it for
[05:23:32] sevenseacat: rylwin: bit of a loaded statement
[05:23:37] lgarvey: krz: it's true that hadoop might have been "better"
[05:23:42] krz: 1m data / data plus aggregation and heavy sql queries. id consider hadoop
[05:23:44] lgarvey: krz: but then I would have had to use hadoop
[05:24:17] lgarvey: I've come to to the conclusion that I must not be as smart as enterprise developers
[05:24:17] krz: there are hadoop clusters in the cloud, with ruby wrappers
[05:24:25] lgarvey: I don't really understand SOAP, or hadoop
[05:24:26] rylwin: sorry. I remember looking at NoSQL (didn't have a use, but wanted to learn abt it) and came across some stuff about mongo and reliability. but i couldn't determine if a bunch of BS or not
[05:24:33] sevenseacat: lgarvey: you're more enterprise than me.
[05:24:47] sevenseacat: biggest app ive ever worked on has like 2000 users
[05:24:52] lgarvey: rylwin: if you're foursquare you might have data problems with mongo
[05:25:00] lgarvey: rylwin: but you aren't foursquare
[05:25:11] lgarvey: rylwin: but if you were you'd have problems with every database
[05:25:14] rylwin: lgarvey: you're right...im not :(
[05:26:25] krz: or even something like keen.io
[05:26:58] lgarvey: krz: I agree with you up to an extent. By choosing Hadoop or something similar at the start you might avoid some future pain if your product is successful.
[05:26:58] axilaris: i read this a long time ago http://highscalability.com/blog/2012/4/9/the-instagram-architecture-facebook-bought-for-a-cool-billio.html
[05:27:07] axilaris: using pg ...
[05:27:09] lgarvey: krz: but you give yourself some current pain because it's hadoop.
[05:27:21] thmz: http://gist.github.com/thomasstr/ anybody know how to get rid of that error? have tried everything (Mac OS X)
[05:27:58] lgarvey: thmz: what gems are you using there?
[05:28:02] krz: if you plan on "tracking everything and anything", id go the hadoop direction. but for basic analytics pg or mongo works more than well
[05:28:34] krz: but 1m / day, sounds like big data
[05:28:40] thmz: lgarvey: Rapns for handling notifications with Google Cloud Messaging
[05:28:40] lgarvey: it really isn't
[05:29:07] lgarvey: we had systems that dealt with that load just using flatfiles
[05:29:08] sevenseacat: tbh i'd defer the pain to later 'if the product is successful'
[05:29:16] rylwin: thmz: not very familiar w/ rapns...make sure to set the right cert?
[05:29:25] sevenseacat: because chances of that happening are small and pain sucks
[05:29:35] lgarvey: the problem is they were slow.. it would take 15 minutes to generate the XML. The mongo system did it in ~30 seconds.
[05:29:56] thmz: rylwin: are you familiar with any other gem for google cloud messaging?
[05:30:12] krz: yea the paradigm "minimum viable product" applies here. scale when needed
[05:30:20] rylwin: thmz: wish I could help. It's not something I've looked into
[05:30:41] lgarvey: thmz: I use gcm
[05:31:03] lgarvey: thmz: https://github.com/spacialdb/gcm
[05:32:35] thmz: lgarvey: does the gem take care for adding devices also?
[05:32:37] lgarvey: I think that in general mongo gets a bad rap. It's a pretty decent system that's useful for a wide range of applications. I'd say that it was/is oversold.
[05:32:46] lgarvey: thmz: adding devices?
[05:33:41] thmz: lgarvey: devices as android phones.. when you execute the app you check if the phone is registered or not
[05:33:44] sevenseacat: i have no problem with in in theory, i just have troubles finding places where it would be the best choice, in practice
[05:33:56] lgarvey: When an android device hits our API we register their token in our database.
[05:34:15] lgarvey: sevenseacat: I'd say it's because pg is just so damn good
[05:34:25] sevenseacat: lgarvey: yep.
[05:34:49] rylwin: axilaris: thanks for the link. good stuff. bookmarked :)
[05:35:57] rylwin: longtime mysql user here, recently started using pg on new projects...i'll never go back
[05:36:33] lgarvey: thmz: Rapns looks complicated. We use an apn_sender gem and gcm which I've wrapped in a single interface.
[05:37:52] thmz: lgarvey: which apn_sender?:)
[05:39:17] lgarvey: thmz: https://github.com/sentia/apn_sender
[05:39:52] lgarvey: I'm not sure if I like it that much though. I prefer how gcm works.
[05:41:29] Mendon: So I need a way to have one table full of item references, and have multiple models able to have multiple groupings of those items. Right now I'm accomplishing this via: https://gist.github.com/anonymous/5410401.
[05:42:06] Mendon: The problem comes in that I've hit a point where I'd like "users" to potentially have multiple groupings of items, using that same join table (so that down the line if I ever need to edit something for a user I can do it en-masse from one table for example.).
[05:42:32] Mendon: So a user would have his "items" and his "equipment" for example. The only way I can think of doing it is having another polymorphic "EquipmentContainer", which then has inventoryable.
[05:43:15] Mendon: Maybe a polymorphic has_many :through would solve all my problems, but I can't wrap my head around it.
[05:44:10] rylwin: Mendon: you could add another field to Item or InventoryItem to denote the group it belongs to
[05:44:46] rylwin: Mendon: Also, why do you have Item and IventoryItem? What are you getting for the extra layer?
[05:45:03] Mendon: A single item database. The item layer would contain common attributes.
[05:45:16] Mendon: Consider it my alternative to a join table.
[05:45:28] Mendon: Or a through table, rather.
[05:46:15] rylwin: So why not have a habtm relationship btwn User and Item? I must be missing something
[05:46:29] rylwin: Oh...to avoid the join table
[05:46:32] Mendon: Because pets can have items too.
[05:47:12] Mendon: So instead of a join table per model I've now got a join table for every model.
[05:47:16] rylwin: Oh I see that now...no poly habtm
[05:48:03] Mendon: I considered the grouping, but I don't know how to make it work so I can say something like, has_many :equipment_items, :class_name => InventoryItem, :onlyifthegroupisthis => "Equipment"
[05:48:17] sevenseacat: conditions on the association?
[05:48:23] Mendon: Can you do that?
[05:48:24] rylwin: I think you can use :condition => "Equipment"
[05:48:31] rylwin: on the association, yes
[05:48:33] sevenseacat: conditions: { group: 'Equipment' } or something?
[05:48:44] rylwin: yes, what sevenseacat said
[05:48:53] Mendon: Will that define a proper setter as well?
[05:49:04] Mendon: So I can do user.equipment_items << item.
[05:49:06] sevenseacat: http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-has_many see conditions
[05:49:07] rylwin: I think if you stick w/ symbols then yes
[05:50:17] sevenseacat: one example i did recently (dont judge me) -has_many :standalone_addresses,     :class_name => 'Address',     :as => :addressable, :conditions => proc { ['id NOT IN (?)', supplier_branches.map(&:address_id)] }
[05:50:30] sevenseacat: you can do some funky stuff
[05:50:36] Mendon: Awesome. Thank you both.
[05:50:59] Radar: ACTION is totally judging right now
[05:51:03] rylwin: I hope you included supplier_branches and didnt let that N+1 :)
[05:51:03] Mendon: Now...anybody know if a polymorphic has_many :through relationship would somehow make this better?
[05:51:04] sevenseacat: DONT JUDGE ME
[05:51:09] Mendon: My thought is I could define the source_type.
[05:51:11] Radar: ACTION judges harder
[05:51:22] sevenseacat: rylwin: maybe,,, possibly.... *runs off*
[05:51:40] rylwin: we've all done it :)
[05:52:15] rylwin: I think the biggest thing I learned last year as the difference btwn #includes and #preload. I need to learn to update Rails docs, cause someone needs to get that in the docs
[05:52:51] rylwin: Mendon: I think you could manage to get a :through working there...sometimes it's tricky and you have to write a joins query yourself
[05:52:57] tobi_: is here any rails4 developer? i have a problem with strong parameters (nested form doesn't get *._attributes at param) e.g. https://gist.github.com/HappyTobi/f25912f79e3534f14bb3
[05:53:22] Mendon: It'd be neat if I could avoid the InventoryItem layer entirely via something like that.
[05:53:42] Mendon: Or well, the self-defined hacky InventoryItem layer.
[05:53:52] rylwin: Mendon: you certainly could, though you may lose some built-in sugar from Rails
[05:54:40] Mendon: Well, guess I'll ignore it. This should be just as fast.
[05:54:43] sevenseacat: tobi_: your params have no doc_screenshot attributes
[05:54:44] Mendon: Time to write the spec.
[05:54:47] Mendon: Thanks again.
[05:55:04] rylwin: Mendon: woah. spec *after*.. :) jk..good luck
[05:55:07] helpa: tobi_: If you're not getting an answer here perhaps try asking on http://stackoverflow.com Use the tag "ruby-on-rails"
[05:55:07] Radar: tobi_: !so
[05:55:18] helpa: tobi_: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[05:55:18] Radar: tobi_: !gist-usage
[05:55:50] Mendon: rylwin: No, spec before. Had to decide if I needed an EquipmentContainer or not. ;)
[05:55:53] Radar: tobi_: and on the final line of that, define what "this" is
[05:56:21] krz: is it fine if a presenter class calls a service object class?
[05:56:38] krz: both are classes, but different scopes
[05:56:50] krz: or does that sound like fishy design?
[05:58:24] krz: should presenter classes call service object classes?
[05:58:43] tagrudev: any suggestion for simple email notification managing gem :?
[05:58:44] Radar: krz: nobody knows what you're talking about when you use just words
[05:58:55] tobi_: sevenseacat: when i read the api of rails4 strong parameters: http://edgeapi.rubyonrails.org/ the accepts_nested_attributes_for "className"... should have the parameter name "className"_attributes as attribute
[06:01:47] rylwin: Radar: you seem like someone who really knows his rails. One of the best things I ever discovered in Rails is #preload (http://api.rubyonrails.org/classes/ActiveRecord/QueryMethods.html#method-i-preload). There is no documentation for this method. I've been a long time user but never contributed to Rails. I'm thinking about writing a doc for this method. Would this be a good thing to do? Or is it
[06:01:48] rylwin: possible this is a method that is public but should not be used? Hope this isn't too weird a question.
[06:02:22] Radar: rylwin: I think you should submit a patch to document that method.
[06:02:40] rylwin: Radar: sweet. First contribution, here I come
[06:02:56] Radar: rylwin: I think lifo/docrails is still public write accessible
[06:03:15] Mendon: Dude, Rails automatically figures out default values from the DB?
[06:03:20] Mendon: I had no idea. That is amazingly cool.
[06:04:21] tobi_: sevenseacat: http://edgeapi.rubyonrails.org/classes/ActionController/StrongParameters.html
[06:05:17] sevenseacat: tobi_: cool story. doesnt address what i said at all
[06:06:13] tagrudev: :D dude where's my attributes
[06:07:27] tobi_: sevenseacat: sorry i updated the gist there was an error on parametes part: https://gist.github.com/HappyTobi/f25912f79e3534f14bb3
[06:07:38] rylwin: Radar: thanks. I think you're right. I was just reading through the rails guide on contributing to documentation
[06:08:29] sevenseacat: tobi_: great, now gist the rest of the code.
[06:09:29] Mendon: Alright, -almost- done. This conditions means that I have to add a condition whenever I add a has_many. I added a default value for when a category isn't specified - is there any way I can make it so has_many relationships pointing to InventoryItem uses a condition by default?
[06:09:48] sevenseacat: tobi_: you're also likely going to have trouble withing directly with a through association like that
[06:09:51] Mendon: So I don't have to add a category when I just want a basic inventory. It might be too much to ask, but meh.
[06:09:52] sevenseacat: *working directly
[06:10:42] sevenseacat: tobi_: also, you cant have a file field of type multiple.
[06:12:56] tobi_: sevenseacat: ok so you think i have so change the create method? updated the gist: https://gist.github.com/HappyTobi/f25912f79e3534f14bb3
[06:13:52] Mendon: Got it. Tests say default_scope on InventoryItem fixes it.
[06:14:01] sevenseacat: tobi_: you're not calling the create action.
[06:14:15] sevenseacat: tobi_: you're editing an existing document.
[06:15:23] tobi_: sevenseacat: update gist. I create the objects in the new method is there the error?
[06:15:49] sevenseacat: tobi_: you're not listening to me.
[06:15:56] sevenseacat: you're not working with a new document.
[06:16:02] sevenseacat: your new/create is irrelevant.
[06:16:26] sevenseacat: the error says you're submitting an ID. the params say you're submitting an ID. new objects don't have IDs.
[06:19:18] tobi_: sevenseacat: ah ok thx sorry
[06:20:23] tobi_: ok i know why, because before i see the form i have a link to new_document_path... the document will be create there and after filling the form i gets an update
[06:20:50] sevenseacat: thats not what your code says
[06:21:26] tobi_: i dont past the html site where have to click to get to the form
[06:22:42] sevenseacat: thats nice - your new_document_path does not create a document.
[06:26:34] tobi_: sevenseacat: thx for help ill will check the complete code
[06:30:42] Radar: yay it's done
[06:30:50] Radar: for vague values of "done"
[06:31:01] Radar: https://github.com/radar/spree/commit/5974c51d3f214b9b7d78359ca0e370542ce4fc76
[06:31:40] Radar: CHECK_TRANSLATIONS=1 bundle exec rspec spec on Spree's core will now show a) translations that are referenced but don't have a matching key and b) translations not referenced at all within the tests
[06:32:34] tbuehlmann: Radar, any reason why you use == instead of eq in rspec? it's raising warnings
[06:32:46] Radar: tbuehlmann: I hate freedom, mostly.
[06:33:50] Radar: I can switch that over now.
[06:34:12] axilaris: i need to ask a bit on relationship... i noticed from here http://guides.rubyonrails.org/association_basics.html, foreign keys have its on field in the migration table. do we need to create those fields explicity like using general model customer foreignkey:integer ?
[06:34:24] Cork: does anyone have a page describing how its meant to send js and html for ajax in rails?
[06:34:39] Mendon: So FactoryGirl persists items that are generated via f.association.
[06:34:40] Cork: the only ways to do it that i've found has always resulted in having to fight with rails
[06:34:55] Mendon: Anyone know a way I can make that -not- persist, to speed up my tests?
[06:34:58] axilaris: say u have sales and customer... customer has many sales... in the sales model... how do i create the foreignkey to customer ?
[06:35:32] tbuehlmann: Radar, great
[06:35:49] Mendon: rails g migration sale customer:references
[06:36:53] sevenseacat: tobi_: please do not PM me.
[06:37:08] tobi_: sevenseacat: sry
[06:37:36] axilaris: Mendon... ok let me try that
[06:38:36] tobi_: sevenseacat: you told me something like: thats nice - your new_document_path does not create a document. .. but why? when i print out <%= debug @document %> i see that there is no id
[06:38:53] sevenseacat: it does not create a document.
[06:40:58] tobi_: but its ok or not? i create the document in the create method of documents_controller so when i submit the form, i'll create the object
[06:41:10] Mendon: So my rspec test suite is already taking two seconds to run, with 37 tests. Can that be improved?
[06:41:27] Mendon: Two seconds with a preloader.
[06:41:36] sevenseacat: Mendon: that would depend on what they are and what theyre doing
[06:41:39] fwchld: dudes - what is the best way of setting default values for a nested resource of user once you've created a new user? should it be done in the new method of the controller or through some other means?
[06:42:03] sevenseacat: fwchld: in the database migration? :)
[06:42:46] royvandermeij: fwchld: or create a UserCreator class which handles these kind of things
[06:43:26] fwchld: royvandermeij: i was thinking of calling the method set_default_values or something in the controller after the new action was called. just wanted to know what best practice was..
[06:44:56] wishfoundry: can you generate a relationship?
[06:45:00] royvandermeij: fwchld: I prefer to put those things in seperate classes, so you don't clutter your models
[06:45:25] fwchld: wishfoundry: I've already got the relationships set up
[06:45:46] royvandermeij: fwchld: also makes it really easy to test without the need of a complete rails stack
[06:45:48] wishfoundry: no no, I don't mean anythoing related to you
[06:45:57] fwchld: wishfoundry: oh lol
[06:46:11] wishfoundry: I want to know if there is a scaffold for relationships
[06:46:38] fwchld: royvandermeij: so how would that UserClass work then? the controller would call the UserClass and that would go and do its thing?
[06:47:28] royvandermeij: fwchld: yeah, and it returns a user so your views can stay 'dumb'
[06:48:07] fwchld: ok. i'll give that a shot. thanks
[06:48:32] royvandermeij: fwchld: if you like this approach I recommend http://objectsonrails.com
[06:48:59] royvandermeij: it's a free book by one of the best Object Oriented programmers I know
[06:49:10] tobi_: sevenseacat: so last question: you told me: "you're also likely going to have trouble withing directly with a through association like that" how do you fix the problem?
[06:49:43] sevenseacat: by not working directly with a through association like that? i dont know if thats the problem, you didnt show enough code to say even when i asked you repeatedly.
[06:50:11] fwchld: royvandermeij: ok i'll give it a read. i'm still learning rails so might be a bit much for me but probably better to learn better at the beginning :)
[06:51:02] tobi_: sevenseacat: ok i'll post more code
[06:51:57] royvandermeij: fwchld: true :)
[06:53:32] tobi_: sevenseacat: now the complete code: https://gist.github.com/HappyTobi/ca607da1620dfe4eac14
[06:55:46] Nom-: Anyone used Capybara in a scenario where a chain of AJAX calls happen? I've got one of those scenarios and it's checking for content before the page finishes loading :(
[06:57:30] axilaris: Mendon... if i execute this, it doesnt seem like its adding any new column for foreignkey - rails g migration sale customer:references
[06:58:23] sevenseacat: tobi_: i suspect that because app_screenshot belongs to app_info, the form should reflect that and the fields for the screenshot should be inside the fields for the app_info block
[06:58:32] tobi_: axilaris: show the migration file please
[07:00:39] axilaris: http://pastie.org/7640637
[07:00:42] axilaris: doesnt seem much
[07:00:47] helpa: Nom-: 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.
[07:00:47] brownies: Nom-: !code
[07:01:21] Mendon: axilaris: If you're adding a new column do rails g migration AddCustomerToSales customer:references
[07:01:22] axilaris: with mongoid... relations are done with has_many and belongs_to.. and i can just add them directly in the document without specifying additional fields in the model
[07:01:23] Nom-: It's not really a code problem but I can write a more detailed problem description which will probably help
[07:01:36] Nom-: Let's see... one moment
[07:01:38] brownies: Nom-: see also the AJAX section of https://github.com/jnicklas/capybara
[07:01:48] brownies: Nom-: you need to use particular matchers that have waiting behavior baked in
[07:01:56] sevenseacat: axilaris: the migration generator doesnt take parameters like that unless you name it properly
[07:02:02] axilaris: mendon...that should add a new customer_id into sales ?
[07:02:05] brownies: (see the README, i mean)
[07:02:10] sevenseacat: axilaris: http://guides.rubyonrails.org/migrations.html#creating-a-standalone-migration
[07:03:31] axilaris: seacat...ok thanks... do we still need to specify has_many or belongs_to for relationships ?
[07:04:29] Nom-: ah, bumping the wait time looks to have fixed it
[07:04:36] Nom-: painful though
[07:04:44] axilaris: seacat.. i mean if there is 2 tables related... customer and sales... in customer do i have to specify has_many sales ? and vice versa
[07:05:06] sevenseacat: axilaris: you're killing me here
[07:05:07] winux: is there a method to unescape a string with escaped characters?
[07:05:17] sevenseacat: axilaris: how have you been here so long without setting up a single association
[07:06:41] tobi_: sevenseacat: its really a pain i don't find why its wrong (i changed the code but it doesn't work https://gist.github.com/HappyTobi/ca607da1620dfe4eac14)
[07:08:21] axilaris: i have but not on activerecords
[07:09:51] seba4: one question ... is it possible to send data into model ... just that it checks validations if ok returns true ... but without save?
[07:11:33] winux: seba4: have you tried using .valid?
[07:11:37] cyclic: I setup a local instance of ruby on rails and I have a ruby on rails application on github that I've cloned locally. How can I import/load this project into my local environment?
[07:11:41] seba4: oh i suspect ...@post = Post.new(params[:post]) @post.valid?
[07:13:30] winux: cyclic: Well it sounds like you already pulled it into your local environment if you cloned it onto your box
[07:14:02] cyclic: so how can I get it loaded up and view it on a web server etc?
[07:14:17] winux: cyclic: Ah, try 'rails s'
[07:14:40] winux: cyclic: in the application's directory
[07:14:45] falkner: cyclic: gem update -> gem install --without production -> rails s
[07:15:04] falkner: cyclic: while pwd is your cloned rails project
[07:15:08] cyclic: I setup ruby on rails locally using this articlehttp://createdbypete.com/articles/ruby-on-rails-development-with-mac-os-x-mountain-lion/
[07:15:17] seba4: thx winux this .valid? will be just fine:)
[07:15:29] winux: seba4: great :)
[07:16:03] cyclic: falkner: invalid option --without
[07:16:45] winux: try gem install
[07:17:19] cyclic: I did gem update and it's updating builder
[07:17:35] winux: yea itll do a bunch of gems
[07:17:55] cyclic: but gem install?
[07:18:23] cyclic: ERROR: While executing gem ... (Gem::CommandLineError) Please specify at least one gem name (e.g. gem build GEMNAME)
[07:18:41] winux: cyclic: try bundle install
[07:18:44] cyclic: what am I installing?
[07:18:56] winux: cyclic: the gems required by the application
[07:19:09] cyclic: bundle install is getting stuff now
[07:19:19] cyclic: oh this is nice :)
[07:19:30] winux: think of them as plugins your app uses
[07:19:39] cyclic: right, I understand that
[07:19:54] cyclic: <-- C,C++,C# developer
[07:20:02] cyclic: new to ruby on rails
[07:20:14] cyclic: neeeewwwb
[07:20:27] winux: after that, run rails s .. you should be able to view the app on http://localhost:3000/
[07:20:54] cyclic: looks like it's grabbing tons of gems
[07:21:14] winux: cyclic: yeah there can be a few depending on the app
[07:21:27] cyclic: winux: thanks for helping me... you too falkner
[07:21:42] cyclic: winux: I have another quick question.
[07:21:47] cyclic: well, maybe quick
[07:24:02] winux: cyclic: ?
[07:24:36] cyclic: I'm using actionmailer in this app in production, and I turned on logging and set the configuration to debug, set all the options required for actionmailer to output errors, etc. (set config.action_mailer.raise_delivery_errors to true, config.action_mailer.perform_deliveries = true, config.log_level = :debug). and I see the email sending in the log files.
[07:25:23] cyclic: I can send individual emails and I have debug statements that show that the code is getting executed, but when I send a bunch of emails consecutively, I, and the users, just don't get them.
[07:25:52] sevenseacat: is your mail server sending them?
[07:25:56] cyclic: But I literally use the same cron job to call into the same actionmailer class to send a single email to myself, and it works.
[07:25:58] winux: cyclic: hmm, are you using postfix?
[07:26:08] cyclic: yes, bsd postfix
[07:26:16] sevenseacat: code? logs? anything?
[07:26:35] Nom-: Which transport are you using? Sendmail?
[07:26:38] cyclic: let me get the codes :)
[07:26:52] cyclic: this is what's in the config: config.action_mailer.delivery_method = :smtp
[07:28:14] Nom-: Ok, and you've configured it for localhost or something like that?
[07:28:34] Nom-: I'd start checking the MTA Logs if that's the case... make sure it actually accepted the emails, and then see what it did with them
[07:31:03] winux: cyclic: fyi you can also set delivery_method to :sendmail
[07:31:43] falkner: cyclic: Oh yeah, sorry, it's early in the morning here. bundle install --without production
[07:31:50] cyclic: https://gist.github.com/Cyclic/5410882
[07:32:26] cyclic: it says installed into ./vendor/bundle
[07:32:35] cyclic: now do rails s?
[07:33:26] falkner: cyclic: Then go to your browser at http://localhost:3000
[07:33:27] cyclic: so that gist was the log
[07:33:46] cyclic: hrrm rails s Rails is not currently installed on this system. To get the latest version, simply type: $ sudo gem install rails
[07:33:55] cyclic: that's the message
[07:34:02] cyclic: when I do rails s
[07:34:17] falkner: try do "bundle exec rails s"
[07:34:26] falkner: Are you using rbenv or RVM ?
[07:35:21] jeebster: is anyone familiar with paperclip s3 functionality? I need to update my attachment in my DB and in S3, are there any available methods to easily complete this?
[07:35:47] falkner: What did "bundle exec rails s" do for you cyclic?
[07:36:00] seba4: does there exist any page that has yml for localization. I need it for active record and this stuff..
[07:36:03] cyclic: falkner: should i do RAILS_ENV="development" before running bundle exec rails s?
[07:37:07] cyclic: falkner, progress
[07:37:20] cyclic: vendor/bundle/gems/mongo-1.5.2/lib/mongo/connection.rb:413:in `connect': Failed to connect to a master node at localhost:27017 (Mongo::ConnectionFailure)
[07:38:11] falkner: Seems you don't have a MongoDB server instance running cyclic
[07:38:35] cyclic: I thought I installed and started it...
[07:38:53] cyclic: mongo command not found
[07:38:56] cyclic: is it a gem?
[07:39:24] cyclic: oh installing now
[07:39:58] falkner: Also check your config/database.yml and see if it has the right credentials for connecting to your database cyclic
[07:41:24] cyclic: I switched the config to sendmail... testing again
[07:42:00] cyclic: mongodb still building on dev
[07:44:53] cyclic: falkner: I switched to sendmail and was able to send the individual test email. Now I'm going to run the batch loop that sends a bunch and see what it does.
[07:45:15] cyclic: mongodb still compiling in dev btw...
[07:45:45] sevenseacat: how are you even running your server without mongo, if your app uses it?
[07:46:18] cyclic: sevenseacat: prod is working ... dev is building
[07:46:47] futhr_: Anyone know issues add_runtime_dependency vs add_dependency (both used with add_development_dependency)?
[07:46:58] Guest28427: anyone has experience with ror and nginx?
[07:47:11] seba4: how is it possible to load one yml file into another .... just to order i18n a bit better
[07:47:46] sevenseacat: seba4: you dont need to. rails will load any yml in your locale folder
[07:48:25] futhr_: seba: add subfolders for each locale
[07:48:50] seba4: oh so he knows which language it is based on first line
[07:49:09] futhr_: seba4: config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s]
[07:50:00] seba4: this goes?
[07:50:16] futhr_: seba4: application.rb
[07:50:56] sevenseacat: seba4: and by the filename, eg. foo.en.yml
[07:51:01] nomad: google map on rails_admin?
[07:53:58] cyclic: falkner: here is the actionmailer source that isn't working: https://gist.github.com/Cyclic/5410984
[07:54:10] seba4: thanks ..
[07:54:13] cyclic: well, not sure if it's the source that's failing since I see the message body getting generated in the log file
[07:55:23] cyclic: send_test_email works fine
[07:59:41] Masoud21: best ORM for cassandar with rails?
[08:03:51] falkner: cyclic: did you do a "bundle exec rake db:migrate" ?
[08:03:55] cyclic: falkner: yay, it works!
[08:04:00] cyclic: no migrate
[08:04:12] cyclic: just the bundle exec you said before
[08:05:53] winux: how do i gsub two backslash characters with a single backslash?
[08:06:17] winux: gsub(/\\/,"\\") isn't cutting it
[08:06:19] cyclic: what does migrate do?
[08:06:29] cyclic: sorry winux, go ahead ;)
[08:06:55] cyclic: btw, thx falkner ...
[08:10:42] rauchy_: Guys, do you know how I can create an ActiveRecord validation on presence of :foo OR :bar, without writing a custom validator?
[08:14:49] Cakey: rauchy_: really ugly.. validates :bar if: unfoo?
[08:14:59] Cakey: validates :foo if: unbar?
[08:15:09] Cakey: but realy really really ugle
[08:15:23] Cakey: *validates_presence_if
[08:15:30] Cakey: fucking keyboard
[08:15:31] rauchy_: Cakey: thought of that, but that will yield two errors, while I'm looking for one "foo or bar must be filled"
[08:15:56] Cakey: why not write a custom validator?
[08:16:46] Cakey: validate :has_foo_bar
[08:16:47] sevenseacat: a custom validator is like two lines
[08:17:13] Cakey: def has_foo_bar ... errors.add blabla if (blabla
[08:17:39] Cakey: and yeah write a custom validator, i can't imagine any reason not too aside from laziness
[08:17:59] rauchy_: Cakey / sevenseacat: just because I have to translate my custom error message to 7 languages :/
[08:20:46] sevenseacat: rauchy: how does that relate to having a custom validator?
[08:22:42] Cakey: afaik rails does not have a translation mapping for something like "X or Y needs to be filled up"
[08:23:00] Proshot: i am trying to import some data into the database via a rake task, but it does not seem to work so whats wrong with the script https://gist.github.com/anonymous/e24d6eb9a4644c4d5bae
[08:24:19] sevenseacat: Proshot: your Book objects are probably invalid
[08:24:27] sevenseacat: make it create! and see if it explodes
[08:26:49] Proshot: sevenseacat: this is my error message i get back https://gist.github.com/anonymous/3b7286db90e2d08d46dc
[08:27:31] sevenseacat: wrap your hash in brackets - it thinks you're giving create a block, not a hash
[08:29:37] Proshot: now its creating some rows in the database which is the primary key and the t.timestamps but not the data :) but we have progress
[08:31:06] sevenseacat: time to learn how to debug :)
[08:31:17] _axx: hey guys, i have some models in my rails app that use another db connection, i use establish_connection in certain models - but now i want to use establish_connection depending on my environment (dev/production) what's the best way to do it? https://gist.github.com/aleks/410800561c3531b8afd2
[08:35:47] brownies: _axx: if Rails.env.production?; do_stuff_here(); end;
[08:45:25] maloik: Does anyone here use shopify's Dashing? I just made a simple widget that keeps track of time passed since a certain event, and it resets when a post request comes in, but I'm just wondering if there's no way to store this rather than have it reset upon each page refresh
[08:45:48] maloik: if our dashboard were to go down, I'd rather not have the counter start from scratch especially for things like 'time since last deploy'
[08:46:07] universa1: maloik: having used dashing, but why not put in a db?
[08:47:22] maloik: well I could add a db but it sounds a bit overkill for this, especially considering all other data is from api's and such
[08:47:39] maloik: we're also running it on a raspberry pi linked to a tv so I want to keep it lightweight
[08:47:40] universa1: maloik: write it in a file?
[08:48:19] universa1: sqlite3 db shouldn't be much overhead, and i find it simpler to use for data ;) but a yaml file might be suitable, too
[08:48:37] maloik: that's what I was thinking too, just checking if there wasn't something obvious that I missed :-)
[08:48:45] mauro1254: Hi guys, I need help with https://gist.github.com/sbu/5411249
[08:49:27] mauro1254: Many thanks in advance.
[09:06:56] maloik: universa1: we're going to try localStorage :-) should do the job nicely
[09:11:07] _axx: brownies: does that work outside of methods?
[09:14:54] ksinkar: does spork work with debugger gem instead of ruby-debug?
[09:22:59] ARMIGER1: Hi. I'm trying to add a custom date format to Time::DATE_FORMATS, but it's giving me a NameError and says that Time::DATE_FORMATS is uninitialized. If there's an example there on api.rubyonrails.org, why won't it let me add a custom format?
[09:24:42] ARMIGER1: Also, can anyone hear me? I'm not sure if I'm being told to re-register my nickname.
[09:25:59] ARMIGER1: Hmm... Looks like nobody can hear me. I guess I'll leave and come back. Perhaps it'll let me talk then. I know for a fact I've already identified myself to the server.
[09:26:23] Hates_: yes we can hear you
[09:26:40] ARMIGER1: Hates_: Ok, good. I was worried there for a sec.
[09:27:08] ARMIGER1: Hates_: I thought that ChanServ was telling me to re-register. It confused me.
[09:28:01] Hates_: ARMIGER1: Time::DATE_FORMATS should be initialized where are you adding your date formats? In an initializer?
[09:28:12] ARMIGER1: Hates_: Yes.
[09:28:35] Hates_: ARMIGER1: And if you type Time::DATE_FORMATS in your console?
[09:28:49] Hates_: ARMIGER1: please show your initializer code
[09:28:52] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[09:28:55] ARMIGER1: Uninitialized constant.
[09:29:19] Hates_: ARMIGER1: What version of rails?
[09:29:40] ARMIGER1: Hates_: 3.2.11
[09:30:14] ARMIGER1: https://gist.github.com/ARMIGER1/e7bbdebc6b2449b17614
[09:30:50] Hates_: ARMIGER1: hmmm strange, they work fine for me
[09:31:15] Hates_: ARMIGER1: so those calls dont work in your console?
[09:31:22] ARMIGER1: Odd... Now I'm no longer getting the NameError. Let me see what happens if I try that call again.
[09:32:38] ARMIGER1: Hates_: Now it's working. Very odd...
[09:32:45] Hates_: ARMIGER1: 8)
[09:33:25] ARMIGER1: Hates_: Thank you. I have no idea why it was happening, but it appears to be fixed.
[09:39:53] ohcibi: hi i have two sinatra servers running as fake-servers for my tests.. one serves the content, the other acts as websocket... how to notice the second app from the first one if a certain request was made?
[09:40:01] sthetz: Anyone used Ox html parser?
[09:40:34] helpa: sthetz: Nope. No one. Ever. In the history of the world.
[09:40:34] universa1: sthetz: !anyone ;-)
[09:41:00] helpa: sthetz: 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.
[09:41:00] universa1: sthetz: !used
[09:41:53] sthetz: I just want to ensure that Ox parser does not have support for finding html elements by class or id
[09:46:27] maloik: For those of you who may have used Dashing, anyone passed any 'settings' into the coffeescript for a widget from the html? Like if you were to have a twitter widget, having data-username define which username to get tweets for
[09:47:29] timmillwood: Anyone had any good experience with russian-doll caching?
[09:47:36] timmillwood: I am finding it slower than action cache.
[09:56:03] brownies: timmillwood: as with most caching strategies, you have to use it "right" and you have to benchmark to find what works best for your app
[09:56:15] brownies: it works nicely for us though.
[09:56:56] timmillwood: It doesn't seem to be caching the queries, is that right?
[09:57:19] brownies: timmillwood: er, well, generally you cache around the query call itself
[09:57:40] brownies: you read the 2 articles on 37signals about it, right?
[09:58:10] timmillwood: right, guess I need to give it another read, but I am caching around the output of the query in the view, but it still seems to run a query.
[09:58:17] tagrudev: yolonized, I have to implement a notification system ( emails on some actions ) and user should be able to edit on which actions he/she will receive emails any pointers on good practices of doing that ?
[09:58:59] brownies: timmillwood: well, if your controller or model is triggering the query, then you need to set up the caching there
[09:59:17] brownies: timmillwood: but if your view is calling the DB (eg @foo.bars) then wrapping that in the view should do it
[10:00:18] timmillwood: brownies: maybe that's my issue, having all the queries in the controller.
[10:00:40] brownies: timmillwood: you can do it there too, but i think you might have to cook up your own cache keys
[10:01:26] timmillwood: I currently just have action cache and clear that in the update or create action.
[10:02:07] brownies: timmillwood: you'll have to do "fragment caching" to set up your russian doll structures
[10:02:11] brownies: action caching is not granular enough
[10:02:59] brownies: and you should be using the cache digests gem... just stare at the code in the articles
[10:09:24] tagrudev: I have to implement a notification system ( emails on some actions ) and user should be able to edit on which actions he/she will receive emails any pointers on good practices of doing that ?
[10:10:26] tagrudev: or an existing gem for that ?
[10:14:18] fwchld: hey ya'all
[10:14:27] fwchld: composite primary keys in rails...
[10:19:26] elaptics: fwchld: there's a gem for it
[10:20:48] tagrudev: ah elaptics ideas on my question :?
[10:23:46] fwchld: elaptics: thanks!
[10:25:48] elaptics: tagrudev: don't know of any gems, but there might be otherwise I'd probably just implement a simple model that's like a user preferences and probably come up with a system for registering email actions - possibly persisting to db - and then use that email actions model in the email sending process
[10:27:21] tagrudev: elaptics, yeah I think the same but I can't find something that is already build, hmm maybe It is time to create a gem for it
[10:27:44] maddog_: Hey, given I have a collection of the same records, as in MyModel.all, how do I create a form for editing all of those records? Is there a better ways than iterating over the individual records?
[10:28:24] elaptics: maddog_: what do you actually want to achieve?
[10:28:56] maddog_: elaptics: What I said. I have a number of records I want to have a form for
[10:29:26] elaptics: maddog_: yes, but 1 single form to edit all records at once, or a form per record..or something else?
[10:29:52] maddog_: elaptics: Ah, i see, ideally one form for all records
[10:30:17] maddog_: elaptics: I have several records scoped by week and I want to edit all records for a week at once
[10:30:42] elaptics: maddog_: then have a look at http://railscasts.com/episodes/165-edit-multiple-revised
[10:31:36] maddog_: elaptics: oh noez, why do I have to subscribe to watch it :/
[10:31:57] maddog_: elaptics: but thanks, maybe the term edit multiple will be enough to search for :)
[10:32:47] elaptics: maddog_: oh it's a revised episode, maybe the original one might have some info though probably out of date. However, I highly recommend railscasts - it is very worth $9/month
[10:33:27] GeorgesLeYeti: I have a problem with sidekiq
[10:33:49] GeorgesLeYeti: I made a worker class: https://gist.github.com/anonymous/3172f95022af76e86b37
[10:34:16] GeorgesLeYeti: and i add testmium attributes to my table stat after that
[10:34:39] GeorgesLeYeti: and it always return me Can't mass-assign protected attributes: testmium
[10:35:09] GeorgesLeYeti: (I add attr_accessible :testmium to my model)
[10:38:43] rushed: GeorgesLeYeti: gist the model? did you restart the worker?
[10:39:27] GeorgesLeYeti: rushed: yep i restart sidekiq
[10:40:13] GeorgesLeYeti: https://gist.github.com/anonymous/ed8c96182428ae2e2979
[10:42:20] rushed: GeorgesLeYeti: might gist the full error trace, perhaps it's from somewhere else or you haven't restarted the worker that took the job
[10:42:58] GeorgesLeYeti: rushed: i reboot my pc and retry after that
[10:47:25] kostas: hiall, I have very strange behaviour in a STI setup. Say I have model SubC inherit from model SuperC. When I do SuperC.all by itself I only get all instances of SuperC.
[10:48:27] kostas: When I then do SubC.all I get, as it should be, all instances of SubC. However, when I subsequently do SuperC.all I get all instances of Super
[10:48:49] kostas: SuperC AND SubC as I would have expected the first time.
[10:50:44] kostas: Any idea what's going on? This happens in the app and I can reproduce it in the console: on forst run only rows with type SuperC are fetched, and after I fetch the SubC instances, and retry SuperC.all I get all SuperC and SubC. Extremely strange behaviour.
[10:51:36] helpa: kostas: 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.
[10:51:36] brownies: kostas: !code
[10:55:40] kostas: here you go guys: https://gist.github.com/kgeo/6edc98656d1e499adfbc
[10:57:12] kostas: as you can see the where clauses change from the first time I call Statusowner.all to the second time!!! WTF!?!
[11:02:12] martinklepsch: Having a Time object is there a way to shift it by one month similar to whats possible with << for Date?
[11:07:50] omarqureshi: martinklepsch: + 1.month
[11:08:12] omarqureshi: << is unreadable
[11:20:59] martinklepsch: omarqureshi: perfect, thanks!
[11:24:00] universa1: kostas: that is your real code? what does User.all do?
[11:25:03] universa1: and why does something which is based on the user class query the contacts the table? shouldn't that be a users table?
[11:29:01] kostas: universal: I just updated the gist. User.all now gives all Users and Statusowners. Let me reload the console. Things might change. Just a sec.
[11:30:34] universa1: kostas: might be because of lazy loading the models, so it doesn't know of it's subclasses when you first query with just StatusOwner.
[11:30:46] universa1: kostas: does this happen in production mode, too?
[11:30:56] universa1: need some food, bbl :-)
[11:32:31] kostas: universa1: just updated gist agein with "console reload.rb". Again at First User.all only shows User instances only after I call Producer.all are the instances visible in User.all
[11:33:56] kostas: universa1: it happens in production mode e.g. when I call index views. First /users/ will only show 1 user. Only after I visit /producers/ and then again /users/ will I see all. way strange, huh?
[11:35:16] kostas: universa1: How to force eager loading then?
[11:35:35] mauro1254: Hi guys, I need help with https://gist.github.com/sbu/5411249, many thanks in advance.
[11:37:50] kostas: universa1: something like include but that is supposed to eager load other tables. We are talking a single table. Somehow force all to loose the type IN check?
[11:40:21] _axx: hey, i use self.table_name 'vb3_forum' in my Vbulletin::Forum model, Rails tells me "wrong number of arguments (1 for 0)" for that line, any idea why this is happening? :O
[11:41:38] kostas: universa1: seems I found something, but related to dev mode: https://github.com/rails/rails/issues/8699
[11:42:41] kostas: will try require_dependency or self.descendants...
[11:43:17] _axx: oh i got it, i need to use "set_table_name"
[11:43:51] _axx: oh, it's deprecated oO
[12:01:32] universa1: _axx: the deprecated set_table_name method should have been replaced by something like self.table_name = "foobar"
[12:02:13] _axx: yeah, i just found the error. i forgot "="
[12:02:15] universa1: kostas: full code, still not seeing user.rb, and then i don't know how clever sti is
[12:02:43] _axx: universa1: self.table_name = 'vb3_forum' and i wrote self.table_name 'vb3_forum'
[12:02:47] universa1: so multi-level sti might not work as you expect, but then sti is rarely the right tool for the job
[12:02:54] _axx: stupid mistake, but it's fixed now :D
[12:03:03] universa1: _axx: happens :-)
[12:05:41] finnnnnnnnnnn: I'm trying to write out a folder structure to a file - http://pastie.org/private/xzbvpvszwurvrle7ssxzvg
[12:06:06] finnnnnnnnnnn: the file is missing lots of folders, any idea where my error is?
[12:06:35] finnnnnnnnnnn: I've ripped the method from here - http://compsci.ca/v3/viewtopic.php?t=13034
[12:07:05] finnnnnnnnnnn: I call write_tree_file to begin
[12:07:49] universa1: finnnnnnnnnnn: what does not work? what is expected? what do you get?
[12:11:45] universa1: finnnnnnnnnnn: and do you even understand what your code does at each line?
[12:12:51] ARMIGER1: Does anyone know what gem Active Admin uses for searching tables via the sidebar filters? I've been looking through the source code and the wiki and can't seem to find it.
[12:13:54] universa1: ARMIGER1: look at the active_admin gemspec? but they might even have implemented that themselves.
[12:14:42] Sturgill: i think they use meta_search
[12:15:12] ARMIGER1: universal: Thanks!
[12:15:32] ARMIGER1: Sturgill: You're right - it's right there in the gemspec. Today I learned something.
[12:18:24] finnnnnnnnnnn: universa1: it should recursively iterate through a folder structure and write it out to a file, I don't fully understand the print tree method.
[12:18:54] universa1: finnnnnnnnnnn: well then you should look at each statement in that method and look up what it does.
[12:19:11] finnnnnnnnnnn: universa1: If I change the file << ("| " * nesting + "|-- #{entry}" ) to a simple puts ("| " * nesting + "|-- #{entry}" ) It prints to terminal fine.
[12:19:31] finnnnnnnnnnn: it's the writing of the file that I'm struggling with, I thought the << would just append the new line to the file
[12:19:58] finnnnnnnnnnn: I'll look into writing files a bit more and see if I can spot the issue. thanks
[12:27:39] Proshot: i am playing a bit on the rails console for learning, but whenever i insert something which is wrong i get an error like this ActiveRecord::StatementInvalid: PG::Error: ERROR: current transaction is aborted, commands ignored until end of transaction block
[12:27:50] Proshot: and i have to restart the rails console
[12:28:10] universa1: Proshot: actual command you execute?
[12:28:27] universa1: Proshot: do you have database-level constraints?
[12:28:37] tagrudev: oh boy :D :D :D https://github.com/thearn/webcam-pulse-detector
[12:29:39] brownies: tagrudev: heh. awesome find.
[12:29:44] Proshot: constraints no well a primary key with the name id but other then that no constraints,
[12:29:56] brownies: i have been waiting for that Eulerian Magnification algorithm to take off... i think it's got a ton of applications
[12:30:05] erichmenge: ACTION can never get any python scripts working
[12:30:12] tagrudev: erichmenge, +1
[12:30:32] universa1: Proshot: so what you're executing in console to receive that error?
[12:30:38] tagrudev: brownies, didn't do research on the topic is there something in ruby on it ?
[12:30:45] erichmenge: I'm sure people that don't use Ruby much have the same trouble. But it's always like "Use pip to install these dependencies" "Your pip is the wrong version" "You can't update pip because you don't have the right dependencies"
[12:31:08] tagrudev: hahahaha true story
[12:31:13] Proshot: ok this statement is not good but i get the message with this universa1 Book.select("isbn").where("id like 10")
[12:31:45] universa1: Proshot: Book.where(id: 10).select(:isbn)
[12:32:05] universa1: Proshot: why the like on an "integer" column?
[12:32:18] Proshot: yes i know, but the problem is that, whenever i make a mistake like that, i have to restart the console
[12:33:08] erichmenge: Proshot: you have to restart the console because of a mistake?
[12:33:40] Proshot: yes, its thinks that the statement is part of a transaction
[12:33:53] Proshot: for the full error https://gist.github.com/anonymous/f662c917fb8eca2c5339 universa1 and erichmenge
[12:34:27] universa1: trying to replicate it.
[12:34:40] erichmenge: Proshot: why are you using like on an integer?
[12:35:27] Proshot: well that was a mistake, but the problem is not with that erichmenge, the problem is i can't execute commands anymore in the rails console after such a mistake
[12:35:38] erichmenge: that is strange indeed
[12:35:50] brownies: tagrudev: not that i know of.
[12:36:01] brownies: tagrudev: the algorithm was only discovered recently.
[12:36:04] erichmenge: Proshot: What do you mean you "can't"? What happens?
[12:36:28] tagrudev: brownies, have some crazy ideas in mind :D
[12:36:44] brownies: yeah. i do iOS dev sometimes, so i think it could make for some pretty cool apps
[12:36:50] Proshot: well this happens when i make the mistake and issue a simple Book.find(1) on the rails console
[12:36:51] Proshot: https://gist.github.com/anonymous/105ba3d5deb4a635301b
[12:37:02] sthetz: Sidekiq just freezes with ruby 2.1.0-dev. Any ideas?
[12:37:18] tagrudev: brownies, android here :D
[12:37:21] erichmenge: Proshot: Hmm..
[12:37:49] Proshot: hmm indeed :) well i am a noob with rails, but this does not seems correct erichmenge
[12:38:33] brownies: sthetz: heh, had no idea ruby was up to 2.1 already. i'm still running sidekiq 2.10 on 1.9.3.
[12:38:39] erichmenge: Proshot: I'm not really sure. I think if I were to try to investigate the issue I would take a look at the postgres logs
[12:38:51] ryannielson: I'm looking to use the instagram realtime api. How it works is by sending new images via a post request. Whereas the twitter streaming api I'm using just uses a constant connection, which would probably work fine in a worker process. Is there any way to make certain post requests hit the worker? Or am I just going to have to handle it like a normal post request in rails and just create a background task to handle the processing of w
[12:38:51] ryannielson: instagram sent to me?
[12:38:52] erichmenge: it seems like maybe the previous transaction is still open
[12:39:27] brownies: sthetz: anecdotally, i've noticed that sometimes they don't really properly test multithreading stuff when they're rushing out new ruby versions. does Celluloid work on that ruby ?
[12:39:35] erichmenge: Anyway I've not seen this happen before and an answer doesn't immediately present itself (at least to me).
[12:39:40] Proshot: oke, should i post the postgresql logs for you erichmenge
[12:39:48] sthetz: brownies: I'm not really sure
[12:39:59] erichmenge: Proshot: I don't really have time to investigate the problem this morning, but it is an interesting problem and I am curious about it.
[12:40:08] brownies: sthetz: well, that's worth checking first.
[12:40:38] Proshot: oke, this is what i do, i will send you a message tomorrow and see if you have the time oke
[12:40:45] sthetz: I'm still struggling with nokogiri segfault
[12:41:00] Proshot: what happend on the official nokogiri channel sthetz
[12:41:06] brownies: this is why i don't miss with dev versions of ruby =P
[12:41:07] sthetz: Noone replied
[12:41:10] brownies: s/miss/mess/
[12:41:17] Proshot: i told you it was slow, but they will replay eventually
[12:41:50] erichmenge: Proshot: Tomorrow would probably be better. What would be great is if you could generate a sample app that does the same thing for you (or if you wanted to share your current app)
[12:41:59] erichmenge: I'd love to be able to replicate it on my own system
[12:42:12] sthetz: Upgrading to 2.1.0-dev seems to solve segfault problem
[12:42:17] Proshot: oke, i could send you an invite to bitbucket
[12:42:19] sthetz: But sidekiq is totally broken on it
[12:45:20] cisforcojo: hi gents, having trouble showing a nested form. pretty sure it how i'm calling the variable to loop through for the nested form. could someone please take a look at this gist? _item_fields.erb is the partial that isn't displaying
[12:45:21] cisforcojo: https://gist.github.com/collenjones/f296043c5348f6a68497
[12:47:10] universa1: cisforcojo: you're at /sales_orders/new ?
[12:48:12] universa1: cisforcojo: if you add a <%= @sales_order.items.inspect %> before the fields for call, what do you get?
[12:48:13] DrHeiter23: Will Model.find_all_by_some_field return nil or [ ] if there are none?
[12:48:22] helpa: DrHeiter23: Why don't you try it and find out for yourself?
[12:48:22] universa1: DrHeiter23: !try
[12:48:58] universa1: DrHeiter23: i would write it as Model.where(...).all anyways
[12:49:13] cisforcojo: universa1: yes
[12:49:24] tagrudev: the sky is blue
[12:49:35] universa1: the grass is green
[12:49:53] DrHeiter23: what's the difference? slightly faster using where because doesn't need to invoke method_missing ?
[12:50:14] cisforcojo: universa1: i get this error… interesting. "undefined method `items' for nil:NilClass"
[12:50:15] RobertBrewitz: Any experienced RoR freelancer in Stockholm/Sweden accepting projects?
[12:50:16] universa1: DrHeiter23: find_by... is deprecated iirc in rails 4
[12:51:10] universa1: cisforcojo: <%= controller_name %><%= action_name %> iirc.
[12:51:26] elaptics: universa1: I think it's becoming find_by(name: "blah", age: 20) instead so it's just one method that takes a hash instead of creating many extra methods as needed
[12:51:33] cisforcojo: universa1: sorry, not following
[12:52:10] cisforcojo: universa1: what would that do?
[12:52:59] universa1: cisforcojo: your supposedly set instance variable is nil... so you're most likely at the wrong action. so <%= "Hello from: #{params[:controller]} at {params[:action]}" %>
[12:53:37] universa1: elaptics: ohh ok, good to know. but then i'm using where only anyways nowadays
[12:53:49] elaptics: universa1: me too, mostly :)
[12:53:56] cisforcojo: universa1: ah i called the inspect incorrectly. I get this… [#<Item id: nil, dept: nil, series: nil, item_code: nil, ………. and so on
[12:54:14] cisforcojo: <%= sales_order.items.inspect %> yields that
[12:55:18] cisforcojo: why can't i do this? <% f.fields_for @sales_order.items do |item| %>
[12:55:30] universa1: cisforcojo: why is your form over @sales_order then? i've the unfortunate feeling you're not showing the full/real code.
[12:55:43] universa1: cisforcojo: form_for nil do |f| ..
[12:56:39] cisforcojo: i'll replace the full files
[12:56:44] brownies: RobertBrewitz: local is required?
[12:56:57] universa1: cisforcojo: if your instance varibale would be set correctly, you wouldn't get a nil error on @sales_order.items
[12:57:05] RobertBrewitz: brownies: Yes, local is required I'm afraid.
[12:57:12] brownies: ah, alright. well, good luck.
[12:57:33] universa1: RobertBrewitz: thoughtbot has a office there iirc ;)
[12:57:34] cisforcojo: i get the same thing in rails console though, should be 'nil' because of the 3.times { @sales_order.items.build } right?
[12:58:26] universa1: cisforcojo: @sales_order = SalesOrder.new; 3.times{@sales_order.items.build}; @sales_order.items.inspect
[12:58:30] universa1: cisforcojo: no nil error.
[12:58:46] RobertBrewitz: universal1: Thanks, might actually be an option.
[12:59:11] RobertBrewitz: universa1: Thanks, might actually be an option*
[12:59:40] universa1: RobertBrewitz: probably check out the local ruby/rails user groups
[12:59:47] universa1: i bet stockholm has some
[13:00:53] cisforcojo: universa1: the first nil error is because i called @sales_orders.items.inspect (extra 's' on sales) no more nil error, just nil values for the items when i call <%= @sales_order.items.inspect %>
[13:01:11] cisforcojo: updated the gist
[13:02:38] universa1: cisforcojo: f.fields_for :items do |item_builder|; render ...; f: item_builder
[13:03:26] cisforcojo: had that before… tried again and still blank
[13:03:45] cisforcojo: is the first part correct? <%= form_form @sales_order do |f| %>
[13:04:10] maddog_: How can I set a blank default date in a date_helper? <%= select_date Date.today, prefix: :real_shipping_date, include_blank: true, default: nil %> doesn't work.
[13:05:41] universa1: maddog_: what happens with select_date nil, ... ?
[13:06:23] universa1: maddog_: select_date(your_date, prompt: true) -- http://apidock.com/rails/ActionView/Helpers/DateHelper/select_date
[13:07:09] maddog_: universa1: oh, thanks, thought I had to provide a Date object
[13:07:13] cisforcojo: universa1: normal for @sales_order.items.count to be 0 as well? I think that might be what's doing it… i can see three 'items' created with nil values but the count is 0
[13:09:58] Cakey: ACTION gasp
[13:10:04] Cakey: ACTION forgot that the local ruby meetup is today
[13:10:21] Hates_: better put some pants on
[13:10:31] sunya7a: good morning guys...can someone help me with an authlogic problem...I'm trying to troubleshoot an authentication problem in my console....these are the steps I perform and the results http://pastie.org/7643705
[13:10:32] sevenseacat: pants are overrated
[13:11:00] Cakey: my socializing meter is really low, i went to a frontend design meetup yesterday
[13:11:11] universa1: cisforcojo: it should work. maybe have a look at: http://railscasts.com/episodes/196-nested-model-form-revised
[13:11:35] tagrudev: Cakey, beer fixes that :D
[13:11:35] brownies: sunya7a: show full stacktrace
[13:12:05] Cakey: fixes everything
[13:12:38] sunya7a: brownies: http://pastie.org/7643735
[13:13:22] Cakey: yeah brownies are fine too
[13:13:26] brownies: sunya7a: in step 4, does it return a non-nil user?
[13:13:40] cisforcojo: universa1: checking it out now
[13:14:10] sunya7a: brownies: it returns a user in step 4
[13:14:34] sunya7a: brownies: the user has persistence token set and password salt etc
[13:20:15] cisforcojo: universa1: i was missing :items_attributes in attr_accessible in the sales_order model but other than that, i can't see what else is different. (:items_attributes didn't fix it)
[13:20:58] erichmenge: attr_accessible?
[13:21:00] helpa: https://github.com/erichmenge/signed_form
[13:21:00] erichmenge: !signed_form
[13:30:18] erichmenge: i_am_Th0r: Results?
[13:31:07] finnnnnnnnnnn: universa1: cracked my silly issue earlier, was forgetting to pass the file param in my recursive call
[13:31:08] sunya7a: erichmenge: Thor is here!
[13:31:33] sunya7a: i hear that in husky's voice
[13:31:37] finnnnnnnnnnn: universa1: took some time, but my ruby has levelled up, thanks
[13:33:55] sunya7a: brownies: =/ anything? i'm looking at the source code for the magic_columns in authlogic and it looks like it's trying to access the controller.request object...but in the console i suppose i'm not actually issuing a request? can I fake one?
[13:35:13] brownies: sunya7a: yeah, you could use Capybara or something to fake one, but that seems pretty convoluted
[13:35:20] bigpack: if someone feels like he or she could have a look here: https://gist.github.com/anonymous/fffa40fdfd984d9113d6 … my problem is, just in development, that all the js files are included AND the application.js, this causes errors… what can I do that the application.js will not be added additionally? in production everything works fine
[13:35:20] brownies: sorry, i don't know authlogic, so i can't be much help.
[13:36:11] sunya7a: okay...thank you for your time. I appreciate it
[13:40:13] erichmenge: i_am_Th0r: Glad to hear it.
[13:41:34] erichmenge: bigpack: what kind of errors?
[13:42:16] bigpack: erichmenge: well just errors of my javascripts because the code is double
[13:42:32] bigpack: once in the js files themselves and additionally in the application.js
[13:43:06] erichmenge: bigpack: Really? In development application.js should be empty
[13:43:17] erichmenge: since there is no actual code in the manifest
[13:45:08] bigpack: erichmenge: yes i thought so also…
[13:45:17] erichmenge: bigpack: You've actually verified that there is code in application.js?
[13:45:34] bigpack: yes, the whole code
[13:46:34] erichmenge: bigpack: Could you gist your application.rb and development.rb files? Have you changed anything?
[13:47:01] toddWork_: what would the active record/rails way for this query: "return all records where the :name field contains the phrase 'whoodonit'"?
[13:49:09] cisforcojo: anyone here familiar with the nested forms railscast? I cannot get my nested form to display
[13:50:06] erichmenge: toddWork_: Model.where('name like ?', '%whoodonit%')
[13:51:08] bigpack: erichmenge: i just deleted the application.js from public/, edited my application.js-manifest and now its ok, application.js is empty
[13:51:42] erichmenge: bigpack: Ah I guess you compiled the assets locally…
[13:52:49] bigpack: erichmenge: i think so… but wonder when
[13:59:20] r00tl3ss: hi, I've set in application.rb config.time_zone = 'Kuala Lumpur' , but when I run a named scope method that checks for time, it still uses gmt 0. am I missing something?
[14:00:17] finnnnnnnnnnn: The heroku room is a bit dead, so I thought I'd try here - I'm trying to push an app to heroku, it was working before. Now every time I do a git push heroku master my terminal just hangs. no info returned at all.
[14:04:41] cisforcojo: Can you please take a look at this gist? I need help in how to show one new item initially. (I thought I had set that up in the controller with @sales_order.items.build)
[14:04:42] cisforcojo: https://gist.github.com/collenjones/f296043c5348f6a68497
[14:04:56] cisforcojo: This is with nested forms
[14:05:27] GeorgesLeYeti: Restartin my computer fix my previous problem bit weird
[14:06:44] hiall: Can i grab an hash of a group of hash's by a specific attribute without having to loop? Thinking pluck + X may solve but can't find the X
[14:07:17] GeorgesLeYeti: I have an another question what do you advise for make a reccurring task (like every minutes) I was using a cron task with whenever and a rake task but i migrate (don't know if it s really a good idea) all my rake task to a sidekiq worker
[14:07:47] GeorgesLeYeti: Is is still compatible to make a reccurring task ?
[14:11:01] toddWork_: in my query: Thing.where('name LIKE ?', 'fooooo').all works. but when i pass in a var like so:
[14:11:08] toddWork_: Thing.where('name LIKE ?', q).all it does not
[14:11:34] toddWork_: i'm confiming that q = fooooooo but how do i wrap that q so Rails can see it?
[14:11:52] Hates_: toddWork_: have you checked the logs to see what SQL it's running?
[14:12:04] pipework: It occurs to me that you're new here.
[14:12:38] Hates_: I've been here a while
[14:12:39] toddWork_: Hates_: yup.
[14:12:43] toddWork_: it's blank.
[14:12:53] toddWork_: thanks. ok, new question.
[14:13:05] toddWork_: how do i pass in an optional variable to a controller?
[14:13:07] cisforcojo: Alright everyone, thanks for the help!
[14:13:20] toddWork_: def index (q) <--- q doesn't need to be there.
[14:13:24] Hates_: toddWork_: you don't pass any variables to a controller
[14:13:35] toddWork_: here's my situation.
[14:13:39] Hates_: toddWork_: they are in params
[14:13:59] toddWork_: ah. let me refactor. thanks Hates_
[14:16:41] toddWork_: Hates_: works! and another piece of the puzzle fits.
[14:17:06] toddWork_: i never realized params are always available from views. old habits.
[14:30:57] liquid-silence: toddWork_ php coder?
[14:31:22] PigDude: how do I install rails 4 with rubygems? I get that version 4.0 and 4.0.0 are not found
[14:31:37] pipework: Use a beta gem version.
[14:31:45] liquid-silence: gem install rails --pre
[14:34:15] mlangenberg: I have a model User, with a default scope: where(deleted_at: nil). Now a Post belongs_to :user. How do I disable the default scope for this belongs_to relation?
[14:34:53] liquid-silence: mlangenberg can you elaborate?
[14:35:27] mlangenberg: liquid-silence: When I all post.user for a deleted user, it should not return nil.
[14:35:40] PigDude: >> sudo gem2.0 install rails --pre --no-ri --no-rdoc
[14:35:42] PigDude: ERROR: While executing gem ... (Gem::DependencyError) Unable to resolve dependencies: rails requires activesupport (= 4.0.0.beta1), actionpack (= 4.0.0.beta1), activerecord (= 4.0.0.beta1), actionmailer (= 4.0.0.beta1), railties (= 4.0.0.beta1), bundler (< 2.0, >= 1.3.0), sprockets-rails (~> 2.0.0.rc3)
[14:35:58] pipework: Sudo? what. D:
[14:36:53] mlangenberg: liquid-silence: I found https://gist.github.com/lwe/2923336, seems a lot of magic is involved.
[14:37:08] liquid-silence: PigDude never install shit as root
[14:37:18] helpa: PigDude: RVM (Ruby Version Manager) - http://rvm.io
[14:37:18] pipework: PigDude: !rvm
[14:37:34] PigDude: i'm not touching that crappy project right now
[14:37:37] pipework: PigDude: I wouldn't install development tools into the system package manager.
[14:37:40] PigDude: i will use it when i need to. i have before
[14:37:40] pipework: PigDude: It's not crappy. :)
[14:37:52] PigDude: yes it is. it requires insanely recent versions of bash, find, tar, etc.
[14:37:58] PigDude: stupid stupid stupid
[14:38:03] liquid-silence: mlangenberg why are you displaying posts of deleted users
[14:38:05] badeball: mlangenberg: User.unscoped do post.user end
[14:38:07] pipework: PigDude: Big whoop, use a distro that doens't suck.
[14:38:10] liquid-silence: PigDude use zsh
[14:38:26] PigDude: but this is all besides the point. my question is about rubygems, not how to administer my machine
[14:38:38] pipework: If you want the best thing around that isn't the manual source compilation, ruby-build and chruby are the best tools.
[14:38:38] PigDude: "Unable to resolve dependencies"
[14:38:41] pipework: rbenv is lol.
[14:38:45] mlangenberg: badeball: sure, but I defined: 'belongs_to :user'
[14:38:58] badeball: mlangenberg: yes?
[14:39:00] pipework: PigDude: In your Gemfile put the version as 4.0.0.beta I believe.
[14:39:12] mlangenberg: badeball: Where would I define the `User.unscoped do post.user end` ?
[14:39:22] pipework: I use rails edge.
[14:39:40] brownies: so my poltergeist saga has reached its thrilling conclusion
[14:39:53] brownies: all our tests are refactored and now running on it...
[14:39:55] badeball: mlangenberg: uh, you can temporarely remove the default scope of a class by using #unscoped of that class.
[14:39:56] PigDude: pipework, where is this file?
[14:39:58] badeball: mlangenberg: http://stackoverflow.com/a/4759121
[14:40:00] brownies: and the whole test suite runs in 1/3 of the time it used to =D
[14:40:04] PigDude: pipework, the docs show "gem install rails" http://edgeguides.rubyonrails.org/getting_started.html
[14:40:06] pipework: PigDude: ... you don't know where a Gemfile is?
[14:40:15] pipework: Oh you haven't started working with rails yet?
[14:40:22] PigDude: Gemfiles are not mentioned until later
[14:40:31] PigDude: I have worked with rails for years, just not recent versions :P
[14:40:37] pipework: it should be `gem install rails --pre`
[14:40:41] mlangenberg: badeball: overriding the getter method?
[14:40:44] PigDude: i am setting up ruby2 and rails 4 for dev.
[14:40:49] PigDude: yes, but see the issue I had
[14:41:02] PigDude: which was from running gem install rails --pre
[14:41:03] pipework: I don't know what your issue is, I don't install rails like that ever.
[14:41:10] PigDude: here, i'll paste it again
[14:41:14] PigDude: >> sudo gem2.0 install rails --pre --no-ri --no-rdoc
[14:41:18] PigDude: ERROR: While executing gem ... (Gem::DependencyError) Unable to resolve dependencies: rails requires activesupport (= 4.0.0.beta1), actionpack (= 4.0.0.beta1), activerecord (= 4.0.0.beta1), actionmailer (= 4.0.0.beta1), railties (= 4.0.0.beta1), bundler (< 2.0, >= 1.3.0), sprockets-rails (~> 2.0.0.rc3)
[14:41:20] pipework: PigDude: You can put your whole thought on one line you know. :D
[14:41:35] badeball: mlangenberg: https://gist.github.com/badeball/925496878cce4cda773d
[14:41:44] pipework: PigDude: Like I said, I don't use rails prerelease gems, I build off master for the latest.
[14:41:49] pipework: Same with ruby 2.
[14:41:53] erichmenge: gem install rails --version 4.0.0.beta1
[14:41:54] mlangenberg: badeball: ok, thx
[14:42:16] pipework: PigDude: Try erichmenge's stuff, he's pretty clever.
[14:42:30] mlangenberg: badeball: I'll put that in my view. <% User.unscoped do %><%= post.user.name %><% end %>
[14:42:40] tubbo: i have also found pre gems for rails to be highly confusing to use
[14:42:48] badeball: mlangenberg: do it in your controller
[14:43:02] tubbo: end up having to change a lot of pre-defined configuration just to get the thing running
[14:43:05] PigDude: erichmenge, thanks for answering my question rather than playing armchair sysadmin :P
[14:43:10] PigDude: erichmenge, worked as expected
[14:43:25] tubbo: PigDude: aren't all sysadmins "armchair sysadmins"?
[14:43:35] tubbo: who are those brave sysadmins on the front lines in the trenches?
[14:43:36] mlangenberg: badeball: I am writing the index action. You can't do @posts = User.unscoped { Post.all }
[14:43:37] erichmenge: tubbo: no there are standing desks
[14:43:42] PigDude: tubbo, except those with walking desks !
[14:43:58] pipework: Won't bother helping then. People who use rails pre gems are weird.
[14:44:40] erichmenge: going from rails 4.0.0.beta1 to the next beta your app will be broken btw :)
[14:44:57] PigDude: fun fun fun
[14:45:04] PigDude: what will break?
[14:45:07] erichmenge: they changed some config stuff
[14:45:12] PigDude: besides my heart
[14:45:14] pipework: I just pop open a Gemfile and build off rails master.
[14:45:22] mlangenberg: badeball: Also, this never works with includes. Post.includes(:user).all
[14:45:23] erichmenge: like the EncryptedCookieStore is automatic now
[14:45:28] PigDude: pipework, can you show your Gemfile, and how you work with this?
[14:45:38] erichmenge: so the config option beta1 sets up for you is a undefined constant
[14:45:42] pipework: PigDude: gem 'rails', github: 'rails/rails'
[14:45:47] PigDude: pipework, i build my erlang projects off master so I would prefer to build off master
[14:45:50] badeball: mlangenberg: that'd work within an unscoped User block
[14:46:06] PigDude: pipework, what do I do with the gemfile?
[14:46:34] pipework: I've got work to do. There's lots of docs. The bundler website, etc.
[14:46:40] badeball: mlangenberg: try https://gist.github.com/badeball/fd3cf4841d9e4b784e6b
[14:46:53] erichmenge: pipework: you work?
[14:46:58] pipework: erichmenge: Not really.
[14:47:10] pipework: I just solve puzzles and write haiku for a living.
[14:47:32] badeball: mlangenberg: I don't think the notion of having a default_scope is such a good idea if you always find the need for the non-scope.
[14:47:38] tubbo: cat ~/haiku.txt | work
[14:47:56] pipework: I don't use scopes ever myself.
[14:48:20] erichmenge: pipework: Not a long range hunter?
[14:48:33] mlangenberg: badeball: right, just finally thought I had a good use for https://gist.github.com/dhh/1014971
[14:48:52] pipework: erichmenge: I'm the sort who sneaks up on his prey and silently brings them down.
[14:49:37] outsmartin: im on edgerails and get a undefined method `[]' for nil:NilClass when trying to use a fixture from /profiles/msc/.rvm/gems/ruby-2.0.0-p0/bundler/gems/rails-dba6a078ee22/activerecord/lib/active_record/fixtures.rb:806:in `block (3 levels) in setup_fixture_accessors'
[14:49:53] outsmartin: any idea what the problem could be?
[14:50:17] erichmenge: outsmartin: gist all the things.
[14:51:13] outsmartin: its just fixtures :users and a users(:admin) call
[14:51:21] outsmartin: last bundle update rails broke it :)
[14:51:33] erichmenge: Price you pay I guess
[14:54:00] rabbite: What are the security concerns of converting a user input int to a string to run match?
[14:54:05] danabrit: gmorning. :)
[14:54:23] erichmenge: danabrit: ohai
[14:54:26] rabbite: i.e. user inputs 1000, then validate runs @amount.to_s.match(…)
[14:54:28] tubbo: rabbite: why would you do that?
[14:54:44] rabbite: match doesn't seem to play well with ints
[14:54:47] tubbo: rabbite: like what are you matching on?
[14:54:47] danabrit: erichmenge: having a good day?
[14:54:51] erichmenge: danabrit: I guess!
[14:54:53] tubbo: rabbite: obviously, because it's a method on String :D
[14:55:10] danabrit: erichmenge: well then i guess i'm glad. :)
[14:55:13] tubbo: i question whether you need all that "power"
[14:55:23] erichmenge: danabrit: how are you?
[14:55:49] tubbo: rabbite: like for example, if you had a user id that was 4 digits and you wanted to see whether it started with '1', couldn't you just see if the number was divisible by 1000?
[14:55:55] danabrit: erichmenge: doing great, thanks! hopefully about to get some coding in while it's still morning for a change. :-P
[14:56:16] rabbite: tubbo: I'm only trying to validate that it's a number.
[14:56:16] tubbo: rabbite: i think validating a number pattern could be done with something much more simple than regex
[14:56:16] kedric: Hey all, Anyone know of a good way to stress test a rails api? Specifically with 400 users hitting it at once lol
[14:56:27] tubbo: rabbite: oh, well then just use validates_numericality_of :your_attribute :)
[14:56:30] tubbo: rabbite: boom
[14:56:42] rabbite: Herm, let me give it a shot
[14:56:43] erichmenge: kedric: apache benchmark?
[14:56:46] tubbo: rabbite: or for the better syntax, `validates :your_attribute, numericality: true`...that lets you tack on other validations
[14:58:31] rabbite: How can I test that in console?
[14:58:44] kedric: erichmenge: I cant believe I missed that! Thanks! Anyone know if a shared hosting plan should be able to handle a short burst of 400 users?
[14:59:04] erichmenge: kedric: probably depends on the needs of your application
[14:59:16] Hates_: kedric: 400 concurrent users is a lot
[14:59:54] kedric: Hates_: its a short burst, Im building a training tool where people will need to open the application to load the quizzes after the training session
[15:01:28] outsmartin: kedric: you can try to cache as much as possible, best bet is to test it from another server with ab
[15:01:35] myappleguy: anyone use digital ocean for hosting? Thinking of trying them wondering if any one has a recommendation.
[15:02:29] erichmenge: myappleguy: they are pretty good for the price. They're not as reliable as Rackspace but they're also way cheaper
[15:02:32] erichmenge: so you need to weigh these things
[15:03:06] myappleguy: erichmenge: awesome thank you :)
[15:03:42] kedric: outsmartin: Everything I can precompute has been. It is simple two table joins at most from there on out
[15:03:55] maddog_: Is there a way to call a function in the model when a specific attribute is being changed?
[15:04:26] momomomomo: maddog_: http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html
[15:04:36] momomomomo: and maddog_ http://guides.rubyonrails.org/active_record_validations_callbacks.html
[15:05:11] maddog_: momomomomo: so...no?
[15:05:29] momomomomo: how did you get no from that?
[15:05:53] outsmartin: kedric: what are the specs of your vps?
[15:06:29] kedric: outsmartin: I am currently testing it on my shared hosting
[15:07:36] maddog_: momomomomo: My question was if I can do it for a specific attribute. I don't see a method doing that there.
[15:08:32] outsmartin: kedric: try to find out your time per request, then you can calculate the load you can take
[15:08:55] momomomomo: well maddog_ , I'm not one to spoonfeed, but here's me doing your googling: http://api.rubyonrails.org/classes/ActiveModel/Dirty.html
[15:09:08] momomomomo: combine that with the previous links
[15:09:25] kedric: outsmartin: I just ran 100 requests, 50 concurrent and the Mean time per request: 407.335 ms
[15:09:47] erichmenge: maddog_: Why not just write that method yourself?
[15:10:37] maddog_: momomomomo: Thanks, I probably missed the correct search term.
[15:10:43] outsmartin: kedric: try it with 1000 and 50 concurrent
[15:10:53] maddog_: erichmenge: why write it if it exists
[15:11:15] liquid-silence: is it worth paying for railscasts?
[15:11:27] momomomomo: liquid-silence: Definitely, if you're learning
[15:11:38] kedric: outsmartin: im using ab and it says 317 requests failed. Any way I can get what errors they were?
[15:11:39] sevenseacat: $9/mo isnt exactly a fortune
[15:11:51] liquid-silence: which is 9 breads
[15:11:52] erichmenge: maddog_: In the time you've spent here asking about it you could have just written the method.
[15:12:22] erichmenge: def something=(*); do_something_else; super end
[15:13:19] outsmartin: kedric: ab has a timeout if a request exceeds that its counted as failed
[15:14:14] erichmenge: onlymejosh: Hi!!
[15:14:22] onlymejosh: erichmenge: hows it going?
[15:14:27] outsmartin: kedric: but that shows that you cant handle heavy load atm, are you testing in production mode?
[15:14:29] erichmenge: onlymejosh: Pretty well. How are you?
[15:14:49] onlymejosh: yeah not bad, playing with red carpet :)
[15:14:57] kedric: outsmartin: The hosting is in production mode. Its throwing 503 errors.
[15:15:10] erichmenge: Is that a euphemism?
[15:16:03] outsmartin: kedric: try less concurrency like 5 or 10
[15:17:17] toddWork_: geez. ruby can save a lot of typing: htmlArray = tags.map{ |tag| tag.text }.sort
[15:17:40] erichmenge: toddWork_: htmlArray = tags.map(&:text).sort
[15:17:46] toddWork_: erichmenge: hah!
[15:19:01] quazimodo: i can't type
[15:19:06] quazimodo: boxing and coding do not mix :(
[15:19:23] toddWork_: with explicit return (if that is what it's called) i dn't even have to declare that var.
[15:19:23] momomomomo: quazimodo: what kind of boxes do you work with?
[15:19:49] kedric: outsmartin: Thanks for all the help! at 100, 5 concurrent I get 65 failed requests out of 100. Starting to think something is wrong with my app
[15:19:52] quazimodo: momomomomo: i mean face punch boxdng
[15:20:10] momomomomo: quazimodo: I know haha
[15:20:26] Pupeno: Since when is rails converting all values to bigdecimal? When I assign an invalid value, like "abc" to a decimal field, it converts it to big decimal so it ends up being 0 (instead of an invalid value, with a validation error, that the user should correct).
[15:20:37] Travis-42: If I wanted to set a proxy on capybara-webkit for each example using the driver, how would I do that? It seems that if I create a "custom" driver that loads a new webkit driver and sets the proxy, it only works for one of the examples and then the proxy setting is lost (maybe when the browser is "reset")
[15:21:35] erichmenge: Pupeno: You're validating numericality?
[15:21:41] Pupeno: erichmenge: I am.
[15:22:03] outsmartin: kedric: you have 503 errors when you have -c at 1?
[15:22:25] momomomomo: Pupeno: http://www.ruby-doc.org/stdlib-1.9.3/libdoc/bigdecimal/rdoc/BigDecimal.html vs. http://ruby-doc.org/core-1.9.3/Float.html
[15:22:58] Pupeno: momomomomo: what's your point?
[15:23:25] Pupeno: erichmenge: not validating numericality has no effect on this behaviour.
[15:23:37] kedric: outsmartin: 0 failed requests, ~323.665 mean, 561 max
[15:24:01] erichmenge: Pupeno: Well the validation should be taking place before any AR casting is done at the database level. So I'd check to make sure you're using the correct validation syntax. Maybe gist up your model code?
[15:24:18] outsmartin: kedric: still pretty slow you better check out your logs how much time is spend on what
[15:24:35] Pupeno: erichmenge: I removed the validation and re-loaded the console. The validation is having no effect on this behavior.
[15:24:56] erichmenge: Pupeno: Well removing the validation certainly won't help.
[15:25:05] momomomomo: Pupeno: http://ruby-doc.org/core-1.9.3/Float.html
[15:25:12] momomomomo: http://stackoverflow.com/questions/49274/safe-integer-parsing-in-ruby
[15:25:58] momomomomo: Same applies for Float, but not BigDecimal, I believe
[15:26:24] onlymejosh: hey guys have any of you used redcarpet? I need to override the link method and am having issues doing so
[15:29:30] horrror: hi guys, how's fancybox-rails gem? any thoughts? how about good alternatives?
[15:29:45] sevenseacat: how is it, other than completely unnecessary?
[15:30:30] pipework: How is it, other than rather tacky?
[15:30:45] horrror: why? unnecessary?
[15:31:18] kedric: outsmartin: Im not sure what im looking at in the logs. Do you mean the web server logs or rails app? Rails app shows views:263.7, active record 29.5
[15:31:39] sevenseacat: fancybox is a jquery plugin, why do you need a gem for it?
[15:31:44] sevenseacat: download js, put in app.
[15:31:52] outsmartin: 260 ms for the views sound rather slow, maybe gist an example
[15:32:42] quazimodo: momomomomo: it's shaking and my fingers refuse to lift lol
[15:32:55] momomomomo_: ??? I disconnected, and didn't see what you said before that
[15:32:59] momomomomo_: so that's really out of context haha
[15:33:46] kedric: outsmartin: My view is render :json, The model overrides as_json to return 3 items.
[15:34:22] kedric: no other logic involved
[15:34:29] r0bgleeson: kedric: that tells us absolutely nothing
[15:35:21] kedric: r0bgleeson: He asked for the view, and there is none. Its rendering json.
[15:35:51] kedric: gisting it now though
[15:36:02] r0bgleeson: that doesn't tell us what the bottleneck is
[15:36:06] r0bgleeson: it tells us nothing
[15:36:07] outsmartin: kedric: that would be nice, include the model stuff
[15:36:17] r0bgleeson: you may as well told us what you had for breakfast instead
[15:37:04] momomomomo: r0bgleeson: I had a protein shake and coffee
[15:37:26] r0bgleeson: momomomomo: very healthy
[15:37:41] momomomomo: yeah, but now I have a headache, fixitfixitfixitfixitfixit
[15:38:22] quazimodo: momomomomo: my hand is shaking andi cant really lift my fingers
[15:38:29] momomomomo: quazimodo: go to the doctor.
[15:38:41] quazimodo: momomomomo: nah it's normala fter a brutal sessino
[15:38:56] momomomomo: welp, at least see a trainer
[15:38:57] quazimodo: still funny to see my words drop from like 110 to 40
[15:39:26] erichmenge: quazimodo: jfajja jkl;a;jkajkl; jkl;adfjkl;
[15:39:29] kedric: outsmartin: https://gist.github.com/anonymous/cff3d0d996158ba22093 Anything else that I should look at to find bottleneck?
[15:41:03] erichmenge: quazimodo: that was me sympathizing with you by the way.
[15:42:06] horrror: is there a way to add js transitions while moving through actions? e.g. show to edit
[15:42:07] outsmartin: kedric: if you are desperate use some kind of performance debugger to find out where the time is spent exactly
[15:43:06] kedric: outsmartin: Im more worried about concurency issues. I know speeding up the request will make it easier on the server, but not being able to handle 10 people stinks
[15:43:18] outsmartin: kedric: you have no indices?
[15:43:32] kedric: outsmartin: Joins are done on ids
[15:48:04] liquid-silence: kedric and that means you need no idices?
[15:48:16] liquid-silence: s/ideces/indices
[15:48:45] outsmartin: kedric: maybe the games and score to_json is slow?
[15:50:22] kedric: liquid-silence: Im using MYSQL. the ID is indexed by default unless I am sorely mistaken.
[15:50:32] liquid-silence: kedric eager or lazy loading?
[15:51:01] liquid-silence: and how big is the object that you are parsing into json
[15:52:35] kedric: outsmartin: Thats a good point. the Game does pull data from 1 of 4 small tables.
[15:53:00] liquid-silence: kedric btw only primary keys are indexed not foreign
[15:53:12] kedric: liquid-silence: Lazy loading. The data's content length is ~ 323
[15:53:29] liquid-silence: does the data change?
[15:53:41] kedric: liquid-silence: tahnks for the tip about foreign
[15:54:01] kedric: liquid-silence: From these four small tables, never. They are seeded into the application
[15:54:13] liquid-silence: cache the fuck out of them
[15:54:20] liquid-silence: and query the cached data
[15:55:16] kedric: liquid-silence: any links on caching the tables?
[15:55:31] liquid-silence: google works well
[16:00:15] WhereIsMySpoon: Hi, I'm having a problem with this simple Rails webform that I've created, which is that when I press the liquid-silenc
[16:00:21] WhereIsMySpoon: Let's try that again <_>
[16:00:25] Paradox: hmm, how would i use a conditional validation on a symbol using "self"
[16:00:32] Paradox: eg self.from_oauth
[16:01:16] WhereIsMySpoon: I'm having a problem with this simple Rails webform that I've created which is that when I press the submit button, the TournamentEntry object is just populated with nil values :( code is here: https://gist.github.com/Jarob22/5408840
[16:03:12] darrik: WhereIsMySpoon: in all likelihood your data is getting passed in as params[:tournament_entry] whereas you're using params[:tournamentEntry], but check your input params to the create method
[16:03:45] Paradox: specifically
[16:04:03] Paradox: i want to skip a particular validation when calling a class method on a model
[16:04:04] Paradox: https://gist.github.com/9ce0404b7860ab0f6db6
[16:04:12] Paradox: and line 9
[16:04:37] Paradox: any help would be welcome, some googling doesnt turn up much
[16:04:43] hmbg: I want to try thinking sphinx for full text search. Until now I've been using sqlite3, so now I change to mysql. But I get this weird error when I run rake db:migrate: "uninitialized constant BasicObject"
[16:04:46] WhereIsMySpoon: darrik: aha, that was the problem, but now I get a http://pastie.org/7645873
[16:05:22] darrik: WhereIsMySpoon: status isn't whitelisted in attr_accessible
[16:05:39] rylwin: Paradox: set an attribute on the instance, like skip_validation, then validate unless skip_validation
[16:05:56] Paradox: rylwin, thats not exactly favorable, but it will work, so thanks!
[16:06:05] darrik: WhereIsMySpoon: you can't pass attributes to new or create in a hash unless attr_accessible allows such
[16:06:08] Paradox: i spose its better than first_or_initialize…save
[16:06:54] rylwin: Paradox: that would work as well (I'm assuming you would do #save validate: false)
[16:06:58] hmbg: same error on all rake tasks actually
[16:07:03] Paradox: yeah, that might be cleaner
[16:07:15] Paradox: would certainly be less…janky
[16:07:33] rylwin: Paradox: using the first_or_init...save method would make it easier to skip ALL validations. The method I described is good for skipping specific validations.
[16:08:10] Paradox: rylwin, does this look accurate? https://gist.github.com/8e6ba633da6c6ea57ac2
[16:08:17] Paradox: im still on my first cup of tea so i dont trust myself
[16:09:02] rylwin: Paradox: you'll have to wrap unless: @skip_validation in a lambda
[16:09:17] Paradox: ah, ok, felt like i was missing something
[16:10:32] Paradox: well, that solves the problem i was having, but turns out i just need to skip all validations on this
[16:10:36] Paradox: stupid oAuth providers
[16:10:47] Paradox: the one i'm using doesn't provide email, and i want users to have email accounts
[16:11:04] Paradox: and the authorization isnt being saved because user isnt validating and kicks back to a form asking the user to fill out more fields
[16:11:14] Paradox: first…save
[16:11:16] Paradox: thanks rylwin
[16:13:42] Paradox: oAuth is one of those things that always seems simple in principle, but is a rabbits hole
[16:14:14] WhereIsMySpoon: https://gist.github.com/Jarob22/5408840 with this new.html.erb, if :status is the name of a method in the TournamentEntry, can I use the second parameter of the radio button as a parameter to the status method?
[16:20:52] rylwin: Paradox: anytime!
[16:31:07] kedric: WhereIsMySpoon: When do you expect that status method to be called?
[16:31:18] WhereIsMySpoon: kedric: when the object is initialized
[16:31:50] WhereIsMySpoon: basically, all i want is a radio button group that has past, ongoing and future in it
[16:31:57] WhereIsMySpoon: the user can select one of these options
[16:32:17] WhereIsMySpoon: ive ended up with this status thing cause the radio button needs a label for a group
[16:32:25] kedric: what happens after the user submits/selects them?
[16:32:48] WhereIsMySpoon: if the user selects past for example, attribute past in teh db is set to true, ongoing to false and future to false
[16:32:48] Bravebellows: Good morning from the West Coast
[16:33:31] hmbg: I get warnings about CSRF tokens even though the correct csrf token is in the request header (X-CSRF-Token)
[16:33:45] hmbg: I really don't know where to start debugging
[16:33:54] erichmenge: OMG you guys my macbook pro is ready for pickup :)
[16:34:04] Bravebellows: erichmenge: congratulations :)
[16:34:14] kedric: WhereIsMySpoon: Is there a reason why those three arent in one column called status? Where status can be Past, Ongoing, Future?
[16:34:19] erichmenge: unfortunately I have to go to school now :/
[16:34:39] WhereIsMySpoon: kedric: because that's how the data is stored in another database this will relate to, and I can't change that now
[16:34:43] Bravebellows: erichmenge: Nice timing. You'd be fidgeting all day
[16:34:52] erichmenge: Bravebellows: I think I'll skip my afternoon class ;)
[16:35:18] Bravebellows: erichmenge: I wonder if "Picking up an Apple product" is still a valid request for a hall pass...
[16:35:41] wagster: It should be
[16:35:49] kedric: WhereIsMySpoon: There is a way to make a variable that is not stored in the database in the model. You can override your setter there to set the data how you want to be in the database. This allows you to code your form normally
[16:36:27] WhereIsMySpoon: kedric: that sounds good, but I don't fully understand what you mean by overriding the setter?
[16:36:49] kedric: WhereIsMySpoon: Give me a few minutes. I am not that good with rails so take my advice with a grain of salt
[16:36:58] WhereIsMySpoon: kedric: no problem
[16:37:53] terrellt: WhereIsMySpoon: Those three methods, .future, .past, and .ongoing are only set one at a time, no?
[16:38:10] kedric: WhereIsMySpoon: check this out http://stackoverflow.com/questions/4370960/what-is-attr-accessor-in-ruby It gives an example to override a setter and a getter, and how they relate to attr_accessor
[16:38:14] WhereIsMySpoon: terrellt: they're just fields not methods
[16:38:16] terrellt: WhereIsMySpoon: So set "status" to be self.future||self.ongoing||self.past
[16:39:16] kedric: terrellt: He is connecting to a pre-existing database and has to change multiple fields when status is set. I proposed overriding the setter of an attr_accessor and keep the form code clean and normal
[16:39:29] kedric: at least thats what I gather
[16:39:33] terrellt: You don't have to build an attr_accessor.
[16:39:36] terrellt: But yes, that's the second part.
[16:39:47] terrellt: Then define status=(value), in that reset past/future/ongoing to null, and if value=="past" set past to true, etc etc.
[16:39:55] manish: hi all i was executing bundle update command but it's throwing error "An error occurred while installing pg (0.12.2), and Bundler cannot continue.
[16:39:56] manish: Make sure that `gem install pg -v '0.12.2'` succeeds before bundling."
[16:40:59] Bravebellows: manish: the pg version is a bit old. Are you working from a tutorial?
[16:41:49] Bravebellows: manish: check the date on the tutorial. Gems are constantly being updated in Internet time.
[16:42:06] Bravebellows: if you're learning RoR, I recommend Michael Hartl's tutorial. It's pretty recent
[16:42:09] manish: Bravebellows: so what version should be appropriate
[16:42:30] Bravebellows: manish: http://ruby.railstutorial.org
[16:43:40] Bravebellows: manish: if money is an issue, go here: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
[16:43:57] Bravebellows: if you become rich from RoR, manish, buy the book and support us ;)
[16:44:09] manish: <Bravebellows> yeah i am referring that tutorial
[16:44:25] omarqureshi: anyone done a Rails 3 upgrade and experienced a "The error occurred while evaluating nil.[]" when using Jammit on the include_stylesheets call?
[16:44:29] omarqureshi: for reference
[16:44:37] omarqureshi: only happens in test environment
[16:44:43] WhereIsMySpoon: terrellt: and in the new.html.erb where I specify the radio buttons, does doing :status, :ongoing pass "ongoing" to the construction of the :status field?
[16:44:44] omarqureshi: and worked fine in Rails 2.3
[16:45:11] omarqureshi: it also happens as part of include_javascripts
[16:45:28] omarqureshi: the stack trace is pretty abysmal
[16:45:53] Bravebellows: manish I see the reference is pg, '0.12.2'. How did you install ruby, rubygems and rails?
[16:45:55] omarqureshi: https://gist.github.com/omarqureshi/ee607fd998c4dc59a977
[16:45:59] omarqureshi: complete stack trace
[16:46:18] omarqureshi: however, i've tracked it down to Jammit.packager.individual_urls
[16:46:31] terrellt: WhereIsMySpoon: Yes.
[16:46:41] WhereIsMySpoon: terrellt: that's lovely, ok thanks
[16:47:02] manish: Bravebellows: all things was running fine until i was try to use postgresql as my default database
[16:47:49] Bravebellows: omarqureshi: before you go further, did you run rake db:test:prepare first?
[16:48:23] WhereIsMySpoon: terrellt: hm, if i put :status in attr_accessible i get a nomethod error saying no such method 'status' . If I put it as attr_accessor, I get mass assignment error
[16:48:24] omarqureshi: for reference ... line 16 in application_responsive is
[16:48:33] manish: Bravebellows: http://ruby.railstutorial.org/chapters/static-pages Exercise 3.5 practice-2
[16:48:46] Bravebellows: manish: I went through that myself a few weeks ago. Is the 'pg' entry the only thing you changed in the Gemfile?
[16:48:46] omarqureshi: <%= include_stylesheets :responsive %>
[16:49:46] terrellt: WhereIsMySpoon: You don't need to use attr_accessible :status...all that is is a shortcut to defining status/status=, and you have to manually define those anyways.
[16:49:55] terrellt: attr_accessor*
[16:50:11] WhereIsMySpoon: terrellt: if I dont put it in either, i get nomethoderror for 'status'
[16:50:24] terrellt: WhereIsMySpoon: Because you didn't define status.
[16:50:24] WhereIsMySpoon: so what on earth do I need to do O.o
[16:50:26] Bravebellows: manish: exercise 3.5, practice 3. is what you're looking at, right?
[16:50:44] terrellt: Sigh. Update your gist and I'll show you.
[16:50:46] manish: Bravebellows: i removed sqlite3 and added :test environment
[16:51:26] WhereIsMySpoon: terrellt: https://gist.github.com/Jarob22/5408840 updated, and sorry for the non-understanding :(
[16:51:35] thmz: how do I get 200 OK message on create method in the controller instead of redirect_to?
[16:51:36] Bravebellows: manish: did you follow the heroku instructions first? You put pg in all environments (dev,test,prod)?
[16:51:59] manish: Bravebellows: yes
[16:52:02] Bravebellows: manish: I hope you did check in all your changes before you started. That way you can rollback and start again if you miss a step
[16:52:08] wagster: terrellt attr_accessible :status does not generate the getter/setter methods… it simply allows the :status attribute to be mass-assigned.. you still need attr_accessor :status
[16:52:09] jeebster: are there any ruby or rails methods for stripping text of encoded characters? I've had someone enter  a ™ symbol and it becomes a ?, I assume because of a copy-pasted character from the internet with some funky encoding
[16:52:22] Bravebellows: manish: does running psql at the command line work for you?
[16:52:56] Bravebellows: jeebster: read about UTF-8 encoding. I've had files with these characters, I had to enforce UTF-8 while opening the questionable file
[16:53:46] manish: Bravebellows: nope it's throwing error "psql: FATAL: role "manish" does not exist"
[16:54:21] Bravebellows: manish: do a psql --version
[16:54:30] Bravebellows: manish: gist me your Gemfile, please
[16:54:31] jeebster: Bravebellows: will do, thanks
[16:54:39] wagster: thmz I believe render :status => 200 should work
[16:54:58] thmz: wagster: thnx
[16:55:13] Bravebellows: jeebster: a sample to give you a clue: records = File.open(import_file, 'r', external_encoding: 'ISO-8859-1').readlines
[16:55:19] terrellt: wagster: I did correct myself and said attr_accessor.
[16:55:40] wagster: terrellt sorry.. i must of missed that
[16:55:55] Bravebellows: jeebster: that tells Ruby that the file isn't UTF-8 so it'll do the necessary conversion when reading the file
[16:56:05] WhereIsMySpoon: oh i see, i needed it in both
[16:56:09] jeebster: Bravebellows: so I'll most likely have to pipe this into a file and re-encode then? I was hoping to simply re-encode a form text string before database storage
[16:56:25] terrellt: WhereIsMySpoon: https://gist.github.com/terrellt/5414304 Something like that should work.
[16:57:15] terrellt: Bah, or it would if I didn't miss an end.
[16:57:39] manish: Bravebellows: https://gist.github.com/man1989/5414354
[16:57:55] WhereIsMySpoon: terrellt: got it :) thanks
[17:01:20] Bravebellows: jeebster: doesn't have to be a file. Most things are streamable
[17:02:18] Bravebellows: manish: how did you install pg?
[17:02:59] Bravebellows: s/pg/postgres/
[17:03:03] manish: Bravebellows: "gem install pg" i used this command to install it
[17:03:27] s2013: what is the default account confirmation url for devise?
[17:03:49] Bravebellows: manish: what that does is set up the ActiveRecord interface to postgres. I'm talking about the actual postgres app that runs in the background
[17:04:16] Bravebellows: manish: did you install it with Heroku's postgres.app? If not, what/how?
[17:05:31] manish: if you are talking about how i install postgresql , i used apt-get to install it
[17:06:04] Bravebellows: manish: did you follow the instructions to the letter (I use Mac OSX so I'm not exactly sure how it goes)?
[17:06:20] Bravebellows: manish: as far as getting it to run in the background, set it up with the proper user roles and ownerships?
[17:07:17] Bravebellows: manish: check this for any steps you may miss: https://help.ubuntu.com/8.04/serverguide/postgresql.html
[17:07:18] manish: i did set any role it didn't ask for it, i will set the role now and recheck it
[17:07:56] manish: Bravebellows: ok
[17:11:17] Bravebellows: jeebster: I just keyed in ™ into one of my forms and it handled it properly so I checked and found that the Rails form enforces UTF-8. Are you receiving the funky characters in another way, like for instance ajax?
[17:12:12] jeebster: Bravebellows: I tried that as well. not too sure, this is someone else entering the data into the forms. I'm just assuming they're copy-pasting from random internet sources
[17:12:27] jeebster: I'll just tell them to use properly encoded characters!
[17:13:07] Bravebellows: jeebster: I did it from a Mac keyboard, maybe the Windows/Linux inputs differently? Telling ordinary users to use properly encoded-characters would just go over their head ;)
[17:14:58] s2013: anyone? how does a typical devise user confirmation url look like?
[17:15:06] jeebster: Bravebellows: oh yes, this much I know ha. most likely from a windows keyboard. I figured it would use the same encoding...
[17:16:28] Bravebellows: jeebster: standards is such a hairball. I'm happy to be working on a specific business process app because I can tell them this: Don't use any browser but FF/CH/Safari
[17:17:00] jeebster: Bravebellows: It's mind-boggling if windows and osx don't use the same character encoding…you would think it's a regional thing
[17:17:43] Bravebellows: jeebster: it could be and then they screw up on the implementation. Please let me know how you make it work. We all would benefit.
[17:18:31] jeebster: Bravebellows: will do. I'll most likely take the easy route unless I can find some more info. these people are halfway across the country :\
[17:19:22] Bravebellows: jeebster: that's my motto too. "Start simple and iterate towards the best solution"
[17:26:46] croby: I seem to be having an issue with renaming a primary key in a migration - I have a legacy db with a column 'some_id' that I want to rename to 'id', but when I migrate with a rename_column, I'm seeing a new column called 'id' created, and 'some_id' is sticking around as the primary key
[17:37:52] Travis-42: I have a User model that has_one Account model. If I do account = user.build_account… is there any way for me to do user.account and see what the state of user.account was before? (in this case nil)?
[17:39:11] Travis-42: The "account_was" method doesn't seem to exist
[17:40:01] omarqureshi: http://api.rubyonrails.org/classes/ActiveModel/Dirty.html - Travis-42
[17:40:05] Bravebellows: croby: there may be an index on some_id that is preventing the migration from happening the way you wish.
[17:40:22] Travis-42: omarqureshi: right, it doesn't get set on associations unless the direct attribute gets changed
[17:40:24] croby: Bravebellows: there doesn't appear to be any indices on that column
[17:40:47] omarqureshi: ah, for a difference in the association from nil to some object?
[17:41:00] Bravebellows: croby: you have to keep in mind that Rails migrations can't go against the DB's policy. My advice: make a new id, copy some_id -> id then remove the some_id in the next migration
[17:41:16] Travis-42: omarqureshi: yea… I want to be able to tell that the user originally have no association
[17:41:32] Travis-42: I guess I can figure out some ways to get this working, however
[17:41:35] croby: Bravebellows: this is just going against a fresh db loaded up in sqlite3
[17:41:48] croby: Bravebellows: just doing a schema load to test the migrations
[17:42:01] omarqureshi: assuming this is a build and not a create
[17:43:15] WhereIsMySpoon: Why is the error here http://pastie.org/7647430 ocurring if i've done the set_table_name ?
[17:43:36] helpa: http://pastie.org - Show us your code! For more info: http://pastie.org/help
[17:43:49] Bravebellows: not what I wanted LOL
[17:44:14] Bravebellows: serves me right for playing in the big kids' pool
[17:44:16] Travis-42: omarqureshi: that does solve the nil -> present state (id will be nil), but there still doesn't seem to be a way to see the original saved association without doing User.find(user.id).account
[17:44:28] Travis-42: I'm trying to handle both situations
[17:44:59] Travis-42: ah never mind, then user.account.changed?
[17:45:01] PigDude: where do I find a list of supported JS libraries?
[17:45:03] Bravebellows: croby: you may have a better picture of how the table is defined if you look inside schema.rb. For all you know, the some_id might be defined as the primary id
[17:45:06] PigDude: I prefer to not use jQuery
[17:45:24] PigDude: http://edgeguides.rubyonrails.org/working_with_javascript_in_rails.html only shows jquery examples
[17:45:26] croby: Bravebellows: it is - I want to rename the primary key on this table
[17:45:39] maoko: Hi guys, would you please help me with this? https://gist.github.com/maokomioko/5414740
[17:45:49] Bravebellows: PigDude: any JS will work, jQuery is just a framework
[17:46:12] terrellt: PigDude: That being said, jQuery is happy times.
[17:46:18] Bravebellows: croby: I'll play the devil's advocate here; why would you do that? Wouldn't you break the app that relies on some_id
[17:46:20] PigDude: Bravebellows, i know that, but I mean it appears the jquery-rails is supported, for instance
[17:46:42] workmad3: PigDude: the only thing the rails integration gives is support for things like remote: true
[17:46:46] Bravebellows: PigDude: it's just a Rails wrapper for the remote. There's the Prototype
[17:46:51] croby: Bravebellows: definitely, I'm refactoring out all our old database naming schemes, so the whole app is going to reflect the change as well
[17:46:53] s2013: isnt remote true for ajax?
[17:47:04] workmad3: PigDude: which are part of the rails ujs driver
[17:47:10] momomomomo: maoko: http://railscasts.com/episodes/17-habtm-checkboxes
[17:47:12] Bravebellows: croby: that's rather a lot of work over a column name :D
[17:47:25] workmad3: PigDude: a quick google finds alternatives, e.g. a mootools ujs driver here https://github.com/kevinvaldek/mootools-ujs
[17:47:38] PigDude: do I need to have one of these?
[17:47:38] croby: Bravebellows: hah, sure - but it is for the whole application, tons of column name changes, etc.
[17:47:50] Bravebellows: croby: you have my sympathies :)
[17:47:53] PigDude: can I just use my own libraries, and have rails not generate JS?
[17:47:53] maoko: momomomo: thanks, I'll take a look.
[17:48:01] workmad3: PigDude: rails doesn't generate any JS anyway
[17:48:09] PigDude: ah, it once did i think
[17:48:14] PigDude: in the form of html attributes
[17:48:16] workmad3: PigDude: it did, but they changed that in rails 3 :)
[17:48:25] Bravebellows: PigDude: you can do whatever you want. I've used both UJS and my own javascript
[17:48:25] workmad3: PigDude: with the move to UJS
[17:48:26] PigDude: so why is coffeescript and jquery included by default?
[17:48:33] PigDude: if they aren't used
[17:48:45] PigDude: that is, can i safely remove both?
[17:48:49] workmad3: PigDude: yes, you can
[17:48:53] PigDude: oh ok, phew
[17:48:57] PigDude: what baout this remote: true stuff?
[17:49:02] PigDude: that Bravebellows refers to
[17:49:04] Dreamer3: PigDude: because a they are strongly recommended
[17:49:10] workmad3: PigDude: they're included by default because they're common choices that are recommended
[17:49:18] PigDude: Dreamer3, ah, ok.
[17:49:32] pi3r: Hi guys, I'm removing a feature from an app and I'm wondering what's the best way to wipe schema related data (migrations) for this table/model
[17:49:33] PigDude: i use google closure library :P
[17:49:33] workmad3: PigDude: so it's rails saying 'here, we recommend these for JS stuff if you don't have any strong opinions for other things'
[17:49:34] Bravebellows: PigDude: you can make links, forms, etc perform ajax calls if you include remote: true
[17:49:38] Dreamer3: PigDude: if you like to paddle upstream you can use whatever you want
[17:49:47] workmad3: PigDude: the remote: true stuff creates data- attributes on the elements
[17:49:54] PigDude: Dreamer3, that's an ignorant view
[17:49:54] maoko: <momomomomo> this way I should re-create model for habtm, but having serialized array is better for me.
[17:49:56] workmad3: PigDude: which the ujs driver picks up on
[17:50:16] Bravebellows: pi3r: create a new migration file that drops the tables in question
[17:50:18] workmad3: PigDude: pretty easy to write a small bit of JS code to integrate with whatever library you want
[17:50:41] PigDude: Dreamer3, jquery is code smell and there's a reason google uses their own library, it's not 'paddling upstream'
[17:50:59] Bravebellows: PigDude: let's not start a framework war
[17:51:00] PigDude: ACTION shakes
[17:51:01] workmad3: PigDude: you just need a way to hook onto the data- attributes you want to support (data-remote, data-method and data-confirm are the main ones)
[17:51:06] Dreamer3: i find query quite nice and everyone else uses it so i know people can easily work on what i work on
[17:51:18] PigDude: workmad3, what do you mean by "hook onto"?
[17:51:20] Dreamer3: much better that prototype :)
[17:51:23] momomomomo: maoko: you can take lessons from that screencast and adopt it to your use case
[17:51:27] Bravebellows: Amen, Dreamer3
[17:51:41] workmad3: PigDude: event listeners
[17:51:44] Dreamer3: google is just weird :)
[17:51:48] PigDude: Dreamer3, is very inefficient, actually why wikipedia stopped using it
[17:51:54] pi3r: Bravebellows: I'll do that, thanks :)
[17:52:05] momomomomo: it also helps to know how checkboxes work and what data they send http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-check_box and http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#method-i-check_box_tag
[17:52:06] Dreamer3: very inefficient at what?
[17:52:11] PigDude: that is why they stopped using it ... mobile performance and power consumption
[17:52:23] Bravebellows: pi3r: before you do that-- write your tests so you can debug any problems that arise from missing tables
[17:52:23] PigDude: inefficient at DOM operations ofc
[17:52:23] Dreamer3: well duh :)
[17:52:27] workmad3: incidentally, I don't give a crap why you chose not to... and this isn't the channel to start a JS framework war
[17:52:30] Dreamer3: that's what … damn what it is
[17:52:34] Dreamer3: query like API
[17:52:42] pi3r: Bravebellows: Yep, tests are already there
[17:52:42] Dreamer3: jquery for desktop
[17:52:49] workmad3: so please take your arguments about why you don't use jquery into either PM or another channel
[17:52:55] pi3r: Bravebellows: it's an old feature
[17:52:56] workmad3: that's to both Dreamer3 and PigDude :P
[17:52:56] PigDude: workmad3, about "listeners" ... is there a post about writing adapters for this, so I know what behavior I need to provide?
[17:53:03] Dreamer3: workmad3: i'm done :)
[17:53:08] workmad3: PigDude: just look at the jquery ujs driver
[17:53:14] PigDude: ok, thanks, will do
[17:53:16] Dreamer3: you can't argue with a pig dude
[17:53:24] workmad3: PigDude: it's about 100 lines of code with comments and whitespace included ;)
[17:54:01] PigDude: workmad3, what I mean is, is there a particular interface I need to provide? I can't immediately tell what members here are private and which are needed for the AIP
[17:54:17] PigDude: or is it just, if such and such attributes are on the page, do X with them
[17:54:44] workmad3: PigDude: yeah, that's it basically
[17:55:15] WhereIsMySpoon: Why is the error here http://pastie.org/7647430 ocurring if i've done the set_table_name ?
[17:55:31] workmad3: PigDude: you're free to do whatever you want with a custom integration, but the standard things are that data-method specifies what method a link or form should be submitted with, data-remote says a form should be submitted with ajax, and data-confirm slaps up an alert before allowing the click or submit to go ahead
[17:55:35] Dreamer3: 7.6 million pastes, wow
[17:55:42] workmad3: PigDude: there might be some others hidden in there, but those are the main ones
[17:55:43] PigDude: workmad3, I see, so the idea was to get rails to stop generating inline JS in html attrs, instead depend on JS plugin to provide this behavior
[17:55:50] workmad3: yup, that's it
[17:56:11] lessless: is it possible to #= require in the bottom of the js file?
[17:56:21] PigDude: lessless, huh?
[17:57:04] lessless: PigDude, I want rails to append other script at the bottom of my js file
[17:57:29] Dreamer3: lessless: why? order shouldn't matter
[17:57:51] momomomomo: lessless: do you mean you want to include your own custom JS
[17:58:09] lessless: momomomomo, no, a jQuery plugin
[17:58:21] momomomomo: which is a js file… right?
[17:58:26] PigDude: sounds liek custom js to me
[17:58:40] momomomomo: lessless: http://stackoverflow.com/questions/9094788/how-do-i-add-a-jquery-plugin-to-rails-3-1
[17:58:59] lessless: actually trouble is that I'm dynamically loading jquery inside the closure, so it's not exposed outside
[17:59:07] lessless: and I need to load a jQuery plugin
[17:59:23] Dreamer3: expose it via a global
[17:59:26] lessless: which is looking for $
[17:59:41] Dreamer3: i set $ = jQuery inside my coffeescripts
[17:59:47] Dreamer3: (we still use prototype outside)
[17:59:53] lessless: so it's a damn bloody mess
[18:00:15] Dreamer3: i forget if regularly js gets closed
[18:00:20] Dreamer3: if so you can do the same thing
[18:00:25] otters: lessless: heh, it uses $ instead of jQuery?
[18:00:33] Dreamer3: or change the plugin
[18:00:41] Dreamer3: technically it's broken
[18:00:44] Dreamer3: it should use $
[18:00:50] otters: I'm guessing the simplest idea would just be to replace $ -> jQuery in the plugin, if you can
[18:01:49] lessless: plugin uses (function($) { ...})(jQuery);
[18:01:58] otters: well that should be fine, then
[18:02:06] otters: is jQuery not defined?
[18:02:07] lessless: but as I'm doing a widget following http://alexmarandon.com/articles/web_widget_jquery/#loading-data-from-our-site
[18:02:30] lessless: jQuery is not defined in the global scope, as I understand
[18:02:39] otters: you using coffeescript?
[18:03:01] otters: yeah you'd have to set window.jQuery
[18:03:11] otters: it's a good thing coffeescript does but it does get irritating
[18:03:14] lessless: what about version conflict
[18:03:27] Dreamer3: if query is just raw JS then jQuery should be global
[18:03:43] Dreamer3: inside your coffee script you can access it as jQuery
[18:03:50] keisans: jQuery should be global, but it may not be $ if noConflict is used
[18:03:53] Dreamer3: or even $ if compatibility mode isn't on
[18:04:22] otters: lessless: how are you loading jquery?
[18:05:42] lessless: otters, https://gist.github.com/dirty-hippie/ae4432108d683e27463e
[18:06:30] otters: lessless: nah, in handler you'd want to set window.jQuery = jQuery.noConflict(true)
[18:07:51] otters: and remove the other uses of window
[18:07:59] lessless: jQuery is undefinded in handler
[18:08:24] lessless: while window.jQuery.fn.jquery is "1.9.1"
[18:08:41] otters: okay, fair point
[18:08:46] otters: I don't really know what you're doing there, it's confusing me
[18:08:54] otters: why are you not just putting a script tag in <head>?
[18:09:09] lessless: it's an widget for an other sites
[18:09:40] otters: is window.jQuery defined in handler?
[18:09:43] lessless: it supposed to be mounted on the 3rd party sites
[18:09:50] DylanJ: otters: code in head happens before code in body. if you want a site to feel like it loads super fast stick your js at the end of body or html
[18:09:55] Dreamer3: window is global
[18:10:02] otters: lessless: then you shouldn't need to set window.jQuery at all
[18:10:06] Dreamer3: if window.jQuery is defined it's defined EVERYWHERE
[18:10:08] tubbo: lessless: seems like you're trying to half-ass ASynchronous Module Definition
[18:10:15] melee: hopefully quick question - if i have a model Post with another model PostMeta (belongs to Post), what's the best practice for creating a new Post then adding many PostMeta entries?
[18:10:24] tubbo: lessless: have you looked at any existing implementations of this concept?
[18:11:18] melee: my thought is to grab the id from .save then run a create statement and pass the id, but that seems a little weird.
[18:11:26] lessless: tubbo, do not know any
[18:11:49] Dreamer3: melee: @paste.post_metas.create
[18:12:03] Dreamer3: melee: read up on associations
[18:12:24] melee: Dreamer3: i have - i'm just a little confused when i have an array and need to make a record for each one
[18:12:36] Dreamer3: melee: read up on Array#each
[18:12:49] Dreamer3: lessless: query should be defined globally
[18:12:59] tubbo: lessless: check out RequireJS
[18:13:00] melee: i know that as well :) so iterate the array and call create each time?
[18:13:16] Dreamer3: melee: sure
[18:13:23] tubbo: lessless: but you probably don't want to use that if you're mounting this widget on other sites
[18:13:44] tubbo: lessless: instead, you want to "sandbox" your code so that it can't pollute the global scope and vice versa
[18:14:11] melee: so create post, create postmeta with the iteration, call save and everyone should be happy
[18:14:19] tubbo: lessless: CoffeeScript does this for you by encapsulating all of your compiled JS in a (function() { ... }).call(this)
[18:14:24] boytoy_: selleo.com/blog/technologies/key-issues-internationalizing-your-app2/ -- is this the best way to find unused as well as missing I18n translations?
[18:14:49] tubbo: lessless: the only thing you should need to do is expose some part of that code to the global scope so it can be accessed by other things on the page. if you are so inclined.
[18:14:55] lessless: tubbo. if I'll drop jQuery than I'll have to create my own datepicker widget...
[18:16:18] tubbo: lessless: i didn't say anything about dropping jQuery, did i?
[18:16:28] tubbo: i just said you don't need RequireJS really
[18:16:54] tubbo: i find Rails' asset pipeline a great solution for keeping your JS deps together in a widget
[18:17:20] Dreamer3: love rails asset pipeline
[18:17:22] Dreamer3: though not for images
[18:17:25] Dreamer3: i always reset the image path
[18:17:31] Dreamer3: for CSS and JS, yes
[18:17:39] tubbo: you can make your widget.js file `#= require jquery` at the top and it will just basically give you the code for jQuery in your widget.js file, on top of your custom code
[18:17:45] tubbo: so it's all self-contained
[18:20:26] melee: thanks Dreamer3 :)
[18:34:39] kanzure: do any of you copy your development database when you branch in git/hg/whatever? for instance, if you have multiple different schema changes you're testing out in separate places.
[18:37:12] Dreamer3: kanzure: nope, and it's a pain in the butt
[18:37:22] Dreamer3: i've considered removing schema.rb from git
[18:37:31] Dreamer3: though often my schema changes aren't incompatible
[18:37:33] Dreamer3: just different
[18:37:39] Dreamer3: makes rebasing a pain
[18:38:07] kanzure: i'm trying to come up with a 5 minute solution to this problem (i don't care a lot, but it would be nice)
[18:38:18] Dreamer3: which problem exactly?
[18:38:26] kanzure: a git hook that executes when i create a new branch would be nice. i would be willing to make it a separate script or something that i run when i want to fork my schema.
[18:38:27] Dreamer3: for large dbs making a copy isn't really practical
[18:38:43] kanzure: well, it's my development db. i would be willing to have a blank db when i branch.
[18:38:57] kanzure: as long as the schema gets created and my config is pointed to the new db settings.
[18:38:59] Dreamer3: go you, i can't develop against a blank db
[18:39:17] Dreamer3: look at db:schema:dump and db:schema:load… you should be able to while something up pretty fast
[18:39:20] kanzure: well, i would have to either seed the tables (like with the test fixtures) or at least run CREATEs
[18:39:43] kanzure: actually i'm not on a rails project at the moment :) but it would be the same problem even if i was on rails.
[18:39:58] Dreamer3: well rails already has code to dump and reloa dschema
[18:40:10] Dreamer3: so it'd be just a few lines of wrapper around that
[18:40:24] Dreamer3: so outside of that you're building the copy code
[18:40:44] kanzure: how would you switch the environment on that branch?
[18:40:49] Retistic: is it normal for a query click event listener to break :remote => true ?
[18:41:06] Dreamer3: Retistic: if you did it right
[18:41:33] Dreamer3: kanzure: just rewrite whichever file defaults it to dev
[18:41:41] Retistic: Dreamer3: is there a way they can coexist? the event listener is an animation
[18:42:09] Dreamer3: Retistic: if you don't cancel the event it should still hit rails handlers
[18:42:54] Retistic: Dreamer3: i didn't cancel any event but when i add the jquery listener it stops working but the animation work
[18:42:55] workmad3: Retistic: event.stopPropagation() would prevent it
[18:43:02] kanzure: Dreamer3: so overwrite a file, and add that file to .gitignore?
[18:43:11] Dreamer3: Retistic: paste your animation code and hookup
[18:43:19] Dreamer3: kanzure: why add to gitignore?
[18:43:27] kanzure: because when i rebase/merge into master or whatever
[18:43:33] kanzure: i don't want to use the new database for development. right?
[18:44:13] Retistic: workmad3, Dreamer3: https://gist.github.com/Retistic/bbd5965ec50a138d121b
[18:44:21] Retistic: line 1 is haml btw
[18:44:26] Dreamer3: not sure where the default is stored these days, i'd probably just while up a .rails_env dotfile
[18:44:35] Dreamer3: and then hack the init to check that file
[18:44:38] workmad3: Retistic: return false
[18:44:57] Retistic: workmad3: you mean get rid of it?
[18:45:20] Retistic: workmad3: awesome thanks
[18:45:24] Retistic: workmad3: that did it
[18:45:28] Dreamer3: Retistic: why are you returning false at all?
[18:45:31] Dreamer3: that seems silly
[18:45:36] workmad3: Retistic: yeah, return false is the traditional method for stopping propagation
[18:45:52] Retistic: Dreamer3: i return false because of some quick with the url i think
[18:46:00] Retistic: i *usually* return false
[18:46:06] Retistic: i don't remember exactly whyt
[18:46:28] Retistic: maybe it adds a hashtag to the end sometimes?
[18:46:38] Dreamer3: what harm is the hash?
[18:46:47] Dreamer3: it is a link tat's it's default behavior to take you somewhere
[18:47:02] terrellt: Retistic: jQuery totally has animation routines, by the way. In fact, you can use something like Transit.JS, which uses CSS transitions that would be hardware rendered.
[18:47:03] Dreamer3: try preventDefault
[18:47:22] Dreamer3: terrellt: i don't think all transitions are hardware rendered on iphone
[18:47:32] Dreamer3: terrellt: working on a site with my sister and it's using transitions and they are SLOW
[18:47:38] terrellt: CSS ones should be.
[18:47:39] Dreamer3: i think you have to do 3d transforms to be FAST
[18:47:43] Dreamer3: terrellt: nope, they aren't
[18:47:46] Retistic: terrellt: i tried spritely and it was pretty buggy
[18:47:47] terrellt: Sometimes with webkit you have to add a tag to force it.
[18:47:55] Dreamer3: terrellt: force what?
[18:47:56] terrellt: So you can do a blank 3d transform and that tends to force it.
[18:48:01] terrellt: Hardware rendering.
[18:48:16] Dreamer3: not sure what a "blank" 3d transform looks like
[18:48:25] Dreamer3: this is foundation library, you'd think they'd know about that and do it
[18:48:43] terrellt: Add the CSS property -webkit-transition: translate3d(0,0,0);
[18:48:51] Dreamer3: terrellt: seriously?
[18:49:07] terrellt: Dreamer3: Indeed. Check out http://ricostacruz.com/jquery.transit/
[18:49:26] Retistic: terrellt: where does it have sprite animations?
[18:50:01] Retistic: terrellt: i don't believe it can
[18:50:02] terrellt: Retistic: I wasn't paying attention - didnt' realize that's what was going on.
[18:50:08] terrellt: Retistic: My apologies.
[18:50:22] Retistic: terrellt: np, nice library though.. thanks :-)
[18:51:30] kanzure: Dreamer3: here's an idea.. for the development environment only, i could have it check the name of the current git branch, because i can assume that i am using git during development. then the branch name is used to inform which database to connect to ("project-branchname").
[18:52:00] kanzure: if that database doesn't exist, then run migrations/create tables/seed data/etc.
[18:54:22] Dreamer3: terrellt: are you saying this library does that hack?
[18:56:24] Dreamer3: it changes transform to 3d if it's supported
[18:57:59] soahccc: Is there a controller base default scope? We have e.g. an FrontendController and BackendController and it would be pretty nice if you could say for example "FrontendController.default_scope(Product, :visible)" or something
[18:59:56] Dreamer3: you could do that if they weren't global to begin with
[19:00:02] Dreamer3: Secret::Product
[19:00:10] Dreamer3: BackendController::Product = Secret::Product
[19:00:20] Dreamer3: and of course you could write some API to wrap that up
[19:00:26] artmann_: Hi, I'm trying to my app to production, Css and images works but JS don't. Any Ideas?
[19:00:53] Dreamer3: soahccc: why though?
[19:01:00] soahccc: Dreamer3: hmm nice idea... I'll give that a try but I guess this won't work
[19:01:00] Dreamer3: artmann_: be more specific
[19:01:21] Dreamer3: soahccc: it's possible you could do it yourself with the global namespace
[19:01:30] artmann_: Dreamer3: http://new.flypatterns.co
[19:01:48] artmann_: it's loads jwuery
[19:01:58] artmann_: but not my controller specific js files
[19:02:02] Dreamer3: maybe you could have a list and loop and remove them from the global scope but keep them somewhere then conditionally add them back to various scope
[19:02:04] soahccc: Dreamer3: Yeah we have those Frontend/BackendControllers which we use as base for the respective areas and to avoid either a lot of .visible or a lot of .unscoped in one of them it would be cool to handle that more context sensitive than in the model
[19:02:26] Dreamer3: we're talking about entirely different things
[19:02:45] Dreamer3: well, kinda
[19:02:56] Dreamer3: you want modified Products in various scopes
[19:03:14] Dreamer3: i dunno if you could clone the class, but you could pass around scopes easily enough
[19:03:30] Dreamer3: Front::Product = Real::Product.visible
[19:03:48] soahccc: Dreamer3: wouldn't that work only once?
[19:04:26] soahccc: never mind, I got it (I was thinking per request)
[19:05:23] Dreamer3: you can const_remove Product and keep redefining it, though that seems weird
[19:05:28] Dreamer3: and no one else is going to understand this
[19:05:43] Dreamer3: when you see a model you assume global scope unless it's namespace
[19:05:50] Dreamer3: so perhaps you just need front and back namespaces
[19:06:04] Dreamer3: Front::Product, Back::Product, and your controller use those
[19:07:55] soahccc: Dreamer3: Hmm that would make it more complicated as it is I guess. Then better try to not forget a .visible/.unscoped :)
[19:10:30] soahccc: Dreamer3: I just thought it could be a good idea since we have to add this "default scope" to an project afterwards so we have to find (and hopefully don't miss any) use of that model in the frontend
[19:14:18] Dreamer3: soahccc: i think that's what tests are for
[19:14:35] Dreamer3: if scope is that important you should have solid tests for it
[19:14:47] artemeff: Hi! Can I send big data via sockets with one packet? Hmm... My problem – when I send big string (json) to other application (on erlang) I receive it piece by piece and json don't be decoded. Any ideas? Sorry for my english :C
[19:14:52] pipework: Scopes are lame.
[19:15:24] wmoxam: Scope tastes icky
[19:16:02] wmoxam: http://is.gd/T3arzu
[19:16:20] rhalff: ACTION Keep smiling, keep shining. Knowing you can always count on me, for sure That's what tests are for. Let's all sing along...
[19:16:49] pipework: rhalff: You're not so good at third person.
[19:17:27] wmoxam: ACTION chuckles
[19:18:02] rhalff: ah sorry, For good times and bad times I'll be on your side forever more That's what tests are for...
[19:24:53] _squidboy: have people been following all these _why updates?
[19:25:46] _squidboy: https://news.ycombinator.com/item?id=5571387
[19:26:15] _squidboy: would be great if he came back
[19:27:05] rhalff: _squidboy, http://whytheluckystiff.net/
[19:27:52] rhalff: I guess he's heartbroken about Amanda.
[19:29:31] rafaelcgo: guys, I'm running a Rails 3.2.13 application, and my slideshow_manifest.js is being compiled with code from the "requires" inside. My Rails 3.1.6 did not behavior this way. This is causing me to have duplicated JS and CSS. Does anyone knows what's happenning?
[19:29:44] rhalff: nothin, trials, reading, burn, yougetit?, eyes, farewell, fireless, torn, amanda, reverse, lookup, flipped...
[19:31:21] jost: How do I set the MTU *permanentely* for a VPN connection on XUbuntu? I can change it per connection using "sudo ifconfig ppp0 mtu 1300"...
[19:32:38] Dreamer3: jost: wrong channel
[19:32:47] jost: Dreamer3: whats the correct one?
[19:32:55] Dreamer3: jost: uh not #rubyonrails
[19:33:01] jost: Oh, sorry
[19:33:06] workmad3: jost: #ubuntu? #linux?
[19:33:09] workmad3: jost: google? :P
[19:33:11] jost: that was meant to go to #ubuntu :-)
[19:34:02] freight: Hi, how do I ensure my sources.list is correct?
[19:35:57] pipework: Wrong channel.
[19:36:04] Dreamer3: is this suddenly #linux
[19:36:08] freight: I have an issue with installing rmagick, I'm getting a dependency error which says that Magick-config is missing
[19:36:16] freight: Sorry I didn't explain properly lol
[19:36:18] fryguy: freight: so install Magick-config
[19:36:49] Dreamer3: freight: this isn't the channel for ruby, rmagick issues
[19:36:59] freight: fryguy: I've tried doing that and I'm getting more dependency errors
[19:37:08] Dreamer3: my advice: stop using rmagick
[19:37:21] Dreamer3: i finally had to do that recently, tired of fucking with it
[19:37:39] _squidboy: mini_magick ++
[19:37:46] rhalff: ACTION hm, ok pretty weird: #whytheluckstiff #Jonathan-Gilette #not-the-same #_why https://www.facebook.com/jgillette
[19:37:49] freight: Dreamer3: Unfortunately I'm having to because it's part of a project that another dev has created
[19:37:54] Dreamer3: _squidboy: for many things that's a great alternative
[19:37:57] Dreamer3: freight: so?
[19:38:05] Dreamer3: that doesn't mean it has to be that way forever
[19:39:06] rc-: hey, any of you guys using a retina macbook pro by any chance?
[19:39:13] Dreamer3: rc-: fuck yeah
[19:39:20] Dreamer3: _squidboy: we switched to high charts :)
[19:40:37] _squidboy: Dreamer3: high charts license doesn't always work on my projects
[19:40:48] freight: Dreamer3: no true. But in this instance, I do not have the time or the budget to replace it. I just want to resolve the issue I'm having. Where would be the besti place to get help?
[19:40:54] Dreamer3: _squidboy: how so
[19:41:17] rc-: Dreamer3/otters did you by any chance ever use the "high-res" 15" macbook before it? the one at 1440x resolution i think? basically i'm used to the high-res MBP screen, and i know the retina screen runs at an equivalent of the normal MBP screen (so screen elements are that larger size); i'm wondering how it looks when you set it to scale down a notch so the resolution is equivalent (but at the higher dpi)
[19:41:29] _squidboy: Dreamer3: http://shop.highsoft.com/highcharts.html
[19:41:41] Dreamer3: _squidboy: i've seen their site
[19:41:55] _squidboy: so its not oss
[19:41:57] Dreamer3: freight: pay someone, but it's a pita… are you having this issue in production?
[19:41:59] rc-: http://support.apple.com/kb/HT5266?viewlocale=en_US&locale=en_US this setting
[19:42:05] Dreamer3: no, it's not OSS
[19:42:08] Dreamer3: but it's licensable
[19:42:33] Dreamer3: rc-: it will look better than the old macbook, but not as crisp as the larger
[19:42:42] Dreamer3: rc-: it's very usable though and an improvement
[19:42:43] rc-: where you scale towards "more space"... i think one notch towards "more space" equals the resolution of the "high resolution" MBP screen on the non-retina MBP
[19:43:04] Dreamer3: rc-: i use the highest mode sometimes for lots of windows and such, it's still nice
[19:43:09] freight: Dreamer3: No it's staging, just set the server up and can't install rmagick, due to dependency issues and it seems all fixes I have found on google do not work
[19:43:27] rc-: Dreamer3 i guess what i'm wondering is like, does it scale in a natural way, or does it run at a truly different resolution and give you the aliasing/scaling issues that running an LCD at a non-native resolution gives
[19:43:29] Dreamer3: freight: what is the project using magic for?
[19:43:43] freight: Dreamer3: image manipulation
[19:43:43] Dreamer3: rc-: what would be natural?
[19:43:59] Dreamer3: rc-: as i said it looks BETTER than an old hi-res 15"
[19:44:14] rc-: Dreamer3 well, running in the same actual screen resolution/dpi but simply changing the resolution/size of screen elements.
[19:44:15] Dreamer3: but it's not 2x exactly so it's not as crisp as the NEW screens looks at "native"
[19:44:26] rafaelcgo: man, how come this assets are being duplicated? I'm two hour on this little problem already.. =[
[19:44:36] Dreamer3: rc-: it's an LCD, there is only the native resolution, anything else is scaled
[19:44:47] freight: Dreamer3: It's on Ubuntu 12.10, and I'm getting errors like this when I try to install the dependencies: libmagickwand-dev : Depends: libmagickcore-dev (= 8: but it is not going to be installed
[19:45:03] Dreamer3: freight: no idea
[19:45:15] Dreamer3: freight: that's the kind of thing i'd start charging money to help with
[19:45:19] Dreamer3: just no easy anyways
[19:45:30] rc-: Dreamer3 right, but im asking how apple does it when you change that setting. does that setting change the actual resolution setting (and run the LCD at a different resolution) or does it simply resize screen elements to match the resolutions you're shooting for
[19:46:08] Dreamer3: rc-: i think you should read an article on it… this was explained over and over when they came out
[19:46:33] rc-: because if it actually runs at a different resolution, then that's lame, it'll look like crap. but if it runs at the native resolution and changes the OS elements, that would look good
[19:46:35] freight: Dreamer3: What would you charge?
[19:46:37] Dreamer3: rc-: i'm not sure there is really any difference between what you a re asking
[19:46:50] rc-: Dreamer3 there's a huge difference, you just don't seem to understand it
[19:46:58] fpruitt_: Hey guys! Really quick/easy question: I need to update a label on an rhtml page using the current values of 4 drop down boxes on the form.
[19:47:01] Dreamer3: rc-: i do, you're asking poorly
[19:47:07] Dreamer3: rc-: what resolution do you want?
[19:47:09] rc-: otter maybe you understand how LCDs work?
[19:47:20] fpruitt_: How can I make it update as the boxes update?
[19:47:48] rc-: Dreamer3 i told you, 1440, the resolution i'm used to working with on the high-resolution upgrade screen on the non-retina macbook pro
[19:48:04] rc-: which would equate to "more space" relative to the native resolution of the retina mbp
[19:48:14] Dreamer3: at 1440 a retina renders everything at 2880x1800 and then it's down sampled to the native resolution
[19:48:18] rhalff: rc-, what is a macbook?
[19:48:49] Dreamer3: same for 1680
[19:48:59] Dreamer3: rendered at 3360 then downsampled
[19:49:07] rc-: Dreamer3 hmm, so it does run the screen at a different actual resolution... that's a bummer
[19:49:26] Dreamer3: rc-: i don't think you understand :)
[19:49:31] Dreamer3: rc-: it's doing the best thing
[19:49:39] rc-: that's not the best thing :]
[19:49:46] Dreamer3: the screen is always 2560x1600
[19:50:10] Dreamer3: the larger 2x screens render at full native resolution and then are downsample
[19:50:20] rc-: that's what all LCD monitors do; downsample
[19:50:38] Dreamer3: most upsample
[19:50:52] fpruitt_: Hey guys- does anyone have a second to help me with a form issue in rails?
[19:50:59] Dreamer3: convert 1280 into 2560, that's upsampling
[19:51:11] Dreamer3: 3360 into 2560 is downsampling
[19:51:19] Dreamer3: up sampling is shit, downsampling looks good :)
[19:52:15] Dreamer3: " For instance, upsampling images faster such as photographs means increasing the resolution of the image." wikipedia
[19:52:29] pipework: Dreamer3: :D
[19:52:54] Dreamer3: sometimes it sucks knowing how right you are but other people just not understanding :)
[19:53:08] Dreamer3: to think apple would build their BEST laptop and have shitty display options… not :)
[19:53:09] Ryuno-Ki: Good evening
[19:53:25] fpruitt: Hey there!
[19:53:29] Dreamer3: and the guy arguing with me doesn't even own a retina macbook pro :)
[19:54:44] Dreamer3: i know of no lcds that downsample like apple does
[19:55:07] otters: I can never go back to a non retina display
[19:55:12] rc-: Dreamer3 it's okay dude, we've established you don't know what you're talking about, and you think apple is the BEST and can do no wrong, etc. just stop talking; someone how actually knows the answer might know
[19:55:25] Dreamer3: rc-: i've already answered your question EXACTLY
[19:55:30] Dreamer3: "at 1440 a retina renders everything at 2880x1800 and then it's down sampled to the native resolution"
[19:55:35] rc-: Dreamer3 EXACTLY wrong
[19:55:58] Dreamer3: ACTION doesn't mind being called wrong when he knows he's right :)
[19:56:08] Dreamer3: rc-: says the guy who hasn't owned one and used one the past 6 months :)
[19:56:31] Dreamer3: ACTION rolls eyes.
[19:56:48] rc-: ooh, you rolled your eyes on irc. what a powerful retort!
[19:56:55] otters: take it to a PM
[19:57:16] pipework: Are you two being assclowns?
[19:57:21] rc-: and i have used one, but what does that matter? that's why i'm asking someone who owns one and understands how it works
[19:57:57] pipework: Are we just talking about high pixel density displays?
[19:58:07] rc-: pipework i simply asked a question about a laptop; Dreamer3 didn't know the answer but has carried on and on without a basic understanding of the concept
[19:58:22] pipework: rc-: does this have anything to do with rails directly?
[19:58:34] Dreamer3: pipework: assclown, what's that?
[19:58:58] Dreamer3: rc-: [x] owns [x] understands
[19:59:07] Dreamer3: sorry i just love arguing when i know i'm right :)
[19:59:09] pipework: rc-: If no, I don't blame him for whatever silliness he's guilty of. If you're offtopic, he's welcome to be offtopic.
[19:59:26] rc-: Dreamer3 i'm guessing you own a car, too; but i'm guessing you don't understand how that works either, so bad logic
[19:59:31] rhalff: ACTION http://www.youtube.com/watch?v=xGbnua2kSa8
[19:59:37] Dreamer3: i never claimed anything about cars
[19:59:48] rc-: pipework it has to do with a development tool, so yeah, it does
[19:59:53] Dreamer3: rc-: you sound dumber the more you talk :)
[20:00:02] pipework: rc-: Nope. Sorry. Doesn't count.
[20:00:09] Dreamer3: rc-: "at 1440 a retina renders everything at 2880x1800 and then it's down sampled to the native resolution" what would you prefer it do instead?
[20:00:24] rc-: pipework what are you, the rails police? go suck a donkey dick
[20:00:53] otters: pipework, are you an op?
[20:00:54] pipework: rc-: I think you're in a bit of a bad mood, perhaps you might invest in a wee break from socializing. No one here's your enemy or means you any ill will.
[20:00:57] rc-: jesus, such a bunch of manginas in this channel. do you guys actually DO any rails work?
[20:01:02] pipework: otters: God no. I don't want to be.
[20:01:11] pipework: Aww what was it. :(
[20:01:20] otters: lambdabot has @where ops
[20:01:24] otters: I doubt that's it though
[20:01:32] pipework: rc-: I do work on rails and ruby projects. Shit you use every day. :)
[20:02:46] coj: anone using Discourse here? is the seed data in pg_dumps/development-image.sql giving anyone else problems? Without it, the app seems to work, but with it, i get errors like missing attributes
[20:02:48] pipework: rc-: Don't query me without asking. :)
[20:02:48] Dreamer3: interesting
[20:02:59] Dreamer3: rc-: i asked a clear question
[20:03:01] Dreamer3: rc-: "at 1440 a retina renders everything at 2880x1800 and then it's down sampled to the native resolution" what would you prefer it do instead?
[20:03:18] fpruitt: Can anyone answer a quick question on updating a text block based on form inputs?
[20:03:29] toretore: fpruitt: ask
[20:03:35] pipework: fpruitt: You can just ask questions directly.
[20:03:36] toretore: the question
[20:03:55] smathy: Wow, pipework is toretore's bot?
[20:04:10] fpruitt: toretore, pipework: I have, but everyone seems more interested in donkey dicks than rails help ;D
[20:04:38] pipework: fpruitt: That's just one individual. He's been known to spend more time practicing asshattery than anything else. Feel free to just ask.
[20:05:21] helpa: fpruitt: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[20:05:21] toretore: fpruitt: !gist your code
[20:06:45] fpruitt: I need to update a text field based off of the average of four drop down boxes, and I need it to be done as those boxes are changed. It looks like this. http://imgur.com/VihoaFv
[20:08:02] DylanJ: thats a js question
[20:08:21] toretore: fpruitt: add a submit button, do the math on the params on the server, render a new page with the results
[20:08:37] smathy: toretore, you missed: "and I need it to be done as those boxes are changed"
[20:09:07] toretore: change boxes, press button
[20:09:08] smathy: fpruitt, you understand you need to write some JS to do this? If so, are you asking where to put JS in a Rails project?
[20:09:19] fpruitt: I think you're right, DylanJ, but I don't know how to get at the values that my <%= f.select :criteria4, [['Needs Significant Improvement', 1],['Needs Improvement',2],['Satisfactory',3],['Very Good',4],['Excellent',5]], :prompt=>true %>
[20:10:26] toretore: fpruitt: if you mean to chante the page dynamically in response to in-document events, then yes, that is a js question. the answer is: learn javascript, learn how to interact with the document using js
[20:10:32] fpruitt: More or less, smathy- usually, I would usually do something like this: https://gist.github.com/fpruitt/5a1764f04abbe3546013
[20:11:16] smathy: fpruitt, not sure what that is, only an example of JS I hope because that code has nothing to do with what you need to do here.
[20:11:44] fpruitt: toretore, I know a bit of JS- my lack of knowledge is in what rails does with my f.select - how do I get at the values.
[20:12:23] DylanJ: $('model_crietera4 :selected').value() or something
[20:12:27] toretore: fpruitt: so your question is really "how do i get the values of one or more select elements using js?" - and it doesn't have anything to do with rails
[20:12:36] smathy: fpruitt, look at the HTML in your browser, you'll see the IDs that Rails gives those fields.
[20:12:53] GreenGorilla: Hi Guys, weird issue with a self.method I've never experienced befre, probably tired eyes: https://gist.github.com/anonymous/5415854
[20:13:00] fpruitt: thanks, smathy - that was my disconnect. Sorry for such a noobish question.
[20:13:28] toretore: GreenGorilla: not weird, expected
[20:13:50] GreenGorilla: toretore: thats what i like to hear, solution?
[20:14:05] DylanJ: don't do self.applications :)
[20:14:05] bobbobbins: hey, quick newbie question here…I set up a controller examples with a method called "create" but when I go to /examples/create it maps to /examples/show. Any idea why this happens and how i fix it?
[20:14:19] DylanJ: has_many applications, through: :occurance_applications
[20:14:32] DylanJ: @occurange.applications.where(accepted: true)
[20:14:33] toretore: GreenGorilla: you have defined a method on the Occurence class, but what you want is to define an instance method for instances of that class
[20:15:16] pitzips: Is it possible to do an active record where statement on a string range?
[20:15:22] smathy: fpruitt, you're welcome.
[20:15:35] pitzips: I have it almost there, but it doesn't work as expected.
[20:15:44] momomomomo: pitzips: Post your code to http://gist.github.com/ (all related code and errors), and then come back and explain: What you're trying to do, what the issue is, and what you think has gone wrong. This will help people be able to digest/understand your problem. Also check this out when you get a chance: http://www.catb.org/esr/faqs/smart-questions.html
[20:15:50] toretore: sideways :/
[20:15:51] pitzips: momomomomo: https://gist.github.com/pitzips/c068e5e8c546eb5cde1c
[20:15:59] DylanJ: toretore: 8 is the best i can do :p
[20:16:27] pitzips: I already asked you this once, and you just presented the Active Record Query Interface doc url.
[20:17:09] toretore: pitzips: ;D ;D ;D
[20:17:27] toretore: u hav ben trold ;D ;D ;D
[20:17:37] momomomomo: pitzips: See here: http://stackoverflow.com/questions/8059770/how-to-specify-ruby-regex-when-using-active-record-in-rails
[20:17:45] momomomomo: It depends on your database.
[20:18:01] pipework: But everyone uses postgres, right?
[20:18:05] pipework: That's the only true databasen.
[20:18:07] smathy: momomomomo, regexp? Wtf?
[20:18:26] momomomomo: everyone has to learn smathy
[20:18:38] pitzips: momomomomo: I know regex, but I want to learn the proper way
[20:18:43] toretore: pitzips: unless your database supports ranges, it's not possible
[20:18:53] GreenGorilla: DylanJ: I get this using that method: Could not find the association :occurrence_applications in model Occurrence D:
[20:18:56] pipework: momomomomo: That's horrible.
[20:18:57] pitzips: toretore: gotcha. that's a great answer thank you.
[20:18:58] momomomomo: Postgres and mysql can do regex queries, but you have to specify this
[20:19:04] momomomomo: pipework: is there a better way?
[20:19:06] pipework: pitzips: Don't just use #all and #select
[20:19:12] smathy: pitzips, Merchant.where( "name in (?)", ('abc'..'def'))
[20:19:20] momomomomo: pipework: Look at the answer - it says to do a query with regex.
[20:19:22] toretore: pitzips: you might be able to do something like BETWEEN 'CAR' AND 'XXX'
[20:19:36] pitzips: toretore: https://gist.github.com/pitzips/c068e5e8c546eb5cde1c
[20:19:52] momomomomo: I wasn't advocating the all.select >:|
[20:19:57] pipework: momomomomo: I'd probably use the database's regexp stuff for sure.
[20:19:59] pipework: momomomomo: Oh good. :D
[20:20:01] pitzips: toretore: that's what I have now, it kind of works, except only seems to use the first letter
[20:20:12] smathy: pitzips, you saw that I gave you the answer right?
[20:20:25] toretore: pitzips: what is it you're trying to get out of the db with that?
[20:20:27] pitzips: smathy: ahh, no I didn't, thanks for the ping
[20:20:38] pitzips: smathy: will try that in sandbox
[20:20:57] pitzips: toretore: I'm trying to update a specific column (add 2), but not to all of the rows
[20:21:06] pitzips: toretore: only the rows between a specific name range
[20:21:29] toretore: pitzips: give me an example of a name?
[20:21:39] smathy: toretore, see the gist.
[20:21:54] toretore: CAR and ZZZ ?
[20:22:12] toretore: doesn't make much sense without some explanation
[20:22:39] smathy: toretore, he wants to select all records where name is in the range 'CAR'..'ZZZ'.
[20:22:51] toretore: i get that.. what i don't get is why
[20:23:15] momomomomo: Right, so let him/her read the documentation on the database they are using; toretore to update fields with a name between that range
[20:23:28] smathy: momomomomo, or just use what I told him to.
[20:23:36] smathy: SQL-independent.
[20:23:49] smathy: *Specific DB
[20:23:51] GreenGorilla: toretore: you have defined a method on the Occurence class, but what you want is to define an instance method for instances of that class, can you elaborate?
[20:24:16] momomomomo: smathy: if that's the case, then yes
[20:25:20] toretore: GreenGorilla: "self" in that scope is the Occurence class object. by defining a method on it, you're defining an instance method in its eigenclass (a so-called singleton method), resulting in a class method
[20:25:59] Frezzy: http://fresfrezzy.blogspot.fr/
[20:25:59] pitzips: smathy: that tried to select all names that were only 3 letters
[20:26:17] toretore: or, without the "i know ruby better than you" wankery: you're defining a class method, not an instance method
[20:26:20] pitzips: smathy: is there a way to substring the name to use?
[20:26:23] smathy: pitzips, that's what 'CAR'..'ZZZ' means. What were you *trying* to do?
[20:27:04] frem: I'm trying to add a new namespace for some classes in lib, but rails isn't finding them. What am I doing wrong? https://gist.github.com/jamesgecko/6b97bf658665434db192
[20:27:08] pitzips: smathy: trying to get all names that include CARLOS CARLS and the end
[20:27:13] toretore: Too Much Anal DiSC1 XXX DVDRip
[20:27:22] ryorky1: if I have a table structure that looks like this companies has_many :users and users has_one :accesses, how can I build this to save everything at the same time?
[20:27:22] GreenGorilla: toretore: I'm trying to get an Occurrence object to be able to call that medthod, i.e. @occurrence.applications, rather than Occurence.new.applications. I thought i was doing this by using def self.applications
[20:27:27] pitzips: toretore: yup.
[20:27:39] toretore: GreenGorilla: those are the same
[20:27:55] smathy: pitzips, you mean like: Merchant.where( 'name LIKE ?', 'CAR%')
[20:27:55] pitzips: smathy: I may be thinking about it all wrong, but I want to select only the names that are above CAR*
[20:28:06] pitzips: yeah, so anything after CAR%
[20:28:19] pitzips: including Delta, Happy, Geoge
[20:28:25] slash_join: but alphabetically after
[20:28:46] toretore: pitzips: is this a one-time operation?
[20:28:49] pitzips: toretore: yes
[20:28:50] smathy: pitzips, just so we're on the same page re terminology - you're looking for names which *start with* "CAR". "above CAR*" has no discernible meaning.
[20:28:56] GreenGorilla: toretore: my life is a lie. thanks buddy!
[20:29:02] frem: toretore: ಠ_ಠ
[20:29:19] toretore: pitzips: Merchant.all.select{|m| m.name > 'CAR' }.each{}
[20:29:23] slash_join: smathy: I think that everything car* would fall into "alphabetically after car"
[20:29:40] pitzips: slash_join: yes, that's what I mean, sorry it's hard to phrase
[20:29:43] ryorky1: before I added in the accesses table, I was simply able to do: @company = Company.new() user = @company.users.build @company.save
[20:29:47] smathy: slash_join, yeah, clear now what he's after.
[20:29:53] slash_join: smathy: but car* doesn't include everything he wants... he also wants dog, elephant, foo, goat
[20:29:58] pitzips: would toretore 's solution work?
[20:30:01] ryorky1: any ideas?
[20:30:33] pitzips: (thanks for helping by the way, I appreciate you guys)
[20:30:45] smathy: pitzips, not sure if that'll work in all DBs, but worth a try in yours.
[20:30:54] otters: so I'm trying to use the new respond_to/respond_with pattern
[20:31:25] toretore: ryorky1: did you try user.accesses.build ?
[20:31:38] smathy: pitzips, it works in sqlite and mysql.
[20:31:50] pitzips: damn, postgres on prod =/
[20:31:57] rotham: hey.. is there a rails javascript file that makes it properly use all of rails little shortcuts like method: _destroy, or remote: true work?
[20:31:58] smathy: pitzips, try it.
[20:32:04] slash_join: pitzips: do you care about casing?
[20:32:04] toretore: pitzips: my solution doesn't run in the db
[20:32:33] ryorky1: toretore: can give it a shot, tnx
[20:32:34] rotham: and if so how can I modify another javascript plugin to use rails method of loading remote calls.
[20:32:36] otters: is there a way to abstract this out with respond_with? https://gist.github.com/otters/cb914b762f09ce8bb176
[20:32:57] otters: like respond_to :csv in the controller, but then I want to be able to specify the filename in the action as well
[20:33:21] pitzips: slash_join: not 100% sure what you mean
[20:33:59] pitzips: toretore: wouldn't run in console you say?
[20:34:02] slash_join: A versus a (as far as alphabetical order)
[20:34:33] smathy: pitzips, toretore's solution is best I think. Pg is a PITA for string stuff like this.
[20:34:51] pitzips: k, gonna try it and get back to ya guys
[20:35:43] smathy: pitzips, could order by name, and then you could make it quicker to go through your list in Ruby.
[20:36:07] slash_join: workin on a silly solution
[20:40:13] toretore: hello my friend how are you
[20:41:13] toretore: i am spectacular, thanks for asking!
[20:42:02] tobi_: i ditnd solve my problem yet :(
[20:42:39] tobi_: but now i have time to solve it :)
[20:43:33] momomomomo: what's your problem tobi_
[20:43:58] tobi_: nested forms with strong parameters in rails4
[20:44:49] tobi_: https://gist.github.com/HappyTobi/ca607da1620dfe4eac14 <--source, the problem is that the param app_screenshot should be named as app_screenshot_attributes
[20:45:07] eroc: I'm dynamically loading a partial into my page. That partial contains a remote link_to. When the partial is added to the page, the remote link isn't being wired up. Is there a way to re-trigger Rails' process that creates the remote links?
[20:45:40] pipework: 'wired up'? What's a 'remote link_to'?
[20:45:53] pipework: You'll probably have to show the code that's relevant.
[20:46:28] momomomomo: tobi_: did you accept_nested_attributes and allow MobileApps to write app_screenshot_attributes ?
[20:47:33] toretore: eroc: bind your listeners to an element higher up (a container, maybe <body>) that doesn't change
[20:47:41] momomomomo: I haven't used strong_params, but I'd make sure that mobile app has permission to write app_screenshot_attributes
[20:47:44] toretore: there's a name for it, but i forget
[20:48:41] eroc: I could do that. Right now, I'm using straight Rails UJS, so it is taking care of all that for me. I'm hoping I don't need to drop down to creating my own handlers.
[20:49:49] toretore: i would've thought that's how the ujs stuff is implemented
[20:50:39] tobi_: momomomomo: you can see it in gist line 108
[20:50:45] tobi_: i think yes
[20:52:00] slash_join: pitzips: https://gist.github.com/rthbound/5416115
[20:52:02] tobi_: i think the problem is has_many with through
[20:52:58] tobi_: but i don't know ... an other option is that my form is wrong
[20:53:26] dopie: Hello how do i tell sublime text 2 to autoclose lets say an <p>???
[20:53:46] pitzips: slash_join: you are a beast, but I am just verifying and think that toretore's solution will work for my needs
[20:55:04] slash_join: cool, was just reading the logs to see what he suggested
[20:55:39] epochwolf: dopie: ctrl+shift+w to create tags
[20:56:00] dopie: yeah right
[20:57:48] rhizome: dopie: <%= content_tag :p, @foo.name %>
[20:57:57] dopie: even beter
[20:58:19] rhizome: ctrl-shift .
[20:58:19] pipework: I try not to use that too much.
[20:58:50] rhizome: content_tag is so un-railsy
[20:59:44] olivier_bK: i try to pass a migration with a number but i get an error rake aborder because
[20:59:50] olivier_bK: he try to pass all migration
[20:59:51] helpa: olivier_bK: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[20:59:51] pipework: olivier_bK: !e
[21:00:46] olivier_bK: rake db:migrate VERSION=20130418203707
[21:01:16] rhizome: it's a little unwieldy
[21:01:35] Aloysius1: Good morning. I have an issue where "rails _version_ new appname" is coming back with the usage text. "rails new appname" works fine, but rails acts like it doesn't recognize the _version_ command.
[21:01:41] rhizome: i don't think plain :migrate responds to VERSION tho
[21:01:50] dopie: is it better to make a partial of a header and then put it in the application layout?
[21:02:03] rhizome: dopie: i do, but i also question it from time to time
[21:02:32] olivier_bK: if you want to force a migration try that rake db:migrate:redo VERSION=20130418203707
[21:02:45] dopie: Is there really a difference except it is being loaded and might cause lag?
[21:05:57] rhizome: aaaand it's gone
[21:07:39] epochwolf: rhizome: rake db:migration:up VERSION=
[21:08:09] epochwolf: okay, it's time for me to start drinking
[21:09:53] rhizome: i love that only the mobile view of adsense dash is working
[21:09:56] smathy: pitzips, FWIW, postgres works fine with the `name > 'CAR'` solution.
[21:10:40] smathy: pitzips, ie. Merchant.where( 'name > ?', 'CAR')
[21:11:11] pitzips: smathy: yup! it looks good so far. just booted up heroku console to run the command
[21:11:22] pitzips: tested it out in sandbox and it's butter smooth
[21:12:06] smathy: pitzips, ah, ok, I thought you were still on toretore's solution. All good then.
[21:13:01] slash_join: ACTION overengineered the hell out of that
[21:13:43] s2013: Radar are you awake by any chance?
[21:14:02] pipework: s2013: It's like 6am there.
[21:14:12] s2013: i am confused about something in r3ia
[21:14:30] pipework: s2013: You can ask here and highlight him in it. :D
[21:14:35] pipework: If we know, we'll help.
[21:14:49] s2013: do you by chance have the book or read it before?
[21:16:07] s2013: not sure if i am getting ahead of myself.. cause there is an error that he mentions.. and he solves it by changing the steps in cucumber but not the actual code..
[21:19:00] Aloysius1: Anyone have any thought about my _version_ issue?
[21:20:09] smathy: Aloysius1, what's the actual command you're doing?
[21:20:15] Aloysius1: (I'm sure this is somthing dumb I've done. Forgotten to install something.)
[21:20:30] smathy: …or are you literally putting: "_version_" ?
[21:20:39] Aloysius1: rails _3.2.13_ new hw16
[21:21:07] Aloysius1: It's not just me. I just installed RubyMine and noticed its new projects were coming up empty.
[21:21:21] Aloysius1: (New machine, new install of everything.)
[21:22:07] smathy: Aloysius1, and `rails -v` gives what?
[21:22:25] Aloysius1: Rails 3.2.6
[21:22:45] Aloysius1: rails _3.2.6_ new hw16
[21:22:51] Aloysius1: Also gives the usage screen.
[21:22:55] pitzips: toretore: smathy: slash_join: thanks a bunch for the help. that one was bugging me for awhile
[21:22:57] smathy: Aloysius1, and `which rails` gives?
[21:23:14] s2013: which js framework do you guys use with rails?
[21:23:29] Aloysius1: Smathy--not sure I get the question.
[21:23:35] smathy: Aloysius1, run: which rails
[21:23:39] smathy: Aloysius1, paste the output.
[21:23:44] Aloysius1: oh duh...sorry
[21:23:55] Aloysius1: /usr/bin/rails
[21:24:46] smathy: Aloysius1, and what about: which gem
[21:24:58] Aloysius1: /usr/bin/gem
[21:26:25] smathy: Aloysius1, ok, and if you cat that `rails` file you can see it has the version stuff in it?
[21:27:10] Aloysius1: Hmmm. I see a script:
[21:27:12] Aloysius1: if File.exists?(File.join(File.expand_path('../../..', __FILE__), '.git'))
[21:27:12] Aloysius1: railties_path = File.expand_path('../../lib', __FILE__)
[21:27:12] Aloysius1: $:.unshift(railties_path)
[21:27:12] Aloysius1: require "rails/cli"
[21:27:44] smathy: Aloysius1, ok, that's an old executable, pre-version. (also, next time don't paste the whole thing in here, use pastie.org or gist.github.com)
[21:27:44] Aloysius1: (With the hash bang for ruby at the front, of course.)
[21:28:06] smathy: Aloysius1, so you want to just `gem install rails` to get a new executable with the _version_ support.
[21:28:23] smathy: Aloysius1, it should replace that one, if it doesn't - delete it, then `gem install rails` again.
[21:28:37] smathy: `sudo` if that's how you're doing things
[21:29:00] Aloysius1: Yeah, I'd done that to no avail, but I haven't done the delete thing...
[21:29:13] Dreamer3: smathy: a pastie fan :) kudos
[21:29:41] rhizome: ACTION hates it when he does dumb stuff
[21:29:43] smathy: Dreamer3, forever, and best wishes for your brother.
[21:32:11] Aloysius1: OK, so "gem install rails" didn't help. I deleted usr/bin/rails. Did "gem install rails" again, but now can't run "rails" at all.
[21:36:24] pipework: Aloysius1: What os?
[21:37:26] helpa: Aloysius1: Ubuntu Ruby, Rails and RVM setup guide: http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/ - Guaranteed to work 100% of the time or your money back!
[21:37:26] pipework: Aloysius1: !ubuntu
[21:37:33] Aloysius1: USe this exact same set up on the other machine with no trouble.
[21:38:13] rhizome: i'm gonna guess it's not exact
[21:38:34] Aloysius1: I'll try the guide.
[21:38:54] Aloysius1: Ooh, I did use curl last time. :-/
[21:38:55] pipework: Aloysius1: If you've got shit in /usr/bin/rails chances are you're doing it wrong.
[21:39:10] Aloysius1: Important safety tip, thanks pipework.
[21:39:26] pipework: I'd suggest forgetting everything you thought you did right before and follow that guide. Later if you like, you can switch to some other ruby manager thingy.
[21:46:32] smathy: Aloysius1, FWIW, you can grab this http://pastie.org/7650416 to replace your /usr/bin/rails and it should work for you with _version_ while you fix your stuff up.
[21:46:41] smathy: Aloysius1, I didn't want to just leave you broken.
[21:49:11] tobi_: what your doing if you have an file_filed and the name of that field ends with empty []? do you set the name property or is there a better way?
[21:50:28] Aloysius1: Smathy, thanks. I've still got some messed up stuff so that script helps.
[21:53:00] Dreamer3: pipework: i use rbenv all the way
[21:53:05] Dreamer3: so much simpler than rvm
[21:53:17] rakl: quick q. if I call #save in an after_save callback, will it go into an infinite loop?
[21:53:27] jost: I'm trying to profile a redmine view, using ruby-prof. I have installed the ruby-prof gem... but the rendering alway aborts with "LoadError (no such file to load -- ruby-prof)". Whats the way to debug that?
[21:53:32] rakl: or even #update_attributes
[21:53:34] pipework: Dreamer3: My condolences.
[21:53:50] terrellt: Dreamer3: It's okay, we all make mistakes. =(
[21:53:52] pipework: Dreamer3: If you wanted to do it more UNIX-y, you'd use chruby and ruby-build
[21:54:05] Dreamer3: i use ruby-build with rbenv
[21:54:07] pipework: rbenv is 90% and 10% project no one wants to maintain
[21:54:36] Dreamer3: interesting, never has a problem with it
[21:54:40] Dreamer3: esp for local work
[21:54:56] terrellt: That's alright.
[21:55:14] pipework: Dreamer3: Never had one with rvm either. :D
[21:55:19] terrellt: When I got here our production machines were just yum install ruby.
[21:55:27] Dreamer3: the ball was definitely rolling away from dvm towards rb-evn, did it change direction?
[21:55:39] pipework: Dreamer3: Having issues?
[21:56:09] pipework: What's dvm?
[21:56:28] rhizome: rvm rbenv ...probably a fast typer
[21:56:28] pipework: It wasn't moving towards it, there was just a split in the community because another 37signalist thought he could write a slightly better shitty ruby manager. :D
[21:56:37] pipework: rhizome: Fast typers don't make mistakes.
[21:56:38] Dreamer3: yeah my fingers are having problems, not me
[21:56:55] pipework: "Officer, it wasn't me, it was my fingers.
[21:56:56] rhizome: pipework: i don't follow tautologies
[21:57:08] Dreamer3: pipework: it's philosophical too
[21:57:10] pipework: rhizome: I don't follow illiterates. :D
[21:57:17] Dreamer3: i like shims much better than changing global environment variables in the shell
[21:57:35] rhizome: when has this crap ever caused a problem?
[21:57:52] Dreamer3: rhizome: never used rvm with sudo, huh?
[21:57:57] smathy: rhizome, when I use pushd and popd to change directories - for one.
[21:57:57] pipework: shims are hilarious bad.
[21:58:12] smathy: pipework, better not use `rails` anymore then.
[21:58:27] pipework: smathy: rails is never an empty shim. :D
[21:58:32] rhizome: Dreamer3: huh? you mean on prod side or something? i deploy as the app user.
[21:58:34] pipework: I mean, unless you rbenv.
[21:58:56] pipework: The best thing here is chruby with ruby-build.
[21:59:00] smathy: Step 1: wait until room gets quiet.
[21:59:24] smathy: Step 2: pick a stupid topic concerning things which are either equally bad, or equally good.
[21:59:28] smathy: Step 3: assert crap.
[21:59:34] Dreamer3: chruby just changes the environment
[21:59:39] banister`sleep: hi, how do i do the equivalent of this sinatra app, but for a rails app: https://gist.github.com/banister/5416580
[21:59:42] pipework: That's all you need.
[21:59:55] Dreamer3: i don't have an argument but shims just feel simpler to me
[22:00:14] pipework: Simpler until they're just empty files and you're scripting against that shit. :(
[22:00:32] Aloysius1: Thanks for everyones help.
[22:00:34] Dreamer3: obviously i've never run into that problem
[22:00:37] smathy: Yeah, wow, software has bugs. Stop the fucking planet and let me off.
[22:00:47] smathy: STFU everyone.
[22:00:54] smathy: Bikeshed!
[22:01:32] rhizome: fun things are fun
[22:03:04] pipework: Yeah, except there's bugs and then there's shitty design decisions. Both our preferred tools are guilty of it.
[22:03:28] smathy: Let's argue over which is better, text mate, sublime or vim. Or, gist or pastie ;) Or resque, sidekiq or DJ.
[22:03:39] Dreamer3: pastie is easy
[22:03:45] Dreamer3: but i can't argue cause i'm biased
[22:03:52] terrellt: Rubymine, Gist, Sidekiq.
[22:03:53] terrellt: ACTION is done.
[22:03:55] pipework: smathy: vim, gist then pastie, none
[22:03:59] smathy: That's why you CAN argue ;)
[22:04:31] pipework: I can argue too.
[22:04:38] smathy: I prefer pastie - because it was first. gist solved a problem that was already solved IMHO :)
[22:04:42] Dreamer3: i don't need to argue
[22:04:46] pipework: smathy: pastie wasn't first.
[22:04:54] Dreamer3: if it's not self evident then you aren't meant for pastie :)
[22:04:58] Dreamer3: pastie was the first best :)
[22:05:06] pipework: Dreamer3: It keeps fucking up highlighting lines.
[22:05:07] smathy: pipework, first of the two candidates.
[22:05:16] Dreamer3: pipework: then email me :)
[22:05:25] pipework: It doesn't know the difference between me clicking to highlight text or highlighting lines.
[22:05:45] Dreamer3: pipework: if you have a solution on how you'd tell the difference… i'm listening :)
[22:05:59] Dreamer3: if i'm coping transiently the hilights just don't bother me
[22:06:01] pipework: Dreamer3: highlight lines when people click line numbers, not just anywhere on the line.
[22:06:10] Dreamer3: pipework: neat idea
[22:06:28] pipework: Not mine. A few things do it.
[22:06:38] Dreamer3: safari doesn't' break
[22:06:43] Dreamer3: must be those other pesky browsers :)
[22:06:53] pipework: I'm still on a webkit chrome, so there's that.
[22:06:57] smathy: Oh, perfect. Another great argument.
[22:07:16] pipework: smathy: Oh great, that last thing you said could be a great argument too.
[22:08:26] smathy: I want to paste the Argument Sketch from Monty Python.
[22:08:34] rhizome: no you don't
[22:09:14] helpa: YOLO driven development - https://gist.github.com/3979145
[22:10:01] banister`sleep: here's my question enshrined in a stackoverflow post: http://stackoverflow.com/questions/16093912/how-to-use-eventmachine-rails-and-websockets
[22:10:31] tagrudev: pipework, yup
[22:11:28] pipework: banister`sleep: Any reason you wouldn't want to mount that as an endpoint in your rails app?
[22:11:55] banister`sleep: pipework: im not entirely sure what you mean by that
[22:12:28] pipework: banister`sleep: You can mount any rack app inside your rails app through the router.
[22:13:37] banister`sleep: pipework: well, i don't know about that, i might look into it later, but is there an analogous way to start rails via a thin instance inside reactor loop, as there is with sinatra in that example?
[22:13:55] pipework: banister`sleep: That I don't know, I'm sorry.
[22:15:03] Dreamer3: damn the camera i want isn't out yet
[22:15:45] tobi_: so its time to go ... cu all
[22:16:13] pipework: banister`sleep: Have you put the reactor inside an initializer perhaps?
[22:20:24] rylwin: Anybody here ever migrate from Authlogic to Devise? I'm working on this but am having some trouble...just can't seem to authorize even though I've set encryptor. Any help would be appreciated. I can of course provide more details. Thanks in advance!
[22:22:54] smathy: rylwin, I've gone the other way plenty of times. I hate devise.
[22:23:16] Dreamer3: i like simple session mechanics
[22:23:31] Dreamer3: i wrote my own just the other day cause i didn't really love either of the two things i looked at
[22:23:34] smathy: I've also started with devise a couple of times and ended up with plain warden.
[22:23:51] smathy: I just never seem to be able to cram my requirements into the devise box.
[22:25:26] smathy: rylwin, seriously though, why change? Is there something you think you'll get with devise that you're not getting from authlogic?
[22:26:36] toretore: "i'm going to switch to devise from authlogic, that's going to solve all my authentication problems"
[22:27:29] rylwin: I like the out-of-the-box support for things like reconfirm emails, reset passwords, etc for one. Also, I've had some issues w/ authlogic updating fields when I don't want it too when I have users creating users of another model
[22:28:28] toretore: rylwin: i can almost guarantee you that you will spend much more time on this socalled migration than you would writing everything from scratch
[22:29:13] rylwin: ha. well, that may be true :). But I don't want to roll my own
[22:29:47] otters: honestly, devise isn't so bad
[22:31:04] rylwin: Does authlogic set a default pepper that I need to give to devise? I don't see that documented anywhere...but maybe?
[22:33:12] smathy: …not that you have to write much from scratch, set the user state to pending by default, email an activation URL that includes the perishable_token, it's 10 lines.
[22:33:45] smathy: …definitely more reading with authlogic though, but that's a function of its flexibility.
[22:34:44] Dreamer3: rolling your own is good
[22:34:54] otters: unless you do it wrong
[22:35:06] Dreamer3: well true, i guess if you can't do it right you shouldn't dot it
[22:39:16] toretore: if you can't do it right you must DIE!!!
[22:39:32] toretore: not really though, i'm just joking
[22:39:38] otters: yeah, part of the reason I used devise was because I didn't want to do it myself, but another part was that I figured a widely used open source project would probably be more secure than my solution
[22:39:59] pipework: If you have pretty straightforward needs for authentication, it ain't bad.
[22:42:42] BrianJ: How do I make a long running sentence go … so that it stays in my css block?
[22:44:17] wishfoundry: BrianJ: you can count the chars at snip at a set threshhold
[22:44:38] wishfoundry: but you cannot really calculate the width dynamically
[22:44:55] Radar: Good morning. 1) your indentation is wrong 2) Separate your files into different gists 3) No, you're doing it wrong. 4) See 3. 5) C'mon now.
[22:45:00] BrianJ: how would I snip the chars? I found truncate, is that the correct way?
[22:45:43] banister`sleep: Radar: heya, dont mean to bug you, but could you tell me the best approach to do something equivalent ot this in rails? http://stackoverflow.com/questions/16093912/how-to-use-eventmachine-rails-and-websockets
[22:45:44] Leighton: BrianJ: I was just going to link you this http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-truncate , you can select length and such, was there something else you were hoping for?
[22:46:17] wishfoundry: ok, I'm stumped with this one:
[22:46:18] wishfoundry: The action 'show' could not be found for AccountWizardController
[22:46:35] wishfoundry: http://tan-tatyana-02.pagodabox.com/j
[22:46:47] wishfoundry: clearly the show method is there
[22:46:50] Radar: banister`sleep: I wouldn't know sorry. I've never worked with websockets.
[22:47:14] pipework: banister`sleep: Are you serving your whole app on thin?
[22:47:23] banister`sleep: Radar: but really if i can just get access to whatever the rails 'rack app' thing is, i think i can just pass that to Thin and it'll work
[22:47:23] pipework: Or do you just want to spin up thing with a reactor inside?
[22:47:37] banister`sleep: pipework: whole app on thin
[22:47:45] BrianJ: Leighton: ya I think thats what I just found. It worked perfectly
[22:47:59] pipework: banister`sleep: Then you should be able to use an initializer to start the EM loop and keep a reference to it I'd think.
[22:48:04] Leighton: BrianJ: no problem, glad it was helpful
[22:48:31] banister`sleep: pipework: start it off in a different thread you mean?
[22:48:52] pipework: banister`sleep: That's what I'm seeing suggested.
[22:48:52] lotsoftraffic: Anyone know of any ad managers for rails?
[22:49:04] pipework: lotsoftraffic: nil is pretty good for adverts.
[22:49:27] lotsoftraffic: pipework: nil? do you a link?
[22:49:51] Radar: s2013: Yes.
[22:49:54] lotsoftraffic: pipework: link to their github?
[22:50:04] pipework: lotsoftraffic: NilClass
[22:50:06] wishfoundry: nil means none, nada
[22:50:19] origcamper: wishfoundry: whats your routes.rb file look like?
[22:51:00] wishfoundry: http://tan-tatyana-02.pagodabox.com/k
[22:51:14] lotsoftraffic: No good ad managment for rails?
[22:52:21] origcamper: not entirely a rails question but does anyone have a suggestion for dealing with gemfile.lock conflicts when rebasing?
[22:52:38] lotsoftraffic: I'm looking for something that rotates ads related to content on page and records page and click impressions. Any suggestions?
[22:55:21] Dreamer3: lotsoftraffic: sounds like a few lines of code :)
[22:56:12] lotsoftraffic: Dreamer3: Any good gems?
[22:56:24] Dreamer3: origcamper: edit them
[22:56:33] Dreamer3: lotsoftraffic: no idea
[22:57:02] Dreamer3: origcamper: you have no choice if the versioned pinned are THAT important
[22:57:14] Dreamer3: if not just bundle update and then check in a fresh lockfile
[22:57:24] lotsoftraffic: Dreamer3: C'mon buddy
[22:57:40] Dreamer3: lotsoftraffic: that's why i use an ad network, let them do the work
[22:57:51] Dreamer3: not a super interesting problem
[22:59:37] origcamper: Dreamer3: minimally important if at all
[22:59:53] Dreamer3: then just replace the lock file with a new one
[23:01:40] Dreamer3: anyone have an aeropress?
[23:03:08] lotsoftraffic: Dreamer3: But I need to promote advertisers in an image text format that matches my design. I don't know of any ad networks that allow this.
[23:03:33] Dreamer3: lotsoftraffic: you can tweak CSS or entirely rewrite using JS but really i don't know your use case
[23:03:36] Dreamer3: i make it work for pastie
[23:03:53] Dreamer3: good networks have a lot of flexibility within reason
[23:04:00] lotsoftraffic: Dreamer3: You're the owner of pastie?
[23:04:21] lotsoftraffic: Dreamer3: Huge fan of your work!
[23:04:49] lotsoftraffic: Dreamer: Haha, I'm a pastie groupie
[23:05:30] lotsoftraffic: Dreamer3: But you use Carbon :(
[23:05:45] wishfoundry: anyone have an idea on my issue?
[23:05:55] lotsoftraffic: I don't like cheap ads though, I need something that matches my specs
[23:06:23] Dreamer3: are carbon ads cheap?
[23:06:33] Dreamer3: my own gripe is they don't serve retina images
[23:07:36] lotsoftraffic: Dreamer3: What cut does carbon give you? 50?
[23:08:07] Dreamer3: i'm not sure i can even discuss, but it's MUCH better than what i was given before carbon bought out the previous network
[23:08:23] Dreamer3: i made over $1k one crazy month, though it's typically not that high
[23:08:39] lotsoftraffic: Dreamer3: If you're not getting at least 50, you're getting jipped
[23:08:49] Dreamer3: i dunno what "50" meas
[23:09:06] Dreamer3: 50% of what?
[23:09:50] lotsoftraffic: adsense is 50/50
[23:09:52] Dreamer3: no idea what rev is
[23:10:16] JanDintel: I got a quick question regarding S3 and paperclip. I keep getting the missing :bucket error in my logs, however it's defined in my production.rb
[23:10:31] Dreamer3: ha i know the abbrv
[23:10:39] lotsoftraffic: JanDintel: Stop using paperclip. Use DragonFly.
[23:12:31] JanDintel: Iotsoftraffic: Won't solve the problem right? Heroku can't find or my app can't find the :bucket name
[23:12:33] bricker: Since ActiveRecord::Base.verify_active_connections! has been removed in rails 4, how should I ensure that the resque worker hasn't lost its connection to MySQL when a job starts?
[23:13:53] Dreamer3: i do 300-400k impressions a month
[23:14:17] modsognir: Dreamer3: of whom?
[23:14:30] Dreamer3: CTR around 0.15%
[23:14:35] Dreamer3: i have no idea if that's good or not
[23:16:00] brownies: that seems... low.
[23:16:11] Dreamer3: well most people go to pastie to paste, not click ads :)
[23:16:37] Shoutsid: This is more of a ruby question, but say if I'm iterating through each line in a file, is there someway to know that i am on the last iteration?
[23:17:20] Radar: wishfoundry: What's your issue?
[23:17:36] bricker: Shoutsid: array.each { |i| puts "last" if array.last == i }
[23:18:00] link15: is there a way to manually make rails forget that it ran a migration?
[23:18:07] wishfoundry: Radar: shoe method not found when it's there
[23:18:09] bricker: Shoutsid: or use each_with_index and compare it to array.size
[23:18:10] link15: my migration table is out of sync with migrations that have actually been ran
[23:18:12] Dreamer3: link15: remove it from the migrations table
[23:18:14] link15: and i cant just clobber the db
[23:18:18] link15: Dreamer3: how?
[23:18:26] Dreamer3: link15: with SQL?
[23:18:27] Dreamer3: with a tool?
[23:18:28] link15: Dreamer3: i don't see a migrations table in my mysql
[23:18:30] Radar: wishfoundry: How are you getting this error?
[23:18:31] Shoutsid: bricker: I was about ot say I'm using each_with_index.
[23:18:44] link15: Dreamer3: i don't see a 'migrations' table in the db i'm using for the app
[23:18:46] Shoutsid: bricker: thanks
[23:18:55] Dreamer3: link15: that's not the exact name
[23:19:00] wishfoundry: Radar: The action 'show' could not be found for AccountWizardController
[23:19:00] Shoutsid: Had me stumped for a second
[23:19:24] Radar: wishfoundry: How are you getting this error?
[23:19:30] Radar: wishfoundry: What is triggering this to happen?
[23:19:43] Radar: wishfoundry: Errors aren't just magical unicorns that appear when you wish for them to.
[23:21:56] lotsoftraffic: Dreamer3: You making a 6 figure salary off pastie?
[23:22:12] Dreamer3: xxx,xxx… god, no that'd be nice
[23:22:17] modsognir: lotsoftraffic: if you include a decimal point
[23:22:28] Dreamer3: 4 figure with 4 figure expenses
[23:22:54] lotsoftraffic: Dreamer3: So you make nothing.
[23:23:15] Dreamer3: oh i do a bet better than that
[23:23:26] Dreamer3: but it doesn't pay for the BMW, no
[23:23:36] lotsoftraffic: Let me guess, 4k in net per yr
[23:23:44] Dreamer3: actually it might, but that's just cause of good financing :) wouldn't buy me a new one :)
[23:23:51] Radar: wishfoundry: Not responding at all is kind of a dick move.
[23:24:30] Dreamer3: lotsoftraffic: i don't keep track of it exactly, it's a little extra cash and i run a service that's the best paste service out there… and more than break even
[23:24:41] lotsoftraffic: Dreamer3: What's your real job?
[23:24:42] Radar: Dreamer3: you run Gist?
[23:24:51] modsognir: Radar: ooh burn
[23:24:55] Eiam: someone beat me to it hah
[23:24:56] Dreamer3: i was going to start accepting donations and perhaps subscriptions but then my brother got cancer and i think all the money i could have raked in for pastie went to him, which is ok
[23:25:06] lotsoftraffic: Dreamer3: Gist is better. Just cut your losses and call it a day.
[23:25:10] Dreamer3: seems weird to offer both options
[23:25:24] Eiam: lotsoftraffic: he doesn't have losses
[23:25:33] Eiam: he has profits less than 10k
[23:25:36] Dreamer3: lotsoftraffic: rails
[23:25:49] Eiam: of which he owes taxes on, 28-34% or something
[23:25:50] modsognir: lotsoftraffic: killing pastie would kill half the web of people asking question
[23:26:05] Eiam: so his profits are less than 8k max
[23:26:15] lotsoftraffic: Dreamer3: Your domain is better than gist though
[23:26:18] origcamper: wishfoundry: rake routes and see what it tells you
[23:26:22] Dreamer3: lotsoftraffic: ha, thanks
[23:26:27] alainus: any idea what's the correct syntax for this with haml? => .item.product#{".used" if product.used}
[23:27:19] origcamper: Dreamer3: that premium and charity models seem to be at odds like that
[23:27:26] Dreamer3: origcamper: right
[23:27:31] wishfoundry: origcamper, Radar: I know it's something to do with the wicked gem. I'll figure it out
[23:27:58] Radar: andatche: .item.product { class: "used" if product.used }
[23:27:59] eeridani: alainus: try this: .item.product#{:class => "used" if product.used}
[23:28:00] Dreamer3: origcamper: i mean i could see having both, but then it's just one competing against the other, which is awkward
[23:28:03] Radar: Oops, alainus ^
[23:29:39] origcamper: wishfoundry: my best educated guess is your match in the routes is causing some trouble
[23:29:40] lotsoftraffic: Dreamer3: Where is Pastie Pro?
[23:29:48] Dreamer3: what would that do?
[23:30:15] modsognir: more ads! more line numbers! more colours!
[23:30:25] Radar: lotsoftraffic: Are you about to offer Dreamer3 SEO?
[23:30:37] Dreamer3: more colors, thaat's good
[23:30:37] Leighton: Dreamer3: more pastie, obviously
[23:30:39] wishfoundry: origcamper: that was my second guess, but it's nothing more than a simple resource route
[23:30:49] Dreamer3: for $10 you can have a blue background
[23:30:54] lotsoftraffic: Dreamer3: There is something there, we just have to monetize it
[23:31:07] Radar: wishfoundry: What happens if you delete taht whole controller file?
[23:31:09] Dreamer3: lotsoftraffic: i have other business ideas, i don't' think pastie is the one to make me rich
[23:31:13] Radar: lotsoftraffic: lolololololololol
[23:31:18] Radar: lotsoftraffic: You're one of *those* people.
[23:31:34] wishfoundry: Radar: already did, same issue
[23:31:40] Dreamer3: i may still do more with it and make more, but it's not going to be a big income stream
[23:31:56] Radar: wishfoundry: So.. you deleted the whole controller and it didn't complain about the controller being missing? Still complained about the show action missing?
[23:31:59] Radar: lotsoftraffic: one of those people ==
[23:32:04] Radar: "There's gold in them there hills!""
[23:32:08] ciwolsey: what version of ruby/rails should i begin learning with?
[23:32:09] lotsoftraffic: Dreamer: You have a strong brand, niche, traction, just need to attract businesses
[23:32:12] Radar: Sorry for the typos, I am just laughing so hard.
[23:32:14] Dreamer3: no aeropress people here?
[23:32:28] Dreamer3: lotsoftraffic: businesses want their own private pasties
[23:32:30] Radar: lotsoftraffic: Start with Rails 4 now and get an edge on everyone.
[23:32:35] wishfoundry: Radar: eh, no. I deleted everything and regenerated from scratch
[23:32:36] Radar: ciwolsey: ^
[23:32:42] Radar: wishfoundry: That sounds bad.
[23:32:52] ciwolsey: really? hmm. and what version of ruby works well with it?
[23:32:55] Radar: wishfoundry: What happens if you delete the controller now? I want to see it erroring that it can't find the controller.
[23:32:59] Radar: ciwolsey: 1.9.3 or 2.0.0
[23:33:20] ciwolsey: it doesnt matter which?
[23:33:44] Radar: ciwolsey: nope.
[23:33:46] lotsoftraffic: Dreamer3: Exactly, Offer Pastie Pro Packages to Businesses, featuring custom logos, collaborative pasties, project management, etc
[23:33:59] Radar: lotsoftraffic: SCOPE CREEP
[23:34:06] Radar: lotsoftraffic: I can't tell if you're being serious.
[23:34:07] Dreamer3: Radar: indeed, thank you
[23:34:14] Leighton: ciwolsey: you likely won't notice any difference in learning, might as well start on 2.0.0 I'd say
[23:34:25] Radar: It's like the perfect parody of a hyperactive sales/marketing guy.
[23:34:29] ciwolsey: ruby 2 and rails 4 it is
[23:34:40] Dreamer3: i'm going to start with pastie freemium… so you can buy pastie coins with in-app purchase and stuff!
[23:34:51] Radar: Dreamer3: Great idea! Just like Zynga did.
[23:34:56] ciwolsey: i just followed the getting started tutorial on rubyonrails.org
[23:35:08] Radar: Can I buy a pony on Pastie Pro? Oh God I want a pony soooooooooooo much.
[23:35:21] lotsoftraffic: Dreamer3: Imagine an organization's programmers collaboratively pastieing and working to help each other like github...THINK BIG
[23:35:23] wishfoundry: Radar: uninitialized constant AccountWizardController
[23:35:27] ciwolsey: i set up my db for mysql... did rake db:create.. which is where i ran into an error
[23:35:29] Leighton: Dreamer3: make sure it notifies me if I haven't pastied in a while so I know
[23:35:29] Radar: wishfoundry: yay
[23:35:38] Radar: wishfoundry: Now re-add the controller and restart your application. What does it do now?
[23:35:48] ciwolsey: can you tell me if this is a bug or just normal? http://stackoverflow.com/questions/3467054/runtimeerror-with-mysql2-and-rails3-bundler
[23:35:54] Radar: lotsoftraffic: So hilarious.
[23:36:03] Dreamer3: lotsoftraffic: that's called GIST or github!
[23:36:14] Radar: ciwolsey: Neither?
[23:36:22] lotsoftraffic: There's nothing hilarious about it. Pastie has all the aspects necessary for a Freemium model.
[23:36:30] Radar: ciwolsey: Why are you worried about that if you're going to be using Rails 4?
[23:36:43] ciwolsey: because i spent the last hour figuring it out
[23:37:02] Radar: ciwolsey: Why are you using Rails 3.0.7?
[23:37:15] ciwolsey: i just wondered if its normal to have to edit my gemfile just to be able to rake db:create to run ?
[23:37:28] Radar: ciwolsey: Depends on the database you're using.
[23:37:33] ciwolsey: im not.. i was using 3.2.x
[23:37:49] Radar: if you want to use the mysql2 gem then yes you would need to edit your Gemfile
[23:37:59] ciwolsey: ok so its my own stupidity
[23:38:21] ciwolsey: i was discouraged because i thought it was a bug
[23:38:59] modsognir: ciwolsey: always assume that it's your own mistake first, until you can rule that out
[23:39:16] ciwolsey: so i assume only sqlite is supported out of the box so to speak?
[23:39:29] ciwolsey: and anything else im going to need to add to the gemfile?
[23:39:39] lotsoftraffic: Dreamer3: You need Promoted Pasties
[23:39:41] ciwolsey: postgresql etc
[23:39:41] Radar: ciwolsey: SQLite3, MySQL and PostgreSQL are all supported with the DB adapter gems that Rails depends on.
[23:39:50] modsognir: ciwolsey: even sqlite is in the gemfile
[23:40:01] Radar: lotsoftraffic: Take it to PM please. I need to do some work.
[23:41:21] mrapple: Could anyone help me figure out why I'm getting cannot load such file -- redis? this is redis-rb.rb http://pastebin.com/DrDwiEub
[23:41:30] ciwolsey: all i remember is in the past ive used mysql without having to add "gem 'mysql2', '< 0.3'" to the gemfile before
[23:41:45] Radar: ciwolsey: Well, now you'll need to add it.
[23:41:46] fryguy: mrapple: did you install the redis gem?
[23:41:57] mrapple: it's in my gemfile and i ran bundle install
[23:42:16] fryguy: mrapple: and is this file getting loaded after running Bundler.setup in your app?
[23:42:28] mrapple: as far as i'm aware, yes
[23:42:31] ciwolsey: why does the tutorial mention it then?
[23:42:56] fryguy: mrapple: show us
[23:43:01] Dreamer3: funny i'm using 0.3.11
[23:43:11] Radar: ciwolsey: which tutorial?
[23:43:14] ciwolsey: http://guides.rubyonrails.org/getting_started.html -- this is what i followed, but theres no mention in the mysql section about editing the gemfile
[23:43:40] mrapple: top of application.rb fryguy Bundler.require(*Rails.groups(:assets => %w(development test)))
[23:43:54] Radar: ciwolsey: then that's a mistake of the guide.
[23:44:09] fryguy: mrapple: and what is loading redis-rb
[23:45:11] ciwolsey: so why is it a requirement that its < 0.3 ?
[23:45:15] mrapple: fryguy: PGM::Application.initialize! i would assume, yes? loads everything in initalizers/?
[23:45:28] Radar: ciwolsey: It's not a requirement. You're getting your facts from an SO question that's 3 years old.
[23:45:41] Radar: ciwolsey: Please just try putting gem 'mysql2' in your Gemfile and seeing if that works for you.
[23:46:01] ciwolsey: ok :) thanks
[23:46:04] Dreamer3: Radar: you were starting to confuse me :)
[23:46:16] Radar: Dreamer3: good
[23:46:27] fryguy: mrapple: is redis-rb in initializers?
[23:46:45] mrapple: fryguy: yes, i think it might be an issue with unicorn
[23:52:04] mrapple: yep, looks like when i send unicorn USR2, the new workers were loading the old gemfile by accident
[23:52:08] mrapple: oopsies, sorry for the bother
[23:54:20] sebkomianos: hello everyone, has anyone ever had a method return [boolean] instead of boolean ?
[23:54:39] sebkomianos: I managed to make a method return [false] and [true] instead of false or true
[23:54:57] sebkomianos: and I am clueless to as why, which worries me the most to be honest :D
[23:55:07] helpa: sebkomianos: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[23:55:07] Radar: sebkomianos: !debug
[23:55:23] tattedsxy33: trying to work on my profile...just signed up http://tinyurl.com/cjkvr8q
[23:56:55] ckwalsh: Any idea what is happening here? I'm getting "undefined method `to_sym' for nil:NilClass" but the blamed line is "e.delete" (e is an instance of a model)
[23:57:31] ckwalsh: I grepped through my app for to_sym, but it's only used once and nowhere near any model code
[23:57:45] sebkomianos: okay, here we are: https://gist.github.com/sebkomianos/5889173b6206e4e2d58d
[23:58:05] helpa: ckwalsh: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[23:58:05] Radar: ckwalsh: !debug
[23:58:26] Radar: sebkomianos: https://gist.github.com/sebkomianos/5889173b6206e4e2d58d#file-room-rb-L7
[23:58:28] tonytaudesign: does anyone on here have experience with customizing layouts with spree commerce?
[23:58:52] helpa: tonytaudesign: Rather than guru hunting and asking if someone has used this or that, just ask your question with as much detail as possible. Even if someone hasn't used X Y or Z, there's a high chance someone can help, but only if they have details to work with.
[23:58:52] Radar: tonytaudesign: !guruhunt
[23:59:36] tonytaudesign: alright good stuff
[23:59:49] tonytaudesign: had no idea you were on radar lol