Core libraries and tools part for pro architecture. It's a submodule - use from this perspective http://git.maniak.pro/madmaniak/pro
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
499 B
24 lines
499 B
require_relative 'paths_resolver'
|
|
|
|
module Sequel::Plugins::CustomModel
|
|
module ClassMethods
|
|
def immutable(*value)
|
|
return @immutable if value.empty?
|
|
@immutable = !!value.first
|
|
end
|
|
end
|
|
end
|
|
|
|
Sequel::Model.plugin :custom_model
|
|
|
|
constants = Object.constants
|
|
|
|
PathsResolver.resolve('model.rb').each do |model|
|
|
require "#{Dir.pwd}/#{model}"
|
|
end
|
|
|
|
$models = (Object.constants - constants).inject({}) { |h, model|
|
|
model = Kernel.const_get(model)
|
|
h[model.table_name] = model
|
|
h
|
|
}
|
|
|