Our new address is: 400-1668 Barrington St. Halifax NS B3J 2A2 Come visit us!
Devise's default behaviour to delete a user is to actually delete them from the database. This isn't the right approach for every site; in my case, I prefer to hang on to users in perpetuity and simply mark their record as deleted. The steps are simple. Create a migration: def up add_column :users, :deleted_at, :timestamp end When deleted_at gets a value, we'll consider the record deleted. Otherwise, it is active. Now we need to change the log in behaviour to check if the user has been deleted or not. Devise provides the valid_for_authentication? method, which you
This is Part 3 of a series of tutorials. Here's Part 1 and Part 2. So we've covered models, collections, controllers, and the basic case of tying a view to a model's callbacks. Now we're going to cover tying a view to a collection. This gets a little hairy, so I'm going to keep it nice and simple to start. Note: As with most things, there are large number of ways you could do this. If you feel that you have a better way, feel free to
The next hacks@ is on 26 February at 4:30 p.m. Read more and sign up.