Class: Spree::Supplier

Inherits:
Base
  • Object
show all
Extended by:
FriendlyId
Defined in:
app/models/spree/supplier.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#passwordObject

Returns the value of attribute password.



6
7
8
# File 'app/models/spree/supplier.rb', line 6

def password
  @password
end

#password_confirmationObject

Returns the value of attribute password_confirmation.



6
7
8
# File 'app/models/spree/supplier.rb', line 6

def password_confirmation
  @password_confirmation
end

Instance Method Details

#deleted?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'app/models/spree/supplier.rb', line 49

def deleted?
  deleted_at.present?
end

#stock_locations_with_available_stock_items(variant) ⇒ Object

Retreive the stock locations that has available stock items of the given variant



63
64
65
# File 'app/models/spree/supplier.rb', line 63

def stock_locations_with_available_stock_items(variant)
  stock_locations.select { |sl| sl.available?(variant) }
end

#user_ids_stringObject



53
54
55
# File 'app/models/spree/supplier.rb', line 53

def user_ids_string
  user_ids.join(',')
end

#user_ids_string=(s) ⇒ Object



57
58
59
# File 'app/models/spree/supplier.rb', line 57

def user_ids_string=(s)
  self.user_ids = s.to_s.split(',').map(&:strip)
end