plant 1.1.0 → 1.2.0

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: fd41caf850e81cba20f441d090d7f6329ead3cc2
4
- data.tar.gz: b15e9dc6409f83ff0b38159b962a689b2b537e8a
3
+ metadata.gz: c9058cb3d727fda89439b7c96328d6125ac9d393
4
+ data.tar.gz: c5aae4d878e147bd07e8b3ba21df08a017bbfd0f
5
5
  SHA512:
6
- metadata.gz: d79c05fe73790426f4394b4f82fafa536d84f8e557664eb1eddf583a7827db536d0b0d7fc53eb725c2fb18d7a57d46281bfd25495fd8c7127cded6efd2f5f06b
7
- data.tar.gz: 524510dcb7c795f2cc004f3ff63a686b16c186c48cb0e2450606c224d5a1e61ae51cb19af7f454dc9ef8785a0781fa52b1581a68fc40ae34dc730108a094c6ef
6
+ metadata.gz: 0da310735d7abb99165292db7125913295b0f8ad70b5fb753d8149be0e3829c59475c2d5df2b0814b8e8e68d090d100cfc71cf46d5ac2c3db9115dbb1466d43e
7
+ data.tar.gz: 172e00f962ef1e4d8ef091cfc77a016fda596c4fe6f5b36d200ab00beb4877dfa4df0cf430bbb69617e2ed0c522c3f34c16325da494c931fe4c3195b50a44642
@@ -1,4 +1,4 @@
1
1
  # Version file
2
2
  module Plant
3
- VERSION = '1.1.0'
3
+ VERSION = '1.2.0'
4
4
  end
@@ -2,11 +2,14 @@ namespace :plant do
2
2
  desc 'Puts the content from the YAML files in app/content into the database'
3
3
  task seed: :environment do
4
4
  count = 0
5
+ added_nodes = []
5
6
  Plant::Utils.load_all_yaml_files.each do |full_node, value|
6
7
  add_object(full_node, value)
8
+ added_nodes << full_node
7
9
  count += 1
8
10
  end
9
- puts "Planted #{count} seeds."
11
+ none = Plant::Content.where.not(node_id: added_nodes).destroy_all.count
12
+ puts "Planted #{count} seeds and removed #{none} redundant seeds."
10
13
  end
11
14
 
12
15
  desc 'Puts the content from the YAML files in app/content into the database'
@@ -7,6 +7,7 @@ RSpec.describe 'Populating the database' do
7
7
  Rake::Task['plant:seed'].reenable
8
8
  Rake.application.invoke_task 'plant:seed'
9
9
  end
10
+
10
11
  after :all do
11
12
  Plant::Content.delete_all
12
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yule
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-19 00:00:00.000000000 Z
11
+ date: 2016-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails