effective_orders 3.1.4 → 3.2.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
  SHA256:
3
- metadata.gz: 95a8ee70cdfec1d0abf23bd3a3d983f9ac6d853a6e795464bcd77bae043799d4
4
- data.tar.gz: 4465d2da717814cdb4de4ca1efc6d606c57e41e034dfe8299aedf9ea93ca1ed3
3
+ metadata.gz: 2fb16bce7ab1576f59980e3774ca39033738a7fb1f5dfc26065ff037bdab48c7
4
+ data.tar.gz: 76b131fd50900070e6ef39214ef833ba5af31106092a0451f7a8bee6f6e7cb40
5
5
  SHA512:
6
- metadata.gz: 738feb98567d85fc601d721e79ba2c06d223d69252287623cca17c4540c362b514bb535000980c3421f30e9c792b40514550eeee5c53a486efb8f02bc8c8054e
7
- data.tar.gz: cca56bc31234719b1ddb3f61721e98ce2ceca177e48eeb812305b270222f8b9f4e5fbc54ac1c24b0fec7166b81b7f12371ee563ab2e36a804330cb933b17d9d6
6
+ metadata.gz: a012457f0896f338f98b164a393d1bb21e83f7cbaa55516b0d1d015277ca2fde3b82b988e933c3905b3447fdc7e2c6edbbcc7610292c12810fc39bb1f9922f37
7
+ data.tar.gz: 78a7aaa52c8b208f13229f5e969f6acf034e7086104246690d44dccdb9c0415a732eb6673b131c5d49137557e8de0edae720d928c3ee934c7e5b3638e488af42
@@ -0,0 +1,3 @@
1
+ //= link_directory ../javascripts .js
2
+ //= link_directory ../stylesheets .css
3
+ //= link_directory ../images/effective_orders
@@ -19,7 +19,7 @@ module Effective
19
19
 
20
20
  layout (EffectiveOrders.layout.kind_of?(Hash) ? EffectiveOrders.layout[:orders] : EffectiveOrders.layout)
21
21
 
22
- before_action :authenticate_user!, except: [:ccbill_postback, :free, :paypal_postback, :pretend]
22
+ before_action :authenticate_user!, except: [:ccbill_postback, :free, :moneris_postback, :paypal_postback, :pretend]
23
23
  before_action :set_page_title, except: [:show]
24
24
 
25
25
  # This is the entry point for any Checkout button
@@ -15,6 +15,13 @@ class EffectiveOrdersDatatable < Effective::Datatable
15
15
  )
16
16
  end
17
17
 
18
+ filters do
19
+ if admin_namespace?
20
+ filter :start_date, nil, as: :effective_date_picker
21
+ filter :end_date, nil, as: :effective_date_picker
22
+ end
23
+ end
24
+
18
25
  datatable do
19
26
  order :created_at, :desc
20
27
 
@@ -94,6 +101,14 @@ class EffectiveOrdersDatatable < Effective::Datatable
94
101
  scope = EffectiveOrders.orders_collection_scope.call(scope)
95
102
  end
96
103
 
104
+ if filters[:start_date].present?
105
+ scope = scope.where('created_at > ?', Time.zone.parse(filters[:start_date]).beginning_of_day)
106
+ end
107
+
108
+ if filters[:end_date].present?
109
+ scope = scope.where('created_at < ?', Time.zone.parse(filters[:end_date]).end_of_day)
110
+ end
111
+
97
112
  attributes[:user_id].present? ? scope.where(user_id: attributes[:user_id]) : scope
98
113
  end
99
114
 
@@ -32,7 +32,7 @@ module Effective
32
32
  validates :stripe_customer_id, presence: true
33
33
  validates :status, if: -> { stripe_subscription_id.present? }, inclusion: { in: %w(active past_due) }
34
34
 
35
- def self.for_user(user)
35
+ def self.for_buyer(user)
36
36
  Effective::Customer.where(user: user).first_or_initialize
37
37
  end
38
38
 
@@ -4,7 +4,7 @@ module Effective
4
4
 
