Activity Graph

Page 1 of 130 | Next »


[15:47:38] elaptics: has joined ##new2ruby
[15:47:38] elaptics: has joined #ruby
[15:47:38] elaptics: has joined #RubyonRails-offtopic
[15:47:38] elaptics: has joined #RubyOnRails
[17:39:09] elaptics: Quit: My iMac has gone to sleep. ZZZzzz…


[09:09:33] elaptics: has joined #RubyonRails-offtopic
[09:09:51] elaptics: has joined #ruby
[09:10:05] elaptics: has joined ##new2ruby
[09:10:05] elaptics: has joined #RubyOnRails
[17:41:32] elaptics: Quit: My iMac has gone to sleep. ZZZzzz…


[10:01:55] elaptics: has joined #RubyonRails-offtopic
[10:01:55] elaptics: has joined #RubyOnRails
[10:01:58] elaptics: has joined ##new2ruby
[10:01:58] elaptics: has joined #ruby
[17:14:10] elaptics: Ping timeout: 264 seconds


[15:10:47] elaptics: has joined ##new2ruby
[15:10:47] elaptics: has joined #ruby
[15:10:47] elaptics: has joined #RubyonRails-offtopic
[15:10:47] elaptics: has joined #RubyOnRails
[17:57:20] elaptics: Quit: My iMac has gone to sleep. ZZZzzz…


[09:25:30] elaptics: has joined #RubyonRails-offtopic
[09:25:30] elaptics: has joined #RubyOnRails
[09:25:33] elaptics: has joined ##new2ruby
[09:25:33] elaptics: has joined #ruby
[18:09:42] elaptics: Quit: My iMac has gone to sleep. ZZZzzz…


[14:52:54] elaptics: has joined #RubyOnRails
[14:53:03] elaptics: has joined #RubyonRails-offtopic
[14:57:19] elaptics: has joined ##new2ruby
[14:57:19] elaptics: has joined #ruby
[15:01:41] elaptics: Remote host closed the connection
[15:06:32] elaptics: has joined #RubyOnRails
[18:20:01] elaptics: Quit: My iMac has gone to sleep. ZZZzzz…


[13:41:10] elaptics: has joined #RubyonRails-offtopic
[13:41:10] elaptics: has joined #RubyOnRails
[13:41:12] elaptics: has joined ##new2ruby
[13:41:12] elaptics: has joined #ruby
[13:42:44] elaptics: Remote host closed the connection


[20:32:02] elaptics: has joined #RubyOnRails
[20:38:38] elaptics: has left #RubyOnRails: ()


[12:45:34] elaptics: AimlessRaven: use cc or bcc if it's the same email. Or do you mean you want to personalise the content for each recipient?
[12:57:54] elaptics: AimlessRaven: http://guides.rubyonrails.org/action_mailer_basics.html#sending-email-to-multiple-recipients
[13:00:15] elaptics: xpl0iter: read the guides http://guides.rubyonrails.org/active_record_querying.html#array-conditions
[13:00:42] elaptics: xpl0iter: read the part about placeholder conditions
[16:08:34] elaptics: Ping timeout: 240 seconds
[16:08:49] elaptics: has joined ##new2ruby
[16:08:49] elaptics: has joined #ruby
[16:08:49] elaptics: has joined #RubyonRails-offtopic
[16:08:49] elaptics: has joined #RubyOnRails


[11:02:40] elaptics: lxsameer: If I understand what you're asking, then nope. Not as far as I know


