Module: Bcdatabase::ActiveRecord::SchemaQualifiedTables::ClassMethods

Defined in:
lib/bcdatabase/active_record/schema_qualified_tables_override_getters.rb,
lib/bcdatabase/active_record/schema_qualified_tables_override_setters.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#schema=(value) ⇒ Object (writeonly)

Sets the attribute schema

Parameters:

  • value

    the value to set the attribute schema to.



21
22
23
# File 'lib/bcdatabase/active_record/schema_qualified_tables_override_getters.rb', line 21

def schema=(value)
  @schema = value
end

#schemasObject

Returns the value of attribute schemas.



20
21
22
# File 'lib/bcdatabase/active_record/schema_qualified_tables_override_getters.rb', line 20

def schemas
  @schemas
end

Instance Method Details

#sequence_nameObject



33
34
35
36
37
38
39
40
41
# File 'lib/bcdatabase/active_record/schema_qualified_tables_override_getters.rb', line 33

def sequence_name
  unless abstract_class?
    if schema_name_prepended?(schema_name, super)
      super
    else
      "#{schema_name}.#{super}"
    end
  end
end

#set_schema(schema) ⇒ Object

Support pre-rails 3.2 style setter



44
45
46
# File 'lib/bcdatabase/active_record/schema_qualified_tables_override_getters.rb', line 44

def set_schema(schema)
  self.schema = schema
end

#set_sequence_name_with_schema(name) ⇒ Object



43
44
45
46
47
48
49
# File 'lib/bcdatabase/active_record/schema_qualified_tables_override_setters.rb', line 43

def set_sequence_name_with_schema(name)
  if name
    update_qualified_sequence_name(name)
  else
    set_sequence_name_without_schema(name)
  end
end

#set_table_name_with_schema(name) ⇒ Object



39
40
41
# File 'lib/bcdatabase/active_record/schema_qualified_tables_override_setters.rb', line 39

def set_table_name_with_schema(name)
  update_qualified_table_name(name)
end

#table_nameObject



23
24
25
26
27
28
29
30
31
# File 'lib/bcdatabase/active_record/schema_qualified_tables_override_getters.rb', line 23

def table_name
  unless abstract_class?
    if schema_name_prepended?(schema_name, super)
      super
    else
      "#{schema_name}.#{super}"
    end
  end
end