Module: TentD::Model::RandomPublicId

Included in:
App, AppAuthorization, Follower, Following, Group, Post
Defined in:
lib/tentd/model/random_public_id.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/tentd/model/random_public_id.rb', line 4

def self.included(base)
  base.extend(ClassMethods)
  base.class_eval do
    property :public_id, String, :required => true, :unique_index => :upublic_id, :default => lambda { |*args| random_id }
    self.raise_on_save_failure = true
  end
end