[10:16:13] elaptics: AimlessRaven: from what I can infer from your gist you haven't decorated your orders in your controller
[11:23:34] elaptics: wherever you clone it to
[11:23:58] elaptics: you just need to be in the root of the project directory
[11:25:20] elaptics: roelof: where is the spec file located?
[11:25:41] elaptics: oh I can see it - what version of rspec?
[11:26:05] elaptics: prudhvi: sorry, that was to roelof
[11:26:35] elaptics: prudhvi: that's not relevant to your problem
[11:27:14] elaptics: prudhvi: if you have done a git clone of the project, then you just need to change into the directory it would have created. That's the root of the project and that's where you would run your commands, i.e. rails server
[11:27:58] elaptics: prudhvi: where is the source code then?
[11:29:03] elaptics: roelof: if you are running a recent version of rspec and your specs are in the standard locations then you shouldn't need to tag them
[11:29:36] elaptics: tildes: prudhvi doesn't need to worry about rspec right now. They just want to run a rails server
[11:29:58] elaptics: prudhvi: so just change into the directory containing the source code
[11:30:22] elaptics: universal: that's usually set by default
[11:31:20] elaptics: prudhvi: are you sitting in the project root directory?
[11:31:53] elaptics: prudhvi: what directories do you see in there? Tell me the first 3
[11:33:42] elaptics: Circuit8: what are you trying to do? But generally you probably don't want to do that. Be in control of your own ids, just store a reference to the external source ids
[11:35:00] elaptics: prudhvi: do you know how to use a terminal and the shell? Or are you new to everything?
[11:35:59] elaptics: prudhvi: so you know how to list a directory. I'm just trying to make sure you are indeed in the rails root directory
[11:36:56] elaptics: prudhvi: ok run the command 'bundle install'
[11:38:06] elaptics: prudhvi: and that ran and installed lots of gems with no errors?
[11:39:16] elaptics: prudhvi: what version of rails is the project and what database is it using?
[11:43:17] elaptics: Circuit8: not sure I understand the specific flow of how you're creating your app records from the json...can you explain more?
[11:44:08] elaptics: prudhvi: so depending on how the app's been put together you might have a bin/setup command that will get your database set up
[11:44:49] elaptics: prudhvi: to be clear run 'bin/setup'
[11:45:00] elaptics: prudhvi: let us know what output that provides, if any
[11:46:25] elaptics: Circuit8: ah gotcha. I would create a service object style thing which would take the json and massage it to suit your needs to create the model as you want it to be
[11:47:04] elaptics: prudhvi: just type it like I showed


[13:21:45] elaptics: nettoweb: nothing's mandatory
[13:22:47] elaptics: nettoweb: in development, I use a local mail program called mocksmtp and I use vagrant for my dev boxes. I just reverse tunnel from the vagrant box back to my local machine to have it send the mail to mocksmtp
[13:23:53] elaptics: nettoweb: this is what I do vagrant: ssh -- -R 1025:localhost:1025
[13:24:06] elaptics: nettoweb: it will if you have enabled delivery, etc
[13:24:40] elaptics: isn't there some preview built into rails for it now?
[13:24:58] elaptics: ACTION has been stuck working on a rails 2 project for quite some time...
[13:28:17] elaptics: some of us still have to develop with it
[13:38:35] elaptics: GorillaApe: what are you actually asking? you are posting (or whatever) to a given controller from a few different places but you want to return from wherever you came from?
[13:39:56] elaptics: GorillaApe: simplest option is to save the url in the place where you start in the session or something and then use that as the return location
[13:40:31] elaptics: if there's an error you're just going to re-render the form aren't you?
[14:01:13] elaptics: GorillaApe: like I said, in your controller where you're rendering that reviews form, i.e. products I'm guessing, you set a session, e.g. session[:review_return_to] = product_path(@product) then when that review is posted to your reviews controller you can use it to redirect back. Similarly set it elsewhere you're showing the reviews form
[14:01:45] elaptics: GorillaApe: alternatively you could do a remote form so you don't leave the page and just re-render it on the page


[08:32:31] elaptics: has joined #ruby
[08:32:31] elaptics: has joined #RubyonRails-offtopic
[10:50:32] elaptics: worst new rails feature in a while
[10:50:44] elaptics: can we add a snippet to helpa now
[11:57:49] elaptics: roelof: maybe your select isn't returning anything?
[11:59:13] elaptics: maybe you just need quotes around it then for the attribute value
[12:00:18] elaptics: roelof: if you want to use image_tag then you need to pass the src attribute
[12:00:35] elaptics: = image_tag(src: <big_long_ruby_select_thing>)
[14:58:22] elaptics: clandry94: what do you want to achieve exactly?


[05:27:35] elaptics: has joined #RubyOnRails
[11:20:29] elaptics: andywww: you'd just pass the cookies stuff into your service object
[11:20:51] elaptics: andywww: what are you trying to do exactly?
[11:57:49] elaptics: pipework: what is/are sugar gliders?
[12:01:16] elaptics: pipework: ah, the possumbilities for that domain are endless!
[12:02:47] elaptics: andywww: so you're wanting to set a load of cookies?
[12:03:39] elaptics: just have your service object take in the params and cookies from the controller and return the managed cookies which you can use and set in the controller
[12:04:26] elaptics: e.g. cookies = FilterManagementService.new(params, cookies).managed_cookies or whatever
[12:06:16] elaptics: what sort of filters?


[12:49:57] elaptics: kareeoleez: just use the MED array as the source for the select then


