Module: NCore::ActiveModel
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/ncore/rails/active_model.rb
Instance Method Summary collapse
- #destroy(*args) ⇒ Object
-
#errors_for_actionpack ⇒ Object
actionpack 4 requires a more robust Errors object.
- #logger ⇒ Object
- #new_record? ⇒ Boolean
- #persisted? ⇒ Boolean
Instance Method Details
#destroy(*args) ⇒ Object
27 28 29 |
# File 'lib/ncore/rails/active_model.rb', line 27 def destroy(*args) delete(*args) end |
#errors_for_actionpack ⇒ Object
actionpack 4 requires a more robust Errors object
32 33 34 35 36 37 38 |
# File 'lib/ncore/rails/active_model.rb', line 32 def errors_for_actionpack e0 = ::ActiveModel::Errors.new(self) @errors.each do |e| e0.add :base, e end e0 end |
#logger ⇒ Object
14 15 16 |
# File 'lib/ncore/rails/active_model.rb', line 14 def logger Rails.logger end |
#new_record? ⇒ Boolean
19 20 21 |
# File 'lib/ncore/rails/active_model.rb', line 19 def new_record? !id end |
#persisted? ⇒ Boolean
23 24 25 |
# File 'lib/ncore/rails/active_model.rb', line 23 def persisted? !new_record? end |