comable_core 0.1.0 → 0.2.0

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: 8b1fe7b5731e6c24383b541a3bd2552839440b58
4
- data.tar.gz: b9c63920adae0de9f6c12a695e90d69a4a1ff576
3
+ metadata.gz: a04e83098af7da04af0085988beee96d9dfaf150
4
+ data.tar.gz: 30d646a65f0e590746934f8f1f34707777d54a4f
5
5
  SHA512:
6
- metadata.gz: 08063df020955b295602e419a111c870572ee0fa404ea1e1a48ae2d08e5d914da7ce4914939c2089da7ef39a8e85024a29bae5cf958b1362fb0080f267643ae5
7
- data.tar.gz: 306fc8020d99c8c8195c3c7d3556008545d7c9d2da04d9457bc51ad34e1ac1948ca4938d7b7f790d9923569150064fe54774686b30708314b3cd60b83c73b09e
6
+ metadata.gz: 0b51d3919bf4bd8ffc65b79d3c0142214e56ce4e1b55ed5b137b57e07e542a7231bc9ce32b1e71c24c6c301997f55e50e7dea2306ec990be9d9359391d8a593f
7
+ data.tar.gz: fe8b54aec6b72c0cd10a76fb86abe592de36b273879d3ffc1642ef9fda419dc25e9aa62c92fef070eb0e1174ef318d3b5edf19df4adfeedfe29dd709c158cead
data/Rakefile CHANGED
@@ -16,27 +16,69 @@ end
16
16
  APP_RAKEFILE = File.expand_path('../spec/dummy/Rakefile', __FILE__)
17
17
  load 'rails/tasks/engine.rake'
18
18
 
19
- Bundler::GemHelper.install_tasks
19
+ if File.exist?('comable.gemspec')
20
+ $LOAD_PATH.unshift File.expand_path('..', __FILE__)
21
+ require 'tasks/release'
20
22
 
21
- # from https://github.com/rspec/rspec-rails/issues/936
22
- task 'test:prepare'
23
+ namespace :app do
24
+ namespace :spec do
25
+ desc 'Run the code examples'
26
+ RSpec::Core::RakeTask.new(:all) do |t|
27
+ FRAMEWORKS.each do |framework|
28
+ t.pattern << ",#{framework}/spec/**{,/*/**}/*_spec.rb"
29
+ end
30
+ end
23
31
 
24
- task :rubocop do
25
- exec 'rubocop'
26
- end
32
+ FRAMEWORKS.each do |framework|
33
+ desc "Run the code examples in #{framework}/spec"
34
+ RSpec::Core::RakeTask.new(framework) do |t|
35
+ t.pattern = "../#{framework}/spec/**{,/*/**}/*_spec.rb"
36
+ end
37
+ end
38
+ end
39
+ end
27
40
 
28
- namespace :app do
29
- namespace :spec do
30
- desc 'Run the code examples'
31
- RSpec::Core::RakeTask.new(:all) do |t|
32
- t.pattern << ',backend/spec/**{,/*/**}/*_spec.rb'
41
+ namespace :db do
42
+ task 'migrate' => 'app:db:migrate'
43
+ task 'app:db:migrate' => 'migrate:all'
44
+
45
+ namespace :migrate do
46
+ task :all do
47
+ FRAMEWORKS.each do |framework|
48
+ command = "cd #{framework} && test -d db && bundle exec rake db:migrate RAILS_ENV=#{Rails.env}"
49
+ puts command
50
+ system command
51
+ end
52
+ end
33
53
  end
34
54
 
