Module: Gearbox::ActiveModelImplementation

Defined in:
lib/gearbox/mixins/active_model_implementation.rb

Overview

I wanted to have all of my ActiveModel mixins in one place. I want to see how this is being used explicitly.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/gearbox/mixins/active_model_implementation.rb', line 7

def self.included(base)
  base.send :include, ActiveModel::Validations
  base.send :include, ActiveModel::Conversion

  # This isn't right...so I need to research these things a little bit. 
  # What I'm thinking is a RESTful API isn't too much to ask from Gearbox, 
  # So I want these to produce JSON and XML in a consistent way...
  # I may be wrong, but I may be getting the RDF::JSON version here instead.
  base.send :include, ActiveModel::Serializers::JSON
  base.send :include, ActiveModel::Serializers::Xml
  
  base.send :extend, ActiveModel::Naming
  base.send :include, ActiveModel::Dirty
end

Instance Method Details

#persisted?Boolean

TODO Temporary!!! Remove after finishing the Mutable changes.

Returns:

  • (Boolean)


23
24
25
# File 'lib/gearbox/mixins/active_model_implementation.rb', line 23

def persisted?
  false
end