admin_product_path
How do i deal with the update method accepting variant_ids? Is it the same way the create method creates each variant from the array of prototypes?
| module AuthenticationHelpers | |
| def sign_in_as!(user) | |
| visit '/login' | |
| fill_in 'Email', :with => user.email | |
| fill_in 'Password', :with => "secret" | |
| click_button 'Login' | |
| end | |
| end | |
| RSpec.configure do |config| |
| # I have a product with a master_SKU = 'BBLZ-A0-00000' | |
| # auto generate a variant SKU for each product variant | |
| # @return variant_SKU = 'BBLZ-A0-00001' OR 'BBLZ-A0-00020' | |
| variants = Product.variants | |
| variants_len = variants.length | |
| i = 0 | |
| master_SKU = 'BBLZ-A0-' | |
| v_sku = '00000' | |
| while i < variants_len |
| class Friendship < ActiveRecord::Base | |
| attr_accessible :friend_id, :user_id, :status | |
| belongs_to :user | |
| belongs_to :friend, :class_name => 'User', :counter_cache => :friends_count | |
| def self.request(user, friend) | |
| unless user == friend or Friendship.where(:user_id => user, :friend_id => friend).exists? | |
| transaction do | |
| create({:user => user, :friend => friend, :status => 'pending'}, :without_protection => true) | |
| create({:user => friend, :friend => user, :status => 'requested'}, :without_protection => true) |
| class Property | |
| include DataMapper::Resource | |
| property :id, Serial | |
| property :name, String, required: true | |
| property :price, Integer, required: true | |
| property :description, Text | |
| has 1, :address | |
| has n, :rooms |