Activity Graph

Page 1 of 1


[13:29:01] phikes: has joined #ruby
[13:29:02] phikes: has joined #RubyOnRails
[14:56:09] phikes: Remote host closed the connection


[07:16:29] phikes: has joined #RubyOnRails


[06:49:51] phikes: has joined #RubyOnRails
[08:28:35] phikes: dminuoso: There is something called the hash table IIRC
[08:29:25] phikes: dminuoso:
[08:33:15] phikes: dminuoso: So maybe ruby is called before chruby, which leads to the shell hashing it?
[08:34:56] phikes: Oh, I did not see the message :O..
[08:46:51] phikes: Read error: Connection reset by peer
[09:50:25] phikes: has joined #RubyOnRails
[14:32:55] phikes: Remote host closed the connection
[14:41:37] phikes: has joined #RubyOnRails
[15:00:17] phikes: Ping timeout: 256 seconds


[09:14:17] phikes: has joined #RubyOnRails
[12:40:42] phikes: Ping timeout: 260 seconds
[14:41:45] phikes: has joined #RubyOnRails
[15:34:49] phikes: Remote host closed the connection
[15:35:15] phikes: has joined #RubyOnRails
[15:39:28] phikes: Ping timeout: 240 seconds
[19:35:14] phikes: has joined #RubyOnRails
[19:39:29] phikes: Ping timeout: 240 seconds


[06:47:57] phikes: has joined #RubyOnRails
[13:58:02] phikes: Remote host closed the connection
[13:58:29] phikes: has joined #RubyOnRails
[14:03:19] phikes: Ping timeout: 268 seconds
[17:58:39] phikes: has joined #RubyOnRails
[18:03:10] phikes: Ping timeout: 260 seconds


[08:28:43] phikes: has joined #ruby
[08:29:13] phikes: has joined #RubyOnRails
[08:54:02] phikes: That's an activesupport method iirc
[08:54:30] phikes: aaaah yeas my bad :D
[09:01:20] phikes: For readability of my code I prefer to use ActiveSupport, so you can do something like ``
[09:01:28] phikes:
[09:01:42] phikes: e.g. ` +`
[09:02:25] phikes: Here you can see that this represents the same integer as 24*60*60
[09:02:56] phikes: The above even more concise is ``
[09:03:28] phikes: this is in the params, i.e. `params[:id]`
[09:03:42] phikes: you don't specify parameters for the controller methods itself
[12:14:09] phikes:
[12:14:31] phikes: do you have `//= require jquery-ujs` and the same for jquery in your application.js
[14:28:59] phikes: rindolf: I guess you should not specify your file in the -c parameter of transpec
[14:29:24] phikes: rindolf: just skip that all together and use `transpec -f test/deduction.rb`
[14:35:53] phikes: rindolf: AFAIK transpec needs to run in a git repo
[14:38:12] phikes: rindolf: Are you absolutely sure? Try a `git status` in the same directory? To me it seems like the automatic discovery of the git repository root fails (and something else below, but let's sort out this one first)
[14:39:31] phikes: rindolf: Is it a git submodule or something? Or a plain non-bare git repository?
[14:40:55] phikes: maybe try it from the root and adjust the path like this? `transpec ../test/deduction.rb`
[14:41:53] phikes: rindolf: sorry, the root directory of the git repository
[14:43:27] phikes: rindolf: you're welcome ;)
[14:46:27] phikes: rindolf: Oh, thanks! No need to :)
[15:09:40] phikes: Remote host closed the connection
[17:10:36] phikes: has joined #RubyOnRails
[17:14:48] phikes: Ping timeout: 240 seconds
[19:10:19] phikes: has joined #RubyOnRails
[19:14:27] phikes: Ping timeout: 240 seconds


[16:58:38] phikes: Remote host closed the connection


[10:27:05] phikes: *.net *.split
[10:30:08] phikes: has joined #RubyOnRails
[10:30:43] phikes: *.net *.split
[10:33:04] phikes: has joined #RubyOnRails


[11:45:16] phikes: has joined #RubyOnRails


