Terens

Activity Graph

Page 1 of 6 | Next »

2019-05-08

[13:14:03] Terens: has joined #RubyOnRails
[14:48:43] Terens: Quit: Leaving

2019-04-30

[17:39:06] Terens: has joined #RubyOnRails
[18:39:37] Terens: Ping timeout: 245 seconds

2019-04-18

[06:27:04] Terens: has joined #RubyOnRails
[14:28:39] Terens: Quit: Leaving

2019-04-17

[09:18:59] Terens: has joined #RubyOnRails
[09:19:44] Terens: I have several integrations that create a model based on STI
[09:20:08] Terens: integrationa_a/models integrationa_b/models ...
[09:20:34] Terens: what would be a restful way to create another resource from these?
[09:21:10] Terens: integration_X/models/export_to_other_model?
[15:11:39] Terens: Quit: Leaving

2019-04-12

[13:25:32] Terens: has joined #RubyOnRails
[13:25:49] Terens: would you do joins in code vs sql?
[15:01:00] Terens: Ping timeout: 268 seconds

2019-04-11

[09:41:55] Terens: has joined #RubyOnRails
[09:42:18] Terens: https://gist.github.com/parhs/b7cdafef5864c37384e35cb3da979c71
[09:42:24] Terens: do you see any problem with this query ?
[15:41:12] Terens: Quit: Leaving

2019-04-10

[09:44:23] Terens: has joined #ruby
[09:44:30] Terens: is there a way to write it in one line
[09:44:36] Terens: return unless enabled return if self.class.valid?
[09:45:11] Terens: return if !enabled || ( enabled && self.class.valid?) - the only thing i can think
[14:14:43] Terens: Quit: Leaving
[19:20:41] Terens: has joined #RubyOnRails
[19:21:38] Terens: is writing these long lines
[19:21:40] Terens: readable?
[19:21:41] Terens: https://gist.github.com/parhs/e7cb3fe43e61da6d42b21e1179a90357
[20:53:22] Terens: Ping timeout: 268 seconds

2019-04-08

[11:22:22] Terens: has joined #RubyOnRails
[11:22:40] Terens: I want to allow app users
[11:22:56] Terens: to authorize with oauth third party app but I have an API only app
[11:23:07] Terens: I am not sure what is the best way to name the endpoints
[12:58:51] Terens: I have implemented several integrations for the app
[12:58:56] Terens: I am working on
[12:59:14] Terens: would you store configurations within integration/configuration routes or
[12:59:20] Terens: configurations/integration
[16:06:42] Terens: Ping timeout: 258 seconds

2019-04-05

[06:55:21] Terens: has joined #ruby
[13:50:55] Terens: Quit: Leaving
[19:08:27] Terens: has joined #RubyOnRails
[21:18:19] Terens: I want to get User's Vote for each Comment object. I did something like select('comments.*', 'votes.reaction as user_reaction').joins('votes on comment.id=votes.comment_id and votes.user_id=666)
[21:18:27] Terens: is there a better way ?
[21:48:39] Terens: this would return the votes only
[21:49:23] Terens: it wont return comments without votes probbaly
[22:03:47] Terens: Ping timeout: 245 seconds

2019-04-04

[00:13:47] Terens: Ping timeout: 245 seconds
[06:08:45] Terens: has joined #ruby
[11:01:46] Terens: does calling benchmark.bm etc in production has any side effects?
[16:15:40] Terens: Ping timeout: 250 seconds
[16:26:29] Terens: has joined #ruby
[17:23:19] Terens: Ping timeout: 246 seconds
[17:34:59] Terens: has joined #ruby
[20:46:33] Terens: Ping timeout: 246 seconds
[21:14:59] Terens: has joined #ruby
[22:28:22] Terens: Ping timeout: 245 seconds

2019-04-03

[20:35:41] Terens: has joined #ruby

2019-04-01

[06:13:47] Terens: Ping timeout: 245 seconds
[06:26:34] Terens: has joined #ruby
[10:40:43] Terens: Remote host closed the connection