5
5
  belongs_to :order, class_name: 'Effective::Order'
6
6
  belongs_to :purchasable, polymorphic: true
7
- belongs_to :seller, class_name: 'User'
7
+ belongs_to :seller, class_name: 'User', optional: true
8
8
 
9
9
  delegate :purchased_download_url, to: :purchasable
10
10
  delegate :purchased?, :declined?, to: :order
@@ -104,7 +104,8 @@ module Effective
104
104
  def order_id
105
105
  [
106
106
  order.to_param,
107
- (order.billing_name.to_s.parameterize.presence if EffectiveOrders.moneris[:include_billing_name_in_order_id])
107
+ (order.billing_name.to_s.parameterize.presence if EffectiveOrders.moneris[:include_billing_name_in_order_id]),
108
+ Time.zone.now.to_i
108
109
  ].compact.join('-')
109
110
  end
110
111
 
@@ -2,7 +2,7 @@ module EffectiveOrders
2
2
  class Engine < ::Rails::Engine
3
3
  engine_name 'effective_orders'
4
4
 
5
- config.autoload_paths += Dir["#{config.root}/app/models/**/"]
5
+ #config.autoload_paths += Dir["#{config.root}/app/models/**/"]
6
6
 
7
7
  # Include acts_as_addressable concern and allow any ActiveRecord object to call it
8
8
  initializer 'effective_orders.active_record' do |app|
@@ -18,6 +18,10 @@ module EffectiveOrders
18
18
  eval File.read("#{config.root}/config/effective_orders.rb")
19
19
  end
20
20
 
21
+ initializer 'effective_orders.assets' do |app|
22
+ app.config.assets.precompile += ['effective_orders_manifest.js', 'effective_orders/*']
23
+ end
24
+
21
25
  # Set up mail delivering config option
22
26
  initializer 'effective_orders.mailer', after: :load_config_initializers do |app|
23
27
  deliver_method = Rails.gem_version >= Gem::Version.new('4.2') ? :deliver_now : :deliver
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '3.1.4'.freeze
2
+ VERSION = '3.2.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_orders
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.4
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-23 00:00:00.000000000 Z
11
+ date: 2021-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -119,6 +119,7 @@ files:
119
119
  - MIT-LICENSE
120
120
  - README.md
121
121
  - Rakefile
122
+ - app/assets/config/effective_orders_manifest.js
122
123
  - app/assets/images/effective_orders/stripe_connect.png
123
124
  - app/assets/javascripts/effective_orders.js
124
125
  - app/assets/javascripts/effective_orders/customers.js.coffee
@@ -169,10 +170,10 @@ files:
169
170
  - app/models/effective/providers/ccbill_postback.rb
170
171
  - app/models/effective/providers/moneris_charge.rb
171
172
  - app/models/effective/providers/stripe_charge.rb
173
+ - app/models/effective/sold_out_validator.rb
172
174
  - app/models/effective/subscripter.rb
173
175
  - app/models/effective/subscription.rb
174
176
  - app/models/effective/tax_rate_calculator.rb
175
- - app/models/validators/effective/sold_out_validator.rb
176
177
  - app/views/admin/customers/_actions.html.haml
177
178
  - app/views/admin/customers/index.html.haml
178
179
  - app/views/admin/customers/show.html.haml
@@ -255,7 +256,7 @@ homepage: https://github.com/code-and-effect/effective_orders
255
256
  licenses:
256
257
  - MIT
257
258
  metadata: {}
258
- post_install_message:
259
+ post_install_message:
259
260
  rdoc_options: []
260
261
  require_paths:
261
262
  - lib
@@ -270,8 +271,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
270
271
  - !ruby/object:Gem::Version
271
272
  version: '0'
272
273
  requirements: []
273
- rubygems_version: 3.0.3
274
- signing_key:
274
+ rubygems_version: 3.1.2
275
+ signing_key:
275
276
  specification_version: 4
276
277
  summary: Quickly build an online store with carts, orders, automatic email receipts
277
278
  and payment collection via Stripe, StripeConnect, PayPal and Moneris.