attribeauty 0.4.6 → 0.4.7
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/lib/attribeauty/params.rb +12 -1
- data/lib/attribeauty/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3e7fb42086d75e28fa5c80ff5718c7de734759a0bce85df5b3fd48a2fabbbaf
|
4
|
+
data.tar.gz: 2a08c818e591cd8b4a780d275f2323c76842c7095a2de878bda7bfaab357ef0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 970ede789c687fd334b84555b610940e3862672166269a2b39055c942f79a7466371f4a05d35bc658b5b455914281e5cde607e9a41da84c49e7554d58df935b7
|
7
|
+
data.tar.gz: 2e7a482d54b2487169cb63380eb641a42a3bc03a1fecd25028ed917e2184110bdd658173924de55ff7440c7101c3a93b5f42bf182f2e58c90a6e874ef4406a86
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/attribeauty/params.rb
CHANGED
@@ -44,7 +44,7 @@ module Attribeauty
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def root(name)
|
47
|
-
@request_params = request_params[name]
|
47
|
+
@request_params = request_params[name].transform_keys(&:to_sym)
|
48
48
|
|
49
49
|
yield
|
50
50
|
end
|
@@ -68,6 +68,9 @@ module Attribeauty
|
|
68
68
|
strict
|
69
69
|
end
|
70
70
|
|
71
|
+
# in Rails if you have a user model you can call
|
72
|
+
# Attribeauty::Params.with(params.to_unsafe_h).generate_for(User, :username, :name, :age, :email)
|
73
|
+
# It will grab the type, and add an exclude_if: for all with Null false
|
71
74
|
def generate_for(model, *columns)
|
72
75
|
raise "Method requires Rails" unless defined?(Rails)
|
73
76
|
|
@@ -80,6 +83,14 @@ module Attribeauty
|
|
80
83
|
attribute(*attrs)
|
81
84
|
end
|
82
85
|
end
|
86
|
+
|
87
|
+
self
|
88
|
+
end
|
89
|
+
|
90
|
+
def generate_for!(model, *columns)
|
91
|
+
@strict = true
|
92
|
+
|
93
|
+
generate_for(model, *columns)
|
83
94
|
end
|
84
95
|
|
85
96
|
private
|
data/lib/attribeauty/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attribeauty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toby
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: There are so many of these, I just needed this one.
|
14
14
|
email:
|