devise-web3 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e68bc1f6d3c232ed313716ffd75366da08cab7aff45a3595aabe257e0b395aaf
4
- data.tar.gz: 051273f57948614a0dbe571102e2e92471ea88a8fd4922c6b17142e25bdc63c1
3
+ metadata.gz: 23f6279d9f03f0ae35fca26cf93e9f09036aa241d86f51655cfb93ba2a1e9eac
4
+ data.tar.gz: 8e2908eef867246d6729fe155d5bf2f799664897b8923e8d9834d30afa76e979
5
5
  SHA512:
6
- metadata.gz: f174021a37f7ea1a6b3e405c1a91bb3bdbb96f78307741b66a6354eb5b3e7fcb34c8215be94ac3bed93b95979ca4eb54d50cb39409d81092799b3e89eb7e50f1
7
- data.tar.gz: e09a3c332cda09742cf51bbbc83a2c78df141f320b9565f0fb0ba9af8451b9869ec996ce40d133081993f1a211efa263811fac05c953bc24dc0ba7f9b0ca84bc
6
+ metadata.gz: 8a320a4db75bb9c700b54c717faca48674b13af02527e1fcb9ea79e66f65131f54104d5d3187c960510e38c48735ea090fe4c5a596a1213ca574e1d9e353661a
7
+ data.tar.gz: c127eb010e7c594d219cc959f85e20ba0e42f66bab31db06de71e4f3cadfda18ef358e0bf96bd1d0bf3aec7735293bbb8ccd572667f41e413145ae6425e2eef1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- devise-web3 (0.1.0)
4
+ devise-web3 (0.2.0)
5
5
  devise (~> 4.0)
6
6
  eth (~> 0.5.15)
7
7
  redis
data/README.md CHANGED
@@ -31,6 +31,11 @@ end
31
31
 
32
32
  ```
33
33
 
34
+ Generate migration
35
+ ```shell
36
+ bin/rails g active_record:devise_web3 users
37
+ ```
38
+
34
39
  ## Development
35
40
 
36
41
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -1,5 +1,5 @@
1
1
  module Devise
2
2
  module Web3
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
@@ -0,0 +1,19 @@
1
+ require 'rails/generators/active_record'
2
+
3
+ module ActiveRecord
4
+ module Generators
5
+ class DeviseWeb3Generator < ActiveRecord::Generators::Base
6
+ source_root File.expand_path('../templates', __FILE__)
7
+
8
+ def copy_devise_migration
9
+ migration_template 'migration.rb', "db/migrate/devise_web3_add_to_#{table_name}.rb", migration_version: migration_version
10
+ end
11
+
12
+ def migration_version
13
+ if Rails::VERSION::MAJOR >= 5
14
+ "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,17 @@
1
+ class DeviseWeb3AddTo<%= table_name.camelize %> < ActiveRecord::Migration<%= migration_version %>
2
+ def up
3
+ change_table :<%= table_name %> do |t|
4
+ t.string :public_address
5
+ end
6
+
7
+ add_index :<%= table_name %>, :public_address
8
+ end
9
+
10
+ def down
11
+ change_table :<%= table_name %> do |t|
12
+ t.remove :public_address
13
+ end
14
+
15
+ remove_index :<%= table_name %>, :public_address
16
+ end
17
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise-web3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - TheSmartnik
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-09-12 00:00:00.000000000 Z
10
+ date: 2025-09-13 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: devise
@@ -150,6 +150,8 @@ files:
150
150
  - lib/devise/web3/routes.rb
151
151
  - lib/devise/web3/strategies/web3_authenticatable.rb
152
152
  - lib/devise/web3/version.rb
153
+ - lib/generators/active_record/devise_web3_generator.rb
154
+ - lib/generators/active_record/templates/migration.rb
153
155
  homepage: https://thesmartnik.com
154
156
  licenses:
155
157
  - MIT