dEPy

Activity Graph

Page 1 of 4 | Next »

2016-06-15

[06:56:14] dEPy: has joined #RubyOnRails
[06:56:14] dEPy: has joined #ruby
[07:04:54] dEPy: Quit: (null)
[07:05:17] dEPy: has joined #RubyOnRails
[07:05:17] dEPy: has joined #ruby
[07:43:04] dEPy: Ping timeout: 272 seconds

2016-06-12

[13:03:16] dEPy: has joined #RubyOnRails
[13:03:16] dEPy: has joined #ruby
[14:45:14] dEPy: Quit: (null)

2016-05-20

[04:13:11] dEPy: has joined #RubyOnRails
[04:13:11] dEPy: has joined #ruby
[04:48:17] dEPy: Quit: (null)

2016-03-07

[15:25:42] dEPy: has joined #RubyOnRails
[15:25:42] dEPy: has joined #ruby
[15:35:02] dEPy: Quit: (null)

2016-02-26

[02:46:56] dEPy: has joined #RubyOnRails
[02:46:56] dEPy: has joined #ruby
[05:03:54] dEPy: Quit: (null)
[05:49:10] dEPy: has joined #RubyOnRails
[05:49:10] dEPy: has joined #ruby
[06:02:03] dEPy: Remote host closed the connection
[06:02:31] dEPy: has joined #RubyOnRails
[06:02:31] dEPy: has joined #ruby
[07:47:01] dEPy: Quit: (null)

2016-02-23

[11:43:42] dEPy: has joined #RubyOnRails
[11:43:42] dEPy: has joined #ruby
[11:45:05] dEPy: People. If I have a query like this my pagination fails cause calling ".count" on it produces invalid SQL. Any ideas around it?
[11:45:28] dEPy: Never crossed my mind... O_o
[11:46:42] dEPy: I don't know how to fix it. That's why I'm asking.
[11:47:28] dEPy: Oh. Damn. I thought I gave the gist link.
[11:47:45] dEPy: Sorry! :) https://gist.github.com/depy/a266b4741e66b0e71f37
[11:48:54] dEPy: Will paginate (I guess) will try running .count on it to get the number of results, which produces invalid SQL.
[11:49:13] dEPy: I would still like to have the same format of data so I can order it by tasks count
[11:51:43] dEPy: Well I could just write SQL, cast it to array and then paginate it. But I don't like that idea.
[11:55:40] dEPy: Added error: https://gist.github.com/depy/a266b4741e66b0e71f37
[11:56:05] dEPy: You can see it's trying to do: SELECT COUNT(users.*, COUNT(tasks.id) AS count) ........
[12:02:47] dEPy: arup_r: noup, still the same. :/
[12:05:45] dEPy: will_paginate
[12:06:33] dEPy: But I think it won't matter. Since even just calling .count on that rails code does this. I guess I shouldn't put that stuff in select statement
[12:06:52] dEPy: arup_r: fields or assocs? or both?
[12:18:54] dEPy: arup_r: https://gist.github.com/depy/b7d8dc228c3f6a22d799
[12:24:34] dEPy: arup_r: no, calling .count on it also no.
[12:25:32] dEPy: arup_r: but adding another COUNT in select statement of course breaks it
[12:25:42] dEPy: arup_r: that's actually fault of rails
[12:26:50] dEPy: Just saying that the role should be 'client'
[12:27:12] dEPy: arup_r: try this: User.select("users.*, COUNT(users.id)").group("users.id").count
[12:27:15] dEPy: arup_r: breaks
[12:27:46] dEPy: arup_r: yea, so it's rails trying to wrap the whole select in COUNT like I though... :/
[12:28:46] dEPy: I don't, but will_paginate calls it :) so it can know how many pages there are :D
[12:30:48] dEPy: arup_r: I could call to_a on the results and then paginate, but with around 10000 users it's reaaaaaly slow. :/
[12:31:04] dEPy: let me see
[12:31:25] dEPy: arup_r: same
[12:32:18] dEPy: arup_r: User.select("users.*, COUNT(tasks.id) AS count").client.joins("LEFT OUTER JOIN tasks ON users.id = tasks.client_id").group("users.id").order("count DESC")
[12:32:27] dEPy: User.unscoped......
[12:32:45] dEPy: Same error. Tries to wrap whole select with COUNT
[13:18:37] dEPy: Quit: (null)

2016-02-05

