Sha256: 4f4dc10fc2c32c0dd0956565e2aa51f58f60a56afe75f52133a6dc375fa2a35b

Contents?: true

Size: 399 Bytes

Versions: 23

Compression:

Stored size: 399 Bytes

Contents

module Saviour
  class PersistenceLayer
    def initialize(model)
      @model = model
    end

    def read(attr)
      @model.read_attribute(attr)
    end

    def write(attr, value)
      @model.update_columns(attr => value)
    end

    def write_attrs(attributes)
      @model.update_columns(attributes)
    end

    def persisted?
      @model.persisted? || @model.destroyed?
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
saviour-0.6.10 lib/saviour/persistence_layer.rb
saviour-0.6.9 lib/saviour/persistence_layer.rb
saviour-0.6.8 lib/saviour/persistence_layer.rb
saviour-0.6.7 lib/saviour/persistence_layer.rb
saviour-0.6.6 lib/saviour/persistence_layer.rb
saviour-0.6.5 lib/saviour/persistence_layer.rb
saviour-0.6.4 lib/saviour/persistence_layer.rb
saviour-0.6.3 lib/saviour/persistence_layer.rb
saviour-0.6.2 lib/saviour/persistence_layer.rb
saviour-0.6.1 lib/saviour/persistence_layer.rb
saviour-0.6.0 lib/saviour/persistence_layer.rb
saviour-0.5.11 lib/saviour/persistence_layer.rb
saviour-0.5.10 lib/saviour/persistence_layer.rb
saviour-0.5.9 lib/saviour/persistence_layer.rb
saviour-0.5.8 lib/saviour/persistence_layer.rb
saviour-0.5.7 lib/saviour/persistence_layer.rb
saviour-0.5.6 lib/saviour/persistence_layer.rb
saviour-0.5.5 lib/saviour/persistence_layer.rb
saviour-0.5.4 lib/saviour/persistence_layer.rb
saviour-0.5.3 lib/saviour/persistence_layer.rb