Sylario

Activity Graph

Page 1 of 23 | Next »

2019-07-15

[12:23:20] Sylario: has joined #ruby
[12:23:20] Sylario: has joined #RubyOnRails
[12:35:12] Sylario: ZAJDAN: Devise only give you authentication. For authorization, you need to do it on your own
[12:36:43] Sylario: cancancan is a popular solution
[12:38:22] Sylario: ZAJDAN: I use pundit because it allow to modify the scope based on authorization, but it's heavier than cancancan to implement
[12:59:14] Sylario: ZADJAN : tehre is none, cancancan do not need devise
[13:00:43] Sylario: devise allow you to know that visitor V is tied to user account N. cancancan will check that user N can do action Foo or not.
[13:01:20] Sylario: https://github.com/CanCanCommunity/cancancan#controller-helpers
[13:01:30] Sylario: CanCanCan expects a current_user method to exist in the controller.
[13:02:20] Sylario: In fact cancancan do works with Devise
[13:02:30] Sylario: out of the box
[23:07:53] Sylario: Quit: Connection closed for inactivity

2019-07-13

[19:45:02] Sylario: Quit: Connection closed for inactivity

2019-07-08

[14:10:26] Sylario: has joined #ruby
[14:10:26] Sylario: has joined #RubyOnRails

2019-07-07

[00:47:35] Sylario: Quit: Connection closed for inactivity

2019-07-06

[01:36:31] Sylario: Quit: Connection closed for inactivity
[17:46:28] Sylario: has joined #ruby
[17:46:28] Sylario: has joined #RubyOnRails

2019-07-05

[07:37:37] Sylario: has joined #ruby
[07:37:37] Sylario: has joined #RubyOnRails

2019-07-03

[15:47:33] Sylario: has joined #ruby
[15:47:33] Sylario: has joined #RubyOnRails
[23:29:06] Sylario: Quit: Connection closed for inactivity

2019-06-01

[00:09:42] Sylario: Quit: Connection closed for inactivity

2019-05-31

[12:10:27] Sylario: has joined #ruby
[12:10:27] Sylario: has joined #RubyOnRails

2019-05-29

[00:18:22] Sylario: Quit: Connection closed for inactivity
[09:29:58] Sylario: has joined #ruby
[09:29:58] Sylario: has joined #RubyOnRails
[22:13:40] Sylario: Quit: Connection closed for inactivity

2019-05-28

[00:00:04] Sylario: Quit: Connection closed for inactivity
[10:10:31] Sylario: has joined #ruby
[10:10:31] Sylario: has joined #RubyOnRails

2019-05-27

[09:45:02] Sylario: has joined #ruby
[09:45:02] Sylario: has joined #RubyOnRails
[12:02:05] Sylario: @ZAJDAN commission_params is a private method inside your controller
[12:02:45] Sylario: It is another method as it will be used for create and update.

2019-05-26

[00:28:55] Sylario: Quit: Connection closed for inactivity

2019-05-24

[00:31:37] Sylario: Quit: Connection closed for inactivity
[07:42:44] Sylario: has joined #ruby
[07:42:44] Sylario: has joined #RubyOnRails

2019-05-23

[00:41:53] Sylario: Quit: Connection closed for inactivity
[08:07:22] Sylario: has joined #ruby
[08:07:22] Sylario: has joined #RubyOnRails

2019-05-22

[13:51:59] Sylario: has joined #ruby
[13:51:59] Sylario: has joined #RubyOnRails

2019-05-21

[22:57:51] Sylario: Quit: Connection closed for inactivity

2019-05-20

[16:36:44] Sylario: has joined #ruby
[16:36:44] Sylario: has joined #RubyOnRails

2019-05-19

[03:49:51] Sylario: Quit: Connection closed for inactivity

2019-05-18

[13:04:51] Sylario: has joined #ruby
[13:04:51] Sylario: has joined #RubyOnRails

2019-05-08

