piggybak_taxonomy 0.2.0 → 0.2.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4660c56c3ad15f277635273557e2f25235b92ae
|
4
|
+
data.tar.gz: 207e8c5f79f3c2fc7f2ac870968df92644f2b0c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bc3feed331a6324b3235045cccf4b77f11dc2fb77ee6a9ce4c47e0aa7a811c652753f8a6c67325dfc2090fa9d555ed43a1d3e0c0153e7239cb3fbfaef271fcb
|
7
|
+
data.tar.gz: 6c6804f8dd5cc6b4ef31c411ae4fa4766afa0074cdf661d496f1832ab268849abc531b3af1999ebe2fae89b38ae2dbe3002a9db39bb724cc5abee7d5eb872ffc
|
@@ -14,7 +14,7 @@ module PiggybakTaxonomy
|
|
14
14
|
def recursive_path(paths, nodes)
|
15
15
|
return nodes if paths.empty?
|
16
16
|
first = paths.shift
|
17
|
-
node = NavigationNode.
|
17
|
+
node = NavigationNode.where(slug: first).first
|
18
18
|
if node && (nodes.empty? || node.parent == nodes.last) && !(nodes.empty? && !node.parent.nil?)
|
19
19
|
nodes << node
|
20
20
|
nodes = recursive_path(paths, nodes)
|
@@ -2,8 +2,7 @@ module PiggybakTaxonomy
|
|
2
2
|
class SellableTaxonomy < ActiveRecord::Base
|
3
3
|
belongs_to :navigation_node, :class_name => "::PiggybakTaxonomy::NavigationNode"
|
4
4
|
belongs_to :sellable, :class_name => "::Piggybak::Sellable"
|
5
|
-
default_scope order('sort ASC')
|
6
|
-
# attr_accessible :navigation_node_id, :sellable_id, :sort
|
5
|
+
default_scope { order('sort ASC') }
|
7
6
|
|
8
7
|
validates_presence_of :sellable, :sort
|
9
8
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: piggybak_taxonomy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steph Skardal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ancestry
|