Skip to content

Instantly share code, notes, and snippets.

View gus4no's full-sized avatar

Gustavo Robles gus4no

View GitHub Profile
@gus4no
gus4no / guilded_rose.rb
Created February 25, 2016 23:46
Guilded Rose no specs
def update_quality(items)
items.each do |item|
if item.name != 'Aged Brie' && item.name != 'Backstage passes to a TAFKAL80ETC concert'
if item.quality > 0
if item.name != 'Sulfuras, Hand of Ragnaros'
item.quality -= 1
end
end
else
if item.quality < 50
17:52:53 web.1 |
17:52:53 web.1 |
17:52:53 web.1 | Started POST "/users/alert_rules" for 127.0.0.1 at 2012-06-18 17:52:53 -0500
17:52:53 web.1 | [Barista] Compiling all scripts for barista
17:52:53 web.1 | [Barista] Compiling all coffeescripts
17:52:53 web.1 | [Barista] Copying all javascripts
17:52:53 web.1 | Processing by AlertRulesController#create as JS
17:52:53 web.1 | Parameters: {"utf8"=>"✓", "authenticity_token"=>"h2gEFkP1MbMRwdFAQKW89FPIn1f2NrR56o0IRBPYrnE=", "alert_rule"=>{"company_id"=>"114250", "user_id"=>"365", "alert_id"=>"1", "name"=>"test 5", "condition_type"=>"Above", "competitor"=>"Lowest price of all competitors", "competitor_id"=>"", "range"=>"", "range_type"=>"%", "product_condition"=>"0", "item_filter_attributes"=>{"company_id"=>"114250", "category_id"=>"74395", "brand"=>"3M", "price_min"=>"", "price_max"=>""}}, "search_item"=>{"competitor"=>"competitor"}, "competitors_query"=>"", "category_query"=>"", "brand_query"=>"", "commit"=>"Sa
# Basic tagging system for mongoid documents.
# jpemberthy 2010
#
# class User
# include Mongoid::Document
# include Mongoid::Document::Taggable
# end
#
# @user = User.new(:name => "Bobby")
# @user.tag_list = "awesome, slick, hefty"