Kvbean
Make redis on rails life easier
Install
put this code in Gemfile
gem 'kvbean'
Usage
class Message
include Kvbean::Base
kv_field :content, :title
end
Message.create(title: 'i am title', content: 'i am content')
= Message.new(title: 'i am title', content: 'i am content')
.save
Callbacks
class Message
include Kvbean::Base
kv_field :content, :title
before_create :set_content
private
def set_content
self.content = 'some text'
end
end
Validations
class Message
include Kvbean::Base
kv_field :content, :title
validates_presence_of :title
end