[00:39:59] Sylario: Quit: Connection closed for inactivity

2019-05-07

[08:18:57] Sylario: has joined #ruby
[08:18:57] Sylario: has joined #RubyOnRails

2019-05-04

[01:10:13] Sylario: Quit: Connection closed for inactivity

2019-05-03

[07:21:59] Sylario: has joined #ruby
[07:21:59] Sylario: has joined #RubyOnRails

2019-04-29

[07:14:55] Sylario: has joined #ruby
[07:14:55] Sylario: has joined #RubyOnRails
[23:48:09] Sylario: Quit: Connection closed for inactivity

2019-04-25

[00:18:22] Sylario: Quit: Connection closed for inactivity

2019-04-24

[08:05:47] Sylario: has joined #ruby
[08:05:47] Sylario: has joined #RubyOnRails

2019-04-20

[01:13:31] Sylario: Quit: Connection closed for inactivity

2019-04-19

[12:41:01] Sylario: has joined #ruby
[12:41:01] Sylario: has joined #RubyOnRails
[12:41:20] Sylario: If anybody if familiar with AMS I have a deserialisation problem with a polymorphic relation : https://stackoverflow.com/questions/55760125/ams-do-not-use-the-type-when-saving-a-polymorphic-relation

2019-04-11

[02:16:21] Sylario: Quit: Connection closed for inactivity
[08:19:23] Sylario: has joined #ruby
[08:19:23] Sylario: has joined #RubyOnRails
[22:41:51] Sylario: Quit: Connection closed for inactivity

2019-04-10

[07:46:44] Sylario: has joined #ruby
[07:46:44] Sylario: has joined #RubyOnRails

2019-04-09

[15:12:32] Sylario: has joined #ruby
[15:12:32] Sylario: has joined #RubyOnRails
[15:12:59] Sylario: I just saw paperclip is deprecated, and they propose active storage, but I do not use a cloud service, what should I use ?
[23:36:29] Sylario: Quit: Connection closed for inactivity

2019-04-02

[01:31:01] Sylario: Quit: Connection closed for inactivity
[07:14:15] Sylario: has joined #ruby
[22:50:18] Sylario: Quit: Connection closed for inactivity

2019-04-01

[20:54:44] Sylario: has joined #ruby

2019-03-29

[04:07:11] Sylario: Quit: Connection closed for inactivity

2019-03-28

[02:00:38] Sylario: Quit: Connection closed for inactivity
[08:48:22] Sylario: has joined #ruby
[08:48:22] Sylario: has joined #RubyOnRails

2019-03-27

[11:05:05] Sylario: has joined #ruby
[11:05:05] Sylario: has joined #RubyOnRails

2019-03-23

[03:56:40] Sylario: Quit: Connection closed for inactivity

2019-03-22

[11:16:09] Sylario: has joined #RubyOnRails
[11:16:12] Sylario: has joined #ruby
[11:17:12] Sylario: Did something changed in 2.4 around regexp ? this code do not seems to works anymore : "05/01/2018" =~ /\A\d{1,2}\/\d{4}\z/
[11:20:25] Sylario: it was returning true, some time ago
[11:21:32] Sylario: my bad it was expecting "05/1212"

2019-03-14

[03:24:05] Sylario: Quit: Connection closed for inactivity

2019-03-13

[01:22:42] Sylario: Quit: Connection closed for inactivity
[09:00:02] Sylario: has joined #ruby
[09:00:02] Sylario: has joined #RubyOnRails

2019-03-12

[01:29:46] Sylario: Quit: Connection closed for inactivity
[09:28:55] Sylario: has joined #ruby
[09:28:55] Sylario: has joined #RubyOnRails
[15:08:49] Sylario: @pavelz weird question, update_attributes or save will prevent to save invalid data, you can run valid? after saving without validation or select element according to updated_at and valid? them after that
[15:09:09] Sylario: But your question is too broad

2019-03-11

