comable_core 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/mailers/comable/order_mailer.rb +1 -1
- data/app/models/comable/address.rb +4 -4
- data/app/models/comable/shipment_method.rb +1 -2
- data/app/models/comable/store.rb +3 -3
- data/app/models/comable/tracker.rb +1 -1
- data/app/models/comable/user.rb +4 -0
- data/config/locales/en.yml +4 -4
- data/config/locales/ja.yml +4 -4
- data/db/migrate/20131214194807_create_comable_products.rb +2 -1
- data/db/migrate/20140120032559_create_comable_users.rb +2 -0
- data/db/migrate/20140502060116_create_comable_stocks.rb +2 -1
- data/db/migrate/20140723175431_create_comable_orders.rb +2 -1
- data/db/migrate/20140723175810_create_comable_order_items.rb +2 -1
- data/db/migrate/20140817194104_create_comable_payment_methods.rb +1 -0
- data/db/migrate/20140921191416_create_comable_shipment_methods.rb +2 -1
- data/db/migrate/20140926063541_create_comable_stores.rb +2 -2
- data/db/migrate/20141024025526_create_comable_addresses.rb +1 -0
- data/db/migrate/20150111031228_create_comable_categories.rb +1 -0
- data/db/migrate/20150112173706_create_comable_images.rb +1 -0
- data/db/migrate/20150423095210_create_comable_shipments.rb +1 -0
- data/db/migrate/20150511171940_create_comable_payments.rb +1 -0
- data/db/migrate/20150513185230_create_comable_trackers.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3c189f71e2286afacd9d9607498850ab4173f88
|
4
|
+
data.tar.gz: 99d3320d9c08295fd80cc41e964ebeb18b957707
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c975609caf19b813fd71634e78e484da97f03982b0ebc27ce68699fdfa03f155db2222e8fb03d6f7d8d36748c8d6dcb6b2ce8ef444e018b2657d4365d081df1a
|
7
|
+
data.tar.gz: 987b35810b75b2a058553510b271bd4b7e1e884a2673ab7d2cd79e85f224fa32dce162adf48d8a2b4d10741e85fb6b341729947da5661792d4733159cd6a1ee9
|
@@ -17,15 +17,15 @@ module Comable
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def same_as?(address)
|
20
|
-
|
20
|
+
contents == address.contents
|
21
21
|
end
|
22
22
|
|
23
23
|
def clone
|
24
|
-
self.class.new(
|
24
|
+
self.class.new(contents)
|
25
25
|
end
|
26
26
|
|
27
|
-
def
|
28
|
-
attributes.except('id', 'user_id')
|
27
|
+
def contents
|
28
|
+
attributes.except('id', 'user_id', 'created_at', 'updated_at')
|
29
29
|
end
|
30
30
|
|
31
31
|
def full_name
|
@@ -4,7 +4,6 @@ module Comable
|
|
4
4
|
validates :fee, presence: true, numericality: { greater_than_or_equal_to: 0 }
|
5
5
|
validates :traking_url, length: { maximum: 255 }
|
6
6
|
|
7
|
-
scope :activated, -> { where(
|
8
|
-
scope :deactivated, -> { where(activate_flag: false) }
|
7
|
+
scope :activated, -> { where(activated_flag: true) }
|
9
8
|
end
|
10
9
|
end
|
data/app/models/comable/store.rb
CHANGED
@@ -3,7 +3,7 @@ module Comable
|
|
3
3
|
validates :name, length: { maximum: 255 }
|
4
4
|
validates :meta_keywords, length: { maximum: 255 }
|
5
5
|
validates :meta_description, length: { maximum: 255 }
|
6
|
-
validates :
|
6
|
+
validates :email, length: { maximum: 255 }
|
7
7
|
|
8
8
|
class << self
|
9
9
|
def instance
|
@@ -15,8 +15,8 @@ module Comable
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
def
|
19
|
-
|
18
|
+
def can_send_mail?
|
19
|
+
email.present?
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -7,7 +7,7 @@ module Comable
|
|
7
7
|
validates :code, presence: true
|
8
8
|
validates :place, presence: true, length: { maximum: 255 }
|
9
9
|
|
10
|
-
scope :activated, -> { where(
|
10
|
+
scope :activated, -> { where(activated_flag: true) }
|
11
11
|
|
12
12
|
enumerize :place, in: %i(
|
13
13
|
everywhere
|
data/app/models/comable/user.rb
CHANGED
@@ -13,6 +13,10 @@ module Comable
|
|
13
13
|
accepts_nested_attributes_for :bill_address
|
14
14
|
accepts_nested_attributes_for :ship_address
|
15
15
|
|
16
|
+
scope :this_month, -> { where(created_at: Time.now.beginning_of_month..Time.now.end_of_month) }
|
17
|
+
scope :this_week, -> { where(created_at: Time.now.beginning_of_week..Time.now.end_of_week) }
|
18
|
+
scope :last_week, -> { where(created_at: 1.week.ago.beginning_of_week..1.week.ago.end_of_week) }
|
19
|
+
|
16
20
|
validates :email, presence: true, length: { maximum: 255 }
|
17
21
|
|
18
22
|
devise(*Comable::Config.devise_strategies[:user])
|
data/config/locales/en.yml
CHANGED
@@ -143,6 +143,7 @@ en:
|
|
143
143
|
tracker_code_help_additional: '<code>order.order_items</code> is Array. And you can retrieve the following information from each element.'
|
144
144
|
list_of_usable_variables: 'Available variables are as follows.'
|
145
145
|
mote_infomation_for_syntax: 'For more information about the syntax please refer to the following page:'
|
146
|
+
help_of_store_email: 'This field will be used as sender of mail that send to customers. The mail will not be sent when the field is empty.'
|
146
147
|
nav:
|
147
148
|
dashboard: 'Dashboard'
|
148
149
|
order: 'Orders'
|
@@ -304,12 +305,11 @@ en:
|
|
304
305
|
name: 'Name'
|
305
306
|
meta_keywords: 'Meta keywords'
|
306
307
|
meta_description: 'Meta description'
|
307
|
-
|
308
|
-
email_activate_flag: 'Email activated'
|
308
|
+
email: 'Email'
|
309
309
|
comable/shipment_method:
|
310
310
|
name: 'Name'
|
311
311
|
fee: 'Fee'
|
312
|
-
|
312
|
+
activated_flag: 'Activated'
|
313
313
|
traking_url: 'Tracking URL'
|
314
314
|
comable/payment_method:
|
315
315
|
name: 'Name'
|
@@ -317,7 +317,7 @@ en:
|
|
317
317
|
fee: 'Fee'
|
318
318
|
enable_price: 'Enable price range'
|
319
319
|
comable/tracker:
|
320
|
-
|
320
|
+
activated_flag: 'Activated'
|
321
321
|
name: 'Name'
|
322
322
|
tracker_id: 'Tracker ID'
|
323
323
|
code: 'Code'
|
data/config/locales/ja.yml
CHANGED
@@ -143,6 +143,7 @@ ja:
|
|
143
143
|
tracker_code_help_additional: '<code>order.order_items</code> は配列で、各要素から次の情報を取り出すことができます。'
|
144
144
|
list_of_usable_variables: '利用可能な変数は次の通りです。'
|
145
145
|
mote_infomation_for_syntax: '構文についての詳しい情報は次のページをご覧ください:'
|
146
|
+
help_of_store_email: 'この項目は顧客に送信するメールの送信元として利用されます。未入力の場合はメールが送信されません。'
|
146
147
|
nav:
|
147
148
|
dashboard: ダッシュボード
|
148
149
|
order: 注文管理
|
@@ -304,12 +305,11 @@ ja:
|
|
304
305
|
name: ストア名
|
305
306
|
meta_keywords: メタキーワード
|
306
307
|
meta_description: メタディスクリプション
|
307
|
-
|
308
|
-
email_activate_flag: メール送信を有効にする
|
308
|
+
email: メールアドレス
|
309
309
|
comable/shipment_method:
|
310
310
|
name: 発送方法名
|
311
311
|
fee: 手数料
|
312
|
-
|
312
|
+
activated_flag: この発送方法を有効にする
|
313
313
|
traking_url: トラッキングURL
|
314
314
|
comable/payment_method:
|
315
315
|
name: 決済方法名
|
@@ -317,7 +317,7 @@ ja:
|
|
317
317
|
fee: '手数料'
|
318
318
|
enable_price: 利用可能な価格範囲
|
319
319
|
comable/tracker:
|
320
|
-
|
320
|
+
activated_flag: 'このトラッキング情報を有効にする'
|
321
321
|
name: 'トラッキング名'
|
322
322
|
tracker_id: 'トラッキングID'
|
323
323
|
code: 'トラッキングコード'
|
@@ -7,8 +7,9 @@ class CreateComableProducts < ActiveRecord::Migration
|
|
7
7
|
t.text :caption
|
8
8
|
t.string :sku_h_item_name
|
9
9
|
t.string :sku_v_item_name
|
10
|
+
t.timestamps null: false
|
10
11
|
end
|
11
12
|
|
12
|
-
add_index :comable_products, :code, unique: true
|
13
|
+
add_index :comable_products, :code, unique: true
|
13
14
|
end
|
14
15
|
end
|
@@ -6,8 +6,9 @@ class CreateComableStocks < ActiveRecord::Migration
|
|
6
6
|
t.integer :quantity, null: false, default: 0
|
7
7
|
t.string :sku_h_choice_name
|
8
8
|
t.string :sku_v_choice_name
|
9
|
+
t.timestamps null: false
|
9
10
|
end
|
10
11
|
|
11
|
-
add_index :comable_stocks, :code, unique: true
|
12
|
+
add_index :comable_stocks, :code, unique: true
|
12
13
|
end
|
13
14
|
end
|
@@ -12,8 +12,9 @@ class CreateComableOrders < ActiveRecord::Migration
|
|
12
12
|
t.references :ship_address
|
13
13
|
t.string :state
|
14
14
|
t.datetime :completed_at
|
15
|
+
t.timestamps null: false
|
15
16
|
end
|
16
17
|
|
17
|
-
add_index :comable_orders, :code, unique: true
|
18
|
+
add_index :comable_orders, :code, unique: true
|
18
19
|
end
|
19
20
|
end
|
@@ -11,8 +11,9 @@ class CreateComableOrderItems < ActiveRecord::Migration
|
|
11
11
|
t.string :sku_h_choice_name
|
12
12
|
t.string :sku_v_choice_name
|
13
13
|
t.integer :quantity, default: 1, null: false
|
14
|
+
t.timestamps null: false
|
14
15
|
end
|
15
16
|
|
16
|
-
add_index :comable_order_items, [:order_id, :stock_id], unique: true
|
17
|
+
add_index :comable_order_items, [:order_id, :stock_id], unique: true
|
17
18
|
end
|
18
19
|
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
class CreateComableShipmentMethods < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :comable_shipment_methods do |t|
|
4
|
-
t.boolean :
|
4
|
+
t.boolean :activated_flag, null: false, default: true
|
5
5
|
t.string :name, null: false
|
6
6
|
t.integer :fee, null: false
|
7
7
|
t.string :traking_url
|
8
|
+
t.timestamps null: false
|
8
9
|
end
|
9
10
|
end
|
10
11
|
end
|
@@ -4,8 +4,8 @@ class CreateComableStores < ActiveRecord::Migration
|
|
4
4
|
t.string :name
|
5
5
|
t.string :meta_keywords
|
6
6
|
t.string :meta_description
|
7
|
-
t.string :
|
8
|
-
t.
|
7
|
+
t.string :email
|
8
|
+
t.timestamps null: false
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -1,12 +1,13 @@
|
|
1
1
|
class CreateComableTrackers < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :comable_trackers do |t|
|
4
|
-
# TODO: Rename the column:
|
5
|
-
t.boolean :
|
4
|
+
# TODO: Rename the column: activated_flag => activated
|
5
|
+
t.boolean :activated_flag, null: false, default: true
|
6
6
|
t.string :name, null: false
|
7
7
|
t.string :tracker_id
|
8
8
|
t.text :code, null: false
|
9
9
|
t.string :place, null: false
|
10
|
+
t.timestamps null: false
|
10
11
|
end
|
11
12
|
end
|
12
13
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comable_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YOSHIDA Hiroki
|
@@ -298,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
298
298
|
version: '0'
|
299
299
|
requirements: []
|
300
300
|
rubyforge_project:
|
301
|
-
rubygems_version: 2.
|
301
|
+
rubygems_version: 2.4.5
|
302
302
|
signing_key:
|
303
303
|
specification_version: 4
|
304
304
|
summary: Provide core functions for Comable.
|