[21:27:44] phikes: Remote host closed the connection


[23:32:23] phikes: Ping timeout: 256 seconds
[23:35:08] phikes: has joined #RubyOnRails


[07:10:01] phikes: I need a pointer into the right direction. What I want to do is: When a record is updated I want the associated records to have the old data associated. Anyone got an idea?
[07:19:17] phikes: Say I have an Invoice that references different Items. When the price of an item changes I don't want the old invoices to pick up that price change as they would get invalid then.
[07:19:56] phikes: What I am looking for (before implementing it myself) is an auditing gem that has this capability, but I couldn't find one.
[07:22:39] phikes: That would solve this particular case, but there are others in my app where I have to do this. And upon creation/editing of invoices users interact with the associated models. So this would pretty much mess up my frontend.. That's why I was looking for something easier.
[07:23:14] phikes: My current idea is to have a "latest" flag on the item model and upon update just create a new one and set the old ones latest flag to false
[07:24:23] phikes: I encountered this so many times and always wondered if noone made a gem out of that..
[07:25:02] phikes: ddv: men calm down :D..
[07:25:50] phikes: ddv: and all the code we write somewhere breaks down to assembler.. what are you trying to tell me? If you just want to offend me please refrain and let me have a normal conversation with other.
[07:26:15] phikes: btt I think I will go the way of adding a flag
[07:26:27] phikes: possibly packing it into a gem in the end and making it available to others
[07:27:35] phikes: It's really not that easy rvanlieshout. What about show actions? I need to find a mechanism to render only the latest records of a model
[07:27:55] phikes: s/show/index
[07:29:45] phikes: I think I found a pretty general solution (regarding ruby's way of doing things) to implement what I am after. I just wanted to see if such solutions already exist.
[07:29:49] phikes: Thanks for your help ;-)
[07:30:22] phikes: Yes it has. I am talking of convention over configuration and thus making it work in 80% of the cases.
[07:30:40] phikes: Because you could always argue that my approach needs a lot of space etc
[07:30:54] phikes: but for 80% of the people using ror that would not matter (imho)
[07:31:03] phikes: thats what i mean by ruby's way of things
[07:31:17] phikes: rvanlieshout: Why would it be unsafe?
[07:31:42] phikes: See, database-wise it's a horrible solution to duplcate another model's columns
[07:32:57] phikes: You are preventing optimizations that way.. normalization etc
[07:33:21] phikes: rvanlieshout: Please don't do it like that
[07:33:27] phikes: That is relly the worst solution
[07:33:36] phikes: And I am not into denormalization
[07:33:53] phikes: Upon copying I prevent denormalization
[07:34:06] phikes: Of course not, but it's a bad thing
[07:35:40] phikes: Thanks for your input, I am back to work now :)
[07:37:30] phikes: This is pretty much the description of any software ^^


[14:46:40] phikes: *.net *.split
[14:47:15] phikes: has joined #RubyOnRails


[08:15:48] phikes: has joined #RubyOnRails


[10:33:33] phikes: has left #RubyOnRails: ()


[08:46:22] phikes: Hi, is it possible to pass in integer values for enum attributes with Rails 4?
[08:53:21] phikes: universa1: Pardon?
[08:54:14] phikes: Ah, well I should have asked differently: Is there a way to.... I already tried directly assigning and mass-assigning, both don't work
[08:56:03] phikes: universa1: Ah, well I should have asked differently: Is there a way to.... I already tried directly assigning and mass-assigning, both don't work
[09:04:52] phikes: universa1: I figured its another problem, thanks for your help anyway. I have to dig deeper


[15:19:55] phikes: Helpers contain methods which help in your view
[15:20:02] phikes: Use concerns


[08:27:38] phikes: Hi, how can I preview the devise mailer with Rails 4's preview feature?
[08:27:53] phikes: tried /rails/mailers but it gives me an empty page
[08:32:56] phikes: it refers to the key :dessert in the params hash
[08:33:09] phikes: it IS related to a model normally
[08:33:23] phikes: because you use this idiomatically with mass assginment


