Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
ARel Ruby visitor
Ruby
Branch: master

Merge pull request #1 from tkawa/master

Implement some visitors
latest commit 170b961357
@amatsuda authored
Failed to load latest commit information.
examples update example and document
lib Implement some visitors
.gitignore bundle gem arel_ruby
Gemfile bundle gem arel_ruby
MIT-LICENSE
README.md update example and document
Rakefile
arel_ruby.gemspec documentations

README.md

ArelRuby

ARel Ruby visitor

Installation

Add this line to your application's Gemfile:

gem 'arel_ruby'

And then execute:

$ bundle

Or install it yourself as:

$ gem install arel_ruby

Usage

This gem adds to_ruby method onto ARel. The to_ruby method transforms ARel AST into pure Ruby Enumerable manipulations, so that you can execute queries without using any RDBMS engine. Try this on your Rails app and you will realize what's actually gonna happen.

YourActiveRecordModel.where(name: 'foo').to_ruby.to_source
YourActiveRecordModel.order('id').to_ruby.to_source
YourActiveRecordModel.offset(10).limit(5).to_ruby.to_source
YourActiveRecordModel.group('created_at').to_ruby.to_source

Examples

See examples directory

Contributing

Fork and PR

Something went wrong with that request. Please try again.