35
- desc 'Run the code examples in backend/spec'
36
- RSpec::Core::RakeTask.new(:backend) do |t|
37
- t.pattern = '../backend/spec/**{,/*/**}/*_spec.rb'
55
+ namespace :migrate do
56
+ task 'reset' => 'app:db:migrate:reset'
57
+ task 'app:db:migrate:reset' => 'app:db:migrate'
58
+ task 'app:db:migrate' => 'reset:all'
59
+
60
+ namespace :reset do
61
+ task :all do
62
+ FRAMEWORKS.each do |framework|
63
+ command = "cd #{framework} && test -d db && bundle exec rake db:migrate:reset RAILS_ENV=#{Rails.env}"
64
+ puts command
65
+ system command
66
+ end
67
+ end
68
+ end
38
69
  end
39
70
  end
71
+
72
+ task default: ['app:spec:all', 'rubocop']
40
73
  end
41
74
 
42
- task default: ['app:spec:all', 'rubocop']
75
+ task default: ['app:spec', 'rubocop']
76
+
77
+ Bundler::GemHelper.install_tasks
78
+
79
+ # from https://github.com/rspec/rspec-rails/issues/936
80
+ task 'test:prepare'
81
+
82
+ task :rubocop do
83
+ exec 'rubocop'
84
+ end
@@ -1,11 +1,36 @@
1
1
  module Comable
2
2
  module ApplicationHelper
3
+ def current_store
4
+ @current_store || load_store
5
+ end
6
+
3
7
  def current_customer
4
8
  @current_customer || load_customer
5
9
  end
6
10
 
11
+ def current_order
12
+ current_customer.incomplete_order
13
+ end
14
+
15
+ def name_with_honorific(name)
16
+ I18n.t('comable.honorific', name: name)
17
+ end
18
+
19
+ def name_with_quantity(name, quantity)
20
+ return name unless quantity
21
+ return name if quantity <= 1
22
+ [
23
+ name,
24
+ "x#{quantity}"
25
+ ].join(' ')
26
+ end
27
+
7
28
  private
8
29
 
30
+ def load_store
31
+ @current_store = Comable::Store.instance
32
+ end
33
+
9
34
  def load_customer
10
35
  @current_customer = logged_in_customer
11
36
  @current_customer ||= Comable::Customer.new(cookies)
@@ -0,0 +1,25 @@
1
+ module Comable
2
+ class OrderMailer < ActionMailer::Base
3
+ helper Comable::ApplicationHelper
4
+ helper_method :subject_for
5
+
6
+ def complete(order)
7
+ @order = order
8
+ mail(from: current_store.email_sender, to: order.email, subject: subject_for(order))
9
+ end
10
+
11
+ private
12
+
13
+ def current_store
14
+ Comable::Store.instance
15
+ end
16
+
17
+ def subject_for(order)
18
+ [
19
+ current_store.name,
20
+ I18n.t('comable.order_mailer.complete.subject'),
21
+ order.code
22
+ ].join(' ')
23
+ end
24
+ end
25
+ end
@@ -1,6 +1,5 @@
1
1
  module Comable
2
2
  class Customer < ActiveRecord::Base
3
- include Decoratable
4
3
  include CartOwner
5
4
 
6
5
  has_many :comable_orders, class_name: Comable::Order.name, foreign_key: table_name.singularize.foreign_key
@@ -62,7 +61,7 @@ module Comable
62
61
  def initialize_incomplete_order
63
62
  orders = find_incomplete_orders
64
63
  return orders.first if orders.any?
65
- order = orders.create(family_name: family_name, first_name: first_name, order_deliveries_attributes: [{ family_name: family_name, first_name: first_name }])
64
+ order = orders.create(family_name: family_name, first_name: first_name, email: email, order_deliveries_attributes: [{ family_name: family_name, first_name: first_name }])
66
65
  @cookies.permanent.signed[:guest_token] = order.guest_token if not_logged_in?
67
66
  order
68
67
  end
@@ -1,9 +1,8 @@
1
1
  module Comable
2
2
  class Order < ActiveRecord::Base
3
- include Decoratable
4
-
5
3
  belongs_to :customer, class_name: Comable::Customer.name, foreign_key: Comable::Customer.table_name.singularize.foreign_key, autosave: false
