adminpanel 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Adminpanel
2
- VERSION = "1.2.3"
2
+ VERSION = "1.2.4"
3
3
  end
@@ -25,6 +25,8 @@ namespace :adminpanel do
25
25
  s.save
26
26
  end
27
27
 
28
+ task :dump => :dump_sections
29
+
28
30
  task :dump_sections => :environment do |t|
29
31
  puts "Dumping adminpanel_sections table into db/seeds.rb"
30
32
  File.open("db/seeds.rb", "w") do |f|
@@ -32,13 +34,9 @@ namespace :adminpanel do
32
34
  Adminpanel::Section.all.each do |section|
33
35
  f << "#{creation_command(section)}"
34
36
  end
35
-
36
37
  end
37
-
38
38
  end
39
39
 
40
- task :dump => :dump_sections
41
-
42
40
  task :populate, [:times, :model, :attributes] => :environment do |t, args|
43
41
 
44
42
  puts "Generating #{args[:times]} records of #{args[:model]}"
@@ -95,7 +93,7 @@ namespace :adminpanel do
95
93
 
96
94
  instance.save
97
95
 
98
- change_update_date(instance)
96
+ change_dates(instance)
99
97
 
100
98
  if(has_image) #forcing the image into the db
101
99
  create_image_of(instance.id)
@@ -127,7 +125,7 @@ private
127
125
  )
128
126
  image_instance.save(:validate => false)
129
127
  image_instance.update_column(:file, @file_url)
130
- change_update_date(image_instance)
128
+ change_dates(image_instance)
131
129
  end
132
130
 
133
131
  def generate_lorem
@@ -158,8 +156,10 @@ private
158
156
  "#{@adjective_denominations} #{@things.sample}"
159
157
  end
160
158
 
161
- def change_update_date(instance)
162
- instance.update_attribute(:updated_at, rand(3.years).ago)
159
+ def change_dates(instance)
160
+ date = rand(3.years).ago
161
+ instance.update_attribute(:created_at, date)
162
+ instance.update_attribute(:updated_at, date)
163
163
  end
164
164
 
165
165
  def init_variables
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adminpanel
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 3
10
- version: 1.2.3
9
+ - 4
10
+ version: 1.2.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jose Ramon Camacho