En la terminal pon:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
y luego:
brew doctor
En la terminal:
[{"courseserid"=>"CS22889", | |
"created"=>Wed, 16 Apr 2014 15:01:06 +0000, | |
"modified"=>Thu, 24 Apr 2014 11:21:31 +0000, | |
"location_id"=>"lon", | |
"startdate"=>Fri, 04 Jul 2014, | |
"enddate"=>Fri, 04 Jul 2014, | |
"prod_id"=>"67", | |
"starttime"=>Mon, 01 Jan -4712 08:30:00 +0000, | |
"endtime"=>Mon, 01 Jan -4712 16:30:00 +0000, | |
"description"=> |
=> variant | |
#<Spree::Variant id: 5637, sku: "PM-AWPPM", weight: #<BigDecimal:7fd03c64cff8,'0.338E3',9(18)>, height: nil, width: nil, depth: nil, deleted_at: nil, is_master: false, product_id: 2384, cost_price: nil, position: 2, cost_currency: "USD", track_inventory: true, is_classroom: false> | |
* Todos los offerings tienen un offertypecode = "PM" * | |
=> variant.offerings | |
[#<Offering id: 7630, offering_osg_id: "O199", name: "Aerial Work Platforms Participant Manuals (10-50)", description: "Aerial Work Platforms Participant Manuals (10-50)", variant_id: 5637, code: "PM-AWPPM", price: #<BigDecimal:7fd03c611840,'0.1595E2',18(18)>,...., range: "(10..50)", offertypecode: "PM">, | |
#<Offering id: 7678, offering_osg_id: "O573", name: "Aerial Work Platforms Participant Manuals (51-100)", description: "Aerial Work Platforms Participant Manuals (51-100)", variant_id: 5637, code: "PM-AWPPM", price: #<BigDecimal:7fd03c610300,'0.1525E2',18(18)>, ...., range: "(51..100)", offertypecode: "PM">, | |
#<Offering id: 7679, offering_osg |
Failures: | |
1) Crm::SubscriptionTransactionBuilder#build_payments with no payments imported builds a new payment | |
Failure/Error: @builder.build_payments(chargify_statement) | |
NoMethodError: | |
undefined method `find_by_remote_id' for #<Class:0x007fdbeec54708> | |
# ./app/models/crm/subscription_transaction_builder.rb:22:in `block in build_payments' | |
# ./app/models/crm/subscription_transaction_builder.rb:19:in `each' | |
# ./app/models/crm/subscription_transaction_builder.rb:19:in `build_payments' | |
# ./spec/models/crm/subscription_transaction_builder_spec.rb:73:in `block (5 levels) in <top (required)>' |
def make_donation | |
if recurring? | |
customer = create_customer | |
result = recurrent_donation(customer) if customer.success? | |
else | |
result = one_time_donation | |
end | |
end |
celsius = 100 | |
fahrenheit = (celsius * 9 / 5) + 32 | |
print "The result is: " | |
print fahrenheit | |
puts “." |
>> Order.columns_hash["pay_type"] | |
=> #<ActiveRecord::ConnectionAdapters::SQLiteColumn:0x7fe673f7da80 | |
@name="pay_type", @null=true, @default=nil, @sql_type="varchar(10)", | |
@type=:string, @scale=nil, @precision=nil, @primary=false, | |
@limit=10> | |
product.price_before_type_cast #=> "29.95", a string | |
product.updated_at_before_type_cast #=> "2008-05-13 10:13:14" |
It leaves the database wide open to a SQL injection attack, is effectively the same as publishing your entire database to the whole online world.
Dont's
Lets asume that params[:name] is equals to ' OR 1 --
name = params[:name]
orders = Order.where("name = '#{name}' and pay_type = 'po'")
common: &common | |
adapter: mysql2 | |
encoding: utf8 | |
reconnect: false | |
pool: 25 | |
username: admin | |
password: secret | |
host: localhost | |
socket: /tmp/mysql.sock |