rails_settlement 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/lib/rails_settlement/version.rb +1 -1
- data/lib/rails_settlement.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6cd260f7d833858f657cf7975bc54f27d9b96ac4683ceae6600b0ee404e5799
|
4
|
+
data.tar.gz: 62504498246549f0742944144059d1a9bff5687f6a0f775a4ff80bb1a75c3440
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 814545781be4df3a5e653ada67eef58ba81264f67bcfc1bab8591c19f4336e3f46051346dab13e9d7e34b6a0d81da75a1441359a67aa66e331193bcd185426f3
|
7
|
+
data.tar.gz: f014d90ed48da27180bf93760dfe0483e300b79974059e3cced620d26932d22195b7661f7b17516b1519ab239e5c0d958cc55755df55ffbfb50fe49e00cd6fcd
|
data/README.md
CHANGED
@@ -18,7 +18,9 @@ class UsersController < ApplicationController
|
|
18
18
|
set_user only: %i[show] # Internally, it's just a before_action callback, so you can pass options to the callback directly.
|
19
19
|
set_user! only: %i[edit] # Using this method with a bang (!) would trigger an ActiveRecord::RecordNotFound Exception.
|
20
20
|
|
21
|
-
|
21
|
+
def show
|
22
|
+
do_something with: user # You will also have an attribute reader with the same name available if the object is found. If not, it'll default to nil (unless a bang method is used, in which case an error is raised!)
|
23
|
+
end
|
22
24
|
end
|
23
25
|
```
|
24
26
|
|
@@ -34,6 +36,7 @@ end
|
|
34
36
|
```
|
35
37
|
|
36
38
|
This way you can use any model instead of a `User`. Just follow the naming convention `set_[model_name_in_snake_case]!`.
|
39
|
+
|
37
40
|
P.S: This should not work with STI or any Namespaced models. If you have a way to make them work, please raise a pull request!
|
38
41
|
|
39
42
|
That's about it!
|
data/lib/rails_settlement.rb
CHANGED