Module: Slingshot::Model::Persistence

Defined in:
lib/slingshot/model/persistence.rb,
lib/slingshot/model/persistence/finders.rb,
lib/slingshot/model/persistence/storage.rb,
lib/slingshot/model/persistence/attributes.rb

Defined Under Namespace

Modules: Attributes, Finders, Storage

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/slingshot/model/persistence.rb', line 6

def self.included(base)

  base.class_eval do
    include ActiveModel::AttributeMethods
    include ActiveModel::Validations
    include ActiveModel::Serialization
    include ActiveModel::Serializers::JSON
    include ActiveModel::Naming
    include ActiveModel::Conversion

    extend  ActiveModel::Callbacks
    define_model_callbacks :save, :destroy

    include Slingshot::Model::Search
    include Slingshot::Model::Callbacks

    extend  Persistence::Finders::ClassMethods
    extend  Persistence::Attributes::ClassMethods
    include Persistence::Attributes::InstanceMethods

    include Persistence::Storage
  end

end