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
28 29 30 |
# File 'lib/ncore/rails/active_model.rb', line 28 def destroy(*args) delete(*args) end |
#errors_for_actionpack ⇒ Object
actionpack 4 requires a more robust Errors object
33 34 35 36 37 38 39 |
# File 'lib/ncore/rails/active_model.rb', line 33 def errors_for_actionpack e0 = ::ActiveModel::Errors.new(self) @errors.each do |e| e0.add :base, e end e0 end |
#logger ⇒ Object
15 16 17 |
# File 'lib/ncore/rails/active_model.rb', line 15 def logger Rails.logger end |
#new_record? ⇒ Boolean
20 21 22 |
# File 'lib/ncore/rails/active_model.rb', line 20 def new_record? !id end |
#persisted? ⇒ Boolean
24 25 26 |
# File 'lib/ncore/rails/active_model.rb', line 24 def persisted? !new_record? end |