[15:16:56] dEPy: has joined #RubyOnRails
[15:16:56] dEPy: has joined #ruby
[15:17:42] dEPy: Is there a way to see on how many other classes and object/class depends? Like A.constants ?
[15:26:19] dEPy: shevy: tnx. I'm trying to find a tool to easily check dependencies in my ruby files. Just look up what classes or modules it uses so maybe I could make a graph and see what files have too many dependencies. Any tool like that maybe?
[15:30:44] dEPy: Maybe I could just go trough files and match any camel cae string including those seperated with :: :)
[15:30:52] dEPy: That's the simplest thing I can think of
[16:16:39] dEPy: Quit: (null)

2016-02-04

[06:56:41] dEPy: has joined #RubyOnRails
[06:56:41] dEPy: has joined #ruby
[07:13:35] dEPy: Ping timeout: 260 seconds
[07:23:35] dEPy: has joined #ruby
[07:23:36] dEPy: has joined #RubyOnRails
[07:40:26] dEPy: Read error: Connection reset by peer

2016-02-02

[11:38:48] dEPy: has joined #RubyOnRails
[11:38:48] dEPy: has joined #ruby
[11:42:18] dEPy: Citizens of this channel... Hear ye hear ye!
[11:42:33] dEPy: I just upgraded to 4.2.5.1 from 4.0.9 and I get some strange random errors for using "model.includes(:assoc)" in some places but not others. Says it's missing FROM clause.
[11:43:27] dEPy: oops sorry, using rails 4.1.14.1, pg 0.17.0, and Postgresql 9.4 I think
[11:43:46] dEPy: Is this 4.1+ ?
[11:44:08] dEPy: Cause I don't see it failing on all queries with "includes"
[11:44:36] dEPy: ah true, stupid me :)
[11:44:41] dEPy: thanks :)
[11:59:53] dEPy: Read error: Connection reset by peer

2016-01-25

[04:16:53] dEPy: has joined #ruby
[04:16:54] dEPy: has joined #RubyOnRails
[04:21:07] dEPy: anyone can enlighten me on why would I want to use Grape with Rails?
[08:38:02] dEPy: Quit: (null)

2016-01-24

[10:18:18] dEPy: has joined #ruby
[10:18:19] dEPy: has joined #RubyOnRails
[10:20:38] dEPy: Anyone mind to take a look at my code for gilded rose (https://github.com/jimweirich/gilded_rose_kata) and tell me how it looks and what can I improve? https://gist.github.com/depy/9062161a450abde52d32
[10:23:29] dEPy: shevy: I know. I should get used to commenting code more. My big flaw... :(
[10:23:44] dEPy: I thought the kata itslef is well known enough :/
[10:24:48] dEPy: Napear: tnx, I was thinking of that yea. But the NoAging class eliminitates sell_in modification
[10:25:22] dEPy: Well I could override it I guess?
[10:25:45] dEPy: I don't know. I feel like both ways have tradeoffs
[10:26:28] dEPy: Yea, and also "Sulfuras" item has quality 80
[10:26:39] dEPy: It's not visible cause I didn't attach tests I guess
[10:29:06] dEPy: But then I have to override the method for NoAging and ManaCakeAging is 2 and 4 for quality aging
[10:30:12] dEPy: Ok. I guess this would be fine for now. But in case I add more items and see more common behaviour, making a parent class would be much more helpful?
[10:30:45] dEPy: ok cool :) tnx for the input
[10:54:30] dEPy: Ping timeout: 250 seconds

2016-01-13

[09:21:00] dEPy: has joined #RubyOnRails
[09:21:00] dEPy: has joined #ruby
[10:00:26] dEPy: Ping timeout: 276 seconds

2016-01-12

[09:09:54] dEPy: has joined #RubyOnRails
[09:09:54] dEPy: has joined #ruby
[09:11:30] dEPy: Anyone can explain to me why would you use Grape with Rails? Any reasons? I don't get it.
[09:22:36] dEPy: Quit: (null)

2016-01-11

[07:01:58] dEPy: has joined #ruby
[07:01:59] dEPy: has joined #RubyOnRails
[09:51:30] dEPy: Ping timeout: 260 seconds

2016-01-08

[13:28:11] dEPy: has joined #ruby
[13:28:12] dEPy: has joined #RubyOnRails
[16:08:45] dEPy: Quit: (null)

2015-12-24

[10:40:24] dEPy: has joined #ruby
[10:40:25] dEPy: has joined #RubyOnRails
[20:46:32] dEPy: Quit: (null)

2015-12-17

[08:57:45] dEPy: has joined #ruby
[08:58:11] dEPy: has joined #RubyOnRails
[08:58:24] dEPy: Anybody using activemodel serializers?
[08:58:42] dEPy: I'm wondering if there's an option to disable auto loading of relations defined in active model serializer?
[08:59:18] dEPy: So if the has_one, has_many, ... relation is not loaded already it would fail
[09:03:56] dEPy: Anybody using activemodel serializers? I'm wondering if I can set it up so it fails if you try have has_many of has_one defined in the serializer but is not yet loaded.
[12:06:38] dEPy: Quit: (null)

2015-12-01

[19:20:35] dEPy: has joined #ruby
[19:21:08] dEPy: Is it ok to say here that we need a Ruby programmer?
[19:22:22] dEPy: Or do you have any recommendation to where to find Ruby programmers to hire?
[19:24:40] dEPy: Well I said it already I guess. More info privately or at matjaz@codeable.io - basically we need a Ruby/Rails programmer to help with development/refactoring and improving our backend/API.
[19:25:07] dEPy: We would prefer someone that is mainly Ruby over someone that mains Rails.
[19:25:59] dEPy: We would like to drive our app development into the direction of DDD and hexagonal approach slowly as it is getting harder to maintain and develop trying to do it the rails way.
[19:26:29] dEPy: centrx: well. I am the 1st employee in the company and after more than 3 years I'm still here. My previous record was 2 years. :)
[19:29:45] dEPy: octagonal sounds awesome :P
[19:30:19] dEPy: No but in all seriousness no matter what you call it, getting core domain logic out of rails is a good idea imo.
[19:31:18] dEPy: apeiros: not sure what you mean. :)
[19:31:51] dEPy: well the company is 3 years so that's the upper limit :)
[19:32:03] dEPy: and my whole career is less than 10y. Cut me some slack. :)
[22:35:50] dEPy: Quit: (null)

