Class: Ratbug::ActiveRecordSchemaMonkey

Inherits:
Object
  • Object
show all
Includes:
ActiveRecordSchemaMonkeyExt
Defined in:
lib/ratbug/active_record_schema_monkey.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ActiveRecordSchemaMonkeyExt

#add_foreign_key, #create_table, #enable_extension

Constructor Details

#initializeActiveRecordSchemaMonkey

Returns a new instance of ActiveRecordSchemaMonkey.



23
24
25
26
# File 'lib/ratbug/active_record_schema_monkey.rb', line 23

def initialize
  # {table_name: Table}
  @tables = Hash.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(symbol, *args) ⇒ Object (private)



32
33
34
# File 'lib/ratbug/active_record_schema_monkey.rb', line 32

def method_missing(symbol, *args)
  puts "ActiveRecord::Schema##{symbol.to_s}(#{args.join(', ')}) has no use currently"
end

Instance Attribute Details

#tablesObject

Returns the value of attribute tables.



21
22
23
# File 'lib/ratbug/active_record_schema_monkey.rb', line 21

def tables
  @tables
end