piggybak 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4470f4fbdba7afd56c0a7e3613540222c9e86c2a
4
- data.tar.gz: da084dbabde7d4edaa8c435399961701ccf8a21e
3
+ metadata.gz: c663b467bee27208e6621f6c0c20cb1e743aca56
4
+ data.tar.gz: fe214ee6cc3d432de2f17a646412eff21b8f0ae6
5
5
  SHA512:
6
- metadata.gz: 1b07bb758a5d9ecf2f8021ec00d26e747df8dead296a6b8a12506a9f275e1e19794f5f51765ae241f39109a1e152102f6e117b49e3c4f3be36fe9223b5b9d677
7
- data.tar.gz: 16f9e4f36cd536d3a0847a1c6a9ce73c7ec892fb366828921e6e4b14e59d8d7de24682c1a5f051592b5ce2f250db0b638ebf84af262afea6717f7c3573b0db16
6
+ metadata.gz: f478b95cce8995d8f355d735140046f0250965fa32245b810ecf7268eae25cfa7cde8b410a19dd68ef1dc0fe3e8fdcb4235ba663270bfb33553b43d196309cf9
7
+ data.tar.gz: 556938bb4aef52ae325d0b2ba24c1664c5adf05d950de9474112293ba989c8d15962a076636edfe4705c17c37581a68817c5404ffbb530cbc12bb34a23bf7de3
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- piggybak (0.7.1)
4
+ piggybak (0.7.2)
5
5
  activemerchant
6
6
  countries
7
7
  rack-ssl-enforcer
@@ -1,18 +1,30 @@
1
1
  require "countries"
2
2
 
3
3
  class PopulateCountriesAndStates < ActiveRecord::Migration
4
- def change
4
+ def up
5
+ Piggybak::Country.class_eval do
6
+ self.table_name = 'countries'
7
+ end
8
+ Piggybak::State.class_eval do
9
+ self.table_name = 'states'
10
+ end
11
+
5
12
  ISO3166::Country.all.each do |country_array|
6
13
  name = country_array[0]
7
14
  abbr = country_array[1]
15
+
8
16
  country = Piggybak::Country.create :name => name, :abbr => abbr
9
17
 
10
18
  iso3166_country = ISO3166::Country.new(abbr)
11
19
  iso3166_country.states.each do |key, value|
12
- abbr = key
13
- name = value["name"]
20
+ name = key
21
+ abbr = value["name"]
14
22
  Piggybak::State.create! :name => name, :abbr => abbr, :country => country
15
23
  end
16
24
  end
17
25
  end
26
+
27
+ def down
28
+ # nothing here
29
+ end
18
30
  end
@@ -1,10 +1,26 @@
1
1
  class LineItemRearchitecture < ActiveRecord::Migration
2
2
  def up
3
+ Piggybak::Shipment.class_eval do
4
+ self.table_name = 'shipments'
5
+ end
6
+ Piggybak::Payment.class_eval do
7
+ self.table_name = 'payments'
8
+ end
9
+ Piggybak::Adjustment.class_eval do
10
+ self.table_name = 'adjustments'
11
+ end
12
+ Piggybak::Order.class_eval do
13
+ self.table_name = 'orders'
14
+ end
15
+
3
16
  add_column :line_items, :line_item_type, :string, :null => false, :default => "sellable"
4
17
  rename_column :line_items, :price, :unit_price
5
18
  rename_column :line_items, :total, :price
6
19
  change_column :line_items, :sellable_id, :integer, :null => true
7
20
  add_column :line_items, :sort, :integer, :null => false, :default => 0
21
+ change_table(:line_items) do |t|
22
+ t.timestamps
23
+ end
8
24
 
9
25
  add_column :shipments, :line_item_id, :integer
10
26
  add_column :payments, :line_item_id, :integer
@@ -64,6 +80,9 @@ class LineItemRearchitecture < ActiveRecord::Migration
64
80
  add_column :orders, :tax_charge, :decimal, :null => false, :default => 0.0
65
81
 
66
82
  to_delete = []
83
+ Piggybak::LineItem.class_eval do
84
+ self.table_name = 'line_items'
85
+ end
67
86
  Piggybak::LineItem.all.each do |line_item|
68
87
  if line_item.line_item_type == "payment"
69
88
  line_item.payment.update_attributes({ :order_id => line_item.order_id, :total => line_item.price })
@@ -1,3 +1,3 @@
1
1
  module Piggybak
2
- VERSION = "0.7.1"
2
+ VERSION = "0.7.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: piggybak
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steph Skardal
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-04-07 00:00:00.000000000 Z
13
+ date: 2014-05-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: countries