[10:56:34] elaptics: ahmgeek: what are you asking?
[10:56:48] elaptics: ahmgeek: you have two different models called Role?
[10:57:29] elaptics: why do you want 2 different auth mechanisms? That just sounds like you're asking for trouble
[10:59:22] elaptics: so what is the specific issue you're having?
[11:00:36] elaptics: conflicts how? You mean your Role model isn't namespaced and the strongbolt code is assuming your Role model is its Role model?
[11:01:03] elaptics: you could namespace yours and make sure all yours are referenced with the namespace where there might be ambiguity
[11:13:29] elaptics: andywww: sounds like maybe you have a circular dependency
[11:14:50] elaptics: andywww: more than likely - this is why callbacks are problematic
[11:21:18] elaptics: andywww: yes, that looks like it's trying to destroy "upwards" too
[11:21:45] elaptics: andywww: hence it'll be trying to destroy the thing that initiated the first one, and back "down" until you run out of stack
[11:27:47] elaptics: kareeoleez: add the stacktrace you're getting to your gist
[11:38:32] elaptics: kareeoleez: you're trying to set it to a "disallowed" value - that's what it's moaning about -i.e. isn't not one of your valid enum values
[11:39:46] elaptics: kareeoleez: but "AUTO" isn't in your enum list at the top
[11:40:19] elaptics: kareeoleez: personally I wouldn't do that in this model
[11:45:59] elaptics: kareeoleez: it sounds like all that IF_MEDIA stuff is just used to allow users to enter something then it should be done in a form object or elsewhere. It's not really the responsibility
[11:47:00] elaptics: it definitely shouldn't be in the controller
[11:47:15] elaptics: like I said I would create a form object
[11:48:58] elaptics: sure it can
[11:49:41] elaptics: I think I might have a gist with an example
[11:50:18] elaptics: kareeoleez: https://gist.github.com/andyh/2840f474153cdf77e0db
[11:51:22] elaptics: kareeoleez: basically it's acting a bit like a typical active record object api but it can do whatever it wants and then it finally persists the massaged user data to update the underlying AR model
[11:52:09] elaptics: kareeoleez: what values?
[11:52:35] elaptics: kareeoleez: something to read http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decompose-fat-activerecord-models/
[11:52:46] elaptics: kareeoleez: for what purpose?
[11:53:24] elaptics: kareeoleez: display where and when?
[11:54:24] elaptics: create a simple value object then and use that in whatever other objects you need to access that data
[11:55:11] elaptics: doesn't really matter
[11:56:28] elaptics: kareeoleez: it will solve things because the form object which is for view purposes controls what users can see, enter and it massages their input into a suitable form that you want to actually persist to the database
[11:57:18] elaptics: If I understand what you want correctly you want them to effectively use aliases to choose the media type, e.g. they could pick any of 3 values and it would resolve to the "proper" enum value
[11:59:03] elaptics: well that's all view concerns so you let the form object manage that complexity. You've defined your valid enum values in the model for persistence so it doesn't need to be concerned with that


[17:40:09] elaptics: LastWhisper____: does it matter which one?
[17:42:50] elaptics: LastWhisper____: great! :)
[17:43:27] elaptics: LastWhisper____: you could shorten that slightly with .uniq(&:event_date)
[17:46:19] elaptics: LastWhisper____: that point 1 there is not quite the same thing. That's talking about the difference between summing it in ruby vs summing in sql
[17:47:36] elaptics: LastWhisper____: as tbuehlmann says it depends, but I wouldn't worry about it until you have some proof that that bit is a bottleneck and needs every ounce of performance squeezed out of it
[17:48:11] elaptics: LastWhisper____: for example it might be that you'd get a much bigger performance boost by removing the dupes using sql instead of in ruby
[17:48:42] elaptics: LastWhisper____: When you have some benchmarks that show it's a bottleneck then you optimize it
[17:50:39] elaptics: jliberman: well you might still need to reference the destroyed model during the request
[17:51:32] elaptics: swinner: I think I might have done a long time ago
[17:57:20] elaptics: swinner: need to see your code
[17:57:24] elaptics: swinner: !gist
[18:06:23] elaptics: swinner: that sounds very heavy-handed. I presume that best_in_place is providing some js event that you can listen for. In which case, I'd think that it would be better to just control classes on whichever elements you want to change colours and then rely on the css styling to utilise those classes to colour the td's appropriately
[18:06:56] elaptics: swinner: what exactly does your get_course_status helper method do? Can you add it to the gist
[18:07:17] elaptics: tubbo: don't go giving away all the trade secrets :D
[18:11:49] elaptics: swinner: That code is horrible :D I would make those course statuses the class names and put the styling in the stylesheet where it belongs
[18:12:56] elaptics: swinner: then listen for the js event from best in place, I imagine it'll be giving you the data back so you could get the course status from that and just manipulate the class on the relevant element with some jquery
[18:14:13] elaptics: swinner: https://github.com/bernat/best_in_place#ajax-success-callback
[18:17:12] elaptics: swinner: np


