Module: Limitable

Defined in:
lib/limitable.rb,
lib/limitable/base.rb,
lib/limitable/locale.rb,
lib/limitable/version.rb

Overview

Limitable

Module that declares database limit validations when included in an ActiveRecord model class. Supports limit inferences on integer, string, text and binary columns.

Defined Under Namespace

Modules: Base, Locale

Constant Summary collapse

VERSION =
'2.0.0'

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



16
17
18
19
20
# File 'lib/limitable.rb', line 16

def included(klass)
  safe_column_names(klass).each do |column_name|
    attach_limit_validator_if_needed klass, column_name
  end
end