Date post: | 22-Jan-2018 |
Category: |
Technology |
Upload: | tejas-bubane |
View: | 232 times |
Download: | 0 times |
THE HIDDEN FEATURES OF
ACTIVE-RECORDAnd the Future…..
- Tejas Bubane
@tejasbubane
1. ENUMS 2. OPTIMISTIC LOCKING
3. DIRTY TRACKINGAnd the Future of course….
ENUMS
ENUMS
LOCKING
1. Optimistic Locking - Application Level
2. Pessimistic Locking - Database Level
OPTIMISTIC LOCKING
DIRTY TRACKINGActiveModel::Dirty tracks changes in a Model
DIRTY TRACKING
FUTURE
Rails 5 !!! 🎉
#OR OPERATOR
PR: https://github.com/rails/rails/pull/16052
Post.where(title: "Tuesday Talk").or(Post.where(title: "Wednesday Talk")
#HAS_SECURE_TOKENSimilar to #has_secure_password
PR: https://github.com/rails/rails/pull/18217
#BELONGS_TO REQUIREDSimilar to #has_secure_password
PR: https://github.com/rails/rails/pull/18937
QUESTIONS ?
REFERENCES1. ENUM: http://edgeapi.rubyonrails.org/classes/ActiveRecord/Enum.html
2. Optimistic Locking: http://api.rubyonrails.org/classes/ActiveRecord/Locking/Optimistic.html
3. Dirty Tracking: http://api.rubyonrails.org/classes/ActiveModel/Dirty.html
4. Future Rails 5: https://medium.com/evil-martians/the-rails-5-post-9c76dbac8fc
THANK YOU 😊