devise_sms_verifiable 0.0.5 → 0.0.6

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: e2b01a58cb30cab2945d444bb44cfdff8ebe40d4
4
- data.tar.gz: 941904053e66f69a922d1cf51f58afa88e039519
3
+ metadata.gz: 1b9341cde59779b8f48240a8bbbb5fa732a0e607
4
+ data.tar.gz: 16aa797f5ea693d554ba6cee746d5f0e6f3629b7
5
5
  SHA512:
6
- metadata.gz: bbf25be7649baea856593213f5d7501cdfcafe700c9112879b31e4301ea95e7768fa50c110496193a2e5233c7d2f1b66f4d3d2e33131e02d09aea4db2aa432fe
7
- data.tar.gz: 50733909ef22e78a69831c9dcbde6ced048b78f0fb492fa1c9f358505e303450997fe971d86fb7db37d5c546590d1a827fb4a997faa85242a630d6f595f3430d
6
+ metadata.gz: d51869dee0ad6abe2b2a85b2d2b45c624fd5d09c94f0a3636c1581869d7654eb4459c332b88e2f7daa852d5aeb8144d5bf6e0a9b9991218f4e2cfc67ac243b84
7
+ data.tar.gz: ef7018d8502a2fd4c3cb0048b355ed436a6211a48ef75fd0d0440ffa0235988d96361ca129145dd9b001c0f8a9ef2d3ee39b17a7fbfbb8339b60840c6b9c9296
@@ -1,3 +1,3 @@
1
1
  module DeviseSmsVerifiable
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -8,6 +8,8 @@ module DeviseSmsVerifiable
8
8
  \033[31mrails g devise_sms_verifiable:install\e[0m\n
9
9
  Add config variables to devise initializer.\n
10
10
  \033[31mrails generate devise_sms_verifiable:views\e[0m\n
11
- Install views to your app"
11
+ Install views to your app\n
12
+ \033[31mrails g devise_sms_verifiable:migration\e[0m\n
13
+ Add migration."
12
14
  end
13
15
  end
@@ -0,0 +1,37 @@
1
+ require 'rails/generators/base'
2
+
3
+ module DeviseSmsVerifiable
4
+ class MigrationGenerator < Rails::Generators::Base
5
+
6
+ def add_migrations
7
+ table_name = Devise::default_scope.to_s.pluralize
8
+ exist_migration = Dir.glob('db/migrate/*_devise_sms_verifiable_add_to_*')
9
+ exist_migration.any? ? p("Check db/migrate, look like have sms verifiable migration") : nil
10
+ if exist_migration.blank?
11
+ migration_path = "db/migrate/#{Time.now.strftime("%Y%m%d%H%M%S")}_devise_sms_verifiable_add_to_#{table_name}.rb"
12
+ migration_template = <<-RUBY
13
+ class DeviseSmsVerifiableAddTo#{table_name.camelize} < ActiveRecord::Migration
14
+ def self.up
15
+ change_table :#{table_name} do |t|
16
+ # Field in the model which phone number
17
+ t.string :phone
18
+ # Field in the model which returns the correct answer
19
+ t.string :sms_answer
20
+ # Field in the model which returns phone confirm or no
21
+ t.boolean :phone_confirm, default: false
22
+ end
23
+ end
24
+
25
+ def self.down
26
+ remove_column :#{table_name}, :phone
27
+ remove_column :#{table_name}, :sms_answer
28
+ remove_column :#{table_name}, :phone_confirm
29
+ end
30
+ end
31
+ RUBY
32
+ create_file(migration_path, migration_template)
33
+ end
34
+ end
35
+ end
36
+ end
37
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_sms_verifiable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kiselenko Roman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-16 00:00:00.000000000 Z
11
+ date: 2014-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -137,7 +137,6 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  description: |2
140
- Description of DeviseSmsVerifiable:
141
140
  Module provide sms functions, easy to use and customize.
142
141
  email:
143
142
  - shindu666@gmail.com
@@ -160,6 +159,7 @@ files:
160
159
  - lib/devise_sms_verifiable/version.rb
161
160
  - lib/generators/devise_sms_verifiable/devise_sms_verifiable_generator.rb
162
161
  - lib/generators/devise_sms_verifiable/install_generator.rb
162
+ - lib/generators/devise_sms_verifiable/migration_generator.rb
163
163
  - lib/generators/devise_sms_verifiable/templates/README
164
164
  - lib/generators/devise_sms_verifiable/views_generator.rb
165
165
  homepage: https://github.com/fishbullet/devise_sms_verifiable