[13:02:34] elaptics: kitsuneyo: RC 1 is out at the moment, not the final release
[13:06:40] elaptics: kareeoleez: render the template name, e.g. the common pattern for e.g. a create action is if @foo.save; redirect some_path; else render "new"; end
[13:07:49] elaptics: kareeoleez: !code
[13:25:57] elaptics: kareeoleez: add the system settings controller to the gist and the edit template you're referring to. Can you clarify the specific issue too. Which controller are you hitting and what error are you seeing. Add any log output for the request to the gist too
[14:14:12] elaptics: kareeoleez: please add the system controller index view to the gist so I can see what you have there
[14:15:34] elaptics: kareeoleez: your index template is empty? So I have no idea where you're rendering that _admin_setup partial then.
[14:16:46] elaptics: tildes: ¯\_(ツ)_/¯
[14:18:43] elaptics: I'm not really sure I even know what the actual problem is yet...
[15:02:46] elaptics: kareeoleez: you said it was empty - but it's not? Add it to the gist
[15:02:57] elaptics: kareeoleez: much easier than me guessing things
[15:16:29] elaptics: kareeoleez: I'm not too familiar with devise but you'll need to make sure that resource is getting set to the @user object you've just updated (or attempted to) so that when that partial gets rendered it has your failed attributes.
[15:16:46] elaptics: kareeoleez: what errors are you actually getting currently?
[15:22:51] elaptics: kareeoleez: is this what you want to do? https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-edit-their-password
[15:31:38] elaptics: kareeoleez: what sort of errors do you want to show?
[15:32:00] elaptics: kareeoleez: like an inline error message?
[15:36:05] elaptics: kareeoleez: you just need to add errors by each input then. I use simple_form which does this for me. What version of rails are you using?
[15:38:48] elaptics: kareeoleez: you don't need to. Not sure if this is the best way because it's been a long since I've done it using this method cos the original helpers got removed but you could do something like f.object.errors[:attribute_name] for each one in the form
[15:39:55] elaptics: kareeoleez: what do you mean by fails to be submitted?
[15:42:05] elaptics: kareeoleez: oh you can do it in rails 4 with `errors.get(:attribute)`


[18:20:43] elaptics: beingjohnm: does a category have multiple transactions?. You can't call the association method on the relation - you've got a collection of categories not a single category
[18:21:25] elaptics: beingjohnm: and you want to count those transactions?
[18:23:57] elaptics: beingjohnm I'd come from the Transaction model then, e.g. Transaction.where(category: [parent_categories], user: current_user).count
[18:25:27] elaptics: beingjohnm: obviously you'll need to set your where conditions appropriately
[18:26:54] elaptics: beingjohnm: need to know how your tables relate then.
[18:27:09] elaptics: beingjohnm: no, you just need to join the tables


[08:54:41] elaptics: chridal: what classes and what sort of functionality? If it's controllers or models that's what concerns are for
[08:55:23] elaptics: roelof: you're not outputting the button text in that erb you need an =
[08:55:52] elaptics: chridal: sounds like concerns are what you want then http://api.rubyonrails.org/classes/ActiveSupport/Concern.html
[08:57:03] elaptics: chridal: bit more info from the source https://signalvnoise.com/posts/3372-put-chubby-models-on-a-diet-with-concerns
[08:57:34] elaptics: roelof: !gist your code
[08:59:27] elaptics: chridal: personally I'm not a huge fan of concerns. I tend to just create a module and just include them in manually. I'll put that module wherever I feel is most appropriate. Most often I stick them in lib
[09:12:37] elaptics: roelof: you need to put the interpolation inside a string, but you may as well just output the text, i.e. <%= button_text %>
[09:13:09] elaptics: roelof: though, I don't know what you think button_text will contain - I don't see any references to it in the view so I imagine it'll just be nil unless you have a helper method with that name
[09:15:32] elaptics: roelof: #{ } is string interpolation, that's only necessary when you're concatenating things e.g. <%= "The button text is: #{ button_text }" %>
[09:15:57] elaptics: it's more convenient than "string" + variable + "more string"
[09:16:22] elaptics: when the only thing you're outputting in your erb is a variable then you can just output the variable
[14:54:15] elaptics: roelof: that's not what your code is doing
[14:54:50] elaptics: roelof: your code is doing the reverse of what you just said
[15:18:11] elaptics: roelof: I would invert the statement, so instead of if !parts.empty? or unless parts.empty? I'd simply do if parts.present?
[15:23:48] elaptics: roamingdog: arrays do have the present? method if you're using rails - it's added to Object
[15:24:26] elaptics: epochwolf: yes it's terriable :D
[15:29:58] elaptics: I don't think it's tracking anything but the time the nickname itself is seen
[15:31:17] elaptics: roamingdog: I assume nice_burger existed pre Sept 2012 then?
[15:32:00] elaptics: roamingdog: helpa is a newbie bot compared to my railsing :D I've been doing this since 2006ish
[15:32:27] elaptics: not specifically here in irc all that time :D
[15:42:54] elaptics: epochwolf: what are you actually testing?
[15:45:23] elaptics: epochwolf: I try to have my own gateway classes that wrap external dependencies like that so since I own it I can stub it


