Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jlurena/active_cached_resource
RESTful API with Rails model convention + Caching
https://github.com/jlurena/active_cached_resource
gem rails rest-api ruby ruby-
Last synced: 6 days ago
JSON representation
RESTful API with Rails model convention + Caching
- Host: GitHub
- URL: https://github.com/jlurena/active_cached_resource
- Owner: jlurena
- License: mit
- Created: 2024-12-16T16:12:17.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2025-01-23T16:09:53.000Z (7 days ago)
- Last Synced: 2025-01-23T16:35:21.854Z (7 days ago)
- Topics: gem, rails, rest-api, ruby, ruby-
- Language: Ruby
- Homepage: https://rubygems.org/gems/active_cached_resource
- Size: 2.85 MB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ActiveCachedResource
[ActiveResource](https://github.com/rails/activeresource) but with a caching layer.## Installation
Install the gem and add to the application's Gemfile by executing:
$ bundle add active_cached_resource
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install active_cached_resource
## Usage
Check out the Wiki! https://github.com/jlurena/active_cached_resource/wiki
## Development
After checking out the repo, run `bin/setup` to install dependencies.
Run `rake` to run the linter and tests.
You can also run `bin/console` for an interactive prompt that will allow you to experiment.Additionally, there is an `example` Rails Application you can play with.
In there you'll find two small rails app:- Provider
- This application contains the remote data.
- Consumer
- This application consumes a remote resource from Provider.## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/jlurena/active_cached_resource.
## Inspirations & Credits
- [CachedResource](https://github.com/mhgbrown/cached_resource)Major differences between this gem and `CachedResource` are:
- This uses a custom, vendored version of the gem [`ActiveResource`](https://github.com/rails/activeresource) that adds the following features
- Lazy `where` chaining
- Flexibility to add your own caching strategies, this gem comes built in with two of them:
- Caching using `ActiveSupport`
- Caching using `SQL`