Project

utusemi

0.0
No commit activity in last 3 years
No release in over 3 years
Providing a flexible alias for column names in ActiveRecord.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Development

Runtime

>= 3.2.0
>= 3.2.0
 Project Readme

Utusemi

Build Status Code Climate Coverage Status Dependency Status

Providing a flexible alias for column names in ActiveRecord.

Installation

  1. Add utusemi in the Gemfile:
gem 'utusemi'
  1. Download and install by running:
bundle install

Usage

  1. Create a file named utusemi.rb in config/initializers and add column names in this file.
Utusemi.configure do
  map :sample do
    name :first_name
  end
end
  1. Use utusemi method.
irb> User.utusemi(:sample).where(name: 'John')
SELECT "users".* FROM "users" WHERE "users"."first_name" = 'John'

Requirements

  • Ruby on Rails 3.2, 4.1
  • Ruby 2.1

Development

To set up a development environment, simply do:

bundle install
bundle exec rake db:create
bundle exec rake db:migrate
bundle exec rake  # run the test suite