rails_settlement 1.0.0 → 1.1.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: 59429b5aef8ee3fb19702c66a17ddba2240017bfa215ef0799483ee076f2b64c
4
- data.tar.gz: 3d153d543d3010e5c067eb9d79bf8c3feb188c6b1c82ec7ca41dee1e6ebba0e1
3
+ metadata.gz: c6cd260f7d833858f657cf7975bc54f27d9b96ac4683ceae6600b0ee404e5799
4
+ data.tar.gz: 62504498246549f0742944144059d1a9bff5687f6a0f775a4ff80bb1a75c3440
5
5
  SHA512:
6
- metadata.gz: 812f2ab5b2974f245af355d5cfdb68b71b1069437c0e5a2e70911f01a44c890acec96bd25aa1d9b031e756090aba9a1961eba113a6b7d17db3aac742fb62d43f
7
- data.tar.gz: f8bb4d5f49e407dda8ee652651a03d3bbcb78fcd1f0173d17196635638c55203bacde0ee84f4dcf392c06faa188b525a27469a8be24c850b9344ddc0148ba31a
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!
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsSettlement
4
- VERSION = "1.0.0"
4
+ VERSION = "1.1.0"
5
5
  end
@@ -35,6 +35,6 @@ module RailsSettlement
35
35
  end
36
36
  end
37
37
 
38
- ActiveSupport.on_load(:action_controller_base) do
38
+ ActiveSupport.on_load(:action_controller) do
39
39
  include RailsSettlement
40
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_settlement
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tejas