Class: ShopDiscount
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- ShopDiscount
- Defined in:
- app/models/shop_discount.rb
Class Method Summary collapse
-
.all_including_invalid(*attrs) ⇒ Object
This will override the default scope.
Instance Method Summary collapse
-
#available_categories ⇒ Object
Return all categories minus its own.
-
#available_products ⇒ Object
Returns all products minus its own.
- #available_users ⇒ Object
Class Method Details
.all_including_invalid(*attrs) ⇒ Object
This will override the default scope
30 31 32 |
# File 'app/models/shop_discount.rb', line 30 def self.all_including_invalid(*attrs) with_exclusive_scope{find(:all,*attrs)} end |
Instance Method Details
#available_categories ⇒ Object
Return all categories minus its own
35 36 37 |
# File 'app/models/shop_discount.rb', line 35 def available_categories ShopCategory.all - categories end |
#available_products ⇒ Object
Returns all products minus its own
40 41 42 |
# File 'app/models/shop_discount.rb', line 40 def available_products ShopProduct.all - products end |
#available_users ⇒ Object
44 45 46 |
# File 'app/models/shop_discount.rb', line 44 def available_users User.all - users end |