abbish_sequel_plugins

Frequently used plugins for Sequel

Installation

Add this line to your application's Gemfile:

gem 'abbish_sequel_plugins'

And then execute:

$ bundle

Or install it yourself as:

$ gem install abbish_sequel_plugins

Usage

RecordProtection

class Model < Sequel::Model(:test_table)
  plugin Abbish::Sequel::Plugins::Model::RecordProtection, { options }
end

Default options

{
    :enabled => true,
    :column_protected => :record_protected,
    :raise_protected_message => 'Cannot destroy protected record'
}

======

RecordTimestamp

class Model < Sequel::Model(:test_table)
  plugin Abbish::Sequel::Plugins::Model::RecordTimestamp { options }
end

Default options

{
    :enabled => true,
    :column_created_time => :record_created_time,
    :column_updated_time => :record_updated_time
}

======

RecordVersion

class Model < Sequel::Model(:test_table)
  plugin Abbish::Sequel::Plugins::Model::RecordVersion
end

Default options

{
    :enabled => true,
    :column_version => :record_version
}

Contributing

  1. Fork it ( https://github.com/abbish/abbish_sequel_plugins/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request