Slide 1

Slide 1 text

THE HIDDEN FEATURES OF ACTIVE-RECORD And the Future….. - Tejas Bubane @tejasbubane

Slide 2

Slide 2 text

1. ENUMS 2. OPTIMISTIC LOCKING 3. DIRTY TRACKING And the Future of course….

Slide 3

Slide 3 text

ENUMS

Slide 4

Slide 4 text

ENUMS

Slide 5

Slide 5 text

LOCKING 1. Optimistic Locking - Application Level 2. Pessimistic Locking - Database Level

Slide 6

Slide 6 text

OPTIMISTIC LOCKING

Slide 7

Slide 7 text

DIRTY TRACKING ActiveModel::Dirty tracks changes in a Model

Slide 8

Slide 8 text

DIRTY TRACKING

Slide 9

Slide 9 text

FUTURE Rails 5 !!!

Slide 10

Slide 10 text

#OR OPERATOR PR: https://github.com/rails/rails/pull/16052 Post.where(title: "Tuesday Talk").or(Post.where(title: "Wednesday Talk")

Slide 11

Slide 11 text

#HAS_SECURE_TOKEN Similar to #has_secure_password PR: https://github.com/rails/rails/pull/18217

Slide 12

Slide 12 text

#BELONGS_TO REQUIRED Similar to #has_secure_password PR: https://github.com/rails/rails/pull/18937

Slide 13

Slide 13 text

QUESTIONS ?

Slide 14

Slide 14 text

REFERENCES 1. 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

Slide 15

Slide 15 text

THANK YOU