rails + DB dependent destroy vs cascade delete
Great idea. Might also make sense to include something there on deleted records that use like an `DeletedUser` class or something to display some sort of text instead. Reddit does something like th...
Chris Oliver
replied
•
Solved
4
General
How can I solve it?
Perfect , I will search how to do that, thank you!
Federico Calarco
replied
•
Solved
11
General
How do I include a placeholder for empty notifications
That did it. Thanks Chris!
Stan Smith
replied
•
Solved
3
General
Limit CSV export by Day, Week and Month
Hey Sacha, you would just want to use a where query to scope to a date range before calling to_csv on it. You may need to change it from `all.each` to `scoped.each` in order for Rails to respect t...
Chris Oliver
replied
•
Solved
2
General
How do i update an attribute for belongs_to association when scraping a site?
Something like this should fix it:
```ruby
desc "Fetch anime info"
task :fetch_anime_info => :environment do
require "open-uri"
require 'mechanize'
Anime.all.each do |anime|
season_scrape...
Chris Oliver
replied
•
Solved
6
General
How to by pass a string that has '???????' when scraping for dates and turning the date into an integer?
Thank you so much. This worked perfect.
Wesly Mezarina
replied
•
Solved
7
General
Rails console hacks :)
Hey Sascha, I'd write it like this:
```ruby
Order.all.each do |tname|
tname.update_attributes(team: User.where(:id => tname.user_id).pluck(:team).shift)
end
```
The problem is when you use ...
Chris Oliver
replied
•
Solved
3
Rails
data consistency for invitation registration
Chris, a great episode again! So I compared your solution to mine and my structure ended up being a bit more complex since I needed to provide users to accept/decline joining the product. So I crea...
Sean M
replied
•
Solved
10
General
Can I 'alias' a Rails active model to another class
Sounds like it turned out really smoothly! :D
Chris Oliver
replied
•
Solved
10
General
Testing your markdown
Also, I posted this in slack, but for anyone else that sees this, I forgot that I'm using Redcarpet instead of html-pipeline anymore. It's because html-pipeline is a real pain to deploy to Heroku (...
Chris Oliver
replied
•
Solved
4
Testing
Dynamic Pricing based on user country
Yeah I'm going to use the Geocoder gem as well as the built-in ip getter from Devise to accomplish that.
Thanks, Chris!
Enrique Benitez
replied
•
Solved
3
General
How to migrate from Heroku to Digital Ocean
Chris, will you be extending Hatch to do patching/updating? tim
tim carmichael
replied
•
Solved
11
Servers
Loop through associated records and deliver as csv
Hi Chris,
many many thanks! I'll try this out.
Sascha M.
replied
•
Solved
6
General
dealing with authorized parts in fragment caching
Just did an episode on this! https://gorails.com/episodes/advanced-caching-user-permissions-and-authorization?autoplay=1
Cache keys are definitely tough because you have to make sure that no matte...
Chris Oliver
replied
•
Solved
5
General
Action Cable vs Mailboxer?
That would a very interesting video to see. Maiboxer + ActionCable. So we dont need to start from scratch for a full messaging system.
Bruno Sacco
replied
•
Solved
4
General
Polling/Long Polling navbar notifications
So many little nuances to everything, it can be really tough to explain and understand it all!
Chris Oliver
replied
•
Solved
4
General