Skip to content

ByCodersTec/protocolize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Protocolize

Generate protocol number for new records, tickets, issues, documents, and everything you need to identify.

Installation

Add this line to your application's Gemfile:

gem 'protocolize'

Then install the dependencies:

bundle

Copy the migration to project:

rails g protocolize:install

Create the protocols table:

rake db:migrate

Test

rspec spec

Usage

Include module to app/models/application_record.rb:

class ApplicationRecord < ActiveRecord::Base
  include Protocolize::ActsAsProtocolable

  self.abstract_class = true
end

Set your model to act as protocolable associating with the protocol:

class MyModel < ApplicationRecord
  acts_as_protocolable
end

That's it! Everytime the model configured to act as protocolable was created a protocol will be created together.

Helpful links

Gem Patterns How To Build A Ruby Gem With Bundler, Test-Driven Development, Travis CI And Coveralls, Oh My!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published