2

With the introduction of ActiveModel in Rails 3 whats the new method of calling ActiveRecord::RecordNotFound. ActiveModel::RecordNotFound ?

JW8
  • 1,496
  • 5
  • 21
  • 36
Rare Pleasures
  • 1,611
  • 1
  • 10
  • 5

2 Answers2

0

This is the definition (1) of ActiveModel:

ActiveModel is a class to be implemented by each ORM to allow Rails to generate customized controller code.

ActiveRecord implements ActiveModel. ActiveRecord raises its ActiveRecord::RecordNotFound exception when it can't find record by given id or a set of ids (2) in the database.

This mean there can't be such exception like ActiveModel::RecordNotFound.

DavidRH
  • 809
  • 5
  • 8
0

ActiveModel is a set of modules and conventions to be implemented, the main goal being providing a common interface to mappers, no more, no less. So nope, ActiveRecord::RecordNotFound stays ActiveRecord::RecordNotFound. RecordNotFound does not make sense for every mapper : with Mongoid for instance, you'll have DocumentNotFound (well, Mongoid::Errors::DocumentNotFound).

ksol
  • 11,835
  • 5
  • 37
  • 64