[15:58:28] Sylario: has joined #ruby
[15:58:28] Sylario: has joined #RubyOnRails

2019-03-09

[02:43:18] Sylario: Quit: Connection closed for inactivity
[12:43:44] Sylario: has joined #ruby
[12:43:44] Sylario: has joined #RubyOnRails
[21:09:15] Sylario: Quit: Connection closed for inactivity

2019-03-08

[02:11:19] Sylario: Quit: Connection closed for inactivity
[09:02:55] Sylario: has joined #ruby
[09:02:55] Sylario: has joined #RubyOnRails

2019-03-06

[01:29:02] Sylario: Quit: Connection closed for inactivity
[08:18:39] Sylario: has joined #ruby
[08:18:39] Sylario: has joined #RubyOnRails
[19:07:58] Sylario: I have a multitenancy set up where the controller method current_shop return the shop
[19:08:32] Sylario: User has many category, but constraints to be sure there is one category per shop
[19:09:15] Sylario: The client ember app do not care about tenancy, and the rails controller always know to wich tenancy he speak
[19:10:57] Sylario: I cannot create a virtual attribute on the user with the ID of the group because the model has no access to the controller context, is the only way to create a controller just for the group_user_shop model?
[19:15:16] Sylario: I could do something with params to add the current_shop but it feels hacky
[19:23:00] Sylario: sorry it's a model name
[19:24:34] Sylario: haaa i meant category
[19:24:54] Sylario: From the POV of hte tenant User belongs_to user_category
[19:25:42] Sylario: in reality User has_many User_Category, a rails controller always know the current tenant/shop
[19:28:01] Sylario: I'll just do a custom action
[19:56:03] Sylario: when I use apache i just follow passenger docs
[20:13:47] Sylario: I never really looked into the pro and con, my choice usually stop to "someone want X", or the classic "it's already installed"

2019-03-05

[14:58:38] Sylario: has joined #ruby
[14:58:38] Sylario: has joined #RubyOnRails
[18:15:13] Sylario: I am using jsonapi-rb as a serializer. It allow you to alias attibute name (key: in AMS), however, when there is an error the source should contain a pointer with the model and attribute, and when it's an alias, it's empty
[18:15:53] Sylario: example: {"errors":[{"title":"Invalid content","detail":"error message","source":{}}],"jsonapi":{"version":"1.0"}}
[19:04:17] Sylario: DOes anybody has an example controller with JSON-API rb
[20:02:51] Sylario: I cannot manage to make JSONAPI-RB deserializer works : https://github.com/jsonapi-rb/jsonapi-rb/issues/6
[20:03:00] Sylario: If anyone has any experience with it
[20:03:32] Sylario: wrong URL : https://github.com/jsonapi-rb/jsonapi-rails/issues/103
[20:03:49] Sylario: I have multiples problems with jsonapi
[20:31:23] Sylario: how would you put a byebug in a third party gem?
[21:14:18] Sylario: Is there a way to use byebug in railtie ?
[21:14:20] Sylario: `method_missing': undefined local variable or method `byebug' for JSONAPI::Rails::Railtie:Class (NameError)
[21:14:54] Sylario: I am trying to understand a gem and I cannot use byebug everywhere. I guess there is probably some loading order not respected
[21:15:40] Sylario: jsonapi-rb
[21:16:02] Sylario: jsonapi-rails-0.3.1
[21:17:27] Sylario: The gem is supposed to add a _jsonap key somewhere in params, but it does not and the deserializer looks for it
[21:17:42] Sylario: So I am just trying to understand how that works
[21:18:28] Sylario: yes with byebug
[21:18:48] Sylario: but it does not work
[21:21:34] Sylario: Radar: well I should have tried it, a require 'byebug' just worked
[21:22:01] Sylario: it"s 22:21 here
[21:33:59] Sylario: https://github.com/jsonapi-rb/jsonapi-rails/blob/v0.3.1/lib/jsonapi/rails/railtie.rb#L12 I put a byebug inside the PARSER but it is never called. DOes it seems like something that would be called by rails ?
[21:41:59] Sylario: I vi'd the railtie.rb of my gem in rvm
[21:42:30] Sylario: in the rvm folders where the gem is stored
[21:43:11] Sylario: But it seems PARSER is added to ActionDispatch::Request.parameter_parsers[:jsonapi]
[21:44:36] Sylario: <Proc:0x0055b84f414b98@/home/sylvain/.rvm/gems/ruby-2.4.1/gems/active_model_serializers-0.10.7/lib/active_model_serializers/register_jsonapi_renderer.rb:55 (lambda)>
[21:44:46] Sylario: gem conflict
[21:49:25] Sylario: Inside the include bybuge works, the lambda is never called because somewhere it is destroyed by AMS parser
[21:49:32] Sylario: or something like that
[21:51:09] Sylario: Inside: include byebug at the start of the gem railtie was enough to make it works
[22:36:05] Sylario: well, i'll have a bastardized serialize /deserialize for now, but at least I learned a few things about rails