6
4
  belongs_to :payment, class_name: Comable::Payment.name, foreign_key: Comable::Payment.table_name.singularize.foreign_key, autosave: false
5
+ belongs_to :shipment_method, class_name: Comable::ShipmentMethod.name, autosave: false
7
6
  has_many :order_deliveries, dependent: :destroy, class_name: Comable::OrderDelivery.name, foreign_key: table_name.singularize.foreign_key
8
7
 
9
8
  accepts_nested_attributes_for :order_deliveries
@@ -12,7 +11,9 @@ module Comable
12
11
  complete_order.validates :code, presence: true
13
12
  complete_order.validates :first_name, presence: true
14
13
  complete_order.validates :family_name, presence: true
15
- complete_order.validates Comable::Payment.table_name.singularize.foreign_key, presence: true
14
+ complete_order.validates :email, presence: true
15
+ complete_order.validates :shipment_fee, presence: true
16
+ complete_order.validates :total_price, presence: true
16
17
  end
17
18
 
18
19
  with_options if: :incomplete? do |incomplete_order|
@@ -20,6 +21,8 @@ module Comable
20
21
  incomplete_order.validates :guest_token, uniqueness: { scope: [:guest_token, :completed_at] }, if: :guest_token
21
22
  end
22
23
 
24
+ define_model_callbacks :complete
25
+ before_complete :precomplete
23
26
  before_create :generate_guest_token
24
27
 
25
28
  scope :complete, -> { where.not(completed_at: nil) }
@@ -33,11 +36,9 @@ module Comable
33
36
 
34
37
  def complete
35
38
  # TODO: トランザクションの追加
36
- precomplete
37
- # TODO: コールバック化
38
- # define_model_callbacks :complete
39
- before_complete
40
- save!
39
+ run_callbacks :complete do
40
+ save_to_complete!
41
+ end
41
42
  self
42
43
  end
43
44
 
@@ -49,29 +50,47 @@ module Comable
49
50
  completed_at.nil?
50
51
  end
51
52
 
52
- # 時価合計を取得
53
- def current_total_price
54
- order_deliveries.map(&:order_details).flatten.each(&:current_subtotal_price)
53
+ # 氏名を取得
54
+ def full_name
55
+ [family_name, first_name].join(' ')
56
+ end
57
+
58
+ # 時価商品合計を取得
59
+ def current_item_total_price
60
+ order_deliveries.map(&:order_details).flatten.sum(&:current_subtotal_price)
55
61
  end
56
62
 
57
- # 売価合計を取得
58
- def total_price
59
- order_deliveries.map(&:order_details).flatten.each(&:subtotal_price)
63
+ # 売価商品合計を取得
64
+ def item_total_price
65
+ order_deliveries.map(&:order_details).flatten.sum(&:subtotal_price)
66
+ end
67
+
68
+ # 時価送料を取得
69
+ def current_shipment_fee
70
+ shipment_method.try(:fee) || 0
71
+ end
72
+
73
+ # 時価合計を取得
74
+ def current_total_price
75
+ current_item_total_price + current_shipment_fee
60
76
  end
61
77
 
62
78
  private
63
79
 
64
- def before_complete
80
+ def save_to_complete!
65
81
  self.completed_at = Time.now
82
+ self.shipment_fee = current_shipment_fee
83
+ self.total_price = current_total_price
66
84
  generate_code
67
- order_deliveries.each(&:before_complete)
85
+ order_deliveries.each(&:save_to_complete)
86
+ save!
68
87
  end
69
88
 
70
89
  def valid_stock
71
90
  order_deliveries.map(&:order_details).flatten.each do |order_detail|
72
- return errors.add :base, "「#{order_detail.stock.name}」の注文数が不正です。" if order_detail.quantity <= 0
91
+ return errors.add :base, "「#{order_detail.stock.name_with_sku}」の注文数が不正です。" if order_detail.quantity <= 0
73
92
  quantity = order_detail.stock.quantity - order_detail.quantity
