Module: Ripple::Conversion

Extended by:
ActiveSupport::Concern
Includes:
ActiveModel::Conversion
Defined in:
lib/ripple/conversion.rb

Overview

Provides ActionPack compatibility for Document models.

Instance Method Summary collapse

Instance Method Details

#new_record?Boolean

True if this is a new document

Returns:



10
11
12
# File 'lib/ripple/conversion.rb', line 10

def new_record?
  new?
end

#persisted?Boolean

True if this is not a new document

Returns:



15
16
17
# File 'lib/ripple/conversion.rb', line 15

def persisted?
  !new?
end

#to_keyObject

Converts to a view key



20
21
22
# File 'lib/ripple/conversion.rb', line 20

def to_key
  new? ? nil : [key]
end

#to_paramObject

Converts to a URL parameter



25
26
27
# File 'lib/ripple/conversion.rb', line 25

def to_param
  key
end