Class: Valkyrie::Persistence::Postgres::ORM::Resource
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Valkyrie::Persistence::Postgres::ORM::Resource
- Defined in:
- lib/valkyrie/persistence/postgres/orm/resource.rb
Overview
ActiveRecord class which the Postgres adapter uses for persisting data.
Instance Attribute Summary collapse
-
#created_at ⇒ DateTime
Date created.
-
#id ⇒ UUID
ID of the record.
-
#internal_resource ⇒ String
Name of Resource model - used for casting.
-
#metadata ⇒ Hash
Hash of all metadata.
-
#updated_at ⇒ DateTime
Date updated.
Instance Method Summary collapse
Instance Attribute Details
#created_at ⇒ DateTime
Returns 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 |
#id ⇒ UUID
Returns 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_resource ⇒ String
Returns 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 |
#metadata ⇒ Hash
Returns 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_at ⇒ DateTime
Returns 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
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 |