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?
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 |
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) |
# 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 |
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| |
require "rubygems" | |
require "net/telnet" | |
params = " | |
T, ##= 1 String [required] Message Type. 'T' to be passed, to define a transaction record | |
, ##= 2 Account Number. This field is no longer used. Use Field 24 | |
01, ##= 3 Integer [required] Transaction Type. ‘01’ – Purchase, ‘02’ – Refund, ‘04’ – Cash advance | |
0000, ##= 4 Integer [required] Modifier. | |
, ##= 5 Reserved, Leave Blank | |
, ##= 6 Reserved, Leave Blank |
# Verifone Error codes. There are 215 codes and they are [-1...-189] and [-999...-1014]. Just take the important ones :=( | |
error_codes = [ | |
[ code: "-0", description: "Unspecified error", action: "Contact VeriFone" ], | |
[ code: "-1", description: "Invalid transaction type", action: " Use alternative method for transaction type" ], | |
[ code: "-2", description: " ", action: "" ], | |
[ code: "-3", description: " ", action: "" ], | |
[ code: "-4", description: " ", action: "" ], | |
[ code: "-5", description: " ", action: "" ], | |
[ code: "-6", description: " ", action: "" ], | |
[ code: "-7", description: " ", action: "" ], |
the-crab$ git push heroku master | |
Counting objects: 970, done. | |
Delta compression using up to 4 threads. | |
Compressing objects: 100% (829/829), done. | |
Writing objects: 100% (970/970), 5.09 MiB | 327 KiB/s, done. | |
Total 970 (delta 110), reused 0 (delta 0) | |
-----> Ruby/Rails app detected | |
-----> Using Ruby version: ruby-1.9.3 | |
-----> Installing dependencies using Bundler version 1.3.2 |
# encoding: utf-8 | |
require "rubygems" | |
require "net/telnet" | |
# request_params = "T,,01,0000,,,,,,,10.00,0.00000,,,,,,,,,,,\n" | |
begin | |
puts 'Trying.....' | |
printo = Net::Telnet::new( "Host" => "192.168.2.37", "Port" => 25000, "Telnetmode" => true ) |
NoMethodError - undefined method `user_signed_in?' for #<#<Class:0x007ff4e946dff8>:0x007ff4eef44648>: | |
(gem) spree_core-1.3.2/app/helpers/spree/base_helper.rb:162:in `method_missing' | |
app/views/spree/shared/_nav_bar.html.erb:2:in `_6fd4240c6a08c5260228ac2bcf10cc4a' | |
(gem) actionpack-3.2.13/lib/action_view/template.rb:145:in `block in render' | |
(gem) activesupport-3.2.13/lib/active_support/notifications.rb:123:in `block in instrument' | |
(gem) activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:20:in `instrument' | |
(gem) activesupport-3.2.13/lib/active_support/notifications.rb:123:in `instrument' | |
(gem) actionpack-3.2.13/lib/action_view/template.rb:143:in `render' | |
(gem) deface-0.9.1/lib/deface/action_view_extensions.rb:37:in `render' | |
(gem) actionpack-3.2.13/lib/action_view/renderer/partial_renderer.rb:265:in `render_partial' |