74
- return errors.add :base, "「#{order_detail.stock.name}」の在庫が不足しています。" if quantity < 0
93
+ return errors.add :base, "「#{order_detail.stock.name_with_sku}」の在庫が不足しています。" if quantity < 0
75
94
  end
76
95
  end
77
96
 
@@ -1,7 +1,5 @@
1
1
  module Comable
2
2
  class OrderDelivery < ActiveRecord::Base
3
- include Decoratable
4
-
5
3
  belongs_to :order, class_name: Comable::Order.name, foreign_key: Comable::Order.table_name.singularize.foreign_key
6
4
  has_many :order_details, dependent: :destroy, class_name: Comable::OrderDetail.name, foreign_key: table_name.singularize.foreign_key
7
5
 
@@ -9,8 +7,13 @@ module Comable
9
7
  delegate :guest_token, to: :order
10
8
  delegate :complete?, to: :order
11
9
 
12
- def before_complete
13
- order_details.each(&:before_complete)
10
+ def save_to_complete
11
+ order_details.each(&:save_to_complete)
12
+ end
13
+
14
+ # 氏名を取得
15
+ def full_name
16
+ [family_name, first_name].join(' ')
14
17
  end
15
18
  end
16
19
  end
@@ -1,6 +1,7 @@
1
1
  module Comable
2
2
  class OrderDetail < ActiveRecord::Base
3
- include Decoratable
3
+ include Comable::SkuItem
4
+ include Comable::SkuChoice
4
5
 
5
6
  belongs_to :stock, class_name: Comable::Stock.name, foreign_key: Comable::Stock.table_name.singularize.foreign_key
6
7
  belongs_to :order_delivery, class_name: Comable::OrderDelivery.name, foreign_key: Comable::OrderDelivery.table_name.singularize.foreign_key
@@ -11,11 +12,18 @@ module Comable
11
12
  delegate :guest_token, to: :order_delivery
12
13
  delegate :complete?, to: :order_delivery
13
14
 
14
- def before_complete
15
- save_price
15
+ before_save :save_to_add_cart, unless: :complete?
16
+
17
+ def save_to_complete
18
+ self.attributes = current_attributes
16
19
  decrement_stock
17
20
  end
18
21
 
22
+ # TODO: カート投入時との差額表示
23
+ def save_to_add_cart
24
+ self.attributes = current_attributes
25
+ end
26
+
19
27
  # 時価を取得
20
28
  def current_price
21
29
  stock.price
@@ -31,12 +39,22 @@ module Comable
31
39
  price * quantity
32
40
  end
33
41
 
42
+ private
43
+
34
44
  def decrement_stock
35
45
  stock.decrement!(quantity: quantity)
36
46
  end
37
47
 
38
- def save_price
39
- self.price = stock.price
48
+ def current_attributes
49
+ {
50
+ name: product.name,
51
+ code: stock.code,
52
+ price: stock.price,
53
+ sku_h_item_name: product.sku_h_item_name,
54
+ sku_v_item_name: product.sku_v_item_name,
55
+ sku_h_choice_name: stock.sku_h_choice_name,
56
+ sku_v_choice_name: stock.sku_v_choice_name
57
+ }
40
58
  end
41
59
  end
42
60
  end
@@ -1,7 +1,5 @@
1
1
  module Comable
2
2
  class Payment < ActiveRecord::Base
3
- include Decoratable
4
-
5
3
  validates :name, presence: true
6
4
  validates :payment_method_type, presence: true
7
5
  validates :payment_method_kind, presence: true
@@ -1,6 +1,6 @@
1
1
  module Comable
2
2
  class Product < ActiveRecord::Base
3
- include Decoratable
3
+ include Comable::SkuItem
4
4
 
5
5
  has_many :stocks, class_name: Comable::Stock.name, foreign_key: table_name.singularize.foreign_key
6
6
  after_create :create_stock
@@ -13,16 +13,6 @@ module Comable
13
13
  !unsold?