2019-03-04

[01:19:17] Sylario: Quit: Connection closed for inactivity
[08:45:53] Sylario: has joined #ruby
[08:45:53] Sylario: has joined #RubyOnRails
[23:40:31] Sylario: Quit: Connection closed for inactivity

2019-03-03

[15:57:30] Sylario: has joined #ruby
[15:57:30] Sylario: has joined #RubyOnRails
[18:29:40] Sylario: @davidfetter Model do not contain all of the DDL
[18:30:17] Sylario: If by DDL you are talking about the migrations, all that information is in the schema and rails is able to rebuild a database from it
[19:44:34] Sylario: Relations use foreign keys
[19:45:12] Sylario: That's when you create the migration, you specify it's a relation and it create foreign keys
[19:45:17] Sylario: that's old
[19:45:47] Sylario: Or is 1.8 the ruby version?
[19:46:09] Sylario: Check that 1.8 is not the version of ruby
[19:46:16] Sylario: you may be in rails 3
[19:46:24] Sylario: in the gemfile
[19:47:15] Sylario: It should be 3 then
[19:47:21] Sylario: And you should upgrade
[19:48:03] Sylario: And that's an often overlooked advantage of tests, it's great to migrate
[19:48:25] Sylario: https://guides.rubyonrails.org/upgrading_ruby_on_rails.html
[19:48:30] Sylario: The rails guides are great
[20:09:41] Sylario: something_id, is per convention, a foreign key
[20:10:46] Sylario: Since rails 3 or 4 migrations, that are the way to create new table on an ongoing project, have the notions of relation, that will use the foreign key notion of the DB and also index it
[20:10:59] Sylario: davidfetter: very very important, do not edit schema.rb
[20:11:43] Sylario: schema.rb is the product of migrations, and what an app will use to create the DB structure
[20:13:23] Sylario: at the very least, has_many :bars in class foo.rb implies that the table bars has a foo_id

2019-03-01

[16:21:53] Sylario: has joined #ruby
[16:21:53] Sylario: has joined #RubyOnRails
[16:22:39] Sylario: I am using jsonapi-rb and I want to replace the field :content by :contentBody at deserialization, however the doc is lacking : http://jsonapi-rb.org/guides/deserialization/deserializing.html
[16:23:28] Sylario: DOes anybody has any experience with jsonapi-rb deserialization?
[19:17:50] Sylario: Quit: Connection closed for inactivity

2019-02-26

[01:08:53] Sylario: Quit: Connection closed for inactivity

2019-02-25

[15:06:04] Sylario: has joined #RubyOnRails
[15:06:05] Sylario: has joined #ruby

2019-02-14

[01:22:45] Sylario: Quit: Connection closed for inactivity

2019-02-13

[12:35:31] Sylario: has joined #ruby
[12:35:31] Sylario: has joined #RubyOnRails

