0.0
No commit activity in last 3 years
No release in over 3 years
Adds methods to ActiveRecord::Migration to create and manage database functions in Rails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.1.3
>= 1.15
>= 0
>= 0
>= 0
>= 3.3

Runtime

>= 4.0.0
>= 4.0.0
 Project Readme

PgAssistant

Adds methods to ActiveRecord::Migration to create and manage database functions in Rails. I took the idea from a project Scenic.

Installation

Add this line to your application's Gemfile:

gem 'pg_assistant'

Setup config

PgAssistant.configure do |config|
  config.functions_directory_path = '<your path>' # by default db/functions
end

Usage

Create or update function:

rails generate pg_assistant:function increment

# => create: db/functions/increment_v01.sql
# => create: db/functions/20140803191158_create_increment.rb

rails generate pg_assistant:function increment

# => create: db/functions/increment_v02.sql
# => create: db/functions/20140804191158_update_increment_to_version_2.rb

License

The gem is available as open source under the terms of the MIT License.