2015-11-27

[11:05:03] dEPy: has joined #ruby

2015-11-26

[11:24:39] dEPy: has joined #ruby
[14:51:17] dEPy: Quit: (null)

2015-11-07

[00:54:34] dEPy: has joined #ruby
[03:50:30] dEPy: Ping timeout: 240 seconds

2015-11-04

[10:59:34] dEPy: has joined #ruby
[11:00:50] dEPy: How do I select only IDs in a table when I have array of array of other fields (like name, surname, ...)
[11:02:07] dEPy: But the whole set of fields must match, for example has to have name 'John', surname 'Doe', age: 10, ...
[11:03:08] dEPy: Ox0dea: well, no. I can programatically replace field values
[11:05:11] dEPy: Ox0dea: I have the data in this format: [ [name: 'John', surname: 'Doe', age: 15]. [...], [...], ... ]
[11:05:26] dEPy: so for each array ofr fields in my main array I need to get id back for that record
[11:05:48] dEPy: I just realized it's an array of hashes actually :D
[11:06:27] dEPy: I don't have IDs :D
[11:06:31] dEPy: I have everything else :)
[11:07:12] dEPy: I have all the data that I mass insert, but now I need to know for each row inserted which ID it was given
[11:08:30] dEPy: Yes, but I don't know how to do that except doing a SELECT for each set of fields. Is there no better way?
[11:17:53] dEPy: Ox0dea: I would preferrably like something like SELECT id FROM table WHERE [name,surname,age] IN [ {...}, {...}, {...} ]
[11:19:11] dEPy: It is in my case
[11:21:25] dEPy: I have this activities table where each row is unique.
[11:21:50] dEPy: It's basically like a log of events for each user. And each event can only happen once.
[11:22:41] dEPy: Ox0dea: just belive me it's unique.
[11:23:57] dEPy: one row is mostly made out IDs so no clashing there
[11:25:26] dEPy: So is there anything or will I really have to do a select for each field set?
[12:10:28] dEPy: Quit: (null)

2015-10-29

[12:07:01] dEPy: has joined #ruby
[12:25:26] dEPy: Quit: (null)

2015-10-28