[12:59:30] elaptics: mvxlr: rack and rake are two different things
[13:01:29] elaptics: mvxlr: what do you mean exactly?
[14:12:45] elaptics: foucist: I left mine at home
[14:13:30] elaptics: foucist: is yours a jedi one?
[14:14:59] elaptics: I hope they're the same thing. I've used the terms interchangeably
[14:16:36] elaptics: foucist: yours sounds like a hhgtg arthur dent one
[14:17:24] elaptics: mine is a jedi one and is both awesome and a royal pain in the arse simultaneously
[14:17:38] elaptics: it is completely impractical
[14:19:07] elaptics: epochwolf: the giant wizard sleeves are the worst. They keep snagging everything and generally get in the way, e.g. try to wash your hands without the sleeves getting wet
[14:19:38] elaptics: epochwolf: the full length is also tricky trying not to trip up going upstairs
[15:17:48] elaptics: this is a keynote? Yikes. I just thought it was some random talk - admittedly I came in part way through
[15:21:11] elaptics: seems like mostly a basecamp advert
[15:53:53] elaptics: tubbo: good news - it's over
[15:57:49] elaptics: felt like it a lot of the time
[15:58:20] elaptics: would be awesome as a drinking game, drink every time he says "basecamp"
[15:58:27] elaptics: you would be hammered
[16:03:22] elaptics: tubbo: was it just %w(ruby rails awesome) + BIG_LIST_SWEARWORDS ? :)


[10:23:53] elaptics: workmad3: apparently pretty much always
[10:24:12] elaptics: workmad3: I got asked the same question the other day, I assured them it wasn't possible. And then I read the docs... :(
[10:25:03] elaptics: alfie_max15: you'd need to query each object that was returned and check if it was persisted or not
[10:25:34] elaptics: workmad3: just shows much/often it's actually needed.
[10:26:08] elaptics: alfie_max15: it would be a pretty useless method if it didn't :)
[12:15:54] elaptics: nettoweb: how do you get male from tildes?
[12:17:24] elaptics: nettoweb: oh interesting, what language?


[13:38:24] elaptics: you could try passing it into StringIO and then you'll have a file again
[13:38:42] elaptics: e.g. file = StringIO.new(document.file)
[13:39:48] elaptics: as for showing that on a page, you'd need to put the file somewhere that can be "read" e.g. write it to disk somewhere suitable, or you'd need a controller action to stream it
[13:41:13] elaptics: no, you could stream it out the db
[14:21:47] elaptics: siaw: storing your image in the db as a string is possible but generally you'd be better storing it on the file system or in cloud storage like s3
[14:22:28] elaptics: siaw: why not?
[14:22:42] elaptics: siaw: if it's an image it needs to be accessible in some form in order to display it
[14:24:22] elaptics: siaw: heroku doesn't have a file-system per-se - they expect you to store anything permanent in some kind of cloud storage
[14:24:39] elaptics: siaw: that's just a misunderstanding as to how heroku works
[14:24:52] elaptics: sevenseacat: has this conversation already been had?
[14:27:30] elaptics: because that makes more sense... :(
[15:06:59] elaptics: which is what carrierwave et al actually do
[15:11:11] elaptics: godzillaenlacasa: concat the strings and hash the resulting one
[15:11:35] elaptics: I think that's a definitive solution :D


[15:56:10] elaptics: epochwolf: ha, I've had the exact same thing in a project I've been working on!


[14:04:48] elaptics: I'm using authy for 2fa because you can transfer them after I found out the hard way with a different app
[14:11:34] elaptics: workmad3: what are you using for password vault?
[14:11:52] elaptics: I guess you just answered it :)