active_buddy 0.1.1 โ†’ 0.2.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: 3259f3d8e92efdc663595c431f70c2a6be20763b4f9df652ffdeb468b126d548
4
- data.tar.gz: 266291b0bb09bdd4b783b0e5ea271d78d8a462554871bb18262e2e3ebd46419c
3
+ metadata.gz: c13cf857ccc9cf61976a9bf736223ae6c2b262c144f99317846c494e413c1419
4
+ data.tar.gz: 7fad1ff5832beaceb9167fb022b63c8cd19ddc0801fef94e3c14f82a9c3a0bd8
5
5
  SHA512:
6
- metadata.gz: 073e9792a150338e1e300d93939065c6340cc30fb64430be35d38e10737ca4605d44e89f61d8dd07a92dd77d5a90746b586e5be4e24f0860b16b2c28e01d18e6
7
- data.tar.gz: c034e5cdb2b25cdcc5d6fdb3facce7e546bd3f317bfc6c337bef81ab34ea1280f1a4650358a5243cbc6f6dca172350c86e1d4310f3842faeae9943581c5dcd4e
6
+ metadata.gz: 674cbe6813cde3884aae361a5481bfd1ca3721f6a48e0093bdac5d9c148a7f404cb51835b8f5552981505fb82f001c3d2e170ade7a138de1e65ad504b32bbb42
7
+ data.tar.gz: bc4be7faf6ae6c04c6f9a90c904171afc2cdb90db853e671370b9fcf9f12b77cae0284c4420aa7347006a0ec11635675ce1d4e98b3ab0c73a838e1910b1f6be0
data/README.md CHANGED
@@ -53,6 +53,7 @@ require 'active_Buddy'
53
53
  analyzer = ActiveBuddy::Analyzer.new(User)
54
54
  puts analyzer.suggest_validations
55
55
  puts analyzer.suggest_associations
56
+ puts analyzer.quick_audit
56
57
  ```
57
58
 
58
59
  Output:
@@ -84,6 +85,22 @@ ActiveBuddy automatically picks up and suggests validations based on:
84
85
 
85
86
  Also detects and formats associations from ActiveRecord relationships.
86
87
 
88
+
89
+ ๐Ÿ” Auditing model: User
90
+ Fields detected: id, email, password, account_id, created_at, updated_at
91
+
92
+ โœ… Suggested Validations:
93
+ validates :email, presence: true
94
+ validates :email, uniqueness: true
95
+
96
+ ๐Ÿ”— Suggested Associations:
97
+ belongs_to :account
98
+
99
+ ๐Ÿ’ก Tips:
100
+ - Consider adding presence validations for key fields.
101
+ - Add associations if your model connects to others (like belongs_to, has_many).
102
+
103
+
87
104
  ---
88
105
 
89
106
  ## ๐Ÿงช Run Specs
@@ -52,5 +52,26 @@ module ActiveBuddy
52
52
  "#{assoc.macro} :#{assoc.name}"
53
53
  end
54
54
  end
55
+
56
+ def quick_audit
57
+ report = []
58
+ report << "๐Ÿ” Auditing model: #{model.name}"
59
+ report << "Fields detected: #{model.columns.map(&:name).join(', ')}"
60
+
61
+ validations = suggest_validations
62
+ associations = suggest_associations
63
+
64
+ report << "\nโœ… Suggested Validations:"
65
+ report += validations.empty? ? ["(none found)"] : validations
66
+
67
+ report << "\n๐Ÿ”— Suggested Associations:"
68
+ report += associations.empty? ? ["(none found)"] : associations
69
+
70
+ report << "\n๐Ÿ’ก Tips:"
71
+ report << "- Consider adding presence validations for key fields."
72
+ report << "- Add associations if your model connects to others (like belongs_to, has_many)."
73
+ report.join("\n")
74
+ end
75
+
55
76
  end
56
77
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveBuddy
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_buddy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Your Name
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-11 00:00:00.000000000 Z
11
+ date: 2025-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord