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)


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

def has_no_table(options = { database: :fail_fast })
  raise ArgumentError, "Invalid database option '#{options[:database]}'" unless %i[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)


69
70
71
# File 'lib/activerecord/tablefree.rb', line 69

def tablefree?
  false
end