Module: Daddy::Models::CrudExtension
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/daddy/models/crud_extension.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #creatable_by?(user) ⇒ Boolean
- #deletable_by?(user) ⇒ Boolean
- #destroy_logically! ⇒ Object
- #readable_by?(user) ⇒ Boolean
- #updatable_by?(user) ⇒ Boolean
Instance Method Details
#creatable_by?(user) ⇒ Boolean
10 11 12 |
# File 'lib/daddy/models/crud_extension.rb', line 10 def creatable_by?(user) readable_by?(user) end |
#deletable_by?(user) ⇒ Boolean
18 19 20 |
# File 'lib/daddy/models/crud_extension.rb', line 18 def deletable_by?(user) readable_by?(user) end |
#destroy_logically! ⇒ Object
22 23 24 25 |
# File 'lib/daddy/models/crud_extension.rb', line 22 def destroy_logically! self.deleted = true save! end |
#readable_by?(user) ⇒ Boolean
6 7 8 |
# File 'lib/daddy/models/crud_extension.rb', line 6 def readable_by?(user) true end |
#updatable_by?(user) ⇒ Boolean
14 15 16 |
# File 'lib/daddy/models/crud_extension.rb', line 14 def updatable_by?(user) readable_by?(user) end |