Class: Valkyrie::Persistence::Postgres::ORM::Resource

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/valkyrie/persistence/postgres/orm/resource.rb

Overview

ActiveRecord class which the Postgres adapter uses for persisting data.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#created_atDateTime

Returns Date created.

Returns:

  • (DateTime)

    Date created



16
17
18
19
20
21
22
23
24
25
# File 'lib/valkyrie/persistence/postgres/orm/resource.rb', line 16

class Resource < ActiveRecord::Base
  def disable_optimistic_locking!
    @disable_optimistic_locking = true
  end

  def locking_enabled?
    return false if @disable_optimistic_locking
    true
  end
end

#idUUID

Returns ID of the record.

Returns:

  • (UUID)

    ID of the record



16
17
18
19
20
21
22
23
24
25
# File 'lib/valkyrie/persistence/postgres/orm/resource.rb', line 16

class Resource < ActiveRecord::Base
  def disable_optimistic_locking!
    @disable_optimistic_locking = true
  end

  def locking_enabled?
    return false if @disable_optimistic_locking
    true
  end
end

#internal_resourceString

Returns Name of Resource model - used for casting.

Returns:

  • (String)

    Name of Resource model - used for casting.



16
17
18
19
20
21
22
23
24
25
# File 'lib/valkyrie/persistence/postgres/orm/resource.rb', line 16

class Resource < ActiveRecord::Base
  def disable_optimistic_locking!
    @disable_optimistic_locking = true
  end

  def locking_enabled?
    return false if @disable_optimistic_locking
    true
  end
end

#metadataHash

Returns Hash of all metadata.

Returns:

  • (Hash)

    Hash of all metadata.



16
17
18
19
20
21
22
23
24
25
# File 'lib/valkyrie/persistence/postgres/orm/resource.rb', line 16

class Resource < ActiveRecord::Base
  def disable_optimistic_locking!
    @disable_optimistic_locking = true
  end

  def locking_enabled?
    return false if @disable_optimistic_locking
    true
  end
end

#updated_atDateTime

Returns Date updated.

Returns:

  • (DateTime)

    Date updated



16
17
18
19
20
21
22
23
24
25
# File 'lib/valkyrie/persistence/postgres/orm/resource.rb', line 16

class Resource < ActiveRecord::Base
  def disable_optimistic_locking!
    @disable_optimistic_locking = true
  end

  def locking_enabled?
    return false if @disable_optimistic_locking
    true
  end
end

Instance Method Details

#disable_optimistic_locking!Object



17
18
19
# File 'lib/valkyrie/persistence/postgres/orm/resource.rb', line 17

def disable_optimistic_locking!
  @disable_optimistic_locking = true
end

#locking_enabled?Boolean

Returns:

  • (Boolean)


21
22
23
24
# File 'lib/valkyrie/persistence/postgres/orm/resource.rb', line 21

def locking_enabled?
  return false if @disable_optimistic_locking
  true
end