has_secure_token | Ram Laxman Yadav

has_secure_token

Bidirectional Destroys in Rails 5

Suppose you have two models having has_many/belongs_to associations between them, In previous versions of rails you cannot add dependent: :destroy to both of the relationships statements. Attempting to delete either of these records results in a circular dependency, with each record attempting to delete the other one, ending in a Stack Too Deep error.

Has secure token in rails 5

Today I gona discuss about the ActiveRecord::Base#has_secure_password method, in rails 5 it became has_secure_token, it specifies that an attribute of your model should be used to store a unique 24-character alphanumeric token.