Sha256: b92a02c317bacd30e0e868b755e9e60495334a5bc241082c9e988e678c4afb94

Contents?: true

Size: 1.4 KB

Versions: 3

Compression:

Stored size: 1.4 KB

Contents

class User < ActiveRecord::Base
  def self.table_name; 'users'; end
  def self.primary_key; 'id'; end

  def to_str; id; end
end

class NotApprovable < ActiveRecord::Base
  def self.table_name; 'nots'; end
  def self.primary_key; 'id'; end
end

class DefaultApprovable < ActiveRecord::Base
  def self.table_name; 'defaults'; end
  def self.primary_key; 'id'; end

  acts_as_approvable
end

class CreatesApprovable < ActiveRecord::Base
  def self.table_name; 'creates'; end
  def self.primary_key; 'id'; end

  acts_as_approvable :on => :create
end

class CreatesWithStateApprovable < ActiveRecord::Base
  def self.table_name; 'creates'; end
  def self.primary_key; 'id'; end

  acts_as_approvable :on => :create, :state_field => :state
end

class UpdatesApprovable < ActiveRecord::Base
  def self.table_name; 'updates'; end
  def self.primary_key; 'id'; end

  acts_as_approvable :on => :update
end

class UpdatesOnlyFieldsApprovable < ActiveRecord::Base
  def self.table_name; 'updates'; end
  def self.primary_key; 'id'; end

  acts_as_approvable :on => :update, :only => [:body]
end

class UpdatesIgnoreFieldsApprovable < ActiveRecord::Base
  def self.table_name; 'updates'; end
  def self.primary_key; 'id'; end

  acts_as_approvable :on => :update, :ignore => [:title]
end

class OwnedApproval < ActiveRecord::Base
  def self.table_name; 'approvals'; end
  def self.primary_key; 'id'; end

  include ActsAsApprovable::Ownership
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
acts-as-approvable-0.6.9.1 spec/support/models.rb
acts-as-approvable-0.6.9 spec/support/models.rb
acts-as-approvable-0.6.8.1 spec/support/models.rb