Class: Rulengine::Engine
- Inherits:
-
Object
- Object
- Rulengine::Engine
- Defined in:
- lib/rulengine.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Engine
constructor
A new instance of Engine.
Constructor Details
#initialize ⇒ Engine
34 35 36 37 |
# File 'lib/rulengine.rb', line 34 def initialize puts "init rulengine" build_db end |
Class Method Details
.a ⇒ Object
39 40 41 42 |
# File 'lib/rulengine.rb', line 39 def self.a puts 'a' 'a' end |
.build_db ⇒ Object
TODO
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# 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. end end unless ActiveRecord::Base.connection.tables.include? 'states' create_table :states do |t| t.json :data t. end end end end |