GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - rpush/modis: ActiveModel + Redis

This repository was archived by the owner on Nov 11, 2026. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

210 Commits
210 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
benchmark
benchmark
 
 
gemfiles
gemfiles
 
 
lib
lib
 
 
spec
spec
 
 
.github_changelog_generator
.github_changelog_generator
 
 
.gitignore
.gitignore
 
 
.rubocop.yml
.rubocop.yml
 
 
.ruby-version
.ruby-version
 
 
Appraisals
Appraisals
 
 
CHANGELOG.md
CHANGELOG.md
 
 
Gemfile
Gemfile
 
 
Gemfile.lock
Gemfile.lock
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
Rakefile
Rakefile
 
 
modis.gemspec
modis.gemspec
 
 

Repository files navigation

Code Climate Test Coverage

Modis

ActiveModel + Redis with the aim to mimic ActiveRecord where possible.

Requirements

Modis 4.0+ supports Rails 5.2 and higher, including Rails 6.1, as well as Ruby 2.3 and above, including Ruby 3.0. Tests are also being run with JRuby. For details please check the current CI setup.

For releases supporting older Rails versions such as 4.2-5.1 please check out the 3.x releases.

Installation

Add this line to your application's Gemfile:

gem 'modis'

And then execute:

$ bundle

Or install it yourself as:

$ gem install modis

Usage

class MyModel
  include Modis::Model
  attribute :name, :string
  attribute :age, :integer
end

MyModel.create!(name: 'Ian', age: 28)

all index

Modis, by default, creates an all index in redis in which it stores all the IDs for records created. As a result, a large amount of memory will be consumed if many ids are stored. The all index functionality can be turned off by using enable_all_index

class MyModel
  include Modis::Model
  enable_all_index false
end

By disabling the all index functionality, the IDs of each record created won't be saved. As a side effect, using all finder method will raise a IndexError exception as we would not have enough information to fetch all records. See #7 for more context.

Supported Features

TODO.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

ActiveModel + Redis

Topics

activemodel-redismodisredisruby

Resources

Readme
MIT license
Activity
Custom properties

Stars

39 stars

Watchers

8 watching

Forks

32 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.