Sha256: 545756a385b41d0c47c925008982f6ee353d44b1d5e91f6b1a163512847f11df

Contents?: true

Size: 707 Bytes

Versions: 15

Compression:

Stored size: 707 Bytes

Contents

#!/usr/bin/env ruby -rubygems

require File.join(File.dirname(__FILE__), 'authentication')

class Guidebook < StorageRoom::Entry
  before_create :log_before_create
  after_create :log_after_create
  
  before_save :log_before_save
  
  before_destroy :log_before_destroy
  
  def log_before_create
    puts "Before create '#{title}'"
  end
  
  def log_after_create
    puts "After create '#{title}'"
  end
  
  def log_before_save
    puts "Before save '#{title}'"
  end
  
  def log_before_destroy
    puts "Before destroy '#{title}'"
  end
end

guidebook_collection = StorageRoom::Collection.find('4e1e9c234250712eba00005f')

guidebook = Guidebook.new(:title => 'Bar')

guidebook.save

guidebook.destroy

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
storage_room-0.3.24 examples/callbacks.rb
storage_room-0.3.23 examples/callbacks.rb
storage_room-0.3.22 examples/callbacks.rb
storage_room-0.3.21 examples/callbacks.rb
storage_room-0.3.20 examples/callbacks.rb
storage_room-0.3.19 examples/callbacks.rb
storage_room-0.3.18 examples/callbacks.rb
storage_room-0.3.17 examples/callbacks.rb
storage_room-0.3.16 examples/callbacks.rb
storage_room-0.3.15 examples/callbacks.rb
storage_room-0.3.14 examples/callbacks.rb
storage_room-0.3.13 examples/callbacks.rb
storage_room-0.3.12 examples/callbacks.rb
storage_room-0.3.11 examples/callbacks.rb
storage_room-0.3.10 examples/callbacks.rb