Class: DMap::Associations::HasMany
- Inherits:
-
Object
- Object
- DMap::Associations::HasMany
- Defined in:
- lib/dmap/associations/hasn.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#associations ⇒ Object
Returns the value of attribute associations.
Class Method Summary collapse
- .associations ⇒ Object
- .field ⇒ Object
- .is_valid?(command = nil) ⇒ Boolean
- .parent_name ⇒ Object
- .validate(command = nil) ⇒ Object
Instance Attribute Details
#associations ⇒ Object
Returns the value of attribute associations.
30 31 32 |
# File 'lib/dmap/associations/hasn.rb', line 30 def associations @associations end |
Class Method Details
.associations ⇒ Object
32 |
# File 'lib/dmap/associations/hasn.rb', line 32 def self.associations; true; end |
.field ⇒ Object
38 39 40 |
# File 'lib/dmap/associations/hasn.rb', line 38 def self.field "has n, " end |
.is_valid?(command = nil) ⇒ Boolean
42 43 44 |
# File 'lib/dmap/associations/hasn.rb', line 42 def self.is_valid?(command=nil) (!command.nil? or command) end |
.parent_name ⇒ Object
34 35 36 |
# File 'lib/dmap/associations/hasn.rb', line 34 def self.parent_name "HasMany" end |
.validate(command = nil) ⇒ Object
46 47 48 49 50 |
# File 'lib/dmap/associations/hasn.rb', line 46 def self.validate(command=nil) command = command.split('-') command[1] = nil if command[1].nil? {:fields => command[0].underscore.to_sym, :through => command[1]} end |