Module: MerbAuth::Adapter::Sequel

Defined in:
lib/merb-auth/adapters/sequel/map.rb,
lib/merb-auth/adapters/sequel/model.rb

Defined Under Namespace

Modules: DefaultModelSetup, InstanceMethods, Map

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/merb-auth/adapters/sequel/model.rb', line 5

def self.included(base)
  # Ensure base is a resource
  raise "Mixin class is not an sequel model class" unless base.ancestors.include?(::Sequel::Model)
  set_model_class_decs!(base)
  
  base.send(:include, Map)
  base.send(:include, InstanceMethods )
  base.send(:include, Common)
  
  MA[:single_resource] ||= base.name.snake_case.to_sym
  MA[:plural_resource] ||= MA[:single_resource].to_s.pluralize.to_sym
  
  MA[:user] = base
end