acts_as_hoc_avatarable 0.1.2 → 0.1.3

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: 0c743ea0761467067371d70dbe7a07d530c85fc6
4
- data.tar.gz: d16a49b481e39823f87f7f2d35f40f70c781a091
3
+ metadata.gz: 34e8b628f9935328c889ec5a6b5265714bfa5fc7
4
+ data.tar.gz: 28ef27baf47306c51db7f332952cb57b6b53c628
5
5
  SHA512:
6
- metadata.gz: 4f1663005241e08990091f1ace44e548dd4aaa7f10844eec52fb8421a239f1a418f5f00960979bb76172a1f67673b4c6030e536b5f8c397ec91e02b6465aed1e
7
- data.tar.gz: af4d6d5d6f3ff5b9bf77e03fad162f7ab023d56b264c46bf85ffbd50388c7c199f6a2d151f502578b4841162bcdf2399320339e3577c5cf25b38e5b9e52d81d1
6
+ metadata.gz: a79bb9770d8d0ccfaca7313d6ce3016093d89ca9532dc35d5134e8d63308a28795f27a76d20ef0d75c20a5bf140e0f22bdda29059e77d07742de7ce561a3f1fb
7
+ data.tar.gz: b6f53392bc3918d5851a23243841ee10a99388b05bf7323ea7f03124e17074562f61aafc1951ddecd3578d338dbb97288c046b867ba7f091818e7b33abd978fe
@@ -1,3 +1,3 @@
1
1
  module ActsAsHocAvatarable
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -1,6 +1,8 @@
1
+ require 'rails/generators/migration'
1
2
  module ActsAsHocAvatarable
2
- #module Generators
3
+ module Generators
3
4
  class InstallGenerator < Rails::Generators::Base
5
+ include Rails::Generators::Migration
4
6
  source_root File.expand_path('../templates', __FILE__)
5
7
 
6
8
  def copy_initializer_file
@@ -10,6 +12,16 @@ module ActsAsHocAvatarable
10
12
  def install_active_storage
11
13
  rails_command 'activestorage::install'
12
14
  end
15
+
16
+ def self.next_migration_number(dirname)
17
+ if ActiveRecord::Base.timestamped_migrations
18
+ sleep 1 # make sure each time we get a different timestamp
19
+ Time.new.utc.strftime("%Y%m%d%H%M%S")
20
+ else
21
+ "%.3d" % (current_migration_number(dirname) + 1)
22
+ end
23
+ end
24
+
13
25
  end
14
- #end
26
+ end
15
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_hoc_avatarable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gert Lavsen