statesman-multi_state 0.1.1 → 0.1.2
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/README.md +2 -2
- data/lib/statesman/multi_state/active_record_macro.rb +2 -2
- data/lib/statesman/multi_state/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: da663a5e7b1efa3dd4494fee8bcd665783b2abaf4decc948d9b538c800439833
|
4
|
+
data.tar.gz: 31fadae9e9c629c966a5ad0f23db3cee60cf27e7536491d48b2e78d7248c9318
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51fefdd8d1620a90dd189f5299cacc04242542111f3d259920f431058d8f9a62e5c7b112f0dca05d11700082976aff8dfd6d1fc3de7f4058f930450e687c10e3
|
7
|
+
data.tar.gz: 52c6bcbad70363cad930ead5cc0a2f368871dbc9c34787909e7be3ed5f9c5f4bf9525cb29f39c3e8152439f00e7fe48d27b040b91d4e3a2632710a5c604be6ea
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# Statesman::MultiState
|
2
|
-
](https://rubygems.org/gems/statesman-multi_state) [](https://github.com/chaadow/statesman-multi_state/actions/workflows/ruby.yml)
|
3
3
|
|
4
4
|
Handle multiple state machines on the same ActiveRecord model for `statesman` through `has_one_state_machine` ActiveRecord macro.
|
5
5
|
|
@@ -8,9 +8,9 @@ module Statesman
|
|
8
8
|
extend ActiveSupport::Concern
|
9
9
|
|
10
10
|
class_methods do
|
11
|
-
def has_one_state_machine(field_name, state_machine_klass:, transition_klass:,
|
11
|
+
def has_one_state_machine(field_name, state_machine_klass:, transition_klass:,
|
12
|
+
transition_name: transition_klass.to_s.underscore.pluralize.to_sym, virtual_attribute_name: "#{field_name}_state_form")
|
12
13
|
state_machine_name = "#{field_name}_state_machine"
|
13
|
-
virtual_attribute_name = "#{field_name}_state_form"
|
14
14
|
|
15
15
|
# To handle STI, this needs to be done to get the base klass
|
16
16
|
base_klass = caller_locations.first.label.split(':').last[...-1]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: statesman-multi_state
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chedli Bourguiba
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|