class Rulengine::Engine

Public Class Methods

a() click to toggle source
# File lib/rulengine.rb, line 39
def self.a
        puts 'a'
        'a'
end
build_db() click to toggle source

TODO

# File lib/rulengine.rb, line 13
def self.build_db
  ActiveRecord::Schema.define do
    unless ActiveRecord::Base.connection.tables.include? 'rules'
      create_table :rules do |t|
        t.json :given # Turns this an its negative into a separate 'fact' class
        t.json :unless_given # Same as "and not given"
        t.json :action # switch to foreign key? Model name? (inherited)

        t.timestamps
      end
    end

    unless ActiveRecord::Base.connection.tables.include? 'states'
      create_table :states do |t|
        t.json :data
        t.timestamps
      end
    end
  end
end
new() click to toggle source
# File lib/rulengine.rb, line 34
          def initialize
                  puts "init rulengine"
build_db
          end