Module: Gorillib::Model::ActiveModelShim

Extended by:
ActiveModel::Naming, Concern
Includes:
ActiveModel::Validations, Conversion
Defined in:
lib/gorillib/model/active_model_shim.rb

Overview

Provides the minimum functionality to pass the ActiveModel lint tests

Examples:

Usage

class Person
  include Gorillib::Model::ActiveModelShim
end

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Methods included from Concern

append_features, extended, included

Methods included from Conversion

#to_key, #to_model, #to_param, #to_partial_path

Instance Method Details

#attribute_method?(attr_name) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/gorillib/model/active_model_shim.rb', line 24

def attribute_method?(attr_name)
  self.class.has_field?(attr_name)
end

#persisted?false

Returns:

  • (false)


20
21
22
# File 'lib/gorillib/model/active_model_shim.rb', line 20

def persisted?
  false
end