14
14
  end
15
15
 
16
- def sku_h?
17
- sku_h_item_name.present?
18
- end
19
-
20
- def sku_v?
21
- sku_v_item_name.present?
22
- end
23
-
24
- alias_method :sku?, :sku_h?
25
-
26
16
  private
27
17
 
28
18
  def create_stock
@@ -0,0 +1,6 @@
1
+ module Comable
2
+ class ShipmentMethod < ActiveRecord::Base
3
+ scope :activated, -> { where(activate_flag: true) }
4
+ scope :deactivated, -> { where(activate_flag: false) }
5
+ end
6
+ end
@@ -4,7 +4,7 @@ module Comable
4
4
  # 商品に複数紐付き、品数やSKU(Stock Keeping Unit)情報を保持する。
5
5
  #
6
6
  class Stock < ActiveRecord::Base
7
- include Decoratable
7
+ include Comable::SkuChoice
8
8
 
9
9
  belongs_to :product, class_name: Comable::Product.name, foreign_key: Comable::Product.table_name.singularize.foreign_key
10
10
 
@@ -28,16 +28,10 @@ module Comable
28
28
  # @!endgroup
29
29
  #
30
30
 
31
+ delegate :name, to: :product
31
32
  delegate :price, to: :product
32
33
  delegate :sku?, to: :product
33
34
 
34
- def name
35
- return product.name unless product.sku?
36
- sku_name = sku_h_choice_name
37
- sku_name += '/' + sku_v_choice_name if sku_v_choice_name.present?
38
- product.name + "(#{sku_name})"
39
- end
40
-
41
35
  # 在庫の有無を取得する
42
36
  #
43
37
  # @example
@@ -0,0 +1,17 @@
1
+ module Comable
2
+ class Store < ActiveRecord::Base
3
+ class << self
4
+ def instance
5
+ Comable::Store.first || Comable::Store.new(name: default_store_name)
6
+ end
7
+
8
+ def default_store_name
9
+ 'Comable store'
10
+ end
11
+ end
12
+
13
+ def email_activate?
14
+ email_activate_flag && email_sender.present?
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,14 @@
1
+ module Comable
2
+ #
3
+ # SKU選択肢
4
+ # 商品と注文明細にSKU選択肢としての機能を付与するためのモジュール
5
+ #
6
+ module SkuChoice
7
+ def name_with_sku
8
+ return name unless sku?
9
+ sku_name = sku_h_choice_name
10
+ sku_name += '/' + sku_v_choice_name if sku_v_choice_name.present?
11
+ name + "(#{sku_name})"
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,17 @@
1
+ module Comable
2
+ #
3
+ # SKU項目
4
+ # 商品と注文明細にSKU項目としての機能を付与するためのモジュール
5
+ #
6
+ module SkuItem
7
+ def sku_h?
8
+ sku_h_item_name.present?
9
+ end
10
+
11
+ def sku_v?
12
+ sku_v_item_name.present?
13
+ end
14
+
15
+ alias_method :sku?, :sku_h?
16
+ end
17
+ end
@@ -0,0 +1,43 @@
1
+ <%= subject_for(@order) %>
2
+ <%= "#{@order.class.human_attribute_name(:code)}: #{@order.code}" %>
3
+ ----------------------------------------------------------------------
4
+
5
+ <%= I18n.t('comable.order_mailer.complete.dear', name: @order.full_name) %>
6
+
7
+ <%= I18n.t('comable.order_mailer.complete.introductions', store_name: current_store.name) %>
8
+
9
+ <%- shipment_method = @order.shipment_method %>
10
+ <%- if shipment_method %>
11
+ <%= shipment_method.class.model_name.human %>:
12
+ <%= shipment_method.name %>
13
+ <%- end %>
14
+
15
+ <%= Comable::OrderDelivery.model_name.human %>:
16
+ <%- @order.order_deliveries.each do |order_delivery| %>
17
+ <%= name_with_honorific order_delivery.full_name %>
18
+ <%- end %>
19
+
20
+ ======================================================================
21
+
22
+ <%= Comable::Order.model_name.human %>
23
+
24
+ <%= "#{@order.class.human_attribute_name(:code)}: #{@order.code}" %>
25
+ <%= "#{@order.class.human_attribute_name(:completed_at)}: #{I18n.l @order.completed_at.to_date}" %>
26
+
27
+ <%- @order.order_deliveries.map(&:order_details).flatten.each do |order_detail| %>
28
+ <%= name_with_quantity order_detail.name_with_sku, order_detail.quantity %>
29
+ <%= number_to_currency order_detail.subtotal_price %>
30
+
31
+ <%- end %>
32
+ ----------------------------------------------------------------------
33
+
34
+ <%= "#{@order.class.human_attribute_name(:item_total_price)}: #{number_to_currency @order.item_total_price}" %>
35
+ <%= "#{@order.class.human_attribute_name(:shipment_fee)}: #{number_to_currency @order.shipment_fee}" %>
36
+
37
+ <%= "#{@order.class.human_attribute_name(:total_price)}: #{number_to_currency @order.total_price}" %>
38
+
39
+ <%= "#{@order.class.human_attribute_name(:payment)}: #{@order.payment.name}\n" if @order.payment -%>
40
+
41
+ ======================================================================
42
+
43
+ <%= I18n.t('comable.order_mailer.complete.outroductions', store_name: current_store.name) %>
@@ -1,5 +1,8 @@
1
1
  ja:
2
2
  comable:
3
+ honorific: &honorific
4
+ '%{name} 様'
5
+
3
6
  carts:
4
7
  add_product: '1つの商品がカートに入りしました'
5
8
  product_not_found: 'ご指定の商品は見つかりませんでした'
@@ -9,3 +12,22 @@ ja:
9
12
  orders:
10
13
  success: '注文が完了しました'
11
14
  failure: '注文に失敗しました。入力項目を見直してください。'
15
+
16
+ order_mailer:
17
+ complete:
18
+ subject: '注文完了メール'
19
+ dear: *honorific
20
+ introductions: |-
21
+ %{store_name} をご利用いただきましてありがとうございます。
22
+ ご注文内容は下記のとおりです。
23
+ outroductions: |-
24
+ またのご利用をお待ちしております。
25
+ %{store_name}
26
+ order: 'ご注文内容'
27
+ order_delivery: 'お届け先'
28
+
29
+ activerecord:
30
+ models:
31
+ comable/order: ご注文
32
+ comable/order_delivery: お届け先
33
+ comable/order_details: ご注文明細
@@ -3,6 +3,7 @@ class CreateComableCustomers < ActiveRecord::Migration
3
3
  create_table :comable_customers do |t|
4
4
  t.string :family_name, null: false
5
5
  t.string :first_name, null: false
6
+ t.string :email, null: false
6
7
  end
7
8
  end
8
9
  end
@@ -7,6 +7,11 @@ class CreateComableOrders < ActiveRecord::Migration
7
7
  t.string :code
8
8
  t.string :family_name
9
9
  t.string :first_name
10
+ t.string :email
11
+ t.integer :shipment_fee, null: false, default: 0
12
+ t.string :shipment_tracking_number
13
+ t.integer :shipment_method_id
14
+ t.integer :total_price
10
15
  t.datetime :completed_at
11
16
  end
12
17
 
@@ -3,7 +3,13 @@ class CreateComableOrderDetails < ActiveRecord::Migration
3
3
  create_table :comable_order_details do |t|
4
4
  t.integer :comable_order_delivery_id, null: false
5
5
  t.integer :comable_stock_id, null: false
6
- t.integer :price
6
+ t.string :name, null: false
7
+ t.string :code, null: false
8
+ t.integer :price, null: false
9
+ t.string :sku_h_item_name
10
+ t.string :sku_v_item_name
11
+ t.string :sku_h_choice_name
12
+ t.string :sku_v_choice_name
7
13
  t.integer :quantity, default: 1, null: false
