#RubyOnRails - 26 November 2018
« Back 1 day Forward 1 day »
[00:01:51]
dopie:
How can I create a user which uses password_digest without a password? I keep on getting PG::NotNullViolation: ERROR: null value in column "password_digest"
[06:24:19]
elcontrastador:
is there a way i can termporarily disable sprockets while in "design" mode? It's annoying AF to wait for assets to compile each reload
[07:32:51]
sevenseacat:
if you disable sprockets, your CSS won't compile and you won't see the changes you're making
[08:07:34]
dionysus69:
yottanami: yes, if you pass correct params while generating scaffolds, it will create full working MVC. in case you already have models you can generate scaffold_controller which creates controllers + views, you still need to manually pass in model attributes see bin/rails generate scaffold_controller HighScore game:string score:integer https://guides.rubyonrails.org/command_line.html#rails-generate
[08:08:25]
dionysus69:
in your case you will get jbuilder views if you are using default rails --api mode
[13:44:29]
Gargron:
How can I set statement_timeout for every query/transaction if I am using pgbouncer with transaction pool mode?
[14:17:20]
emers2n:
Got a question I've been racking by brain over... I use find to get an active record relation. Then I use a .each to iterate over each object. How the fuck do I end up with records still in @articles? https://dpaste.de/xgMa
[14:19:44]
emers2n:
I'm left with 2/5 objects after running .each to delete object... If I run the .each again, I'm left with 1 object, and again I'm left with 0
[16:14:04]
emers2n:
@tubbo It is 5.2.1. Instead of trying to run a .each, I've went with .reject, which is achieving the desired results
[16:14:54]
emers2n:
That's all I was trying to do, filter them from the active record relation variable
[16:14:57]
tubbo:
i asked about what version of rails you were running because you're using a very old syntax there, `find(:all)` instead of just `all`...
[16:16:54]
emers2n:
No. To be completely up front I was searching through my Shopify blog posts using the API: "@articles = ShopifyAPI::Article.find(:all, :params => {:limit => 250})". After that was retrieved, I wanted to search them by title and remove articles that don't match title (As API doesn't allow this).
[19:26:04]
Sylario:
When I have a Parent and CHildren serializer, how do I make AMS embedd the child in the answer instead of only referencing it?
[19:27:21]
Sylario:
https://github.com/rails-api/active_model_serializers/blob/v0.10.6/docs/general/serializers.md#associations
[23:59:53]
SteenJobs:
hey all - in the docs for `update_all`, https://apidock.com/rails/v4.2.7/ActiveRecord/Relation/update_all, it mentions the values won’t go through AR’s type-casting behavior - would this cause an issue if updating a bool property when using mysql?