2019-02-07

[00:59:40] Sylario: Quit: Connection closed for inactivity

2019-02-06

[00:28:50] Sylario: Quit: Connection closed for inactivity
[08:31:12] Sylario: has joined #ruby
[08:31:12] Sylario: has joined #RubyOnRails
[13:42:53] Sylario: For complicated query you should start in SQL(or mongodb) and then translate it in AR
[13:57:46] Sylario: guyzmo : do a subquery selecting foobars.parent_id and max(foobars.order_value) and group by parent_id
[14:00:32] Sylario: guyzmo for subquery you can do : Bar.where('bars.id in #{suquery.to_sql})

2019-02-05

[09:40:29] Sylario: has joined #RubyOnRails
[09:40:30] Sylario: has joined #ruby
[09:41:21] Sylario: I have a ruby question about code from the Devise gem : https://github.com/plataformatec/devise/blob/715192a7709a4c02127afb067e66230061b82cf2/lib/devise/mailers/helpers.rb#L34 Why is resource not "undefined" ?
[12:05:17] Sylario: @phaul ho... that was an easy one.
[13:49:00] Sylario: I cannot find where *_url methods are defined in rails. I want to know what params it can take
[14:06:20] Sylario: no I mean when you do photo_url(@photo)
[14:07:08] Sylario: I did not find where it is
[14:57:59] Sylario: Ok so I tried to add subdomain: 'content' to a *_url, and it works, it was a shot in the dark
[14:58:20] Sylario: I still do not know what toher options may be available

2019-01-17

[01:21:33] Sylario: Quit: Connection closed for inactivity

2019-01-16

[01:34:37] Sylario: Quit: Connection closed for inactivity
[10:04:25] Sylario: has joined #ruby
[10:04:25] Sylario: has joined #RubyOnRails

2019-01-15

[01:55:29] Sylario: Quit: Connection closed for inactivity
[08:35:01] Sylario: has joined #RubyOnRails
[08:35:02] Sylario: has joined #ruby

2019-01-14

[16:52:05] Sylario: has joined #ruby
[16:52:05] Sylario: has joined #RubyOnRails

2019-01-10

[00:27:48] Sylario: Quit: Connection closed for inactivity

2019-01-09

[16:26:12] Sylario: has joined #ruby
[16:26:12] Sylario: has joined #RubyOnRails

2018-12-21

[02:17:14] Sylario: Quit: Connection closed for inactivity

2018-12-20

[12:36:11] Sylario: has joined #RubyOnRails
[12:36:12] Sylario: has joined #ruby

2018-12-18

[00:09:19] Sylario: Quit: Connection closed for inactivity

2018-12-17

[02:36:05] Sylario: Quit: Connection closed for inactivity
[09:14:45] Sylario: has joined #ruby
[09:14:45] Sylario: has joined #RubyOnRails

2018-12-16

[14:47:39] Sylario: has joined #RubyOnRails
[14:47:40] Sylario: has joined #ruby

2018-12-04

[01:25:00] Sylario: Quit: Connection closed for inactivity

2018-12-02

[14:59:35] Sylario: has joined #RubyOnRails
[14:59:36] Sylario: has joined #ruby

2018-11-29

[02:21:12] Sylario: Quit: Connection closed for inactivity

2018-11-28

[02:08:18] Sylario: Quit: Connection closed for inactivity
[14:51:06] Sylario: has joined #RubyOnRails
[14:51:07] Sylario: has joined #ruby

2018-11-27

[10:30:57] Sylario: Ok, I already asked the question yesterday but, in AMS, is it possible to nest relation in a JSON payload instead of linking it?
[10:32:31] Sylario: "operations":{"data":[{"id":"5","type":"invoice/operation"}]} Is the kind of relation i Have currently
[10:33:01] Sylario: And with ember it works fine with another query on invoice/operation/:id that return operation serialized
[10:33:23] Sylario: But it is the API version of the n+1 query problem