refinerycms-products 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/app/models/category.rb +4 -6
  2. metadata +2 -2
@@ -1,17 +1,15 @@
1
1
  class Category < ActiveRecord::Base
2
2
 
3
3
  include Rails.application.routes.url_helpers
4
- #default_url_options[:host] = request.host_with_port
5
4
 
6
-
7
5
  acts_as_indexed :fields => [:name]
8
6
 
9
- validates :name, :presence => true, :uniqueness => true
10
-
11
-
7
+ validates_presence_of :name
8
+ validates_uniqueness_of :name, :scope => :parent_id
9
+
12
10
  belongs_to :parent, :class_name => "Category", :foreign_key => "parent_id"
13
11
  has_many :children, :class_name => "Category", :foreign_key => "parent_id"
14
-
12
+
15
13
  has_and_belongs_to_many :products
16
14
 
17
15
  if defined?(Banner)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-products
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-03-26 00:00:00.000000000Z
13
+ date: 2012-03-30 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: acts-as-taggable-on