Quantcast
Channel: Active questions tagged redis+ruby-on-rails - Stack Overflow
Viewing all articles
Browse latest Browse all 873

Rails store some attributes in redis instead of relational db

$
0
0

I have the following model:

class Movie < ActiveRecord::Base #Has rating, duration, year as database fields #Want to store content_rating in redis instead of databaseend

I update the model like this:

 movie = Movie.find(1) movie.update(rating: 5, duration: 3600, year: "1955", content_rating: "PG-13")

Want I want is that all the db attributes(rating, duration, year) are stored in the database, and content_rating is stored in redis.

Is this possible with rails without saving content_rating manually in the after_update callback?


Viewing all articles
Browse latest Browse all 873

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>