8
14
  end
9
15
 
@@ -0,0 +1,10 @@
1
+ class CreateComableShipmentMethods < ActiveRecord::Migration
2
+ def change
3
+ create_table :comable_shipment_methods do |t|
4
+ t.boolean :activate_flag, null: false, default: true
5
+ t.string :name, null: false
6
+ t.integer :fee, null: false
7
+ t.string :traking_url
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ class CreateComableStores < ActiveRecord::Migration
2
+ def change
3
+ create_table :comable_stores do |t|
4
+ t.string :name
5
+ t.string :meta_keyword
6
+ t.string :meta_description
7
+ t.string :email_sender
8
+ t.boolean :email_activate_flag, null: false, default: true
9
+ end
10
+ end
11
+ end
@@ -7,6 +7,8 @@ module Comable
7
7
  g.test_framework :rspec, fixture: true
8
8
  g.fixture_replacement :factory_girl, dir: 'spec/factories'
9
9
  end
10
+
11
+ config.autoload_paths << "#{config.root}/app/models/concerns" if Rails::VERSION::MAJOR == 3
10
12
  end
11
13
  end
12
14
  end
data/lib/comable_core.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  require 'comable/core/engine'
2
2
 
3
- require 'comable/decoratable'
4
3
  require 'comable/errors'
5
4
  require 'comable/cart_owner'
6
5
  require 'comable/payment_method'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comable_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - YOSHIDA Hiroki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-18 00:00:00.000000000 Z
11
+ date: 2014-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -36,13 +36,19 @@ files:
36
36
  - app/assets/stylesheets/comable/application.css
37
37
  - app/helpers/comable/application_helper.rb
38
38
  - app/helpers/comable/products_helper.rb
39
+ - app/mailers/comable/order_mailer.rb
39
40
  - app/models/comable/customer.rb
40
41
  - app/models/comable/order.rb
41
42
  - app/models/comable/order_delivery.rb
42
43
  - app/models/comable/order_detail.rb
43
44
  - app/models/comable/payment.rb
44
45
  - app/models/comable/product.rb
46
+ - app/models/comable/shipment_method.rb
45
47
  - app/models/comable/stock.rb
48
+ - app/models/comable/store.rb
49
+ - app/models/concerns/comable/sku_choice.rb
50
+ - app/models/concerns/comable/sku_item.rb
51
+ - app/views/comable/order_mailer/complete.text.erb
46
52
  - config/locales/ja.yml
47
53
  - db/migrate/20131214194807_create_comable_products.rb
48
54
  - db/migrate/20140120032559_create_comable_customers.rb
@@ -51,9 +57,10 @@ files:
51
57
  - db/migrate/20140723175624_create_comable_order_deliveries.rb
52
58
  - db/migrate/20140723175810_create_comable_order_details.rb
53
59
  - db/migrate/20140817194104_create_comable_payments.rb
60
+ - db/migrate/20140921191416_create_comable_shipment_methods.rb
61
+ - db/migrate/20140926063541_create_comable_stores.rb
54
62
  - lib/comable/cart_owner.rb
55
63
  - lib/comable/core/engine.rb
56
- - lib/comable/decoratable.rb
57
64
  - lib/comable/errors.rb
58
65
  - lib/comable/payment_method.rb
59
66
  - lib/comable/payment_method/base.rb
@@ -1,10 +0,0 @@
1
- module Comable
2
- module Decoratable
3
- def self.included(base)
4
- # refs: http://edgeguides.rubyonrails.org/engines.html#overriding-models-and-controllers
5
- Dir.glob(Rails.root + "app/decorators/comable/#{base.name.demodulize.underscore}_decorator*.rb").each do |c|
6
- require_dependency(c)
7
- end
8
- end
9
- end
10
- end