Sha256: bd814b155aad7d9e6987f70840e4b75419849816fcbc44cfedab380f9f45288c

Contents?: true

Size: 1.26 KB

Versions: 5

Compression:

Stored size: 1.26 KB

Contents

require 'active_remote/association'
require 'active_remote/attributes'
require 'active_remote/bulk'
require 'active_remote/dirty'
require 'active_remote/dsl'
require 'active_remote/persistence'
require 'active_remote/publication'
require 'active_remote/rpc'
require 'active_remote/search'
require 'active_remote/serialization'

module ActiveRemote
  class Base
    extend ::ActiveModel::Callbacks

    include ::ActiveAttr::Model

    include ::ActiveRemote::Association
    include ::ActiveRemote::Attributes
    include ::ActiveRemote::Bulk
    include ::ActiveRemote::DSL
    include ::ActiveRemote::Persistence
    include ::ActiveRemote::Publication
    include ::ActiveRemote::RPC
    include ::ActiveRemote::Search
    include ::ActiveRemote::Serialization

    # Overrides some methods, providing support for dirty tracking,
    # so it needs to be included last.
    include ::ActiveRemote::Dirty

    attr_reader :last_request, :last_response

    define_model_callbacks :initialize, :only => :after

    def initialize(*)
      @attributes ||= {}

      skip_dirty_tracking do
        run_callbacks :initialize do
          super
        end
      end
    end

    def freeze
      @attributes.freeze; self
    end

    def frozen?
      @attributes.frozen?
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
active_remote-1.5.9 lib/active_remote/base.rb
active_remote-1.5.8 lib/active_remote/base.rb
active_remote-1.5.7 lib/active_remote/base.rb
active_remote-1.5.6 lib/active_remote/base.rb
active_remote-1.5.5 lib/active_remote/base.rb