Sha256: bd78ecfd101507b3d95c4c52be3d4489d0e2a44d81886992ee7feb61df3f661b

Contents?: true

Size: 1.2 KB

Versions: 12

Compression:

Stored size: 1.2 KB

Contents

motion_require '../helpers/has_authorization'
motion_require './_nano_bag_mixin.rb'
motion_require './_finder_mixin.rb'
motion_require './_base_mixin.rb'
motion_require './_sync_mixin.rb'
motion_require './_association_mixin.rb'
motion_require './_dirty_mixin.rb'
motion_require './store.rb'
motion_require './store_extension.rb'
module MotionPrime
  class Model < NSFNanoObject
    include MotionPrime::HasAuthorization
    include MotionPrime::HasNormalizer
    include MotionPrime::ModelBaseMixin
    include MotionPrime::ModelAssociationMixin
    include MotionPrime::ModelSyncMixin
    include MotionPrime::ModelFinderMixin
    include MotionPrime::ModelDirtyMixin
    include MotionPrime::ModelTimestampsMixin

    attribute :bag_key # need this as we use shared store; each nested resource must belong to parent bag
    attribute :id

    def errors
      @errors ||= Errors.new(self.weak_ref)
    end

    def set_errors(data)
      errors.track_changed do
        data.symbolize_keys.each do |key, error_messages|
          errors.set(key, error_messages, silent: true) if error_messages.present?
        end
      end
    end

    def dealloc
      Prime.logger.dealloc_message :model, self
      super
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
motion-prime-0.9.9 motion-prime/models/model.rb
motion-prime-0.9.8 motion-prime/models/model.rb
motion-prime-0.9.7 motion-prime/models/model.rb
motion-prime-0.9.6 motion-prime/models/model.rb
motion-prime-0.9.5 motion-prime/models/model.rb
motion-prime-0.9.4 motion-prime/models/model.rb
motion-prime-0.9.3 motion-prime/models/model.rb
motion-prime-0.9.2 motion-prime/models/model.rb
motion-prime-0.9.1 motion-prime/models/model.rb
motion-prime-0.9.0 motion-prime/models/model.rb
motion-prime-0.8.12 motion-prime/models/model.rb
motion-prime-0.8.11 motion-prime/models/model.rb