kkt_shoppe 1.3.0 → 2.0.0
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/README.md +1 -2
- data/app/controllers/kkt_shoppe/product_categories_controller.rb +2 -1
- data/app/models/kkt_shoppe/product_category.rb +5 -1
- data/app/views/kkt_shoppe/product_categories/_form.html.haml +4 -2
- data/db/migrate/20131102143930_remove_default_on_order_item_weight.rb +2 -2
- data/lib/kkt_shoppe/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77f73aae190d929e1b27577771dd3144d27a2964
|
4
|
+
data.tar.gz: 9f09682d22e387fa69ff05277c0f177d6530e07f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf8e65bf71de2e49f0275e427ab2b1da0b9ea17f4ed33a532ae3d975f3ed3243adb80bfa3d2ffb21b51fe07b4b54e061479d48febbfb90705dde8edf520f71c3
|
7
|
+
data.tar.gz: 4800eb03becbab1d4cc981746084f0d6c6a2e7e2ac32ebc5289610c7a0cfbe56fe79c48918ea16f5038cdc6b46443fe4b7e9a4c177f11471324226c9de8b9801
|
data/README.md
CHANGED
@@ -5,7 +5,6 @@ catalogue-based store into your Rails 4 applications.
|
|
5
5
|
|
6
6
|

|
7
7
|
[](https://codeclimate.com/github/trykkt_shoppe/core)
|
8
|
-
[](https://travis-ci.org/trykkt_shoppe/kkt_shoppe)
|
9
8
|
|
10
9
|
* [Check out the website](http://trykkt_shoppe.com)
|
11
10
|
* [View the demo site](http://demo.trykkt_shoppe.com)
|
@@ -36,7 +35,7 @@ instructions below and you'll be up and running in minutes.
|
|
36
35
|
|
37
36
|
rails new my_store
|
38
37
|
cd my_store
|
39
|
-
echo "gem 'kkt_shoppe'
|
38
|
+
echo "gem 'kkt_shoppe'" >> Gemfile
|
40
39
|
bundle
|
41
40
|
rails generate kkt_shoppe:setup
|
42
41
|
rails generate nifty:key_value_store:migration
|
@@ -40,7 +40,8 @@ module KktShoppe
|
|
40
40
|
private
|
41
41
|
|
42
42
|
def safe_params
|
43
|
-
|
43
|
+
file_params = [:file, :parent_id, :role, :parent_type, :file => []]
|
44
|
+
params[:product_category].permit(:name, :permalink, :description, :parent_id, :permalink_includes_ancestors, :attachments => [:image => file_params])
|
44
45
|
end
|
45
46
|
|
46
47
|
end
|
@@ -29,13 +29,17 @@ module KktShoppe
|
|
29
29
|
# No descendents
|
30
30
|
scope :except_descendants, ->(record) { where.not(id: (Array.new(record.descendants) << record).flatten) }
|
31
31
|
|
32
|
-
translates :name, :permalink, :description
|
32
|
+
translates :name, :permalink, :description
|
33
33
|
scope :ordered, -> { includes(:translations).order(:name) }
|
34
34
|
|
35
35
|
# Set the permalink on callback
|
36
36
|
before_validation :set_permalink, :set_ancestral_permalink
|
37
37
|
after_save :set_child_permalinks
|
38
38
|
|
39
|
+
def attachments=(attrs)
|
40
|
+
if attrs["image"]["file"].present? then self.attachments.build(attrs["image"]) end
|
41
|
+
end
|
42
|
+
|
39
43
|
def combined_permalink
|
40
44
|
if self.permalink_includes_ancestors && self.ancestral_permalink.present?
|
41
45
|
"#{self.ancestral_permalink}/#{self.permalink}"
|
@@ -39,10 +39,12 @@
|
|
39
39
|
|
40
40
|
= field_set_tag t('kkt_shoppe.product_category.attachments') do
|
41
41
|
%dl
|
42
|
-
%dt= f.label
|
42
|
+
%dt= f.label "attachments[image][file]", t('kkt_shoppe.product_category.image')
|
43
43
|
%dd
|
44
44
|
= attachment_preview @product_category.image
|
45
|
-
%p= f.file_field
|
45
|
+
%p= f.file_field "attachments[image][file]"
|
46
|
+
= f.hidden_field "attachments[image][role]", value: "image"
|
47
|
+
= f.hidden_field "attachments[image][parent_id]", value: @product_category.id
|
46
48
|
|
47
49
|
%p.submit
|
48
50
|
- unless @product_category.new_record?
|
data/lib/kkt_shoppe/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kkt_shoppe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Thompson
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-07-
|
13
|
+
date: 2015-07-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -665,7 +665,7 @@ files:
|
|
665
665
|
- lib/kkt_shoppe/version.rb
|
666
666
|
- lib/kkt_shoppe/view_helpers.rb
|
667
667
|
- lib/tasks/kkt_shoppe.rake
|
668
|
-
homepage:
|
668
|
+
homepage: https://www.kylekthompson.com/
|
669
669
|
licenses:
|
670
670
|
- MIT
|
671
671
|
metadata: {}
|