Class: AssocOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/railz_lite/models/associatable.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.



5
6
7
# File 'lib/railz_lite/models/associatable.rb', line 5

def class_name
  @class_name
end

#foreign_keyObject

Returns the value of attribute foreign_key.



5
6
7
# File 'lib/railz_lite/models/associatable.rb', line 5

def foreign_key
  @foreign_key
end

#primary_keyObject

Returns the value of attribute primary_key.



5
6
7
# File 'lib/railz_lite/models/associatable.rb', line 5

def primary_key
  @primary_key
end

Instance Method Details

#model_classObject



11
12
13
# File 'lib/railz_lite/models/associatable.rb', line 11

def model_class
  class_name.constantize
end

#table_nameObject



15
16
17
# File 'lib/railz_lite/models/associatable.rb', line 15

def table_name
  model_class.table_name
end