caboose-cms 0.6.27 → 0.6.28

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- M2EyNjk4NjZkOTcxNDVkOTkwMGE1N2FlZDVmMDA3M2NiMTIyNjM3ZQ==
4
+ YjFhYTBlYWY1MTMyOGU5ZjhjNzcyMzQ3MDkwNjZiYTQ5ZjA3N2Q5Nw==
5
5
  data.tar.gz: !binary |-
6
- ZjdmYThiNmI0Y2I3Nzk0ODk2MDI2Yzc4YWFkNGYwYThhZGRjNDdiNg==
6
+ YzAwNjA3Y2JmODQwNTg3ZWQyNDFmMTQ3MDhlODExM2JmMjFlYzIyNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzhkMTAyOTA4MjE2OWU4ZjU2MGI2ZmFlODQ2NzU1NjlmNGRlZDA3Y2U3ZGMz
10
- YzIxNGZlODA4NTFiNGFkYmEwMWFiNTg4NzExMzMyY2Y2NzI1ZjJmYWFiMmFk
11
- YzFkNTQyOTQzYTQ0YWQ5ZDA5MGRhNGRjYjljMjlmNWY0YmUwZmE=
9
+ NjkzMTk0MGE5MjQwMjA4MjllMjJjMDJiMGIyNWFiOTk3NWE4NWI5OGY5Y2Ez
10
+ YTU4ZGQ1NDZjMTI1MWI5NmJiZmY2NzY2YTY4NWQ0YmY0Y2M4ZGIxOTM5Zjgx
11
+ NTBkZGNjNWFlOTUzM2ZlYWY1OTE2NmZiMDU0ZDc1ZDhiODdiYjE=
12
12
  data.tar.gz: !binary |-
13
- Y2E5MGI2ZDY5YjBiMThlZWE1ZmU1ZTAwNWNjZjIyMGY5MmQ0Y2RmZTA2ZDJm
14
- MDdmMzZlMmEzNWRmMDA2OTc5ZTI3NjJmOThiOTkyNDgyYWQwODgxNGFiZTli
15
- OWUyYmRiNzRlZmViYmNjNzMxNTZiMmFkMThlZDZlZmUxMjdhZjk=
13
+ NDRhMDAyODhlM2JlZTQ0Y2ZiMjRmN2EwZDZmZmFmNjM5MGFlODhkYmViOTUw
14
+ YWE5NzFlMDEzMTk3NTllYjQ1ZThhYzBmZGQwYzQyYTk0Zjg4YzdjNzkyYTM5
15
+ NmVjMDQ3MDdmMDkxYmNmZmZjODU0NTJkMjc0OTliYzA0ZGVjYzM=
@@ -40,7 +40,7 @@ module Caboose
40
40
  case name
41
41
  when 'name' then calendar.name = value
42
42
  when 'description' then calendar.description = value
43
- when 'color' then calendar.color = value
43
+ when 'color' then calendar.color = value
44
44
  end
45
45
  end
46
46
 
@@ -127,16 +127,16 @@ module Caboose
127
127
  end
128
128
 
129
129
  # GET /admin/categories/status-options
130
- def admin_status_options
130
+ def admin_status_options
131
131
  render :json => [
132
132
  { :value => 'Active' , :text => 'Active' },
133
133
  { :value => 'Inactive' , :text => 'Inactive' },
134
134
  { :value => 'Deleted' , :text => 'Deleted' }
135
135
  ]
136
136
  end
137
-
137
+
138
138
  # GET /admin/categories/options
139
- def admin_options
139
+ def admin_options
140
140
  @options = []
141
141
  cat = Category.where("site_id = ? and parent_id is null", @site.id).first
142
142
  if cat.nil?
@@ -145,25 +145,25 @@ module Caboose
145
145
  admin_options_helper(cat, '')
146
146
  render :json => @options
147
147
  end
148
-
148
+
149
149
  def admin_options_helper(cat, prefix)
150
150
  @options << { :value => cat.id, :text => "#{prefix}#{cat.name}" }
151
151
  cat.children.each do |c|
152
152
  admin_options_helper(c, "#{prefix} - ")
153
153
  end
154
154
  end
155
-
155
+
156
156
  # GET /admin/categories/:category_id/products/json
157
- def admin_category_products
157
+ def admin_category_products
158
158
  query = ["select P.id, P.title from store_category_memberships CM
159
159
  left join store_products P on P.id = CM.product_id
160
- where CM.category_id = ?
160
+ where CM.category_id = ? AND P.status = 'Active'
161
161
  order by CM.sort_order, P.title", params[:id]]
162
162
  rows = ActiveRecord::Base.connection.select_rows(ActiveRecord::Base.send(:sanitize_sql_array, query))
163
163
  arr = rows.collect{ |row| { :id => row[0], :title => row[1] }}
164
164
  render :json => arr
165
165
  end
166
-
166
+
167
167
  end
168
168
  end
169
169
 
@@ -6,7 +6,7 @@ module Caboose
6
6
  # GET /station
7
7
  def index
8
8
  @user = logged_in_user
9
- page_id = params['page_id'].nil? ? 1 : params['page_id']
9
+ page_id = params['page_id'].nil? ? Page.index_page(@site.id).id : params['page_id']
10
10
  @page = Page.find(page_id)
11
11
  @tab = params['tab']
12
12
 
@@ -197,5 +197,11 @@ module Caboose
197
197
  end
198
198
  end
199
199
 
200
+ def Product.update_on_sale
201
+ Product.reorder(:id).all.each do |p|
202
+ p.delay.update_on_sale
203
+ end
204
+ end
205
+
200
206
  end
201
207
  end
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.6.27'
2
+ VERSION = '0.6.28'
3
3
  end
@@ -2,6 +2,11 @@ require "caboose/version"
2
2
 
3
3
  namespace :caboose do
4
4
 
5
+ desc "Update the on sale value for all products and variants"
6
+ task :update_products_on_sale => :environment do
7
+ Product.update_on_sale
8
+ end
9
+
5
10
  desc "Create media categories for existing products on all sites"
6
11
  task :create_product_media_categories => :environment do
7
12
  sites = Caboose::Site.where(:use_store => true).all.each do |s|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.27
4
+ version: 0.6.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-02 00:00:00.000000000 Z
11
+ date: 2015-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg