campfire_logic 2.0.6 → 2.0.7

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.6
1
+ 2.0.7
@@ -28,6 +28,7 @@ class Locale
28
28
 
29
29
  # Callbacks ======================================================================================
30
30
  after_create :post_process
31
+ before_destroy :delete_descendants
31
32
  before_save :set_slug
32
33
 
33
34
  # Macros =========================================================================================
@@ -46,7 +47,7 @@ class Locale
46
47
  end
47
48
 
48
49
  def self.find_or_create_state_for(location)
49
- Locale.states.where(:name => location.state_long_name).first || Locale.find_or_create_country_for(location).children.create(:abbreviation => location.state, :name => location.state_long_name)
50
+ Locale.states.where(:abbreviation => location.state).first || Locale.find_or_create_country_for(location).children.create(:abbreviation => location.state, :name => location.state_long_name)
50
51
  end
51
52
 
52
53
  # Instance methods: Initialization ===============================================================
@@ -107,7 +108,7 @@ class Locale
107
108
  Rails.logger.info "Did not destroy #{self.parent.name}: has #{self.parent.children.to_a.map{|x|x.name.to_s}.sort * ', '}"
108
109
  end
109
110
 
110
- super unless self.country?
111
+ super if ! country? || (country? && slug.blank?)
111
112
  end
112
113
 
113
114
  def has_other_locations?
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "campfire_logic"
8
- s.version = "2.0.6"
8
+ s.version = "2.0.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Roderick Monje"]
12
- s.date = "2012-03-23"
12
+ s.date = "2012-04-16"
13
13
  s.description = "Users can browse locations by country, city, and state and search locations by string or zip code. Administrators can manage locations and the services they offer."
14
14
  s.email = "rod@seologic.com"
15
15
  s.extra_rdoc_files = [
@@ -140,7 +140,7 @@ Gem::Specification.new do |s|
140
140
  ]
141
141
  s.homepage = "http://github.com/ivanoblomov/campfire_logic"
142
142
  s.require_paths = ["lib"]
143
- s.rubygems_version = "1.8.11"
143
+ s.rubygems_version = "1.8.10"
144
144
  s.summary = "Rails engine that adds a location directory to your web app"
145
145
 
146
146
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: campfire_logic
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 6
10
- version: 2.0.6
9
+ - 7
10
+ version: 2.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Roderick Monje
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-03-23 00:00:00 Z
18
+ date: 2012-04-16 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: bson_ext
@@ -348,7 +348,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
348
348
  requirements: []
349
349
 
350
350
  rubyforge_project:
351
- rubygems_version: 1.8.11
351
+ rubygems_version: 1.8.10
352
352
  signing_key:
353
353
  specification_version: 3
354
354
  summary: Rails engine that adds a location directory to your web app