Class: AssocOptions

Inherits:
Object show all
Defined in:
lib/activeleopard/assoc_options.rb

Direct Known Subclasses

BelongsToOptions, HasManyOptions

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#class_nameObject

Returns the value of attribute class_name.



2
3
4
# File 'lib/activeleopard/assoc_options.rb', line 2

def class_name
  @class_name
end

#foreign_keyObject

Returns the value of attribute foreign_key.



2
3
4
# File 'lib/activeleopard/assoc_options.rb', line 2

def foreign_key
  @foreign_key
end

#primary_keyObject

Returns the value of attribute primary_key.



2
3
4
# File 'lib/activeleopard/assoc_options.rb', line 2

def primary_key
  @primary_key
end

Instance Method Details

#model_classObject



8
9
10
# File 'lib/activeleopard/assoc_options.rb', line 8

def model_class
  class_name.constantize
end

#table_nameObject



12
13
14
# File 'lib/activeleopard/assoc_options.rb', line 12

def table_name
  model_class.table_name
end