[07:00:03] phikes: Good Morning, guys ;-) (Germany^^).. I am experiencing problems with a rails form helper: f.button :submit (simple_form uses rails helpers under the hood) is not translatable with the key helpers.submit.create ... anyone else can confirm that? .. Or did the key change?


[21:02:42] phikes: Hi. How can I use virtual attributes with ActiveRecord::Base#new. I wrote a getter and a setter for my virtual attribute and am trying to instantiate via `.new`. This doesn't work and its also in the docs. My question: How to get it working? Reference.
[21:03:16] phikes: (I see this is deprecated... But you will find the correct docs from there)
[21:05:19] phikes: zorak8: You don't (e.g.) want Rails to load your classes when it starts and never update them again, because if you changed something in your code you would need to restart your web server
[21:05:35] phikes: rhizome: Oh, of course you should
[21:05:56] phikes: rhizome: That's like: Hey don't learn something new, which you **will** need with every production level rails app
[21:06:18] phikes: zorak8: There are many kinds of caching. Rails Guides has a page on that
[21:06:32] phikes: zorak8,
[21:26:48] phikes: (resolved my own issue from before a few minutes. had my accessors private, d'oh).. there was a breaking commit once, which restricted some methods from use with virtual attributes. but this was some time ago and it has been fixed: one can use virtual attributes with #new)


[21:38:31] phikes: Hi, I recently "discovered" Rails Streaming and I am trying to achieve the following: Say I have a lengthy loop in my view and want to give the browser an interim result. Is that possible somehow?
[21:38:51] phikes: I know Streaming does something slightly different but this led me to the idea.


[10:19:37] phikes: Hi. When using a has_one association with conditions: { field: true} e.g. in Rails 3 upon Record Creation it automatically sets the associated records field to true. How to achieve this in Rails 4? Docs suggest using a scope, but this does (of course) not set the field.
[10:23:38] phikes: Ok, I see it actually should be working.. when using a hash with the scope
[10:25:45] phikes: Docs say "If you use a hash-style where option, then record creation via this association will be automatically scoped using the hash".. But this is not working for me
[10:28:01] phikes: helpa: Ok, I'll provide it. Thought maybe someone had the same problem.. Sorry for that ;)
[10:28:47] phikes: This is the class I have a problem with
[10:29:42] phikes: Basically because I have two different has_one associations to the same polymorphic join table, I need to explicitly set the relayable_type.. So Rails can distinguish between the two
[10:38:25] phikes: I guess that is what isn't working.. I looked at a SQL query rails issued and messing with the xxx_type should be avoided it seems.. Rails actually tryes relayable_type = Mixer AND relayable_type = motor_mixer now
[10:59:07] phikes: P-NuT: I am doing this too! :-) We overclocked the Pi to 1Ghz (it supports it without losing warranty afaik) and its running very fast
[11:00:33] phikes: P-NuT: Also you need to pay attention to your queries (we used .includes to cache stuff) because the databases tend to be very slow there... It requires a lot of optimization in the end
[14:11:46] phikes: I am still curious on how to have multiple has_one associations onto the same polymorphic model. Does anybody know? I tried several things, but nothing is working (including altering the _type field myself).
[14:58:11] phikes: Can I somehow implement a "superclass" of a view? e.g.: suppose I always have the same new view: I already have a partial, but I still need every new view for all my controllers. Can I just have a views/application/new.html.haml and it will use this as a fallback?
[14:58:29] phikes: (just popped up my mind.. i could try it later)
[15:00:09] phikes: centrx: Can this be accomplished with layouts? Even if so, is it semantically correct to use layouts for this? I don't think so..
[15:00:49] phikes: centrx: A layout is more like the base HTML every view gets rendered into.. isn't it?
[15:01:05] phikes: centrx: Maybe I was unclear
[15:01:31] phikes: centrx: I want to reuse e.g. the "new (action)" view for a few of my controllers
[15:04:04] phikes: centrx: Yip, that's what I already have, but I still need to create new.html.haml for every controller and render the partial in there.. Can't I just have a "global" new.html.haml which all of my controllers rely on?
[15:04:50] phikes: centrx: I think I could call "render" with the "global" new-view.. But isn't support built into Rails for my needs?
[15:06:01] phikes: centrx: Exactly :).. That's cool, thank you!.. I already have all that stuff setup but the key I didn't think about was to call render with another view


