Exception: ActiveRecord::Associations::NotPortableError
- Inherits:
-
StandardError
- Object
- StandardError
- ActiveRecord::Associations::NotPortableError
- Defined in:
- lib/portable_model/active_record.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(assoc) ⇒ NotPortableError
constructor
A new instance of NotPortableError.
Constructor Details
#initialize(assoc) ⇒ NotPortableError
Returns a new instance of NotPortableError.
8 9 10 |
# File 'lib/portable_model/active_record.rb', line 8 def initialize(assoc) super("#{assoc.proxy_reflection.name}:#{assoc.proxy_reflection.klass.name} is not portable") end |
Class Method Details
.raise_on_not_portable(assoc) ⇒ Object
14 15 16 |
# File 'lib/portable_model/active_record.rb', line 14 def raise_on_not_portable(assoc) raise NotPortableError.new(assoc) unless assoc.proxy_reflection.klass.include?(PortableModel) end |