Sha256: 37f6be82a6597646ae231d1b5a2e01f88c0d1f26c138f2103c2179e4e93cb674

Contents?: true

Size: 716 Bytes

Versions: 3

Compression:

Stored size: 716 Bytes

Contents

require 'virtus'
require 'securerandom'
require 'active_support'
require 'active_model'

require 'soulless/accessors'
require 'soulless/associations'
require 'soulless/dirty'
require 'soulless/model'
require 'soulless/validations'
require 'soulless/version'

module Soulless
  I18n.load_path += Dir.glob('lib/soulless/locale/*.{rb,yml}')
  
  def self.model(options = {})
    mod = Module.new
    mod.define_singleton_method :included do |object|
      object.send(:include, Virtus.model(options))
      object.send(:include, Model)
      object.send(:include, Associations)
      object.send(:include, Validations)
      object.send(:include, Dirty)
      object.send(:include, Accessors)
    end
    mod
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
soulless-0.4.3 lib/soulless.rb
soulless-0.4.1 lib/soulless.rb
soulless-0.4.0 lib/soulless.rb