[14:51:10] phikes: Hi all, can I use multiple has_one through on the same model? Currently it doesn't seem to work, but it returns the same record. That does actually make sense to me, because how should it know which of the records to get in which has_one. Can I use the "source" parameter somehow?
[14:52:49] phikes: pacMakaveli: What do you mean by "i should"? .. It works without because I follow the standard naming parameters.. I can't really find any information on this.. Ok I'll gist
[14:54:02] phikes: pacMakaveli: ah ok, hmm. But I don't know how to specify that ActiveRecord correctly fills the "type" column.. But I'll provide m models in a minute
[14:57:37] phikes: pacMakaveli: Essentially this is it: .. I need two different relays on my mixer and thats the problem
[15:05:02] phikes: pacMakaveli: Actually I'm getting the same relay for the motor relay and the sutter rrelay on the mixer
[15:05:23] phikes: pacMakaveli: Which makes sense, because how should ActiveRecord identify the correct RelayAssociation?
[15:51:01] phikes: pacMakaveli: This describes my problem (and the solution to it :-)) Thought I'd share in case any of you stumble across something similar.


[16:07:11] phikes: Hi, quick question: Is there any gem out there which autoupdates code into the browser. E.g. I write <%= autoupdate every: 1.second { } and it will handle updating the page in the browser automatically (via JS e.g.)
[16:22:47] phikes: I knew for a long time, maybe i build something upon it
[16:23:31] phikes: relix: Nice ^^... Well I haven't really used it, but it definitely'd make it easier
[16:24:34] phikes: relix: Maybe together with angularJS this would do the trick.. using variables from gon in angular expressions .. smth like that.. still not as simple as id like it to be
[16:36:55] phikes: relix: Yeah, that's the way I have been doing (or kind of the way).. I guess I will look into making it simple in the future.. Because it'd be such a cool feature with the syntax I proposed.. Wondering why there is nothing like this atm


[13:07:51] phikes: Hi friends! :-) I still need some help with simple_form as I am still not happy with my workaround from yesterday. So my question is how to handle has_one:through associations with simple_form?
[13:10:11] phikes: mikecmpbll: Thanks for the link, I was unclear: I just want to update the association not the associated record
[13:12:52] phikes: mikecmpbll: Yup, one moment
[13:15:00] phikes: mikecmpbll:
[13:15:58] phikes: mikecmpbll: I hope that makes sense, I have never dealt with polymorphic associations before
[13:22:33] phikes: I can simply do Silo.create relay: Relay.first
[13:22:38] phikes: @mikecmpbll:
[13:23:25] phikes: mikecmpbll: Say I have some relays and want to create a silo.. How can I generate the field for that
[13:23:53] phikes: mikecmpbll: f.association is not working with has_one so I tried f.input with collection: Relay.all..
[13:24:13] phikes: mikecmpbll: but that leads to numerous problems, including that it doesn't preselect the correct relay
[13:26:28] phikes: mikecmpbll: Yup, this is what I could do, but it won't generate my wrapper divs etc (i am using bootstrap) .. or is there a way to do this (except for a helper)?
[13:27:45] phikes: mikecmpbll: Wrapper divs which give me a nice form including a label, etc.. Any why not a helper? Well I could use one but if I change my CSS framework I had to change it in two places.. That's why I am asking.. I am not satisfied with doing it with a helper
[13:30:18] phikes: mikecmpbll: Ah ok, I see. Hmm, because simple_forms f.input :some_field construct gives me these exact wrapper divs
[13:35:24] phikes: universa1: mikecmpbll: Thanks for your help I have some new ideas I will try out.. :-) Actually it really is a nested form.. With this in mind I will try out some things
[13:37:43] phikes: mikecmpbll: So this might be why simple_form says it does not support has_one associations
[14:54:15] phikes: mikecmpbll: I finally got it working :-) Had some parameters wrong in my form and Rails/simple_form does more than I thought.. Thanks for your help.. For anyone who is interested here is some explanation/tutorial on how to do has_one as nested form
[14:58:01] phikes: mikecmpbll: It was so much easier than I initially thought.. And I can even use ff.association now inside of f.simple_fields_for.. I just didn't realize I really had a nested form at my fingertips.. Thank you so much! :)
[15:00:26] phikes: mikecmpbll: For me that wasn't actually needed.. I can do silo.update relay_association_attributes: {relay_id: 12, id: 1}.. e.g.
[15:00:35] phikes: mikecmpbll: And that suffices
[15:02:41] phikes: mikecmpbll: That'd be cool, but I guess it would be much more work than one might initially think.. After all it needs to handle creation/deletion etc of the associated record
[15:03:00] phikes: (for has_one trough at least)
[15:03:10] phikes: mikecmpbll: Back to work I am ;).. Thanks again!


