Class: Cats::Core::Store
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Cats::Core::Store
- Defined in:
- app/models/cats/core/store.rb
Class Method Summary collapse
- .ransackable_associations(_auth_object = nil) ⇒ Object
- .ransackable_attributes(_auth_object = nil) ⇒ Object
Instance Method Summary collapse
Class Method Details
.ransackable_associations(_auth_object = nil) ⇒ Object
50 51 52 |
# File 'app/models/cats/core/store.rb', line 50 def self.ransackable_associations(_auth_object = nil) %w[stacks warehouse] end |
.ransackable_attributes(_auth_object = nil) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'app/models/cats/core/store.rb', line 32 def self.ransackable_attributes(_auth_object = nil) %w[ available_space code gangway_corner_dist gangway_length gangway_width has_gangway height length name temporary usable_space warehouse_id width ] end |
Instance Method Details
#update_usable_space ⇒ Object
26 27 28 29 30 |
# File 'app/models/cats/core/store.rb', line 26 def update_usable_space self.usable_space = (length - 2) * (width - 2) self.usable_space -= (gangway_length * gangway_width) if has_gangway self.available_space = self.usable_space end |