Class: Runo::Workflow::Register

Inherits:
Runo::Workflow show all
Defined in:
lib/_workflow/register.rb

Overview

Author

Akira FUNAI

Copyright

Copyright © 2009-2010 Akira FUNAI

Constant Summary collapse

DEFAULT_META =
{
  :p_size     => 0,
  :conds      => {:p => '1'},
  :order      => 'id',
  :item_label => Runo::I18n.n_('item', 'items', 1),
}
DEFAULT_SUB_ITEMS =
{
  '_owner'     => {:klass => 'meta-owner'},
  '_timestamp' => {:klass => 'meta-timestamp'},
}
PERM =
{
  :create => 0b11001,
  :read   => 0b11100,
  :update => 0b11100,
  :delete => 0b11100,
}

Constants inherited from Runo::Workflow

ROLE_ADMIN, ROLE_GROUP, ROLE_NONE, ROLE_OWNER, ROLE_USER

Instance Attribute Summary

Attributes inherited from Runo::Workflow

#sd

Instance Method Summary collapse

Methods inherited from Runo::Workflow

#_get, #_hide?, #after_commit, #default_sub_items, #initialize, instance, #permit?, roles

Methods included from I18n

_, bindtextdomain, domain, domain=, find_msg, lang, lang=, merge_msg!, msg, n_, parse_msg, po_dir, po_dir=

Constructor Details

This class inherits a constructor from Runo::Workflow

Instance Method Details

#before_commitObject



27
28
29
30
31
32
33
# File 'lib/_workflow/register.rb', line 27

def before_commit
  @sd.send(:pending_items).each {|id, item|
    if id =~ Runo::REX::ID_NEW
      item.item('_owner').instance_variable_set(:@val, item.item('_id').val)
    end
  }
end

#next_action(base) ⇒ Object



35
36
37
# File 'lib/_workflow/register.rb', line 35

def next_action(base)
  (Runo.client == 'nobody') ? :done : super
end