[13:03:44] phikes: Hi. Can I specify a wildcard for has_many:through:'s source_type:? To get all associated objects? Or specify a superclass?
[13:23:07] phikes: elaptics: Thanks! The solution I am using now is to use multiple has_many through associations and have a method which gives me an array of all of the associated records


[11:11:23] phikes: t field remains unset.
[11:11:23] phikes: I need some help with simple_form and a has_one through association I'd like to update. Essentially nothing is working, now I kind of hacked creation, but edit is still not working. Does anybody know the right way to do it? Since f.association is not working with has_one I tried f.input, but when I say f.input :relay (thats the associated model) it of course does not correctly get the id of it and in edit the selec
[11:31:47] phikes: Use ">>" to append to a file
[11:32:01] phikes: this would override the file for every file in the current directoy that matches your wildcard
[11:32:44] phikes: greengriminal: yup, np


[09:59:02] phikes: Hi, I need some help with paper_trail: I want to keep a "reference" to a record of Model A, in Model B, even if it gets destroyed.. I tried after_destroy callback, but .version is still nil there.. anyone got an idea?
[09:59:54] phikes: my idea was to have two columns a_id and a_version_id and set them accordingly (a_id is set when the record exists and a_version_id gets set in after_destroy of A)
[10:02:31] phikes: (it's also possible for me to use another gem, if anyone can recommend)
[10:09:37] phikes: no he meant
[10:09:43] phikes: you can put the ul around
[10:09:45] phikes: your if/else
[10:09:52] phikes: and need only one pair then


[18:37:46] phikes: asdf__: I put my extensions in initializers
[18:38:03] phikes: asdf__: and a folder extensions
[18:38:12] phikes: asdf__: then use rails default conventions
[18:38:18] phikes: asdf__: ok hmmm
[18:38:34] phikes: asdf__: ok
[18:38:51] phikes: asdf__: I mean when I reopen Conversation
[18:38:56] phikes: I'd put in it
[18:39:07] phikes: config/initializers/conversation.rb
[18:39:53] phikes: asdf__: It's merely a change on where the file resides .. I'd delete all the other lines which do not correspond to the reopening
[18:41:46] phikes: asdf__: actually its working the way I described. Just double checked some code to see if i did something else


[08:23:09] phikes: jbuilder was listed on the default gemfile as tagrudev said
[09:03:52] phikes: daryllxd: I always use gems because the update process is all in one than
[09:04:22] phikes: but I'd also like to hear others opinions
[09:06:31] phikes: daryllxd: i think its easy to build one yourself, but honestly i never tried
[09:12:12] phikes: daryllxd: ah nice, thanks for the link
[09:28:14] phikes: mr_foobar: Capybara?
[09:28:44] phikes: mr_foobar:
[11:24:05] phikes: or .first
[13:55:27] phikes: Ist it better to use a global variable or a constant for the connection to my redis server?
[13:55:32] phikes: uses a global variable
[13:57:25] phikes: lgarvey: ok thanks, i'd go for a constant, because well it is constant