[07:22:53] dEPy: has joined #ruby
[07:24:42] dEPy: Is theree any quick metaprogramming trick I can use to see which objects (Classes) are calling which objects (Classes)? So when I run rspec for one example I will see something like: Task sent 'register' to User
[07:25:41] dEPy: So... I guess that's a no?
[07:26:29] dEPy: I just want to find our in my Rails app what relies on what. Cause I have a bunch of code that needs cleaning up. :/
[07:26:55] dEPy: I guess I could look at my tests where I have a lot of setup code also. But I still think there's a better way to do this. Is it?
[07:28:48] dEPy: Well rcov can certainly help me find dead code but not code with too many dependencies
[07:46:01] dEPy: agent_white: do you need to combine more strings or is that it?
[07:46:40] dEPy: I guess. You can complicate things like: [['omg'
[07:46:56] dEPy: [['omg']].first.first or .flatten.first
[07:47:13] dEPy: but probably no point
[07:48:19] dEPy: I guess the best thing you can do is wrap it in a method named something like 'unwrap_from_array' or 'string_from_array'
[07:48:32] dEPy: so if you use it at other places it's more descriptive
[07:48:52] dEPy: If that's the only place you use it then i would just leave it like that
[07:49:17] dEPy: I think that's even more cryptic :)
[07:56:35] dEPy: Ping timeout: 268 seconds

2015-10-18

[05:15:14] dEPy: has joined #ruby
[06:42:27] dEPy: Quit: (null)

2015-10-17

[11:27:20] dEPy: has joined #ruby
[11:27:49] dEPy: Client Quit

2015-10-16

[10:31:28] dEPy: has joined #ruby
[10:31:28] dEPy: has joined #RubyOnRails
[10:43:45] dEPy: has left #RubyOnRails: ("(null)")
[10:46:41] dEPy: Are there any examples of really good object oriented ruby code?
[10:47:00] dEPy: Something beyond a trivial app.
[10:47:55] dEPy: maybe something with 'a bit' less code than rails :D
[10:59:54] dEPy: Remote host closed the connection

2015-10-15

[10:20:04] dEPy: has joined #ruby
[10:20:04] dEPy: has joined #RubyOnRails
[10:21:29] dEPy: Remote host closed the connection
[10:30:11] dEPy: has joined #ruby
[10:30:11] dEPy: has joined #RubyOnRails
[10:32:12] dEPy: I have a (well not yet) simple cli app that requires login. Then based on the role of logged in user I wan't to restrict what he can or can not do.
[10:33:30] dEPy: So.. Should I after login based on the user role return an instance of specific client like AdminClient, ExpertClient, CustomerClient... ?
[10:34:30] dEPy: I'm just thinking that if I do that, and if I expose my 'api' to a web app then calling wrong method on the client will just tell you the method does not exist rather than the fact that you don't have permission to do that.
[10:39:33] dEPy: this has nothing to do with rails
[10:42:51] dEPy: Quit: (null)

2015-10-08

[06:23:50] dEPy: has joined #ruby
[06:23:50] dEPy: has joined #RubyOnRails
[09:13:17] dEPy: Ping timeout: 272 seconds
[10:53:14] dEPy: has joined #RubyOnRails
[10:53:15] dEPy: has joined #ruby
[11:03:32] dEPy: Ping timeout: 260 seconds
[11:41:16] dEPy: has joined #RubyOnRails
[11:41:17] dEPy: has joined #ruby
[11:41:24] dEPy: Client Quit

2015-10-07

[02:58:34] dEPy: has joined #ruby
[02:58:34] dEPy: has joined #RubyOnRails
[03:12:48] dEPy: Ping timeout: 256 seconds
[04:04:19] dEPy: has joined #ruby
[04:04:19] dEPy: has joined #RubyOnRails
[05:10:54] dEPy: Quit: (null)

2015-10-06

[08:01:05] dEPy: Quit: (null)

2015-09-21

[03:22:00] dEPy: has joined #ruby
[03:22:00] dEPy: has joined #RubyOnRails
[04:31:59] dEPy: Quit: (null)

2015-09-18

[00:41:46] dEPy: has joined #ruby
[00:41:46] dEPy: has joined #RubyOnRails
[01:13:38] dEPy: Quit: (null)
[04:47:29] dEPy: has joined #RubyOnRails
[04:47:30] dEPy: has joined #ruby
[04:54:53] dEPy: Any way to check which gem is using another gem specified in Gemfile.lock?
[05:00:27] dEPy: Quit: (null)

2015-09-17

[13:10:50] dEPy: has joined #RubyOnRails
[13:10:51] dEPy: has joined #ruby
[13:25:13] dEPy: Remote host closed the connection

2015-09-12

[06:25:51] dEPy: has joined #ruby
[06:25:51] dEPy: has joined #RubyOnRails
[07:40:51] dEPy: Ping timeout: 244 seconds

2015-08-26

[10:45:47] dEPy: has joined #ruby
[10:45:47] dEPy: has joined #RubyOnRails
[12:17:13] dEPy: Quit: (null)

2015-08-24

[12:25:23] dEPy: has joined #ruby
[12:25:23] dEPy: has joined #RubyOnRails
[12:56:48] dEPy: Quit: (null)

2015-08-16

[15:04:21] dEPy: has joined #ruby
[15:04:21] dEPy: has joined #RubyOnRails
[18:08:21] dEPy: Quit: (null)

2015-08-15

[10:36:27] dEPy: has joined #ruby
[10:36:27] dEPy: has joined #RubyOnRails
[17:15:27] dEPy: Ping timeout: 240 seconds