Module: ActiveRecord::ModelSpaces::ClassMethods

Defined in:
lib/active_record/model_spaces.rb

Instance Method Summary collapse

Instance Method Details

#current_table_nameObject



65
66
67
# File 'lib/active_record/model_spaces.rb', line 65

def current_table_name
  REGISTRY.current_table_name(self)
end

#hooverObject



83
84
85
# File 'lib/active_record/model_spaces.rb', line 83

def hoover
  REGISTRY.hoover(self)
end

#in_model_space(model_space_name, opts = {}) ⇒ Object

register a model as belonging to a model space



49
50
51
# File 'lib/active_record/model_spaces.rb', line 49

def in_model_space(model_space_name, opts={})
  REGISTRY.register_model(self, model_space_name, opts)
end

#new_version(&block) ⇒ Object

create a new version of the model



74
75
76
# File 'lib/active_record/model_spaces.rb', line 74

def new_version(&block)
  REGISTRY.new_version(self, &block)
end

#set_table_name(table_name) ⇒ Object



53
54
55
# File 'lib/active_record/model_spaces.rb', line 53

def set_table_name(table_name)
  REGISTRY.set_base_table_name(self, table_name)
end

#table_nameObject



61
62
63
# File 'lib/active_record/model_spaces.rb', line 61

def table_name
  ActiveRecord::ModelSpaces::REGISTRY.table_name(self)
end

#table_name=(table_name) ⇒ Object



57
58
59
# File 'lib/active_record/model_spaces.rb', line 57

def table_name=(table_name)
  REGISTRY.set_base_table_name(self, table_name)
end

#updated_version(&block) ⇒ Object

create an updated version of the model



79
80
81
# File 'lib/active_record/model_spaces.rb', line 79

def updated_version(&block)
  REGISTRY.updated_version(self, &block)
end

#working_table_nameObject



69
70
71
# File 'lib/active_record/model_spaces.rb', line 69

def working_table_name
  REGISTRY.working_table_name(self)
end