administration-zero 0.0.1 → 0.0.2

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: 631eb6474ed5d2677353b675da33f5dc6ffe728a75c782f264386d5d70cf77bb
4
- data.tar.gz: 977ff8b33aaeb393ff8d5a35eadb59fcf6436d3fe87e065fdeff319186c8442b
3
+ metadata.gz: 214d49406cab89939a1eed9fca062ea1eddec241da295ced816f779ee2f6d439
4
+ data.tar.gz: 4fba566d3efca4b047eb189207ba69a8bd00d4224b4b34aff56db44bcbf0c04a
5
5
  SHA512:
6
- metadata.gz: 464d70d9d38119bc9cbd519e9b0345f4db705a6be203b62893a6e5395a1f046a611f14d54a1191a934eb59d1ae65a5a8e719dd4dbac3f0802e1b01bf3d2576c6
7
- data.tar.gz: 4ce3bcd7fa19c2cbe83b12c6339f324e269ca8fe7b527b5882abd9c02fa18098effbc0f9b5d1109278f23800a98aa894f8910c3b30e9d6f9cb6fc0eae17515ce
6
+ metadata.gz: b88ec66ddfd35b0e1fb14225f7788a1d3c8bcfee529329490400b914664d02be2ace9d27042662793c810e414079d66615d09558a02b0605a2f8b497cc16ff9f
7
+ data.tar.gz: fb350fef6c38587bf81ec922e8a258ad37a4044c2d159d3efd12f5a8235ec9959f60b61c9e0c41baa24c715ce34c6d8d04e8eb181423c8d5de754aa1c0554250
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- administration-zero (0.0.1)
4
+ administration-zero (0.0.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -21,13 +21,24 @@ gem "authentication-zero"
21
21
 
22
22
  Then run `bundle install`
23
23
 
24
+ You'll need to create a model to be administrated, if you don't have one. for this example let's use the following:
25
+
26
+ ```
27
+ $ rails generate model posts title:string body:text published:boolean
28
+ ```
29
+
24
30
  ## Usage
25
31
 
26
32
  ```
27
33
  $ rails generate admin:install
28
34
  ```
29
35
 
30
- Then run `bundle install` again, now you're ready to generate your admin scaffolds.
36
+ Then run `bundle install` again
37
+
38
+ Then run `rails db:seed`, you can access the admin panel in `/admin`, using `email: "admin@example.com", password: "Password9957"`
39
+
40
+
41
+ Now you're ready to generate your admin scaffolds.
31
42
 
32
43
  ```
33
44
  $ rails generate admin:scaffold posts title:string body:text published:boolean
@@ -1,3 +1,3 @@
1
1
  module AdministrationZero
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -14,7 +14,8 @@ module Admin
14
14
  gem "spreadsheet_architect", comment: "Spreadsheet Architect is a library that allows you to create XLSX, ODS, or CSV spreadsheets super easily [https://github.com/westonganger/spreadsheet_architect]"
15
15
  end
16
16
 
17
- def create_migrations
17
+ def create_db_files
18
+ copy_file "db/seeds.rb", "db/seeds.rb", force: true
18
19
  migration_template "migrations/create_admin_users.rb", "#{db_migrate_path}/create_admin_users.rb"
19
20
  end
20
21
 
@@ -0,0 +1,9 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }])
7
+ # Character.create(name: "Luke", movie: movies.first)
8
+
9
+ AdminUser.create(email: "admin@example.com", password: "Password9957", password_confirmation: "Password9957")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: administration-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon
@@ -457,6 +457,7 @@ files:
457
457
  - lib/generators/admin/install/templates/models/admin/current.rb
458
458
  - lib/generators/admin/install/templates/models/admin_user.rb
459
459
  - lib/generators/admin/install/templates/models/application_record.rb
460
+ - lib/generators/admin/install/templates/seeds.rb
460
461
  - lib/generators/admin/install/templates/test_unit/admin_users.yml
461
462
  - lib/generators/admin/install/templates/test_unit/application_system_test_case.rb
462
463
  - lib/generators/admin/install/templates/test_unit/controllers/admin/home_controller_test.rb