« Back to channel list

#RubyOnRails - 21 August 2014

« Back 1 day Forward 1 day »
[00:09:56] salparadise: capin: I was, but yeah I found the problem, some sort of caching thing, thanks for help anyways
[00:10:25] capin: salparadise: i was going to suggest restart your rails app
[00:15:48] salparadise: capin: yep thats what I did
[00:24:24] hahuang65: anyone know how I can use a defined scope as the default scope so I don't repeat myself?
[00:24:47] hahuang65: scope :secret, -> { where(secret: true) }
[00:24:53] hahuang65: default_scope :secret
[00:24:55] hahuang65: something like that
[00:38:06] lilia: why not just default_scope where(secret: true)
[00:38:26] lilia: you dont need the named scope
[00:39:02] hahuang65: lilia: because I'm going to use Model.secret in a lot of other places?
[00:39:05] lilia: since you can just do MyClass.find for that...
[00:39:08] lilia: Model.find
[00:39:43] hahuang65: lilia: I guess I won't be using it since it's the default scope eh?
[00:56:02] everettForth: hi fellow railsers
[01:02:12] pipework: I call them railturds.
[01:25:40] capin: i like conductors ;)
[01:28:15] stef1a: is there an up-to-date tutorial that explains exactly how to use i18n to generate customized error messages in en.yml?
[01:28:54] helpa: http://guides.rubyonrails.org/i18n.html - Guide on i18n by Sven Fuchs and Karel Minařík
[01:29:03] pipework: should be all you need
[01:29:14] stef1a: i don't think so, but i'll give it another go.
[01:33:58] coreycondardo: quick question - do production apps tend to use a) lots of gems b) only super standard gems or c) roll their own gems (or somewhere in between)
[01:34:18] coreycondardo: by production apps i mean, say something you might work on while working for a 50-100 person startup
[01:34:19] pipework: coreycondardo: Yes.
[01:34:36] pipework: 50-100 person startup, you mean a medium sized business?
[01:34:36] rhizome: there is no rule
[01:34:42] coreycondardo: pipework: sure
[01:34:51] pipework: coreycondardo: Most codebases I see use as many gems as possible.
[01:34:53] pipework: And then some.
[01:34:58] pipework: I hate it, but people suck.
[01:35:20] coreycondardo: pipework: interesting. im learning now and going to try to not use gems (since its better to roll your own then accept that a gem does it better or somethign like that)
[01:35:31] coreycondardo: but im curious what i???ll run into in the wild, when i get a job or something down the line
[01:35:46] pipework: coreycondardo: I try to use good gems that provide a lot of value, don't try to be invasive, and have great tests.
[01:37:15] coreycondardo: roughtly, like broad strokes, what % of the ones you???ll find thru google are ???good???. Meaning, if i google for ???gem that weaves baskets underwater??? and i get underwaterweaver gem, what are the chances it???s solid? i know that???s a wierd question, but im come from a drupal world, where like 75% of modules are shippable.
[01:37:37] coreycondardo: just want to know how ???weary??? to be
[01:38:45] pipework: coreycondardo: I don't find gems through google as much. Most gems are shit, but I'm very particular and a bit of a prick.
[01:38:59] coreycondardo: pipework: you seem like a nice guy :-P
[01:39:12] pipework: You can use most anything, but I personally ask 'why' until I get a convincing answer.
[01:48:36] coreycondardo: pipework: cool, thanks :)
[01:50:08] everettForth: Does anyone have a solution to speed up slow rails starts? I've used spork, spring, etc. in the past, but I always need to wind up restarting rails for certain changes, which is annoying
[01:50:24] pipework: everettForth: like what
[01:50:28] everettForth: and things like running rake tasks are slow
[01:50:51] pipework: use guard with spring?
[01:51:07] everettForth: guard with spring make rake tasks fast?
[01:51:50] everettForth: does that also work with rails 3 apps?
[01:51:57] bratsche: Which rake tasks are you using anyway?
[01:53:01] bratsche: The rake task that I used to use a lot was 'rake routes', and I was always frustrated by how slow it was. But I recently learned about localhost:3000/rails/info/routes
[01:57:35] dcope: is there a way to do action caching for just objects created in the method's scope?
[01:57:44] dcope: so globals (such as a logged in user) dont get cached
[02:07:03] rhizome: what do you mean?
[02:08:21] dcope: rhizome: i use devise and i tried action caching and noticed that the logged in user was being cached
[02:15:39] rhizome: why don't you want that?
[02:22:07] dcope: rhizome: because if user x logs in, hits page, then user y comes along they'll see the page as if user x was logged in
[02:25:13] Sigma00: just add a transparency clause to the TOS. BOOM, now you provide transparency
[02:26:08] Sigma00: dcope: add the current user ID as part of the cache key
[02:26:16] Sigma00: yes, that will eat more memory
[02:26:26] sevenseacat: or just dont do action caching :)
[02:26:47] Sigma00: indeed. Do caching in the view and don't cache user-specific areas
[02:27:33] Sigma00: hell, you can even cache expensive-to-compute user data there (again, if you use their ID as part of the key)
[02:27:52] lobo_tuerto: hello guys, do you know why rails 4.2.0.beta1 can't be installed?
[02:28:07] Sigma00: maybe if you gave us your error we might be able to help
[02:28:23] lobo_tuerto: gem install rails --version 4.2.0.beta1
[02:28:23] lobo_tuerto: ERROR: While executing gem ... (Gem::DependencyError)
[02:28:24] lobo_tuerto: Unresolved dependency found during sorting - activesupport (>= 4.0) (requested by sprockets-rails-3.0.0.beta1)
[02:28:32] lobo_tuerto: it fails with that error D:
[02:30:29] sevenseacat: well thats odd because there are many versions of activesupport > 4.0
[02:30:59] sevenseacat: but yeah i got the same error
[02:31:07] Sigma00: yay broken build!
[02:31:47] lobo_tuerto: looks like so D:
[02:32:02] lobo_tuerto: wanted to play with it
[02:32:32] lobo_tuerto: something with the requisites for prerelease versions?
[02:32:38] lobo_tuerto: or more specifically, beta versions
[02:32:51] sevenseacat: i dislike all github's interface changing all the time
[02:33:08] lobo_tuerto: we usually dislike change
[02:33:29] lobo_tuerto: learn to embrace it, and you won't suffer
[02:34:05] Sigma00: oh god I hadn't read 4.2's changes
[02:34:22] lobo_tuerto: http://weblog.rubyonrails.org/2014/8/20/Rails-4-2-beta1/
[02:34:26] Sigma00: that console on exception pages looks amazing
[02:34:45] lobo_tuerto: everything looks amazing, finally a unified interface for async jobs
[02:37:13] sevenseacat: it does look interesting
[02:37:24] sevenseacat: ACTION laments still being stuck on 3.2 for all apps
[02:37:27] lobo_tuerto: speed improvements on activerecord, lots of good stuff
[02:37:44] lobo_tuerto: that's why i wanted to get my hands on it now.... but will have to wait a little bit
[02:38:16] lobo_tuerto: you are lucky sevenseacat, i have a friend still stuck on rails 2.0
[02:38:35] sevenseacat: a couple months ago i upgraded my oldest app from 3.0 to 3.2
[02:38:40] sevenseacat: now all the apps i maintain are 3.2
[02:40:15] lobo_tuerto: it's a chore to upgrade, but, ease of mind is granted after u upgrade
[02:40:39] sevenseacat: oh i'd love to upgrade - time and budget does not permit it
[02:41:43] lobo_tuerto: that's why he is stuck at 2.0 too
[03:10:02] bratsche: I always have trouble with nested attributes. :/
[03:29:33] scott0101: hey, looking for a q&a gem for rails?
[03:30:25] pipework: scott0101: Yeah, it's called rails.
[03:30:37] pipework: zlx_star: survey gem
[03:30:56] pipework: scott0101: there are crappy ones, but it takes about 20 minutes without tests to write.
[03:31:13] scott0101: yeah surveyors not the right fit
[03:31:16] sevenseacat: 20 min is a bit of an exaggeration, but it sounds like standard rails CRUD fare
[03:31:40] scott0101: what???s it called?
[03:31:46] sevenseacat: no gem is likely to be the 'right fit' because 'Q&A' is such a vague and generic term
[03:32:01] scott0101: acts as commentable?
[03:32:05] scott0101: i just attach it to a moel
[03:32:11] sevenseacat: i mean, are you looking for a stack overflow clone?
[03:32:35] sevenseacat: because thats Q&A
[03:32:41] scott0101: jsut for a hackathon
[03:32:47] scott0101: doesnt have to be bulletproof
[03:32:48] sevenseacat: so you're not looking for a stack overflow clone
[03:32:52] sevenseacat: for a hackathon? start writing
[03:32:56] scott0101: haha no time
[03:33:04] sevenseacat: start writing fast.
[03:33:10] pipework: I bet by the time you find something, you could have written something.
[03:33:54] scott0101: yeah ill just use acts as commentable
[03:34:07] sevenseacat: seriously, why is there not an existing spree extension to tie contributors to products :(
[03:34:15] Radar: sevenseacat: that Radar guy did it
[03:34:23] pipework: Blame that guy
[03:34:37] sevenseacat: Radar: wait, there is one? why have i notfound it?
[03:34:48] Radar: sevenseacat: nope
[03:34:56] sevenseacat: ACTION scowls
[03:35:24] Radar: Seems like it would be easy enough to make
[03:35:29] Radar: Probably easier than a Q&A GEM
[03:36:04] sevenseacat: Radar: for you who are super familiar with spree, maybe :P
[03:37:10] sevenseacat: i have had it suggested i should be creating a taxonomy for product contributors and abusing that functionality
[03:38:49] Radar: Why not just have contributors+products be a many-to-many?
[03:39:06] sevenseacat: because then i have to create a whole new interface for contributors
[03:39:23] sevenseacat: and that isnt fun within the spree interface
[03:40:03] Radar: (this is mainly the reason I think that Spree should've just been some APIs with instructions on how to build frontends)
[03:40:11] Radar: No frontend/backend components
[03:41:19] sevenseacat: but yeah, custom seems to be a better way to do it and i will just muddle my way through it
[03:42:03] EasyCo: Hey guys & girls, I've got a route path the looks like this: line_item_line_item_state. All works fine but when I do redirect_to @line_item_state (which is an instance of LineItemState<AR) it tries to use the line_item_state_url helper which obviously fails.
[03:42:31] EasyCo: Any ideas as to why it's using the incorrect helper?
[03:43:06] sevenseacat: because you want it to use a nested helper but you're not providing what its nesting under
[03:43:17] sevenseacat: what line item is it nested under
[03:43:49] EasyCo: sevenseacat: @line_item_state = @line_item.line_items.create()
[03:43:55] EasyCo: That should be sufficient shouldn't it?
[03:44:16] sevenseacat: right, so you actually want to redirect to line_item_line_item_state_url(@line_item, @line_item_state) ?
[03:44:31] EasyCo: Hang on, I'll create a gist :)
[03:47:52] EasyCo: Et voila: https://gist.github.com/trev/91ff8d102d9dfea228a2
[03:48:22] sevenseacat: so what was the answer to my question?
[03:48:51] rhizome: do you want to redirect to the state or to the line item itself?
[03:49:09] EasyCo: Well, yes, I want to redirect to the saved line_item_state
[03:49:34] w09x: anyone know of a way to dynamically setup devise strategies? For example I want do include an ldap_authenticatable strategy if a user has a given flag
[03:49:38] bratsche: huzzah! Finally got this nested attributes shiz working.
[03:50:10] EasyCo: rhizome: The the line_item_state itself
[03:50:18] rhizome: EasyCo: try redirect_to [@line_item, @line_item_state]
[03:53:23] EasyCo: rhizome: Yah that works thanks. I thought that rails would automatically figure that out itself through the define relationship and nested resources
[03:54:48] EasyCo: Cheers for the help
[03:55:07] sevenseacat: how can it figure out your nested route?
[03:55:11] rhizome: it's a shortcut for line_item_line_item_state_path(@line_item, @line_item_state)
[03:55:19] sevenseacat: seriously, how can it possibly know
[03:56:09] Sigma00: reading the routes file?
[03:56:31] rhizome: i could see assuming that if a model is only #show'able through a nested route that rails should be able to find that.
[03:57:09] EasyCo: sevenseacat: I assumed it might have done some matching with a resource and model name the same it does with the model, view and controllers.
[03:57:22] sevenseacat: it did, thats how it tried to use line_item_state_path
[03:57:40] EasyCo: sevenseacat: But that path doesn't exist
[03:57:41] sevenseacat: because it knew @line_item_state is an instance of a LineItemState
[03:57:51] sevenseacat: exactly, because you've done all custom routing
[03:58:13] sevenseacat: if you're not following conventions, you need to specify things
[03:58:17] EasyCo: Where it came up with line_item_state_path I do not know
[03:58:41] EasyCo: Custom routing? I just nested 2 resources if that's what you mean?
[03:58:48] sevenseacat: yes, thats custom.
[03:59:00] sevenseacat: thats nbot a bog-standard resourceful route.
[04:00:55] EasyCo: So back to my assumption of how it could possibly have figured it out itself: it sees @line_item_state is an instance of LineItemState. It then matches up that model with the resource which is nested under a parent, LineItem. Therefore the path should be line_item_line_item_state...
[04:02:50] sevenseacat: it does no such matching
[04:03:00] EasyCo: Would be cool though :)
[04:03:06] sevenseacat: it presumes that if you say 'redirect to this item', then you actually want to redirect to a route for that item
[04:03:12] sevenseacat: for that item nested under a parent item
[04:03:38] sevenseacat: EasyCo: what if you have routes for both? and then that item nested under other things? and then that item in an admin namespace?
[04:03:47] sevenseacat: seriously, just think about it
[04:03:55] amh345: i've got a custom link_to helper in application_helper. i have a loop that generates the appropriate custom link_tos in my view. the thing is it's slow as hell. removing the link_to in the view renders that particular partial in 1ms. with the custom link_to is goes up to 2000ms. if i remove everything in the custom helper it still takes just as long. is there a speed rendering thing in application_helper?
[04:04:07] sevenseacat: whats in the helper?
[04:04:31] amh345: ill paste it.
[04:04:48] EasyCo: I'll think about it, promise
[04:06:11] amh345: here is the application_helper. link_to_product_href is the helper I'm calling in my view. it's empty in this gist, just like in my app. and it's still slow. https://gist.github.com/anonymous/5f1d811bacb1891bbad5
[04:07:29] sevenseacat: so calling an empty method increases page speed from 1ms to 2seconds?
[04:07:35] sevenseacat: what are you not telling us here
[04:07:39] amh345: i dont know.
[04:07:45] amh345: I've been testing it out.
[04:07:51] amh345: i drop it.. and it loads quick.
[04:07:55] amh345: put it back. loads forever.
[04:08:13] amh345: i'll paste the partial that calls it.
[04:14:42] amh345: sevenseacat: https://gist.github.com/anonymous/ff7f171887a0a4f91865 if i drop line #9 it drops to 2ish ms .
[04:16:06] amh345: christ. even if i do <%= link_to_product_href %> in the view it's just as slow.
[04:17:14] rhizome: so...what's that method
[04:18:49] sevenseacat: its empty apparently
[04:19:08] amh345: yeah. i stripped it out.
[04:19:12] amh345: it's literally empty.
[04:19:22] amh345: I'm trying to dig down to find what's making it slow.
[04:19:52] microdex: Whats the most railsy way to Query for a set of values ?
[04:19:57] amh345: and empty def link_to_product_href end and just calling it via <%= link_to_product_href %> makes it slow.
[04:20:15] microdex: Say Car.where( color:green OR color:red )
[04:20:27] microdex: Say Car.where( color:"green" OR color:red )
[04:21:05] sevenseacat: or Car.where(color: [:green. :red]) ;)
[04:21:29] microdex: yeeeah! thanks
[04:23:32] amh345: i suppose i need to find a way to inspect the load time of individual helpers/methods.
[04:23:46] amh345: log only gives me the load for that particular partial.
[04:51:20] yuung: rails noob here - i need to add a column to my model; should i be looking at active record migrations?
[04:53:12] yuung: sevenseacat, k; so 1st I would do rails generate migration AddNameToMyTable, then rails rake migrate?
[04:55:39] sevenseacat: well the first command will generate you a migration
[04:55:44] sevenseacat: open it up and see whats in it
[04:57:08] yuung: sevenseacat, right - just added 'add_column :MyTable, :name, :string'
[04:57:41] sevenseacat: i hope your table isnt actually called MyTable
[04:58:28] yuung: sevenseacat, it's not
[04:59:08] sevenseacat: you can run any migrations you havent already run with `rake db:migrate`
[05:00:04] yuung: mkay - just did, now do i have to update my rappers model manually?
[05:00:15] yuung: looks like i do
[05:00:42] yuung: err, controller*
[05:00:44] sevenseacat: what do you need to add to it? shouldnt need to add anything
[05:00:48] sevenseacat: ah controller yes
[05:37:18] AlexRussia: Why this code https://gist.github.com/bffefe93e4261e84d00a return this http://i.imgur.com/P0rA3pA.jpg? @_@
[05:37:48] sevenseacat: what is build_new ?
[05:38:25] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[05:38:32] AlexRussia: sevenseacat: the own method from model Game
[05:38:52] AlexRussia: sevenseacat: even not model, its unique for each Game object
[05:40:43] AlexRussia: sevenseacat: and yep, i tried restart server etc etc
[05:40:50] helpa: AlexRussia: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[05:40:50] sevenseacat: AlexRussia: !debug
[05:41:02] AlexRussia: sevenseacat: lol
[05:41:08] AlexRussia: sevenseacat: i've readed that
[05:41:17] sevenseacat: great, now do what it says.
[05:42:03] AlexRussia: sevenseacat: and what i says?
[05:42:06] AlexRussia: sevenseacat: it*
[05:42:44] sevenseacat: it tells you what information to provide if you are asking for help.
[05:44:08] AlexRussia: sevenseacat: https://gist.github.com/85d8864c272e7ade8a1c
[05:45:20] AlexRussia: sevenseacat: what you need more?
[05:45:59] AlexRussia: sevenseacat: what?
[05:46:23] sevenseacat: i dont think you read it very well
[05:46:34] sevenseacat: provide an error, logs, and a backtrace.
[05:47:06] AlexRussia: sevenseacat: i haven't backtrace i guess
[05:47:21] sevenseacat: you havent provided an error, logs or a backtrace.
[05:48:03] AlexRussia: sevenseacat: i have only log i guess(server) https://gist.github.com/650ab9577fa6e1efef77
[05:48:29] AlexRussia: sevenseacat: i didn't? error on image, isn't?
[05:48:32] sevenseacat: ok, whats on app/controllers/games_controller.rb:129:in `new'
[05:48:46] AlexRussia: sevenseacat: the code in first first first gust
[05:48:49] AlexRussia: sevenseacat: gist*
[05:48:54] sevenseacat: it only has 51 lines
[05:48:58] sevenseacat: so whats on line 129?
[05:49:05] AlexRussia: sevenseacat: yep, started with 118
[05:49:22] sevenseacat: ....so answer the question, because you're wasting my time
[05:49:26] AlexRussia: sevenseacat: all previous - old commented code, dont worry :)
[05:49:56] AlexRussia: sevenseacat: where answer? @_@
[05:50:06] sevenseacat: so whats on line 129?
[05:51:10] AlexRussia: sevenseacat: >render status: 404
[05:51:22] sevenseacat: so what do you think that is going to do?
[05:51:56] AlexRussia: sevenseacat: render 404.html page
[05:51:59] AlexRussia: sevenseacat: isn't?
[05:52:10] AlexRussia: grrrrrrrrrrrr
[05:52:15] sevenseacat: its saying to render the normal view with a status of 404
[05:52:24] AlexRussia: sevenseacat: srsly?
[05:52:36] AlexRussia: sevenseacat: how to then render 404 page? @_@
[05:53:00] AlexRussia: maybe i even not need in that...
[05:53:30] sevenseacat: why are you trying to render a 404 when creating a new game?
[05:54:47] tfitts: I'm accessing my rails app @ from In the NGINX access logs it shows the request coming from, but in the rails logs it shows GET "/selected/route" for Anyone know why this would be?
[05:55:10] sevenseacat: because nginx is probably proxying the request
[05:55:25] sevenseacat: and if nginx and the rails server are on the same server, well
[05:55:36] AlexRussia: i understand now this chain errors
[05:56:09] AlexRussia: sevenseacat: no, when FAIL creating
[05:56:12] sevenseacat: you can swear, we dont mind :P
[05:56:17] tfitts: sevenseacat: but external requests show the public IP
[05:56:26] sevenseacat: you shouldnt be changing app state on a get request
[05:56:28] AlexRussia: sevenseacat: that was just gag.
[05:57:55] AlexRussia: sevenseacat: lol
[05:58:10] AlexRussia: sevenseacat: why i should swear? if you dont trust me, is your problem ;)
[06:01:32] magg: I???m using a scope on a has_many assoc, but somehow the joins is being ignored
[06:01:43] magg: can you help me?
[06:01:50] zlx_star: show your code
[06:06:15] AlexRussia: sevenseacat: ok, i fixed it
[06:12:08] rickjamesthethir: hey guys i'm having some issue with my form whenever I view it on my website the labels are on the right side of the form. I am using bootstrap and the gist of the form is
[06:12:39] rickjamesthethir: https://gist.github.com/plutocoin/eb528f7f781204749369
[06:12:45] waseem_: rickjamesthethir: That sounds like a CSS issue. Ask in #css.
[06:13:18] sevenseacat: i have a feeling they'd shoot him if he walked in there asking bootstrap questions.
[06:13:28] sevenseacat: but still, it is a css issue.
[06:13:52] rickjamesthethir: yeah its a css issue but I was hoping you guys would know
[06:14:06] sevenseacat: most language channels (the ones ive been in anyway) get really pissed off if you ask questions about a specific framework
[06:14:15] sevenseacat: rickjamesthethir: its a question about styling and you havent shown us any of it
[06:14:52] sevenseacat: so we probably would know, if we had all the information
[06:15:03] magg: zlx_star: http://pastie.org/9490694#5 here is the code
[06:16:06] spygame: is there any framework/library available to create a customized calendar UI from scratch ?
[06:16:11] rickjamesthethir: well its literally pulling all the form css from bootstrap 3.2
[06:16:29] sevenseacat: plus anything custom you've added
[06:16:49] sevenseacat: there are classes and IDs there that are not part of bootstrap
[06:17:16] sevenseacat: so i presume theyve been added for styling purposes
[06:19:34] acriax: For a new app right now, is it safe to go with rails 4.2.0.beta1 which just came out? I'll probably want to get to 4.2 stable at some point when that's done, but should I use the 4.2.0 beta or stay with 4.1? Which would be the most painless?
[06:19:50] sevenseacat: acriax: i wouldnt use a beta for a new app, no.
[06:20:08] sevenseacat: there will be dedicated 4.1 -> 4.2 upgrade guides after the final release, go with 4.1 for now.
[06:20:08] acriax: but upgrading from 4.1 to 4.2 seems like it would be more difficult
[06:20:14] rickjamesthethir: damn those guys over at #css were quick with the answer
[06:20:30] acriax: alright, thanks sevenseacat
[06:21:06] rickjamesthethir: was simply changing it from inline-block to block
[06:22:23] zlx_star: magg: seems ok, use to_sql to print the raw sql
[06:22:37] rickjamesthethir: the css for my <label> was display:inline-block instead of display: block;
[06:23:11] magg: zlx_star: the weird thing is that .to_sql prints it OK
[06:23:12] sevenseacat: i'm not sure what that has to do with 'being on the right', but im glad its fixed :)
[06:24:35] magg: zlx_star: i???m using active model serializers with media_packages relantioship. and the query is done without the INNer JOIN
[06:25:34] zlx_star: magg: in your packages scope, why are u use joins? it seems u donot use any condition with it
[06:25:55] zlx_star: magg: with media_flight
[06:26:26] magg: zlx_star: i display information from the flight table on the serializer
[06:27:02] zlx_star: use includes if u only want to reduce query
[06:27:17] zlx_star: magg: #includes
[06:27:51] magg: zlx_star: or do i need to put a condition for the join to work?
[06:28:01] magg: will try the includes though
[06:32:58] magg: well thanks anyway, later
[06:55:22] tagrudev: morning lads
[07:06:08] sevenseacat: its going to take me longer to figure out how to test this spree extension than it is to write it :(
[07:23:24] waseem_: sevenseacat: Frustrating, isn't it?
[07:24:02] waseem_: sevenseacat: Do the chicken dance, it'll help. :)
[07:34:56] Macaveli: How do I require all the .js files in the same folder ?
[07:40:22] riotjones: require_tree .
[07:41:04] Macaveli: If I require the JS. I don't need to have "<script src="assets/js/platform.js"></script>" something like this in my code right?
[07:41:28] riotjones: *require_directory
[07:42:22] riotjones: u include files in the application.js file
[07:42:43] riotjones: app/assets/javascripts/application.js
[07:43:16] riotjones: /= require platform.js
[07:54:24] Macaveli: riotjones sorry this explains my problem more -> https://gist.github.com/YOUConsulting/0a36e936d03a14c815c2
[07:54:40] Macaveli: I need to include all those files in the folder that shows in the gist
[07:56:10] riotjones: alright 1 sec
[07:58:00] riotjones: so: //= require_tree custom
[07:58:09] riotjones: add to application js
[07:58:26] Macaveli: w8 i will you the top of the tree
[07:59:28] Macaveli: Please notice the full_tree https://gist.github.com/YOUConsulting/0a36e936d03a14c815c2
[08:00:58] Macaveli: So what do I need to add to the ui.js and what do I need to add to the application.js (the ui.js is needed to include all the js in that folder for rails admin) sorry that I state this so unclear.
[08:01:01] riotjones: /= require_tree rails_admin/custom
[08:01:38] Macaveli: that in appliation.js?
[08:01:41] Macaveli: riotjones ^
[08:01:48] riotjones: cmd: //= require_tree rails_admin/custom
[08:05:31] riotjones: Macaveli yes
[08:06:35] _tpavel: hi, does anyone have any recommendations for building a Rails app that will also serve as a RESTful API for native mobile apps?
[08:06:43] pyemkey: Hello, I want to reject checking presence if one of attributes is not correct. I mean https://gist.github.com/anonymous/d3d048bab2876cf0d590
[08:06:56] pyemkey: how to setup this correctly
[08:12:17] Macaveli: riotjones so in ui.js I have require_tree and in application.js i have require_tree rails_admin/custom and I'm receiving -> require_tree argument must be a relative path
[08:12:50] _tpavel: pyemkey, something like http://railscasts.com/episodes/41-conditional-validations ?
[08:12:50] riotjones: try require_tree ./rails_admin/custom
[08:13:29] _tpavel: of course, this is pretty old and you should check the guides for syntax changes
[08:21:29] mikecmpbll: c = Contact.new; c.id = 1; c.reload
[08:21:42] mikecmpbll: c.persisted? => false
[08:23:27] sevenseacat: because you didnt save it?
[08:23:29] mikecmpbll: no, because it's fails uniqueness validations, because it's obviously the same as record with id = 1
[08:23:51] mikecmpbll: but .reload() loads that record from the database in to that instance, shouldn't it set persisted? true ?
[08:24:43] sevenseacat: ACTION confuzzled
[08:24:49] pyemkey: _tpavel: Thanks, that what I looked for.
[08:25:18] _tpavel: pyemkey, no prob. :)
[08:25:30] riotjones: i thin reload do nothing
[08:25:43] riotjones: because the object was never before in the database present
[08:25:44] _lazarevsky: good morning everybody
[08:25:49] sevenseacat: reload on an unpersisted object shouldnt do anything
[08:26:01] _lazarevsky: I just wanted to wish you all a happy coding day :)
[08:26:02] sevenseacat: you havent done any validating of anything
[08:26:44] tagrudev: ok first time I encounter has_many from self
[08:26:45] mikecmpbll: it loads a record from the database ..
[08:26:49] mikecmpbll: it knows it's persisted
[08:26:50] tagrudev: why would one do that
[08:27:09] sevenseacat: obviously it doesnt if persisted is fakse
[08:27:21] mikecmpbll: exactly, i'm saying that behaviour is unintuitive
[08:27:28] mikecmpbll: it /can/ know that it's persisted.
[08:31:24] mikecmpbll: eh, it was fixed on July 4 https://github.com/rails/rails/pull/16049
[08:32:09] sevenseacat: 'find via reload' just sound so wrong
[08:32:18] sevenseacat: it's basically 'find_or_initialize'
[08:35:24] mikecmpbll: it's incredibly useful, allows me to replace a new record in memory with a persisted one in one move, and maintain it's associations etc to other in memory records
[08:39:46] tagrudev: anyone done something like this
[08:39:46] tagrudev: http://code.duffy.jp/rails-3-self-referential-has-many-through-mentor-mentee-parent-child-etc/
[08:39:54] tagrudev: is this a correct approach
[08:40:57] mikecmpbll: tagrudev: i do it with habtm so i don't bother with the join table.
[08:42:13] tagrudev: the join table is self
[08:42:34] mikecmpbll: nein, you need an intemediate table between self and self ;d
[08:43:03] tagrudev: self.id, self.self_id
[08:43:14] tagrudev: selfception
[08:43:21] mikecmpbll: oh, that article is about many-to-many
[08:43:53] mikecmpbll: or maybe i didn't read it right.
[08:48:29] arup_r: How can I stub this Post.all.order(:name) in Rspec ?
[08:50:21] andywww: is there a stable and established CMS/CMF in rails which is relatively painless to develop in?
[09:05:30] maloik_: Using nested_form, is there a way to display one newly built object right on the page load without using javascript to trigger it to add the nested fields? What about validating the form so that at least one is required?
[09:06:33] sevenseacat: maloik_: build one before rendering the view? :)
[09:07:47] Macaveli: Does rails have something to do this = "<link rel="import" href="elements/ga-auth.html">"
[09:07:54] sevenseacat: Macaveli: no.
[09:10:10] maloik_: sevenseacat: yea okay that was obvious haha... what about the validation though? Just adding required: true doesn't seem to do much at all
[09:10:19] sevenseacat: depends on where you add it
[09:11:22] Macaveli: I've added a folder elements to my assets folder how do I link to something like that?
[09:11:46] sevenseacat: Macaveli: http://guides.rubyonrails.org/asset_pipeline.html
[09:11:54] sevenseacat: linking to a folder doesnt make any sense.
[09:18:19] _tpavel: Hello, did anyone try to use Devise as an OAuth2 provider?
[09:20:55] xsannyx: It seems as make_flaggable gem doesn't work with posgresql... Did any one of you guys have any luck with that? Or is there another gem I could use?
[09:21:22] Macaveli: sevenseacat little stuck here on where to put the polymer html elements in rails?
[09:21:33] sevenseacat: Macaveli: what does that even mean
[09:21:46] Macaveli: http://www.polymer-project.org/
[09:21:58] Macaveli: I'm embedding a google analytics dashboard in rails admin
[09:22:11] sevenseacat: put it where you want to use it?
[09:22:18] Macaveli: and with the code came plain html files and they are added by <link rel="import" href="elements/ga-auth.html">
[09:22:33] Macaveli: I put it in public but that's not the right place I think
[09:22:50] sevenseacat: ACTION shrugs
[09:22:56] helpa: Care reserves depleted. Please come back later.
[09:34:35] greengriminal: For some reason my body is not being passed into my params hash:
[09:34:39] greengriminal: https://gist.github.com/anonymous/fcd0b77d189a8e73ee4d
[09:35:40] workmad3: greengriminal: 1) update_attributes saves, so you don't need to call .save after it
[09:36:12] workmad3: greengriminal: 2) you don't seem to have put the content body out into any form of submittable form field... so how would it get submitted?
[09:36:44] workmad3: greengriminal: 3) you also aren't following nested-parameter naming conventions with your hidden_field_tag elements, so they aren't going to go where your controller expects either
[09:37:10] greengriminal: workmad3: okay so i could do <%= text_field_tag 'body', content.body %>
[09:37:27] workmad3: greengriminal: any reason you're not using form_for ?
[09:38:12] workmad3: greengriminal: also, for once you've actually managed to use a deprecated helper in the form of 'form_remote_tag'
[09:38:22] greengriminal: workmad3: Don't they say when you use form_for you use it to work directly with the the model object.
[09:39:34] workmad3: greengriminal: it kinda looks like you're working with a PdfTicketDetail object there :P
[09:40:08] workmad3: greengriminal: and http://blog.markusproject.org/?p=3336 for a nice, old blog post about moving from form_remote_tag to the rails 3 method
[09:42:16] greengriminal: :P that's where i got: <%= form_tag url_for ... %> from.
[09:42:19] workmad3: greengriminal: oh, the last bit of that post, regarding attaching listeners... change '.observe' to '.on' in any javascript you write
[09:42:32] workmad3: greengriminal: then why are you using 'form_remote_tag'?
[09:43:23] greengriminal: Just updating that gist 2minutes.
[09:48:08] greengriminal: workmad3: Left a comment on the gist: https://gist.github.com/anonymous/fcd0b77d189a8e73ee4d
[09:48:39] workmad3: greengriminal: that doesn't alter any of the initial 3 points btw
[09:49:14] greengriminal: workmad3: well I'm not longer using form_remote_tag i'm using "form_tag url_for"
[09:49:33] greengriminal: Also i had put the content.body in a form_tag_helper: <%= text_area_tag 'body', content.body %>
[09:50:18] greengriminal: workmad3: As for my hidden_fields these aren't an issue.
[09:50:19] workmad3: greengriminal: ah, so that solves 2
[09:50:23] workmad3: greengriminal: but not 1 or 3
[09:50:37] workmad3: greengriminal: btw, 3 is the largest issue now
[09:50:48] greengriminal: oh i didn't update my controller. But i have removed the @template.save.
[09:51:24] workmad3: greengriminal: yay... now you just need to solve the *real* problem
[09:51:42] workmad3: greengriminal: which is that you've got completely screwed up input names that don't correspond to what you've written in the controller
[09:52:35] hendricius: hello, good morning :)
[09:52:38] hendricius: (from germany)
[09:52:43] helpa: hendricius: hi
[09:52:43] workmad3: hendricius: !hi
[09:53:03] hendricius: those after_commit callbacks are driving me mad :D
[09:53:55] hendricius: For some reason the callbacks are run twice: https://gist.github.com/hendricius/02afa3c3d19cb0287e3c#file-cacheable-rb-L14
[09:54:28] hendricius: the new syntax: on: [:create, :update] does not exist in rails 3.2 yet it seems
[09:56:23] rvanlieshout: that syntax is available in ruby 1.9+
[09:56:24] greengriminal: workmad3: So i solved the hidden_field issue.
[09:57:06] greengriminal: workmad3: You'll see that I updated it once again but this still doesn't resolve my issue. When you click save it is not calling the "update_template" action.
[09:57:13] hendricius: rvanlieshout: are you sure?
[09:57:21] hendricius: rvanlieshout: i get an error, expecting a symbol
[09:58:38] workmad3: hendricius: I think it's taht [:create, :update] isn't expected as an array for the on:
[10:00:24] greengriminal: workmad3: when you edit a template it renders the "edit_template" action at which point when I hit submit it should call a update_template.
[10:00:59] workmad3: greengriminal: sorry, I stopped paying attention when you didn't bother to provide the new gist
[10:01:00] hendricius: workmad3: yep, works in rails 4 though. but why is the callback run twice?
[10:01:13] greengriminal: workmad3: i updated it
[10:01:19] workmad3: greengriminal: not in the link you provided
[10:01:24] workmad3: greengriminal: and no new link was provided
[10:01:33] workmad3: greengriminal: so I stopped paying attention, because you know better than that now
[10:01:36] workmad3: greengriminal: hf
[10:03:37] workmad3: hendricius: hmm... not sure... I've noticed that happen at times, never managed to get to the bottom of it
[10:04:45] workmad3: hendricius: I suppose you could have one declaration with no 'on:' and just check 'destroyed?' in the action to skip it... it's a workaround hack, but should work
[10:05:25] greengriminal: workmad3: https://gist.github.com/anonymous/d5eef27b50199350c013#file-example-html-erb-L16-L18
[10:05:57] workmad3: greengriminal: yeah... notice how that's a *different* gist? :P
[10:06:07] workmad3: greengriminal: as I said, hf
[10:07:25] greengriminal: workmad3: Okay apologies on my behalf. Now the issue still remains. That when you hit the submit_tag it fires the edit_template action and not update_template
[10:11:19] sp1rs: Hi , I created a model which has a field type text . How should i change the property of text so that without using html in Text user easily write , what it want ?
[10:11:34] greengriminal: workmad3: In other words I know the following will not work: <%= submit_tag "Save", :controller => "ticket_detail", :action => "update_template" %>
[10:12:10] workmad3: greengriminal: address to the room at large, as I said I've moved on
[10:12:14] workmad3: greengriminal: hf
[10:12:53] hendricius: workmad3: good idea
[10:14:42] hendricius: greengriminal: what exactly do you want to do?
[10:14:54] hendricius: greengriminal: have you considered using haml/slim as a template language?
[10:21:14] arup_r: User.find(12) will throw error if 12 is not present.. But I want to return nil.. Is there any method ?
[10:21:39] workmad3: arup_r: User.where(id: 12)
[10:21:45] workmad3: arup_r: or User.find_by(id: 12)
[10:22:39] arup_r: workmad3: Thanks I forgot the method...
[10:23:08] hendricius: sp1rs: what exactly?
[10:23:48] hendricius: workmad3: that tip really worked. just one generic after_commit, that one handles all
[10:23:56] hendricius: workmad3: this really caused nightmares :D thx man
[10:24:25] workmad3: hendricius: np :) it's a little bit hacky, but at least it gets stuff working so you can investigate with less pressure if you so desire ;)
[10:25:13] workmad3: hendricius: I guess you can also use 'on: [:create, :update]' once you've moved to rails 4 too
[10:25:32] hendricius: workmad3: we should do that soon with rails 4. unfortunately my client thinks it is not worth it :D
[10:25:46] hendricius: workmad3: i am a bit scared most of the gems no longer work hehe
[10:26:24] workmad3: hendricius: most gems have either upgraded or don't need changing by now
[10:27:00] workmad3: hendricius: rails 3.2 -> rails 4 was a much less drastic upgrade than 2.3 -> 3.0, or even 3.0 -> 3.1 (if you wanted to add in asset pipeline stuff)
[10:27:39] workmad3: hendricius: also, a lot of the changes are flagged up as deprecations in 4.0, rather than outright removals
[10:42:58] sp1rs: hendricius: Got it ... I use simple_format(text_area_field) ..
[10:43:13] sp1rs: hendricius: May be my question was not so clear .. :(
[10:45:43] sp1rs: Can i create a single html page without creating model and controller ??
[11:15:44] nettoweb: guys, cI cant do this: ActsAsTaggableOn::Tag.includes(:taggings).order("count(taggings.tag_id) desc") ?
[11:16:05] nettoweb: can someone have another solution to lista all tags by quantity of taggings related
[11:17:23] roelof: I found this idea of making a multi-step form (http://andymaleh.blogspot.nl/2013/10/ultra-light-maintainable-wizards-in.html) . Could this idea also work when one of the steps is filling a devise model ?
[11:17:42] xIzIv: maybe someone knows about postgresql array, and something like 'test' = ANY(tags)?
[11:18:41] xIzIv: do we have something like [1,2,3] = ANY(numbers)?
[11:19:15] xIzIv: or just need build '1' = ANY(numbers) OR '2' = ANY(numbers) ..?
[11:21:37] xIzIv: [1,2,3].map {|number| "'#{number}' = ANY(numbers)"}.join(' OR ') it looks little bit awful or not?)
[11:22:55] roelof: xIzIv: what are you trying to achieve ?
[11:26:50] xIzIv: roelof: get records which contain at least one of the numbers
[11:27:34] roelof: xIzIv: which numbers ??
[11:27:39] xIzIv: roelof: if one of [1,2,3,4] present in `numbers` array
[11:30:01] roelof: xIzIv: why do you not use the array.include? (number) ?
[11:31:16] xIzIv: roelof: I'm about postgresql query
[11:31:50] roelof: xIzIv: then I think yu can better ask on a postgresql irc channel
[11:33:04] xIzIv: roelof: probably;)
[11:39:50] Macaveli: Do you guys manually make your sitemaps or do you use a gem like "https://github.com/kjvarga/sitemap_generator" or a better gem?
[11:44:08] xIzIv: answer on my question: '{1,2,3} && numbers' ;)))
[11:44:59] _bart: Hi all, I'm just checking out the free EC2 tier of Amazon, can I use that with Ruby?
[11:49:13] leex: Hi is there a better way to pass a parameter from one controller to another than setting it in the params of the first controller and then reading the params at the second contoller? Because what I would like to do is this: Views from controller_1 should have a link: create controller_2 and the instance created by controller_2 should set controller_id to the correct controller_1 id
[11:50:01] rvanlieshout: leex: there is no thing as passing params betewen controllers
[11:50:05] rvanlieshout: each request is a request on his own
[11:51:03] leex: rvanlieshout: so the only sane way of doing it would be nesting?
[11:52:04] rvanlieshout: there are plenty of solutions
[11:52:12] rvanlieshout: describe your actual problem
[11:52:15] leex: rvanlieshout: how you'd you do it?
[11:53:02] rvanlieshout: leex: it all depends on your actual problem
[11:53:10] leex: I have a survey and I want to create responses for surveys and every user should be able to answer the survey
[11:53:24] diegoviola: any ideas for refactoring this? https://gist.github.com/diegoviola/611b0bbd1cfc580d9d5c
[11:54:40] rvanlieshout: diegoviola: added a comment
[11:54:41] leex: rvanlieshout: so I have a survey controller and a response controller and I have a link "answer this survey" which should create a new response and know about the survey id so that I can load the questions from that survey
[11:55:08] rvanlieshout: leex: and what _exactly_ is your problem with that?
[11:55:10] diegoviola: rvanlieshout: thank you
[11:55:57] rvanlieshout: diegoviola: although there is a syntax error in that, but you can figure it out i hope
[11:56:10] diegoviola: rvanlieshout: sure, ty :)
[11:56:41] leex: rvanlieshout: well, the only way I know to do this is setting the survey.id as param in the link and reading them on the other end, but maybe I don't want the user to change that id and answer a different survey
[11:57:10] rvanlieshout: leex: the best way is to include that in the link
[11:57:26] rvanlieshout: you have to authorize access in the controller
[11:57:39] rvanlieshout: so that you do not allow the user to change that id into a survey that he isn't allowed to answer
[11:59:29] leex: rvanlieshout: yeah, that's how I would have done it anyway, but I though I'd ask if there is a better way to go about it
[11:59:53] rvanlieshout: you could use a session for that, but that would conflict if one uses multiple browser windows
[12:00:53] leex: rvanlieshout: no, don't wanna do sessions.
[12:01:10] leex: rvanlieshout: thanks for the brainstorming :)
[12:08:22] tagrudev: wut wut it's almost Friday wiga wiga
[12:11:07] mauro1254: Hi guys, I'm working on a Bootstrap 3 app. Is there a difference from the point of view of the assets pipeline to use @import 'my_stylesheet' instead of *= require './my_stylesheet'?
[12:12:13] tagrudev: mauro1254, http://stackoverflow.com/a/6295059/677024
[12:13:22] pyemkey: I need your help guys I have address url where I need to cut part after the last slash. My solution is really ugly, but... works. Can you help me how to do this in the right way https://gist.github.com/pyemkey/a97abd5ee512abec0c0e
[12:15:18] rvanlieshout: pyemkey: "http://test.dev:3000/comapnies/microsoft".sub(/\/[^\/]*$/,'')
[12:16:28] banisterfiend: heya, anyone here know the correct way to deal with timezones and rails? i assume time is stored in UTC in the database, what's the best way to get the time/date back in EST?
[12:16:46] rvanlieshout: banisterfiend: if your app timezone is configured correctly you would get it back in the local timezone
[12:16:48] nettoweb: guys, can someone help me order this query by count of taggings? https://gist.github.com/osnysantos/d67b03cdaa34fda445fc
[12:16:53] pyemkey: rvanlieshout: thank you. Your solution give me another reason why I should start to learn regex
[12:16:59] banisterfiend: rvanlieshout i dont wnat it in local time though, i want it in EST
[12:17:50] rvanlieshout: banisterfiend: http://api.rubyonrails.org/classes/ActiveSupport/TimeWithZone.html#method-i-in_time_zone
[12:18:08] mauro1254: tagrudev: I know that with import I can reuse variables, ... that is great. But, from the point of view of assets compilation?
[12:18:16] banisterfiend: rvanlieshout thanks -- where also can i learn about configuring the default time zone for the app?
[12:18:32] mauro1254: Will be unchanged assets be recompiled on a new deploy?
[12:18:43] rvanlieshout: banisterfiend: http://guides.rubyonrails.org/configuring.html
[12:18:53] rvanlieshout: nettoweb: .order('count(*)')?
[12:19:02] tagrudev: mauro1254, it would be a bit slower that's all
[12:19:29] rvanlieshout: mauro1254: it depens on your rails version... iirc they've changed that behavior
[12:19:42] nettoweb: rvanlieshout: PG::Error: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
[12:19:54] rvanlieshout: nettoweb: than add a name to your count(*) in your select
[12:20:03] mauro1254: In rails 4 unchanged assets aren't compiled again ...
[12:20:04] rvanlieshout: SELECT .. COUNT(*) AS foobar_count ... ORDER BY foobar_count
[12:20:21] tagrudev: that would make sense ?
[12:20:34] banisterfiend: rvanlieshout thanks
[12:20:36] rvanlieshout: tagrudev: to not compile them again?
[12:20:42] nettoweb: rvanlieshout: id, taggings.tag_id, count(*) as total ?
[12:20:52] rvanlieshout: nettoweb: then order by total
[12:20:57] mauro1254: tagrudev: Yes, to save time
[12:20:57] rvanlieshout: tagrudev: yeah that makes sense?
[12:21:18] pyemkey: rvanlieshout: One more question to you, how to leave last slash?
[12:21:23] tagrudev: of course it was litorical
[12:21:30] nettoweb: rvanlieshout: I tried this, but got PG::Error: ERROR: column "total" does not exist
[12:22:14] rvanlieshout: nettoweb: can you gist the full query?
[12:22:28] rvanlieshout: pyemkey: "http://test.dev:3000/comapnies/microsoft".sub(/\/[^\/]*$/,'/')
[12:22:53] nettoweb: rvanlieshout: https://gist.github.com/128c7009f9fc15358b02 Im using acts-as-taggable-on
[12:23:03] rvanlieshout: nettoweb: the full sql query
[12:23:10] pyemkey: rvanlieshout: no way, that was too easy. I have to take a coffee.
[12:24:00] nettoweb: rvanlieshout: https://gist.github.com/faa780fff89330f663fc
[12:24:31] rvanlieshout: nettoweb: SELECT DISTINCT "tags".id, total AS alias_0
[12:24:33] rvanlieshout: that part is wrong
[12:24:37] rvanlieshout: it should have COUNT(*) AS total
[12:24:43] rvanlieshout: then you order by total
[12:25:45] nettoweb: rvanlieshout: I dont touch in it because Im using ActsAsTaggableOn::Tag .. I dont have a tag model.. must I create?
[12:26:01] rvanlieshout: nettoweb: no that doesn't matter
[12:26:08] nettoweb: that part ActsAsTaggableOn::Tag do itselt
[12:26:29] rvanlieshout: so your select part is removed
[12:26:42] rvanlieshout: which is strange imo
[12:27:59] nettoweb: yes??? my select is removed. maybe cause this: .result(distinct: true)
[12:29:20] nettoweb: rvanlieshout: take a look now please: https://gist.github.com/osnysantos/faa780fff89330f663fc
[12:34:28] rvanlieshout: nettoweb: what code triggers this? that in the previous gist?
[12:34:49] nettoweb: rvanlieshout:
[12:35:08] rvanlieshout: can you gist your db schema?
[12:35:17] nettoweb: https://gist.github.com/osnysantos/128c7009f9fc15358b02
[12:35:24] nettoweb: I???ll check
[12:35:31] rvanlieshout: and what are you trying to get here?
[12:36:53] nettoweb: rvanlieshout: Im using this gem https://github.com/mbleigh/acts-as-taggable-on and Im creating a admin area to manage my tags, and I???m trying to list all tags by total of taggings (how much times it was add in my articles for example).
[12:37:58] rvanlieshout: i still find it strange that the select-part of that thing is changed
[12:45:06] banisterfiend: rvanlieshout one question -- if i have config.time_zone set to EST, does that mean that all AR date/times will be stored in EST too? so it'll make sense to compare, for example: Date.current to my_record.start_date ?
[12:46:18] rvanlieshout: banisterfiend: it'll be stored in utc in the db
[12:46:49] banisterfiend: rvanlieshout ok, so even though i set config.time_zone to EST, when i read out my_record.start_date it'll still be in UTC?
[12:48:37] rvanlieshout: that will be in EST
[12:55:08] sonOfRa: I'm having a weird issue with confirm dialogs: https://gist.github.com/sonOfRa/879703993f61daf9d126 When the delete button is clicked, a dialog spawns as expected. On clicking the dialog, a get request to the page is started (see development.log), and then another dialog spawns. On clicking the second dialog box, nothing happens.
[12:55:14] Andrew124: Hello. I am trying the demo app from railstutorial.org but when I type the generate scaffold command rails seem to cycle indefinitely (after printing http://pastebin.com/PLuPUhGy) Any ideas how to debug this please?
[12:56:27] pontiki: what does "cycle indefinitely" mean?
[12:57:01] Andrew124: pontiki: does not halt
[12:57:09] pontiki: and does not print anything?
[12:57:21] Andrew124: pontiki: exactly
[12:57:28] pontiki: how long do you wait?
[12:57:39] tyl: hi i am having a problem . I am getting ERROR Errno::ECONNRESET: Connection reset by peer @ io_fillbuf
[12:58:02] tyl: i've been trying to google io_fillbuf but i don't get a solid answer on what it is
[12:58:13] pontiki: Andrew124: ?
[12:58:26] Andrew124: pontiki: over 10 minutes for sure
[12:58:49] Andrew124: pontiki: and it doesn't consume system resources according to the top program
[12:59:25] pontiki: Andrew124: okay, 10 minutes does seem stupid long
[12:59:42] pontiki: Andrew124: what OS are you using for development?
[12:59:53] Andrew124: pontiki: Ubuntu 14.04
[13:00:42] Andrew124: ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux-gnu], Rails 4.1.5
[13:02:39] Andrew124: emocakes: what do you mean?
[13:02:40] pontiki: it's what is head
[13:03:23] root3d: Andrew124, http://stackoverflow.com/questions/22387196/warning-running-gem-pristine-all-to-regenerate-your-installed-gemspecs
[13:04:38] pontiki: that would get rid of the warning, root3d, but his problem is that rails g is hanging
[13:05:07] pontiki: Andrew124: you should probably follow the advice on the link, tho, all the same
[13:05:24] root3d: Andrew124, you using rvm ?
[13:06:37] Andrew124: pontiki: I got this stack trace when I interrupt the command https://gist.github.com/anonymous/47e2066a803a0fcd27c8
[13:07:30] Andrew124: root3d: not sure actually. I installed rails and ruby from the packages in the system.
[13:08:07] root3d: ok. sudo apt then .
[13:08:10] pontiki: Andrew124: right, that's just telling you it caught the interrupt
[13:08:42] root3d: pontiki, i think pristine will reinstall all the gems , and then rails might not hang
[13:08:43] Andrew124: pontiki: sure, but I aimed for the place it happens. It might tell where's the problem
[13:09:25] pontiki: Andrew124: has this happened from the very beginning? I'm now wondering if possibly you have a spring process stuck someplace
[13:09:40] pontiki: i'm not up on using spring, so i'm just guessing
[13:11:14] Andrew124: pontiki: wow, indeed. I found the process, killed it and the generate scaffold worked. Thank you
[13:11:41] pontiki: like i said, just a guess
[13:12:23] pontiki: i'm not sure how one is *actually* supposed to deal with it
[13:14:00] root3d: Andrew124, is this the very first time
[13:14:20] root3d: never mind
[13:15:58] pontiki: Andrew124: did you still get the warning?
[13:16:50] Andrew124: pontiki: yes, i am working on removing that next
[13:17:12] pontiki: Andrew124: okay, super :)
[13:30:05] Macaveli: How can I use pluck on a ActiveRecord query like for example "Testimonial.with_translations("en")"?
[13:33:25] waseem_: Macaveli: There is a method called pluck.
[13:33:41] Macaveli: waseem_ I can't seem to use pluck(:id)
[13:34:00] waseem_: Macaveli: What are you expecting it to do?
[13:34:03] Macaveli: Testimonial.pluck(:id) -> Works / Testimonial.with_translations("en").pluck(:id) doesn't
[13:34:17] Macaveli: I want to get all the id's in an array from the query
[13:34:18] sonOfRa: http://stackoverflow.com/questions/25427582/rails-duplicate-confirm-dialogs anyone got an idea what might be causing this?
[13:34:20] waseem_: Macaveli: What does with_translations return?
[13:34:57] Macaveli: waseem_ array of Testimonials that are in the language specified
[13:35:10] waseem_: Macaveli: Can you show me its code?
[13:35:18] Macaveli: yes hold on i'll gist it all
[13:37:31] Macaveli: waseem_ https://gist.github.com/YOUConsulting/b277aece65df3f6aa6b4
[13:37:39] Macaveli: the last item is the one that doesn't work
[13:37:49] waseem_: sonOfRa: You should specify the method option on the form and not the button.
[13:38:52] waseem_: Macaveli: Where is the code for Testimonial.with_translations?
[13:39:16] waseem_: Macaveli: Also did you migrate your database?
[13:39:26] Macaveli: yes waseem_
[13:40:02] Macaveli: code for with_translation waseem_ -> https://github.com/globalize/globalize#scoping-objects-by-those-with-translations
[13:40:07] waseem_: Macaveli: The error says locale column does not exist in the testimonials table.
[13:40:37] waseem_: s/testimonial/testimonial_translations/
[13:40:45] Macaveli: if you notice the secon exampl you can see there is an id
[13:42:24] waseem_: Macaveli: The problem is not with pluck. It's with your database.
[13:42:55] waseem_: Macaveli: In your database console see if testimonial_translations table has column called locale.
[13:43:11] Macaveli: there is not problem with the DB if there was the "Testimonial.with_translations(:en)" wouldn't output something, correct? / locale = the language
[13:44:03] waseem_: Macaveli: Can you read the error message?
[13:44:11] Macaveli: for example Testimonial.first.pluck(:id) does not also work
[13:44:16] waseem_: Macaveli: SQLite3::SQLException: no such column: testimonial_translations.locale
[13:44:26] Macaveli: is it possible that you can't combine querys with using pluck
[13:44:38] Scient: pluck returns an array
[13:44:42] sonOfRa: waseem_: how do I add options to the form with the button_to helper? Or do I have to write that up manually?
[13:44:45] Scient: its an AR "trigger" method
[13:45:04] waseem_: Macaveli: Testimonial.first.pluck will not work. It returns a AR::Base object and not a Relation object.
[13:45:09] Macaveli: So how do you make an array of a combined query's?
[13:45:29] sonOfRa: waseem_: the method IS on the form, actually
[13:45:36] sonOfRa: the button_to helper already puts it there
[13:45:38] waseem_: sonOfRa: Read the documentation for form_for or form_tag. Whichever you're using.
[13:46:12] skullz: is there a way to create a new record with a preset ID?
[13:46:41] waseem_: skullz: What do you mean by preset ID?
[13:46:57] skullz: waseem_: like that, State.create(id: 1...)
[13:46:58] sandstrom_: I'm setting up instrumentation (ActiveSupport::Notifications.subscribe 'process_action.action_controller') but it doesn't run on exceptions handled with `rescue_from`. Is this by design?
[13:47:22] waseem_: skullz: Why do you want to do that?
[13:47:28] skullz: waseem_: a seed file
[13:48:19] skullz: waseem_: There are hundreds of Cities and States, and I don't wanna automate the creation of the relationships
[13:48:27] skullz: Cities in States*
[13:49:05] waseem_: skullz: I don't understand. How will specifying IDs will help you.
[13:50:03] skullz: waseem_: can I set the ID in create method?
[13:50:13] waseem_: skullz: No you can't.
[13:50:19] skullz: ok, thanks
[13:51:31] walidvb: hey guys. i have a kind of urgent question
[13:52:47] rvanlieshout: skullz: give it an id first, then save
[13:53:26] sonOfRa: waseem_: wasn't the form, typed the form up manually, left out the confirm option, and the request works. It seems like some javascript thing bound twice, but I cannot figure out what
[13:54:12] anti-freeze: Hey guys/girls. I'm using digital ocean to host my rails website (small 2 page site). I currently have a preconfigured droplet. For my second website, should I use the same droplet or make a new one?
[13:58:31] waseem_: anti-freeze: Depends upon the website.
[13:59:01] anti-freeze: waseem_: Just another small 2 page site
[13:59:16] waseem_: anti-freeze: What kind of droplet are you using?
[13:59:17] rvanlieshout: why would a 'small 2 page site' be created in rails?
[13:59:31] tyl: can anyone help with the ERROR Errno::ECONNRESET: Connection reset by peer @ io_fillbu
[13:59:37] anti-freeze: rvanlieshout: Good point. It has a back system
[13:59:39] waseem_: rvanlieshout: That's an important question. Probably for learning purposes. :)
[14:00:16] rvanlieshout: so it's not really a small 2 page site
[14:00:30] anti-freeze: rvanlieshout: Nope, my mistake. Would you suggest a new droplet then?
[14:04:36] skullz: rvanlieshout: thanks!
[14:07:54] magnetica: Is there a rails way to update every record in a model after adding a new field to it ?
[14:08:07] waseem_: magnetica: update_all
[14:08:26] goatish_mound: magnetica: usually people do that in the same migration adding the field
[14:08:54] banisterfiend: rvanlieshout but setting config.time_zone won't change whether created_at and updated_at are stored in UTC or not, right?
[14:08:56] waseem_: magnetica: Won't a default value work?
[14:09:44] ringarin: do I really need to restart rails each time i add a new @varx in the e.g def index from my controller ?
[14:10:08] _bart: ringarin: no, I don't think so?
[14:11:01] magnetica: waseem_: yes, but update_all requires an argument ex: User.update_all(:name => "")
[14:12:05] waseem_: ringarin: Depends upon the environment in which server runs. Or to be precise it depends upon your configuration.
[14:12:11] waseem_: magnetica: So?
[14:12:32] xsannyx: http://stackoverflow.com/questions/24728983/acts-as-taggable-on-and-select2-returning-weird-results-in-active-admin does anyone know an answer to this?
[14:13:57] ringarin: waseem_, _bart I don't know what i changed but i need to restart the server each time now
[14:14:32] waseem_: ringarin: Do `git diff` to know what you changed.
[14:16:34] frank_o: Hi! I'm trying to integrate Instagram subscriptions with Forem, but everything feels like a big mess. Has anybody ever done something similar and can give me some advice on what to do next, what to keep, what to discard etc.? https://gist.github.com/frankie-loves-jesus/ba96036885e795cd8541
[14:26:56] ringarin: waseem_, I'dont know when it broke any clue on what may be causing this ?
[14:27:50] waseem_: ringarin: In your environment file see if config.cache_classes is set to true. It should be false.
[14:28:12] waseem_: ringarin: You're checking this on your development machine, right?
[14:28:20] ringarin: wasamasa, y
[14:29:19] glundgren: someone can point me out
[14:29:25] wasamasa: ringarin: nope
[14:29:26] wm3|busy: ACTION points out glundgren 
[14:29:29] glundgren: how i add a watermakr in an image on the fly?
[14:29:54] Sigma00: glundgren: there are quite a few image manipulation gems
[14:30:02] glundgren: theres the thing, im getting the youtube image from a video
[14:30:06] glundgren: using a url
[14:30:25] glundgren: i get the id from that url, then i convert ina an miage tag
[14:30:39] glundgren: using the youtube image api
[14:30:42] ringarin: waseem_, I got config.cache_classes = false config/environments/development.rb
[14:30:48] wm3|busy: glundgren: you'd basically need to intercept the request for the image, run the image through an image manipulation tool (e.g. image magick) that adds the watermark, and then serve up the modified image as the response
[14:31:24] glundgren: i create a controller that gets the id from the video as a get param
[14:31:31] glundgren: then process and serve the treated image
[14:31:32] waseem_: ringarin: That seems okay. Grep your project if you're doing it in an initializer. It's highly unlikely though.
[14:31:39] wm3|busy: glundgren: sounds reasonable
[14:31:44] Sigma00: you're using the image API to get video thumbnails?
[14:32:06] glundgren: i cant add the PLAY icon on html
[14:32:13] glundgren: because its being send by email
[14:32:17] glundgren: it breaks everywhere
[14:32:25] glundgren: if i try to position absolute the icon
[14:32:41] wm3|busy: glundgren: did you make sure that your email container had position: relative on it?
[14:32:50] Sigma00: email has some... interesting issues with HTML
[14:32:58] glundgren: has EVERY ISSUE
[14:33:03] glundgren: in the world
[14:33:03] Scient: how would i test inline model callbacks...
[14:33:05] wm3|busy: but yeah, html in email can be weird :)
[14:33:14] wm3|busy: Scient: badly :P
[14:33:15] Sigma00: it's the only time you'll ever be told to use tables for layout
[14:33:23] Scient: and these are not default model callbacks, but custom ones
[14:33:32] glundgren: how do i return an image
[14:33:35] Scient: defined using ActiveSupport::Callbacks
[14:33:36] glundgren: from a controller?
[14:33:39] Scient: cant figure this shit out
[14:33:42] Scient: glundgren: send_file
[14:33:54] glundgren: send_file it renders the binary?
[14:34:04] wm3|busy: Scient: if it's inline, you'd basically need to do whatever would trigger the callback and test that any side-effects are done
[14:34:19] Sigma00: glundgren: you'd write the image to a file, save the location to a variable, and use that location in an image tag in the view
[14:34:20] Scient: but that seems like im testing the implementation _inside_ the callback
[14:34:31] Scient: not the fact that the callback gets triggered
[14:34:34] wm3|busy: Scient: pretty much
[14:34:37] Sigma00: glundgren: if you use an image manipulation gem they'd likely already have helper methods for this
[14:34:38] glundgren: sigma00: sounds better then process on the fly
[14:34:43] Scient: so if i change the implementation inside it, the test breaks when it should not
[14:34:48] Scient: fucking fuck
[14:34:50] wm3|busy: Scient: that said, testing that the callback is triggered is testing the callback framework
[14:34:55] glundgren: sigma, how can i get an image from a url?
[14:35:01] wm3|busy: Scient: which is likely not something you need to check
[14:35:08] Scient: wm3|busy: that is true as well
[14:35:16] Scient: wise words as always
[14:35:23] wm3|busy: Scient: while testing some important semantic side-effect is likely what you want to do
[14:35:45] wm3|busy: Scient: but it's definitely easier to test if it's a callback method, so you can just call the method explicitly instead
[14:36:00] Scient: then i could separate the tests as well
[14:36:01] wm3|busy: Scient: and things are easier to test overall if you don't use callbacks at all ;)
[14:36:15] Scient: so i test the implementation of the method separately, and then if the method gets called via callbacks
[14:36:26] Scient: well i need to have callbacks :P
[14:36:54] wm3|busy: Scient: you can generally use a service object of some form to orchestrate the flow you need ;)
[14:36:56] Scient: im basically triggering different user lifecycle events and i want to be able to hook into them from different places
[14:37:19] Scient: i have a shared User (base) model that is used via an engine in different apps
[14:37:27] Scient: and these different apps need to hook into different lifecycle events
[14:37:34] Scient: doing different things as a result :D
[14:37:50] wm3|busy: Scient: fair enough :)
[14:38:02] Scient: it sounds like exactly the case for event listeners, does it not? :)
[14:38:28] Sigma00: glundgren: yes. Again, your image manipulation gem will have helpers for this
[14:38:42] wm3|busy: glundgren: I wouldn't suggest using open-uri in real code
[14:39:00] wm3|busy: glundgren: it lacks any way to do any form of useful error recovery
[14:39:02] Sigma00: glundgren: make sure you cache those generated thumbnails as you wouldn't want to generate the same thumbnail a bunch of times
[14:39:17] glundgren: very nice info guys
[14:39:19] glundgren: thanks a lot
[14:39:26] glundgren: i will write a solution using this info
[14:39:36] wm3|busy: glundgren: instead, I'd suggest using net/http, or a wrapper around it (e.g. faraday, httparty...)
[14:39:53] ringarin: waseem_, i just did a rails new testapp and this seems to be the default behaviour
[14:39:57] glundgren: wm3|busy: thanks!
[14:40:43] waseem_: ringarin: The default behavior is exactly opposite. Do you refresh your page after changing the variable?
[14:40:49] waseem_: ringarin: And where is the variable?
[14:44:48] ringarin: waseem_, https://gist.github.com/anonymous/e243acd9fbe1f24e6edf
[14:46:10] wm3|busy: ringarin: so you're saying that if you change '@v = "you"' to, say, '@v = "me"' then nothing changes, no matter how many times you refresh the page
[14:46:14] ringarin: waseem_, so when i change @v in controller and refresh welcome/index it still show's @v first value
[14:46:21] waseem_: ringarin: I assume you copied the template wrong and there is closing erb tag.
[14:46:45] ringarin: waseem_, yes <%= @v %>
[14:48:01] waseem_: ringarin: This should not be an issue but can you remove get 'welcom/index' from your routes and try again?
[14:49:27] ringarin: waseem_, yes still the same results
[14:50:39] waseem_: ringarin: I don't know how to fix this. Sorry.
[14:52:33] cz3ch: I had a question. I have a few 3.2.x apps (14 and 19) and am wanting to upgrade them to 4.1.x. I know about the upgrading rails guides, but are there any gems or resources out there that can look at your code and tell you what needs to be changed or what has been deprecated?
[14:53:45] ringarin: waseem_, I removed any references to turbolinks and it didn't help either; I would have sworn this was not the default rails behaviour
[14:54:01] waseem_: ringarin: It isn't.
[14:56:59] ringarin: waseem_, this is the version in my Gemfile : gem 'rails', '4.1.4' is that ok ?
[14:57:11] waseem_: ringarin: Yes that's fine.
[15:01:00] wm3|busy: ringarin: hmm... could you gist config/application.rb and config/environments/development.rb please
[15:01:18] wm3|busy: ringarin: also, what OS are you on?
[15:01:40] ringarin: wm3|busy, ubuntu 14
[15:02:25] ringarin: wm3|busy, I just made rails new ... then rails generate controller welcome index and modified those 3 files
[15:02:37] wm3|busy: ringarin: can you gist them anyway please
[15:03:15] wm3|busy: ringarin: when it comes to debugging something weird, you need to drop assumptions about what 'can't' be a problem
[15:03:44] wm3|busy: ringarin: and as we don't have access to your computer, we need to rely on you gisting stuff :P
[15:03:52] ringarin: wm3|busy, https://gist.github.com/anonymous/17a44148d6a3ec86af18
[15:04:42] wm3|busy: ringarin: ok... and in your console, does doing 'echo $RAILS_ENV' give you either 'development' or a blank line?
[15:05:11] ringarin: wm3|busy, blank line
[15:05:13] wm3|busy: ringarin: and you definitely started the server with 'rails s', not 'rails s production' or 'RAILS_ENV
[15:05:20] wm3|busy: ringarin: and you definitely started the server with 'rails s', not 'rails s production' or 'RAILS_ENV=production rails s' or anything like that?
[15:05:29] ringarin: wm3|busy, rails server -p 99
[15:05:47] wm3|busy: ringarin: you started it on port 99?
[15:05:57] wm3|busy: ringarin: does that mean you started it with 'sudo'?
[15:06:09] ringarin: wm3|busy, I'm running root on my host
[15:07:02] wm3|busy: ringarin: wait... is your host a separate machine (or vm) from where you're editing code?
[15:07:28] ringarin: wm3|busy, I'm sshing with putty to this 14.04 ubuntu
[15:07:40] ringarin: wm3|busy, which is a virtual box vm
[15:07:50] wm3|busy: ringarin: right... and how are you editing code?
[15:08:02] ringarin: wm3|busy, vim in putty
[15:08:43] wm3|busy: ringarin: hmm... so no weirdnesses with shared folders or anything?
[15:09:37] ringarin: wm3|busy, it is on a shared folder i'll try again on a folder local to the vm
[15:13:29] ringarin: wm3|busy, -_- gotcha
[15:13:46] wm3|busy: ringarin: works fine outside the shared folder?
[15:14:04] ringarin: wm3|busy, yes
[15:14:59] wm3|busy: ringarin: out of curiosity... how much of a change were you making to the ivar contents?
[15:16:09] ringarin: wm3|busy, it seems that if I "touch app/controllers/welcome_controller.rb" on the shared folder it works
[15:17:16] ringarin: wm3|busy, I think i can remap ":w" in vim so i actually "touches" the file on save too
[15:17:26] wm3|busy: ringarin: right... so it seems that editing in the shared folder isn't updating the updated_at attr on the file properly
[15:17:52] ringarin: wm3|busy, I don't have exact figures but I think I restarted my rails app way to much in my last project
[15:20:23] wm3|busy: ringarin: if this was happening to you then as well, I'd say it's quite likely ;)
[15:21:37] wm3|busy: ringarin: it does seem there are some issues with shared folders returning old content in other circumstances (like people using static file serving from a shared folder in nginx)
[15:21:46] wm3|busy: ringarin: it's an open ticket on virtualbox
[15:22:30] lobo_tuerto: why can't rails 4.2.0.beta1 be installed?
[15:23:47] ringarin: wm3|busy, yes I think it's more complex then updated_at value because if I stat my welcome_controller.rb : its Access, Modify and Change timers all change on ":w" but change will only get caught in browser if I "touch welcome_controller.rb"
[15:25:19] ringarin: wm3|busy, thanks allot much <3
[15:25:44] lobo_tuerto: gem install rails --pre
[15:25:44] lobo_tuerto: ERROR: While executing gem ... (Gem::DependencyError)
[15:25:44] lobo_tuerto: Unresolved dependency found during sorting - activesupport (>= 4.0) (requested by sprockets-rails-3.0.0.beta1)
[15:40:57] rightisleft: Hello, working with a partial - passed some params in locals - i see them in local_assigns, has_key? returns true - but their variable value in the template scope are nil
[15:47:48] helpa: rightisleft: 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.
[15:47:48] mikecmpbll: rightisleft: !code
[15:58:28] greengriminal: I have some html content being interpreted as text: http://i.stack.imgur.com/a2UJl.png which results in the page looking like: http://i.stack.imgur.com/pvxPB.png FYI in my view for this page i am doing <%= h @output %>
[15:58:55] greengriminal: I have to use .html_safe
[15:59:07] greengriminal: As rails has a security measure to ensure you don't just pass in any random html
[15:59:27] SourceForged: i have some errors when i call the index of my page, i get a 200 ok status but this error seems to come with it
[15:59:28] SourceForged: ERROR Errno::ECONNRESET: Connection reset by peer
[16:03:14] pwz2000: I have a small question if someone can assist. In my view I am linking to a popup so user can select action to Follow/Unfollow user. I need help with changing the code to provide the follow/unfollow action directly on the show page instead of linking it to a popup. https://gist.github.com/pwz2k/ef12b7cc0a851794569e
[16:26:47] greengriminal: Hey guys so in my application you can choose print sizes. What I want to do is dependent on the page size they choose this will then be passed into the @media print { }
[16:27:16] greengriminal: This isn't the most practical but i envision something like this: https://gist.github.com/anonymous/909845b74b952619eb88#file-css-erb-L29 and dependent on what size is passed in will deter what size is printed.
[16:27:30] brownbathrobe: hey folks, anyone familiar with a circular dependency error when running rspec tests?
[16:27:36] brownbathrobe: (...lib/sass/version.rb:5: warning: loading in progress, circular require considered harmful)
[16:28:05] jstrong: brownbathrobe http://stackoverflow.com/questions/24176446/rspec-capybara-loading-in-progress-circular-require-considered-harmful
[16:29:19] brownbathrobe: jstrong: wow, that's it?
[16:29:28] jstrong: https://github.com/sass/sass/issues/1337
[16:29:42] jstrong: it's a warning inside sass apparently.
[16:30:07] jstrong: i'd just ignore it or disable the warnings flag if output is annoying
[16:30:08] jstrong: err sorry: https://github.com/rspec/rspec-core/issues/1571
[16:30:17] brownbathrobe: man, thanks for that
[16:33:39] brownbathrobe: jstrong: should rspec take > 5 seconds to run, even with no tests?
[16:34:54] jstrong: brownbathrobe: well rspec loads the rails environment by default
[16:35:03] jstrong: rails application init is usually pretty heavy, so yeah.
[16:35:13] jstrong: if you want to reduce that time take a look into zeus which preloads your rails environment once
[16:35:24] jstrong: so all subsequent rspec calls work on the preloaded environment
[16:35:30] jstrong: instead of loading environment each time you run the command
[16:35:41] brownbathrobe: jstrong: yeah, i'm used to running fast javascript/mocha tests
[16:35:46] jstrong: https://github.com/burke/zeus
[16:35:49] brownbathrobe: jstrong: i'll look into zeus!
[16:36:07] jstrong: there's a couple of alternatives such as spork and spring. but zeus is the best imo
[16:36:11] jstrong: (well i haven't tried spring)
[16:37:06] workmad3: jstrong: spring comes in the default rails bundle now
[16:37:27] jstrong: i haven't been following latest rails since 3.2 because we're stuck on that
[16:37:29] jstrong: so thanks for clarification
[16:40:22] stef1a: i'm trying to modify a model's JSON attribute and save it to the db. everything appears okay, except that when i examine the object after the save, the modification isn't there: https://gist.github.com/smlance/3efbd74b6ae8662a7a34 help?
[16:44:01] cleopatra: how are you friends
[16:44:06] cleopatra: long time i no come back
[16:49:55] chrislerum: stef1a: where exactly in the code is this 'modification'?
[16:50:24] stef1a: chrislerum: https://gist.github.com/smlance/3efbd74b6ae8662a7a34#file-evaluations_controller-rb-L22
[16:52:42] makerop: has anyone written anything using devise inside a mountable engine?
[16:52:52] stef1a: oh. let me hypothesize: the column type is :json. the objects i'm working with in that method are hashes. i am not declaring any serialization. is it possible that i need to explicitly make everything json?
[17:00:12] lilia: stefia: do you expect it to add question #3 or update an existing question?
[17:00:21] lilia: i think we need to see the controller code
[17:01:22] stef1a: lilia: the controller code is there
[17:01:40] lilia: oh ha, pages scroll on the web. forgot about that. ;)
[17:01:50] stef1a: lol no worries
[17:02:34] stef1a: yeah i think i need to serialize this... which i'm not doing in evaluation_survey.rb
[17:04:45] lilia: are there any validations failing on the model?
[17:05:02] lilia: hmm, nope
[17:05:15] stef1a: lilia: no
[17:07:02] lilia: kinda weird to have a table with only one record in it.
[17:07:19] lilia: why not just have a table of questions?
[17:07:37] jrhorn424: how do i get rails to change an object's id and persist it? i've tried assign_attribute, update_attibute, update_attributes (rails 3.2) all with appropriate options like without_protection: true. The object is changed, it just won't persist.
[17:14:09] stef1a: lilia: i'd have to serialize some of the columns anyway
[17:19:33] chrislerum: jrhorn424: maybe coz it'd have a new id (one not in the db yet) but would still be marked as new_record = false, so save fails because it's expecting to update.
[17:19:54] chrislerum: jrhorn424: getting log output?
[17:21:48] jrhorn424: chrislerum that's a good point. we just figured it out. We did a query and called update_all instead of update_attributes.
[17:22:43] chrislerum: jrhorn424: i bet we're looking at the same SO page
[17:23:51] jrhorn424: have a link? i wasn't actually on SO. :D chrislerum
[17:24:00] chrislerum: http://stackoverflow.com/questions/8301635/how-to-change-primary-id-of-a-record-in-rails
[17:39:44] andywww: I have a problem which I???m struggling to get to the root of
[17:40:08] andywww: i have developed a jsonp api which serves up data which is consumed by ajax calls
[17:40:19] andywww: so that i can decouble the front and back end of the app
[17:41:10] andywww: but i???m trying to ???lock down??? the calls to the api to just the ajax calls from the sites front end
[17:41:44] andywww: i???m not entirely sure what I???m trying to do is possible but i thought I???d ask incase anyone has done anything similar?
[17:43:40] Scient: so i have a gem, where i define dependencies via gemspec
[17:43:59] Scient: but those dependencies are broken unless i add that dependency in the app using the gem as well
[17:44:02] Scient: this is not intended, is it?
[17:51:56] makerop: how can i run rails g devise User in an engine?
[17:52:18] makerop: it's a moutable engine, but it dies on invoke active_record, with a bad databse connection
[17:52:22] makerop: rails g model User ,works
[17:58:27] leex: in my controller I have: def a; b; render :b; end which works fine but it doesn't include any of my css files. Any idea why?
[18:01:28] makerop: ping radar
[18:02:06] Sou|cutter: leex: the information you provided is seemingly completely unrelated to the problem you describe
[18:02:15] Sou|cutter: maybe you can elaborate how those things are related?
[18:03:57] leex: Sou|cutter: me? if me then: it is literally: def search; index; render :index; end
[18:04:41] leex: Sou|cutter: and index is: def index; @search = ...; @results = ...; end
[18:06:07] Sou|cutter: rendering css has more to do with your layout/view templates than your controller code (although the controller may specify a layout)
[18:06:25] Sou|cutter: err I should say including css, not rendering
[18:08:23] stef1a: i'm trying to modify a model's JSON attribute and save it to the db. everything appears okay, except that when i examine the object after the save, the modification isn't there: https://gist.github.com/smlance/3efbd74b6ae8662a7a34 help?
[18:08:40] leex: Sou|cutter: it doesn't matter what's in the index.html.erb even if there isn't anything in there it doesn't include any of the css
[18:09:06] leex: Sou|cutter: if the index.html.erb is empty the page is literally empty, nothing in there
[18:09:58] leex: Sou|cutter: all my other views at least have: <link href="/assets/application.css?body=1" media="all" rel="stylesheet" /> and the other relevant stylesheet links...
[18:11:55] leex: Sou|cutter: well not the views, but if I request the page it has the links and stuff
[18:15:11] |RicharD|: what technology stack is better for do live "notifications" with rails ?
[18:16:37] antivert: javascript..?
[18:18:16] |RicharD|: antivert: not a good reply :D btw found http://rubysnippets.com/2013/04/10/rails-4-live-streaming-versus-node-dot-js/
[18:19:00] antivert: not a good reply?!
[18:20:44] stef1a: so... does anyone know how i can look at the sql statements being performed? because my save, which commits just fine, doesn't acutally update my db.
[18:20:57] wasamasa: stef1a: take a look at the logs?
[18:21:09] stef1a: wasamasa: it doesn't show up there :/
[18:21:42] wasamasa: stef1a: I guess nothing is executed then :P
[18:22:16] stef1a: ah. that's scary.
[18:22:35] rhizome: |RicharD|: it always depends on the details
[18:22:41] pipework: |RicharD|: Single direction?
[18:22:44] wasamasa: I'd use the console, enable logging, then do whatever you've been doing in that piece of code
[18:22:45] pipework: server to client?
[18:23:40] |RicharD|: pipework: yes
[18:23:55] stef1a: wasamasa: okie dokie, i'll try... how do i enable logging?
[18:23:58] pipework: |RicharD|: SSE then.
[18:24:12] wasamasa: stef1a: I mean, enable logging to stdout
[18:24:21] stef1a: wasamasa: my question remains
[18:24:38] antivert: people sure are entitled today
[18:24:52] wasamasa: stef1a: `ActiveRecord::Base.logger = Logger.new(STDOUT)`
[18:28:11] stef1a: wasamasa: https://gist.github.com/smlance/3efbd74b6ae8662a7a34#file-rails_c-log-L9
[18:29:20] maletor: what is the point of this? i thought ruby had a default ca file path it used? https://github.com/Diego81/omnicontacts/blob/master/lib/omnicontacts/http_utils.rb#L86-L90
[18:29:40] wasamasa: stef1a: no, I won't help you debug your own code :P
[18:30:19] stef1a: ACTION moans
[18:30:42] wasamasa: I'm not in *that* mood either
[18:31:01] stef1a: i was being facetious :-)
[18:31:28] wasamasa: also, your snippet triggered a rendering bug in my gpu driver, yay
[18:32:32] cantonic: hey there. How can I make rails 4 reload locales automatically on change without having to restart the server (for development and test)
[18:38:43] i42n: Hey I have a question on capistrano and asked already in #capistrano channel. But no response. Anyone here who might help as capistrano is pretty close to rubyonrails... I want to use this capistrano gem: https://github.com/tablexi/capistrano3-unicorn However I am new to capistrano and want to know what happens when I reboot my server. Does it run unicorn automatically? I suppose not as it does not
[18:38:45] i42n: create init.d file, right?
[18:41:50] nettoweb: guys, I tried again and would like to ask why rails remove my count(*) from generate query: https://gist.githubusercontent.com/osnysantos/5744b77ae1364319744d/raw/3e3cd838ca933ba53980fbfd1b9140b470d577ae/gistfile1
[18:42:53] wasamasa: i42n: why should it?
[18:43:30] wasamasa: i42n: assuming you mean the box you're running it on with "server"
[18:44:00] i42n: wasamasa: yes I mean the box. So rebooting does not startup the app again.
[18:44:21] wasamasa: again, why should it mess with what your init does for you unless it's stating that explicitly?
[18:45:08] i42n: wasamasa: So if I want unicorn to be started on server reboot, I have to create the init.d file for it "manually"?
[18:45:30] wasamasa: assuming you're using something sysvinit-like, yes
[18:45:32] i42n: With manually I mean, I have to add extra custom code to my capistrano stuff
[18:45:41] i42n: wasamasa: ok thanks
[18:45:56] wasamasa: well, capistrano does handle the deployment
[18:46:06] wasamasa: not the init and supervising of processes
[18:46:12] wasamasa: that's the job of your init system
[18:46:25] wasamasa: which could be upstart, systemd, openrc, sysv, ...
[18:46:45] i42n: wasamasa: true. So it is common practice to create the init.d file with capistrano for my app?
[18:47:07] wasamasa: dunno, don't use capistrano
[18:47:26] i42n: why not capistrano?
[18:47:35] rhizome: capistrano is best thought of as a scripting and file-copying utility. best to keep server-side stuff server-side.
[18:47:38] wasamasa: no, I mean *I* don't use it yet
[18:47:51] wasamasa: so far I've rolled out my rails stuff to only one server :P
[18:48:08] i42n: wasamasa: ok. so how do you know so much about capistrano already?
[18:48:24] wasamasa: I know a bit about init systems
[18:48:33] wasamasa: and what deployment tools are supposed to do
[18:48:46] wasamasa: also, I have this super-rare power
[18:48:53] wasamasa: it's known as "Common Sense"
[18:49:25] wasamasa: it allowed me to guess that capistrano probably won't hack around with your init system behind your back
[18:50:07] i42n: of course capistrano does not do anything "behind my back"
[18:50:45] i42n: but I thought maybe the unicorn gem to extend capistrano might provide such an init file as many people might need that
[18:51:05] wasamasa: "This is a capistrano v3 plugin that integrates Unicorn tasks into capistrano deployment scripts"
[18:51:17] wasamasa: I doubt "Unicorn tasks" is about that
[18:51:42] rhizome: https://github.com/farmdawgnation/unicorn-easy-restart
[18:51:48] wasamasa: the rest I've read on its README is all about supervising and controlling unicorn
[18:51:51] rhizome: lets you use touch tmp/restart.txt like passenger
[18:51:53] wasamasa: not the machine it's on
[18:52:02] rhizome: which is built in to capistrano
[18:52:25] makerop: how can i let devise know it is within an engine?
[18:53:08] i42n: rhizome: thanks for the tip
[18:54:11] wasamasa: i42n: guess you mixed up "server" as in machine and "server" as in software service
[18:54:42] wasamasa: i42n: the thing is that you only need to set up starting the webapp once
[18:55:01] wasamasa: i42n: however copying over new code and restarting the service is much more frequent which is probably why someone devised capistrano
[18:57:49] Vegetable: hi, in an active model serializer, is there any way to apply an order or sort to the model being returned?
[18:58:55] blackmesa: hi all. Ive deleted rubyracer from my gemfile (rails 41) and installed node on the production system. But I receive a javascript runtime error
[18:59:05] nahob: hi, is this the right channel for questions?
[18:59:14] nahob: I suppose it is
[18:59:57] nahob: I have a form within a form, and that is causing problems as when you click either one's submit button, it submits both. However I want both to be able to submit indepedently. If the out one submits I do not want the inner one to submit. Easy way around this?
[19:00:23] nahob: Probably will have to rewrite it and I accept that but is there a quick hack?
[19:03:49] pipework: Vegetable: What do you mean by 'to the model being returned'?
[19:04:40] Vegetable: rather the results of the call on that model
[19:04:45] Vegetable: by default it sorts by id
[19:05:27] Vegetable: like if I wanted to serialize users and order them by name instead of id
[19:06:36] Vegetable: all I can find is sorting based on associations
[19:07:07] makerop: can i point the devise generater at a non-standard database.yml file?
[19:08:04] stef1a: antivert: i tried what you suggested regarding having four models to create a survey and ran into all sorts of problems ;-)
[19:08:20] pipework: Vegetable: Query them sorted then?
[19:11:18] pipework: Vegetable: Wherever you're querying for the models now.
[19:11:25] pipework: Without showing me code, I have no clue.
[19:14:57] Vegetable: well shouldn't the sort order be part of the serializer itself
[19:15:03] pipework: Vegetable: no, why
[19:15:34] Vegetable: well I can't find where it's being called otherwise
[19:20:18] Vegetable: undefined method `order' for EventSerializer:Class
[19:20:53] makerop: has anyone implemented this https://github.com/plataformatec/devise/wiki/How-To%3a-Use-devise-inside-a-mountable-engine
[19:20:58] makerop: in a full mountable engine?
[19:21:04] pipework: Vegetable: I said to put an order on the model query.
[19:21:28] Vegetable: I can't find the query
[19:21:39] makerop: i cant get the rails g devise MODEL install to work; it's not finding the databse
[19:26:59] stef1a: the solution to all my problems was: just use :text instead of :hstore or :json
[19:29:14] pipework: Vegetable: Then you're fucked.
[19:47:52] blackmesa: hi all. Ive deleted rubyracer from my gemfile (rails 41) and installed node on the production system. But I receive a javascript runtime error
[20:03:59] cleopatra: frankson, ?? there
[20:09:26] dtordable: I'm trying to do gem install rails
[20:09:30] dtordable: but get an error
[20:09:55] dtordable: Installing gem tzinfo-1.2.2
[20:09:55] dtordable: ERROR: While executing gem ... (NoMethodError)
[20:09:55] dtordable: undefined method `size' for nil:NilClass
[20:09:59] dtordable: what's that?
[20:16:02] dtordable: anyone understand that?
[20:18:01] rhizome: it's a common error in general, but what it's referring to is a mystery
[20:18:52] pipework: dtordable: Let me blow your mind: It's all open source.
[20:18:58] dtordable: simply doesn't work
[20:19:18] pipework: It all Just Works???
[20:20:25] pipework: It is 100% a-okay to pop open the source and try to locate what's going on. You have the permission and blessing of #rubyonrails
[20:21:14] jabbott: How do I declare a global variable in rails like for <title></title> ?/
[20:22:03] rhizome: jabbott: you probably don't want to
[20:22:30] jabbott: how would I provide a title variable to each controller ?
[20:22:42] pipework: People often use helper methods
[20:22:46] rhizome: you wouldn't. you'd change it in the view
[20:22:49] pipework: railscast has some stuff on this
[20:23:18] rhizome: yeah, google "railscast page title"
[20:23:29] jabbott: rhizome: what do you mean
[20:23:37] jabbott: pipework: which video
[20:24:09] pipework: jabbott: One of them. Go look.
[20:41:26] gizmore: jabbott: maybe use config var?
[20:41:34] gizmore: or lang file?
[21:02:08] gizmore: new logo proposal rejected https://www.wechall.net/rails_logo.png
[21:05:28] otherj: Let's see if I can actually stay connected this time :/
[21:06:15] skyjumper: gizmore: lawl
[21:06:26] momomomomo: gizmore: didn???t realize we challw as a site; that???s interesting and reminds me of an old crypto challenge site I used to use
[21:10:01] gizmore: sorry for my trolling ;D
[21:10:28] gizmore: i used that kinda pun for a project at work ^.^ it??s quite hill
[21:11:00] gizmore: i did php for 5 years, then 2 years ruby at work... now 6 months ruby at private project
[21:11:19] gizmore: my private project is a chatbot, which can speak irc, websocket and libpurple a bit
[21:11:39] gizmore: you can meet your ruby chatbot doom in #ricergame ... probands welcome
[21:15:48] hadifarnoud: this is driving me nuts! I did set secret_key_base in .bashrc file. 'printenv secret_key_base' confirms that. why am I still getting secret_key_base not set error
[21:17:50] cleopatra: frankson, ?? there
[21:17:56] mozzarella: hadifarnoud: how are you running it?
[21:18:25] hadifarnoud: mozzarella: what do you mean? my server is Passenger
[21:19:13] bricker`work: hadifarnoud: how did you set it?
[21:19:19] hadifarnoud: secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
[21:19:23] hadifarnoud: bricker`work: ^
[21:19:35] cleopatra: anyone have a example how to make a tree categories??
[21:19:38] mozzarella: hadifarnoud: what makes you think it runs it inside a bash interactive shell?
[21:19:45] hadifarnoud: in my bashrc, export SECRET_KEY_BASE=5735e5
[21:19:57] bricker`work: hadifarnoud: where did you set SECRET_KEY_BASE? it's very unlikely that bashrc is being read by your server
[21:20:00] hadifarnoud: I thought you mean my secrets.yml
[21:20:36] bricker`work: hadifarnoud: you'll need to set it in your passenger config somewhere, for example SetEnv if you're using apache
[21:20:46] hadifarnoud: bricker`work: but printenv shows me the value. I tried to use dotenv-deployment gem and set it all in .env but it doesn't work
[21:20:47] capin: hadifarnoud: run 'rake secret' then put that in your secrets.yml
[21:21:39] hadifarnoud: capin: I obviously don't want to do that mate. I have a public github repo
[21:21:44] bricker`work: hadifarnoud: printenv has nothing to do with your ruby application
[21:22:14] hadifarnoud: bricker`work: with dotenv gem, how should I set it in .env file?
[21:22:15] capin: hadifarnoud: the add the secrets.yml file to your .gitignore
[21:22:38] bricker`work: hadifarnoud: the way we do it is that we have a secrets.yml that lives on the server, and it just gets moved into place on each deployment. So the Rails app just read it like normal.
[21:22:41] hadifarnoud: capin: I did that too, but for some reason capistrano keeps deleting my file
[21:23:03] bricker`work: hadifarnoud: capistrano doesn't delete files unless you tell it to
[21:23:13] bricker`work: hadifarnoud: you're probably just not symlinking it correctly
[21:23:21] capin: hadifarnoud: didn't realize you were deploying with capistrano :/
[21:23:29] hadifarnoud: bricker`work: I haven't symlink it
[21:23:43] bricker`work: hadifarnoud: you're using capistrano 3?
[21:23:48] hadifarnoud: yes bricker`work
[21:25:11] bricker`work: hadifarnoud: use linked_files: `set :linked_files, %w[ config/secrets.yml ]`
[21:25:26] bricker`work: hadifarnoud: and then put your secrets.yml in shared/config/secrets.yml
[21:25:34] hadifarnoud: bricker`work: cheers
[21:25:36] bricker`work: hadifarnoud: and then you can just put the real secret key in there
[21:25:43] hadifarnoud: will try it now
[21:26:05] Brycetron: I had a question about making a simple to-do list app on ruby on rails, would anyone be able to help?
[21:26:06] capin: hadifarnoud: i did a little write up in a Readme for sharing rails apps, here => https://github.com/ipatch/klynda up and runndidndidningegcop-web
[21:26:27] capin: do sorry wrong link
[21:26:56] capin: https://github.com/ipatch/kegcop-web
[21:27:09] kaawee: Hello! When model M has_many :events , but model Events actually has subclasses FooEvent, BarEvent, BazEvent, is it possible to declare "has_many :foo_events; has_many :bar_events, has_many :baz_events"? Or what is the proper way to access the events filtered by the particular event type?
[21:27:46] hadifarnoud: capin: oh thanks
[21:28:27] capin: hadifarnoud: no prob, i hope it helps
[21:29:42] bricker`work: kaawee: yes, you can do that.
[21:30:06] Brycetron: anybody experienced with creating a simple to-do list app with ruby on rails ? Ty
[21:30:12] bricker`work: kaawee: otherwise, you can use the Event class and add scopes to filter by class
[21:30:12] otherj: if one wants to use a lookup table, shouldn't this relationship work? https://gist.github.com/majnun/128b5871017262dd7752 error as a comment in the gist -- it looks like it's also not saving a race_id when I hit save on the form
[21:30:21] bricker`work: Brycetron: just ask your question
[21:30:37] Brycetron: Would someone not experienced with Ruby on Rails be able to accomplish a simple to-do list app?
[21:30:43] bricker`work: Brycetron: yes
[21:30:53] centrx: I write my to-do list on a napkin
[21:31:02] Brycetron: May I pm you Bricker?
[21:31:29] centrx: http://rubygems.org/gems/napkin
[21:31:29] kaawee: bricker`work: well, the next question is: when I create a FooEvent (foo_event = FooEvent.new), should I add it like this (m.events << foo_event) or like this (m.foo_events << foo_event)?
[21:33:18] kaawee: bricker`work: now there is a validation which takes the most recent entry of m.foo_events ... if foo_event is added to m.events and not m.foo_events, then the validation on m.foo_events fails
[21:33:35] bricker`work: kaawee: it shouldn't matter, rails will fill in the 'type' column either way.
[21:35:01] kaawee: bricker`work: when loading, but not before having saved the model instance... before save, only one of m.event or m.foo_event is populated
[21:36:11] bricker`work: kaawee: you said m.foo_events works, so what's the problem?
[21:38:11] cantonic: hey there. is there a way to make rails 4.1.4 auto-reload locales when editing them without having to restart the server and guard? (using spring)
[21:39:26] mwmnj: Anyone around familiar with pdfkit?
[21:39:31] kaawee: bricker`work: the problem is that other code could write to m.events and then the validation on m.foo_events does not catch that there is actually an object in m.foo_events which does not satisfy the constraints...
[21:39:37] mwmnj: I am having trouble using it (http://stackoverflow.com/questions/25355697/wkhtmltopdf-error-when-generating-pdf-with-lots-of-pages-with-header-footer)
[21:39:43] kaawee: bricker`work: could I make m.events read-only?
[21:39:52] capin: cantonic: how are you restarting the server?
[21:40:12] cantonic: capin: ctrl + c, rails s
[21:40:29] cantonic: and ctrl + c, guard for testing
[21:41:05] capin: ahh i thought you meant the rails app itself (-.-)
[21:42:15] puppeh: is there a template for rails dev test cases?
[21:42:29] puppeh: I can recall seeing one in the past but can't find it :/
[21:42:44] hadifarnoud: I have this random issue with images. http://persianpreneur.com/ it disappears despite being present on server. I dunno if it's my .gitignore fault or cloudflare
[21:43:26] cantonic: capin: yes???. well i have to quit the rails server and restart it in order to see my changes to a locale
[21:44:15] hadifarnoud: also, I see no error log on nginx
[21:44:45] capin: cantonic: yeah not sure if there a way to do that :/ sounds like you'd have to write a bash script of some sort
[21:45:31] cantonic: hmm??? ok, not that important then ;) thank you
[21:48:21] cpruitt: if class Page has_one :permalink, will Permalink???s before_save callback occur after page has been saved so that attributes of page.permalink can be updated using page???s id ?
[21:54:50] gizmore: hadifarnoud: your problem description is bad / vague... try to enable assets_compile
[21:55:13] hadifarnoud: gizmore: I use capistrano. I assume it does it for me?
[21:55:24] gizmore: hadifarnoud: if that solves your problem, add some dirs to your asset pipeline. also blame rails for being such a bad preconfig
[21:55:36] stef1a: is there a gem that allows one to add form fields by clicking on a button?
[21:55:39] gizmore: hadifarnoud: i don??t know capistrono
[21:55:56] gizmore: stef1a: work_with_js_yourself 1.0 solves it
[21:56:24] hadifarnoud: gizmore: I run a rake task on server that adds some data to db and import some pictures. do I have to precompile again? (because capistrano does it with every deploy).
[21:56:26] gizmore: stef1a: also you might want to try the i_learn_jquery gem
[21:56:46] stef1a: gizmore: i'm unsure i understand your intent.
[21:57:19] gizmore: stef1a: your requirement sounds a bit like javascript feature, so i suggest you learn jquery a bit
[21:57:52] stef1a: gizmore: indeed it is, and i will do so. thanks!
[21:58:31] stef1a: (of course, there may very well be a gem that incorporates a lot of small, common jquery features, which is why i asked in the first place.)
[21:58:50] momomomomo: stef1a gizmore: is a bit of a troll, and http://railscasts.com/episodes/403-dynamic-forms is something that will help you
[21:59:02] stef1a: momomomomo: thank you!
[22:00:38] waseem_: stef1a: This might as well http://railscasts.com/episodes/197-nested-model-form-part-2
[22:02:19] stef1a: waseem_: danke, tack, etc.
[22:09:29] bricker`work: I've never seen an aestically pleasing Routes file
[22:09:52] bricker`work: they're always just a clusterfuck of long lines and inconsistencies
[22:13:18] rhizome: where was i
[22:16:21] Brycetron: Anyone with much experience in RoR be able to PM me, I had a quick question. Ty
[22:49:08] kaawee: Hello! Is the :created_at field set before or after validations are run when saving a model instance?
[22:56:28] PeterBoy: Is application.html.erb with all the views?
[23:23:21] Spami: Guys, I'm not sure I understand the Aggregator thing https://gist.github.com/dhh/b0a106a00e8737280666 can someone give me a quick explanation on it?
[23:27:49] bricker`work: Spami: just a wrapper for two related models. Unnecessary in my opinion.
[23:28:48] Spami: bricker`work, I don't understand the purpose of it. How is it different from belongs_to, has_one, ...
[23:30:47] bricker`work: Spami: It treats the two models as one model. So instead of calling user.address.street1, you'd just call profile.address_street1
[23:30:50] bricker`work: Like I said...
[23:31:12] Spami: Oh, ok. Yeah. it's weird
[23:32:03] Spami: bricker`work, so composed_of does slightly the same thing right ?
[23:32:04] bricker`work: It's just DHH trying to wrap a pattern in some convoluted, obfuscated macro because he had to type something twice
[23:32:44] avi__: Hi, I'm doing a study on topics of bug reports (issue reports, some related to rails) and I am looking for volunteers for a 10 minute survey. If you're interested just msg me and I can email it to you or give you a URL.
[23:33:04] Spami: avi__, send me the url in pm
[23:35:03] bricker`work: Spami: no, not really the same thing
[23:36:30] Spami: bricker`work, I'm looking at this: http://api.rubyonrails.org/classes/ActiveRecord/Aggregations/ClassMethods.html
[23:37:28] bricker`work: Spami: yeah, it's not the same thing.
[23:38:34] bricker`work: The Aggregator class might come in handy two when you have two models that are part of a single API that you want to query.
[23:39:07] bricker`work: I assume it would provide all the query methods and then combine the results intelligently. *shrug*
[23:44:02] Spami: Damn I wish I could work with really good rails programmers. I would learn so much
[23:44:12] Spami: Yo rickjamesthethir
[23:47:15] Radar: Good morning everyone.
[23:47:43] helpa: Nom nom. Thanks, Radar!
[23:47:43] Radar: !botsnack
[23:49:35] Radar: received report of gizmore trolling
[23:49:37] Radar: Saw no trolling
[23:49:39] Radar: Extremely confused
[23:52:46] krnflake: are there any papers on how to implement hourly billing?
[23:53:12] krnflake: not sure what's the best way to implement it :/
[23:58:53] bricker`work: krnflake: total = hours * wage