Module: Ci::StaticModel

Extended by:
ActiveSupport::Concern
Defined in:
lib/ci/static_model.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object


41
42
43
44
45
46
47
# File 'lib/ci/static_model.rb', line 41

def ==(other)
  if other.is_a? ::Ci::StaticModel
    id == other.id
  else
    super
  end
end

#[](key) ⇒ Object

Used by AR for fetching attributes

Pass it along if we respond to it.


21
22
23
# File 'lib/ci/static_model.rb', line 21

def [](key)
  send(key) if respond_to?(key)
end

#destroyed?Boolean

Returns:

  • (Boolean)

37
38
39
# File 'lib/ci/static_model.rb', line 37

def destroyed?
  false
end

#new_record?Boolean

Returns:

  • (Boolean)

29
30
31
# File 'lib/ci/static_model.rb', line 29

def new_record?
  false
end

#persisted?Boolean

Returns:

  • (Boolean)

33
34
35
# File 'lib/ci/static_model.rb', line 33

def persisted?
  false
end

#to_paramObject


25
26
27
# File 'lib/ci/static_model.rb', line 25

def to_param
  id
end