Class: Product

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
ActionView::Helpers::NumberHelper
Defined in:
app/models/product.rb

Instance Method Summary collapse

Instance Method Details

#photos?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'app/models/product.rb', line 8

def photos?
  self.photos.present?
end

#price?Boolean

Returns:

  • (Boolean)


12
# File 'app/models/product.rb', line 12

def price? ; self.price_exists?(self.price)  ; end

#pricefObject



13
# File 'app/models/product.rb', line 13

def pricef ; self.format_price(self.price)   ; end

#sale?Boolean

Returns:

  • (Boolean)


15
# File 'app/models/product.rb', line 15

def sale?       ; self.price_exists?(self.sale_price)  ; end

#sale_pricefObject



16
# File 'app/models/product.rb', line 16

def sale_pricef ; self.format_price(self.sale_price)   ; end