Sha256: 71028206327fbc3f412e945721471b268704bba846c3f61280b06da1563f08c2

Contents?: true

Size: 595 Bytes

Versions: 1

Compression:

Stored size: 595 Bytes

Contents

module ActiveData
  module Model
    module Conventions
      extend ActiveSupport::Concern

      included do
        delegate :logger, to: ActiveData
        self.include_root_in_json = ActiveData.include_root_in_json
      end

      def persisted?
        false
      end

      def new_record?
        !persisted?
      end
      alias_method :new_object?, :new_record?

      module ClassMethods
        def i18n_scope
          ActiveData.i18n_scope
        end

        def to_ary
          nil
        end

        def primary_name
          nil
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_data-1.0.0 lib/active_data/model/conventions.rb