2019-03-31

[00:42:35] Terens: has joined #ruby
[00:53:48] Terens: Ping timeout: 245 seconds
[10:12:48] Terens: has joined #ruby
[10:13:03] Terens: has joined #RubyOnRails

2019-03-30

[08:47:10] Terens: is it better to not have
[08:47:12] Terens: namespaces?
[08:47:20] Terens: is it better to avoid namespaces?
[10:43:36] Terens: Ping timeout: 250 seconds
[13:12:56] Terens: has joined #ruby
[13:25:04] Terens: has joined #RubyOnRails
[13:25:31] Terens: I have a comment and it has association with vote. Vote has comment_id, user_id, vote
[13:26:01] Terens: I have counter caches however how can I show if a comment is liked by current user without N+1
[14:23:07] Terens: Ping timeout: 255 seconds
[14:56:58] Terens: has joined #ruby
[14:58:00] Terens: has joined #RubyOnRails
[14:58:06] Terens: I have a comment and it has association with vote. Vote has comment_id, user_id, vote
[14:58:08] Terens: I have counter caches however how can I show if a comment is liked by current user without N+1
[16:41:28] Terens: I have a comment and it has association with vote. Vote has comment_id, user_id, vote
[16:41:29] Terens: I have counter caches however how can I show if a comment is liked by current user without N+1
[22:26:42] Terens: Ping timeout: 245 seconds
[22:27:57] Terens: has joined #ruby
[22:30:40] Terens: has joined #RubyOnRails
[23:56:45] Terens: Ping timeout: 246 seconds

2019-03-29

[11:14:45] Terens: has joined #RubyOnRails
[11:15:25] Terens: I have a model that can be liked. Should I create another controller for likes?
[12:43:52] Terens: I see but I want to make it REST
[12:45:42] Terens: is this valid PUT model/vote { params: { type: 'dislike'} } DELETE model/vote ? single nested resource?
[13:55:04] Terens: if you have to store incoming web hooks for teams (title, hook_url) would naming table teams_incoming_webhoobs be ok or bad name?
[15:51:38] Terens: Hello would you have a folder eg configurations/something.rb configurations/integration_a.rb ..... or within a namespace eg: integration_a/configuration , feature/configuration ?
[16:03:20] Terens: has joined #ruby
[16:13:46] Terens: would you store configuration as rows or within jsonb column ?
[16:14:15] Terens: some are depended so ancenstry would be used
[16:34:57] Terens: Quit: Leaving
[17:45:37] Terens: has joined #RubyOnRails
[17:54:52] Terens: We store configuration as separate records. eg: title, descritpion, key, value,. The problem is that configuration cannot be saved as a whole. Some configuration pages have active / username password and complex configurations. I suggested to store them as jsonb and have validations on model. Why is this a bad idea? Other two devs said that we can solve this by adding ancestry at configuration and do this way validations.
[17:55:40] Terens: they do some evals on configuration
[18:02:45] Terens: has joined #ruby
[18:03:04] Terens: why is this code good? scope :holidays, -> { sla_active? ? eval(find_by(key: 'holidays').value) : '' }
[18:14:23] Terens: but senior dev says that there isn't other way but I don't understand why
[18:17:58] Terens: Would you choose single vs multiple rows for configuration? With multiple rows I find it hard to do validations. I have run them conditionally on key, also dependend validations are hard. Also frontend has to make lots of PUT requests. Senior dev and other dev agreed that it is better to go multiple rows. They use eval too. Senior said that dependency can be solved by adding ancestry gem and this way we can check.
[18:18:25] Terens: All configurations are STI about 20 models now
[18:19:59] Terens: darix good point
[18:32:32] Terens: they want a single record although this defeats the purpose of scopes
[18:32:38] Terens: not chainable

2019-03-15

