Skip to content

Instantly share code, notes, and snippets.

View zamith's full-sized avatar

Luís Ferreira zamith

View GitHub Profile
@zamith
zamith / strings.rb
Created July 19, 2015 01:28
Format strings
str = "this is a template string with a %{placeholder} in it"
puts str % { "placeholder": "piece of text" }
# => this is a template string with a piece of text in it
@zamith
zamith / app.js
Last active August 18, 2016 14:06
helpButton.on("click", event => {
chan.push("help_needed", {})
})
@zamith
zamith / data.rb
Created August 20, 2015 20:23
DATA example
puts DATA.gets
__END__
Hello Mr. World!
diff --git a/app/models/shipping/commodity.rb b/app/models/shipping/commodity.rb
index ae7b51bc..1cdcf3f7 100644
--- a/app/models/shipping/commodity.rb
+++ b/app/models/shipping/commodity.rb
@@ -2,10 +2,13 @@ module Shipping
class Commodity < ApplicationRecord
belongs_to :shipments
+ monetize :sales_unit_price_cents
+ monetize :total_price_cents
diff --git a/app/models/shipping/commodity.rb b/app/models/shipping/commodity.rb
index ae7b51bc..1cdcf3f7 100644
--- a/app/models/shipping/commodity.rb
+++ b/app/models/shipping/commodity.rb
@@ -2,10 +2,13 @@ module Shipping
class Commodity < ApplicationRecord
belongs_to :shipments
+ monetize :sales_unit_price_cents
+ monetize :total_price_cents