This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Uno | |
def queue_mode | |
@queue_mode ||= :single | |
end | |
def queue_mode=(value) | |
@queue_mode = value | |
end | |
def enqueue_mode(mode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%h2 | |
Brands | |
.brands | |
-('A'..'Z').each do |letter| | |
-li_brands="" | |
[email protected] do |brand| | |
-if brand.name.slice(0..0).upcase == letter | |
-li_brands+="<li>#{link_to(brand.name,{:controller=>:brands, :action => :show, :id =>brand.to_param}, :class=>"#{brand.name}")}</li>" | |
-unless li_brands=="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.use_certificate(code, cart) | |
return false if cart.nil? | |
return cart.set_gift(0, nil) if code.blank? | |
return false if cart.gift_code == code | |
certificate = self.certificate(code).first | |
unless certificate.blank? || certificate.state == 'in_cart' | |
unless certificate.state == 'empty' | |
total = cart.total + cart.gift_discount | |
if certificate.amount < total |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.clear.sizes | |
- @product.grouped_attributes.each do |attribute,upcs| | |
= attribute.name | |
%br | |
%ul.sizes.details | |
- attribute.cached_size_values.each do |size| | |
- if upc = upcs.detect {|u| u.size == size} | |
%li | |
= check_box_tag "post[upc_id]", storefront_update_sellers_list_path(upc.id), false, :class => "post_upc_class", :id => upc.id | |
%a{:href => "#", :class => "chk-select"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%div | |
Este es tu nombre de usuario: | |
= "#{current_user.name}" | |
Gracias por ser como eres, vales mil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SimpleCov.at_exit do | |
percent = SimpleCov.result.covered_percent | |
unless percent == 100.0 | |
puts "Coverage is not at 100% !!!!" | |
Kernel.exit(1) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- i ||= 0 | |
= f.fields_for :options do |ff| | |
- i += 1 | |
%label Option #{i} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@javascript | |
Scenario: Add image for different countries | |
Given a country exists with name: "Mexico", locale: "en_MX" | |
And a country exists with name: "United States", locale: "en_US" | |
And an event exists with name: "Huge Sale" | |
When I go to the edit event page for "Huge Sale" | |
And I select "United States" as the country | |
When I attach the file "spec/support/logo.jpg" to "Image" | |
And I press "Update" | |
Then I should see an image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def display_item(item) | |
to_return = [] | |
if item.upc? | |
if item.item | |
to_return << item.quantity | |
to_return << "<a href='#{edit_admin_product_path(item.item.product.id)}'>#{item.item.product.name}</a>" | |
to_return << item.item.product_attribute.name | |
to_return << item.item.size.name | |
end | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias gs="git status" | |
alias gc="git commit" | |
alias gp="git push" | |
alias gpl="git pull" | |
alias r=rails | |
alias ga="git add" | |
alias gr="git rm" | |
alias clean="find . -name \"*.orig\" -print -exec rm {} \;" | |
alias be="bundle exec" | |
alias ber="bundle exec rake" |