[16:36:29] Terens: has joined #RubyOnRails
[16:41:54] Terens: I work on a relatively small multitenant app about 220 models. Basic controller actions are generic like create, update, destroy.For every user role there are about 220models X actions records that are loaded at every request. Each record has the action name, controller name, and attributes. So if attributes are editable then they are automaticaly permitted. Then serializer gets visible attributes and shows only these.
[16:43:04] Terens: The drawback is that we have to maintain long lines of style action: 'create', ..... , attributes: { id: visible, title:'visible' .....}
[16:43:44] Terens: however lead dev who designed that says that this is the best thing and we have flexibility and really generic actions
[16:44:12] Terens: and that this way frontend knows what fields to show
[16:44:20] Terens: what do you think?
[17:17:37] Terens: Ping timeout: 246 seconds
[19:02:06] Terens: has joined #RubyOnRails
[19:02:30] Terens: I work on a relatively small multitenant app about 220 models. Basic controller actions are generic like create, update, destroy.For every user role there are about 220models X actions records that are loaded at every request. Each record has the action name, controller name, and attributes. So if attributes are editable then they are automaticaly permitted. Then serializer gets visible attributes and shows only these.
[19:02:41] Terens: The drawback is that we have to maintain long lines of style action: 'create', ..... , attributes: { id: visible, title:'visible' .....}
[19:02:51] Terens: however lead dev who designed that says that this is the best thing and we have flexibility and really generic actions
[21:00:53] Terens: Ping timeout: 245 seconds

2019-02-05

[19:02:45] Terens: has joined #RubyOnRails
[19:03:53] Terens: when developing a service/something that involves calling other libraries should I catch and raise custom errors?
[19:04:59] Terens: For example when developing an API wrapper that makes some calls using Oauth. Should I catch the specific oauth error and raise mine
[20:11:45] Terens: Ping timeout: 246 seconds

2019-01-31

[09:24:51] Terens: has joined #RubyOnRails
[09:25:09] Terens: where should I put a wsdl file in my app ?
[15:17:08] Terens: Ping timeout: 245 seconds

2019-01-28

[18:01:12] Terens: has joined #RubyOnRails
[18:02:58] Terens: I have an argument of what is better. More experienced developer loads all AR objects like Contact.all.inject({}) { |_, v| _.merge!(v.id => { firstname: v.firstname, lastname: v.lastname, account_id: v.account_id, time_zone: v.time_zone})
[18:03:27] Terens: and then lookups with contacts.select{ |k, v| v[:email] == row_email }
[18:03:33] Terens: for each row..
[18:03:44] Terens: is this more effient than querying the database?
[19:44:43] Terens: he wants to load all as a hash ine memory in order to avoid lookups
[19:44:58] Terens: it works though faster
[20:34:36] Terens: Ping timeout: 246 seconds

2019-01-24

[09:43:26] Terens: has joined #RubyOnRails
[09:44:09] Terens: On the project I work for every request 600 rows are loaded for each request however app isn't very slow.
[09:47:57] Terens: no but I am always trying to make my code fast. However I did not expect doing such things and app to run fine.
[09:48:14] Terens: I cannot change that code since it is not mine
[09:48:29] Terens: Yes but loading 600 records into memory and rails
[12:35:07] Terens: Read error: Connection reset by peer

2019-01-22

[08:51:50] Terens: has joined #RubyOnRails
[14:35:15] Terens: Quit: Leaving

2018-12-11

[12:21:20] Terens: has joined #RubyOnRails
[12:22:05] Terens: Having a list with integrations model Integration how would you name a table that holds installed integrations ?
[12:22:50] Terens: this was what i thought first
[12:23:03] Terens: but I am sure whether it is a good name
[18:07:30] Terens: Ping timeout: 244 seconds

2018-12-10

[13:38:26] Terens: has joined #RubyOnRails
[13:39:32] Terens: I want to store configuration for integrations. I think that I could use sti and a jsonb column but
[13:39:42] Terens: I am not whether there is a clean way to get the instance
[15:41:48] Terens: Ping timeout: 250 seconds

2018-12-05

[11:26:07] Terens: has joined #ruby
[11:26:16] Terens: why this doesn't add a \
[11:26:18] Terens: text.gsub(/([&|!(){}\[\]^"~*?:\\'+-])/, "\\1")
[11:32:41] Terens: has joined #RubyOnRails
[11:32:49] Terens: why this doesn't add a \
[11:32:55] Terens: text.gsub(/([&|!(){}\[\]^"~*?:\\'+-])/, "\\1"
[15:18:42] Terens: Ping timeout: 246 seconds
[20:25:35] Terens: has joined #RubyOnRails
[20:57:07] Terens: Ping timeout: 240 seconds

