Method: ActiveNode::Associations::Association#validate_type
- Defined in:
- lib/active_node/associations/association.rb
#validate_type(records) ⇒ Object
61 62 63 64 65 |
# File 'lib/active_node/associations/association.rb', line 61 def validate_type(records) unless records.all? { |r| r.is_a?(reflection.klass) } raise ArgumentError, "#{reflection.name} can only accept object(s) of class #{reflection.klass}" end end |