Module: ActiveRecord::Tablefree::ActsMethods

Defined in:
lib/activerecord-tablefree.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#has_no_table(options = {:database => :fail_fast}) ⇒ Object

A model that needs to be tablefree will call this method to indicate it.

Raises:

  • (ArgumentError)


45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/activerecord-tablefree.rb', line 45

def has_no_table(options = {:database => :fail_fast})
  raise ArgumentError.new("Invalid database option '#{options[:database]}'") unless [:fail_fast, :pretend_success].member? options[:database]
  # keep our options handy
  class_attribute :tablefree_options
  self.tablefree_options = {
    :database => options[:database],
    :columns_hash => {}
  }

  # extend
  extend  ActiveRecord::Tablefree::SingletonMethods
  extend  ActiveRecord::Tablefree::ClassMethods

  # include
  include ActiveRecord::Tablefree::InstanceMethods

  # setup columns
  include ActiveModel::AttributeAssignment
  include ActiveRecord::ModelSchema
end

#tablefree?Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/activerecord-tablefree.rb', line 66

def tablefree?
  false
end