Exception: Ooor::UnknownAttributeOrAssociationError
- Inherits:
-
OpenERPServerError
- Object
- RuntimeError
- OpenERPServerError
- Ooor::UnknownAttributeOrAssociationError
- Defined in:
- lib/ooor/errors.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
Returns the value of attribute klass.
Attributes inherited from OpenERPServerError
#faultCode, #faultString, #request
Instance Method Summary collapse
Methods inherited from OpenERPServerError
build, create_from_trace, #filter_password, #initialize
Constructor Details
This class inherits a constructor from Ooor::OpenERPServerError
Instance Attribute Details
#klass ⇒ Object
Returns the value of attribute klass.
101 102 103 |
# File 'lib/ooor/errors.rb', line 101 def klass @klass end |
Instance Method Details
#available_fields(clazz) ⇒ Object
109 110 111 112 113 114 115 116 117 |
# File 'lib/ooor/errors.rb', line 109 def available_fields(clazz) msg = "\n\n*** AVAILABLE FIELDS ON #{clazz.name} ARE: ***" msg << "\n\n" << clazz.t.fields.sort {|a,b| a[1]['type']<=>b[1]['type']}.map {|i| "#{i[1]['type']} --- #{i[0]}"}.join("\n") %w[many2one one2many many2many polymorphic_m2o].each do |kind| msg << "\n\n" msg << (clazz.send "#{kind}_associations").map {|k, v| "#{kind} --- #{v['relation']} --- #{k}"}.join("\n") end msg end |
#to_s ⇒ Object
103 104 105 106 107 |
# File 'lib/ooor/errors.rb', line 103 def to_s() s = super s << available_fields(@klass) if @klass s end |