Class: Pbw::Item
- Inherits:
-
Object
- Object
- Pbw::Item
- Includes:
- Mongoid::Document, Mongoid::Timestamps
- Defined in:
- app/models/pbw/item.rb
Class Method Summary collapse
- .creatable_by?(user, subject) ⇒ Boolean
- .deletable_by?(user, subject) ⇒ Boolean
- .editable_by?(user, subject) ⇒ Boolean
- .viewable_by?(user, subject) ⇒ Boolean
Instance Method Summary collapse
- #after_add(container, quantity) ⇒ Object
- #after_conversion(to, quantity) ⇒ Object
- #after_remove(container, quantity) ⇒ Object
- #after_transfer(from, to, quantity) ⇒ Object
- #before_add(container, quantity) ⇒ Object
- #before_conversion(to, quantity) ⇒ Object
- #before_remove(container, quantity) ⇒ Object
- #before_transfer(from, to, quantity) ⇒ Object
Class Method Details
.creatable_by?(user, subject) ⇒ Boolean
18 19 20 |
# File 'app/models/pbw/item.rb', line 18 def self.creatable_by?(user, subject) user.admin? end |
.deletable_by?(user, subject) ⇒ Boolean
26 27 28 |
# File 'app/models/pbw/item.rb', line 26 def self.deletable_by?(user, subject) user.admin? end |
.editable_by?(user, subject) ⇒ Boolean
22 23 24 |
# File 'app/models/pbw/item.rb', line 22 def self.editable_by?(user, subject) user.admin? end |
.viewable_by?(user, subject) ⇒ Boolean
14 15 16 |
# File 'app/models/pbw/item.rb', line 14 def self.viewable_by?(user, subject) true end |
Instance Method Details
#after_add(container, quantity) ⇒ Object
35 36 37 |
# File 'app/models/pbw/item.rb', line 35 def after_add(container, quantity) # stub method end |
#after_conversion(to, quantity) ⇒ Object
62 63 64 |
# File 'app/models/pbw/item.rb', line 62 def after_conversion(to, quantity) # stub method end |
#after_remove(container, quantity) ⇒ Object
44 45 46 |
# File 'app/models/pbw/item.rb', line 44 def after_remove(container, quantity) # stub method end |
#after_transfer(from, to, quantity) ⇒ Object
53 54 55 |
# File 'app/models/pbw/item.rb', line 53 def after_transfer(from, to, quantity) # stub method end |
#before_add(container, quantity) ⇒ Object
30 31 32 33 |
# File 'app/models/pbw/item.rb', line 30 def before_add(container, quantity) # stub method true end |
#before_conversion(to, quantity) ⇒ Object
57 58 59 60 |
# File 'app/models/pbw/item.rb', line 57 def before_conversion(to, quantity) # stub method true end |
#before_remove(container, quantity) ⇒ Object
39 40 41 42 |
# File 'app/models/pbw/item.rb', line 39 def before_remove(container, quantity) # stub method true end |
#before_transfer(from, to, quantity) ⇒ Object
48 49 50 51 |
# File 'app/models/pbw/item.rb', line 48 def before_transfer(from, to, quantity) # stub method true end |