lotus_admin 1.0.0 → 1.0.1

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
  SHA256:
3
- metadata.gz: ca7667ec6d3d57d5e7656adbf615844998d4e1e452242bab411d91f3fa67bcca
4
- data.tar.gz: ed86a00d57f807c58e02033ccf13f40de08f0a908c4f205bc964fe2ed5bb8e82
3
+ metadata.gz: 7654d4a6375e34d5e2b58abff7c19c3e16721b4518ada9b5f84ccfe955838f95
4
+ data.tar.gz: 828b1e84b78a6b828c4b5f503d4205d14732064e145c343630c49aca4e440dea
5
5
  SHA512:
6
- metadata.gz: 890614c3de41babfa7341d1bdffa368949eff041e4ae24ccb67d0f7c5add598d096aab409abd58a3b2d4e62bc79d7472472fcedb8249536103524172829b01c4
7
- data.tar.gz: 564b94f2a43f90332b2e4dda37aee8fe1443d066d41831bca6ba5ec4a315b183560c76ddbcd7042e662ed6bf6c99ee48714badeda6b6d7d63758d7f33a0a883e
6
+ metadata.gz: d288f6e13b189d0b63af5ba153caffc5e4e3a8a86d64920cc0b9315e661bc781d61e01dd0e48b17bfcdd601c08a302485c56f5832a0b5bc3bdc04c95b20b92f2
7
+ data.tar.gz: 27425031f367f49b0b35946bc11a276ecd139ed560f1825d23a2f6c0e2db9968a4745917badacd58ebd803bfee4bd28c225eff87f688245ed8aa6ee697923b6b
data/README.md CHANGED
@@ -74,6 +74,13 @@ LotusAdmin.configure do |config|
74
74
  end
75
75
  ```
76
76
 
77
+ ### Custom User Class
78
+ You can choose to use a table pre-existing (with some columns added) or make use of the default schema when adding to your project for the first time.
79
+
80
+ If wanting to use a custom class and table name, but with the provided migration, just simply add the gem and then provide the initializer configuration before running migrations. You'll need to also define the model.
81
+
82
+ Otherwise if the table already exists, it won't be touched.
83
+
77
84
  ## Contributing
78
85
  Contribution directions go here.
79
86
 
@@ -1,8 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class DeviseCreateLotusAdminUsers < ActiveRecord::Migration[5.1]
4
- def change
5
- create_table :lotus_admin_users do |t|
4
+ def up
5
+ return if table_exists?(LotusAdmin.configuration.user_class.table_name)
6
+
7
+ create_table LotusAdmin.configuration.user_class.table_name do |t|
6
8
  ## Database authenticatable
7
9
  t.string :email, null: false, default: ""
8
10
  t.string :encrypted_password, null: false, default: ""
@@ -34,13 +36,18 @@ class DeviseCreateLotusAdminUsers < ActiveRecord::Migration[5.1]
34
36
 
35
37
  t.string :first_name, null: false
36
38
  t.string :last_name, null: false
39
+ t.string :time_zone, null: false, default: 'Eastern Time (US & Canada)'
37
40
 
38
41
  t.timestamps null: false
42
+
43
+ t.index :email, unique: true
44
+ t.index :reset_password_token, unique: true
45
+ t.index :confirmation_token, unique: true
46
+ # t.index :unlock_token, unique: true
39
47
  end
48
+ end
40
49
 
41
- add_index :lotus_admin_users, :email, unique: true
42
- add_index :lotus_admin_users, :reset_password_token, unique: true
43
- add_index :lotus_admin_users, :confirmation_token, unique: true
44
- # add_index :lotus_admin_users, :unlock_token, unique: true
50
+ def down
51
+ drop_table LotusAdmin.configuration.user_class.table_name
45
52
  end
46
53
  end
@@ -1,3 +1,3 @@
1
1
  module LotusAdmin
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lotus_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Millsaps-Brewer
@@ -430,8 +430,7 @@ files:
430
430
  - config/locales/simple_form.en.yml
431
431
  - config/locales/users.en.yml
432
432
  - config/routes.rb
433
- - db/migrate/20180228124526_devise_create_lotus_admin_users.rb
434
- - db/migrate/20180228210938_add_timezone_to_users.rb
433
+ - db/migrate/20180228210938_devise_create_lotus_admin_users.rb
435
434
  - lib/lotus_admin.rb
436
435
  - lib/lotus_admin/configuration.rb
437
436
  - lib/lotus_admin/engine.rb
@@ -1,5 +0,0 @@
1
- class AddTimezoneToUsers < ActiveRecord::Migration[5.1]
2
- def change
3
- add_column :lotus_admin_users, :time_zone, :string, null: false, default: 'Eastern Time (US & Canada)'
4
- end
5
- end