2018-12-04

[07:38:08] Terens: has joined #RubyOnRails
[07:38:25] Terens: is really dangerous eval on user input ?
[08:03:28] Terens: But I believe the danger is low until someone finds it
[08:06:38] Terens: I am trying to figure out what is best to do. Maybe open it as a bug
[08:07:01] Terens: the eval thing.
[08:08:14] Terens: Boss wants features with no tests if I replace the eval thing he will tell me " I feel we waste lot of time"
[08:14:38] Terens: yeah that sucks :p
[13:33:48] Terens: Ping timeout: 245 seconds

2018-11-30

[08:15:31] Terens: has joined #RubyOnRails
[17:11:40] Terens: Ping timeout: 246 seconds

2018-11-28

[07:56:00] Terens: has joined #RubyOnRails
[07:56:20] Terens: what do you use for internal documentation ?
[15:55:13] Terens: Ping timeout: 246 seconds

2018-11-26

[19:57:02] Terens: has joined #RubyOnRails
[20:40:06] Terens: Remote host closed the connection

2018-11-21

[20:43:46] Terens: has joined #RubyOnRails
[20:44:04] Terens: Do you believe that it is possible to
[20:44:14] Terens: not have code at controllers at all ?
[20:44:28] Terens: have a base one only
[21:32:50] Terens: fryguy, I thought that it was impossible
[21:33:21] Terens: but the project I am working on now with about 100 models
[21:34:23] Terens: doesn't have code at all. Initially I tried to add some but lead dev got pissed and I found out that with callbacks it is possible to do almost everything
[21:34:45] Terens: some models have about 50 callbacks and they work still
[21:34:58] Terens: however no tests at all
[21:37:24] Terens: 720 wow heh
[21:37:43] Terens: do you have other layers too?
[21:44:38] Terens: Ping timeout: 245 seconds

2018-11-20

[12:57:38] Terens: has joined #RubyOnRails
[15:39:06] Terens: Quit: Leaving

2018-11-14

[09:25:26] Terens: has joined #RubyOnRails
[16:05:18] Terens: Quit: Leaving

2018-10-25

[19:07:16] Terens: has joined #RubyOnRails
[19:07:34] Terens: I use sanitize method but it is too slow and brings down whole server
[19:07:36] Terens: any ideas?
[20:10:03] Terens: Ping timeout: 245 seconds

2018-10-19

[10:10:35] Terens: has joined #RubyOnRails
[14:55:30] Terens: Ping timeout: 252 seconds

2018-10-18

[11:17:00] Terens: has joined #RubyOnRails
[14:20:46] Terens: Ping timeout: 272 seconds

2018-10-09

[08:21:38] Terens: has joined #ruby
[08:21:49] Terens: how can I initialize my hash here
[08:21:51] Terens: hash[:date] << key.to_s if property[:type] == :date
[17:56:21] Terens: Ping timeout: 252 seconds

2018-10-03

[09:39:22] Terens: has joined #RubyOnRails
[14:39:03] Terens: Quit: Leaving
[16:23:38] Terens: has joined #RubyOnRails
[16:24:06] Terens: How would you handle DST changes if you displayed a chart ?
[20:59:50] Terens: Ping timeout: 252 seconds

2018-09-19

[07:53:07] Terens: until we do some kind or refactoring
[07:53:30] Terens: service objects? or interactors? or something else
[07:53:58] Terens: however service object has to be used from controller
[11:51:32] Terens: I have rescue ActionController::ParameterMissing => e
[11:51:38] Terens: but I get the error
[14:26:16] Terens: Quit: Leaving