statesman-multi_state 0.1.1 → 0.1.3

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: 0a9378684e0c78e8d531c24c8471836c9bc8622b48574c91d9d2a7e1fd84b2c8
4
- data.tar.gz: 6f0b45c1209e420cf240bc2cf6e25095cf02b84d3b7c64f9e23c10a88d627534
3
+ metadata.gz: e46de0c69e16445bf06a31f55dd04be09853dcb41773cc61252e45f17cc84fdb
4
+ data.tar.gz: 05b43b0794b37be03bd9d97b45b5660a3ffa8e095b0c903754d7f478d0d48dd1
5
5
  SHA512:
6
- metadata.gz: ecb9417ce2ab341e6802da12b7c16c798e67a5e224edde1764e8387e20cd0d7acecb84b2aa2935854b8d1069de71edf58d04eec2f4a0cbe9aceed9c1661dca6e
7
- data.tar.gz: fdd791478bfebf064b84801126fe22e1ceed791f0d96b4076166610ec861cbec4f126ff825cf26931bed0bf7b827bae3a053b9c57b5b502ce4d01af0f359c6bc
6
+ metadata.gz: 8cdfde1e0826666e57cb82d6be2eff7649675ba8d170520b40c22a139c3fc981030b07b072f454148d446ba7cc71121e09644a03709d2ba618307153bb6558a3
7
+ data.tar.gz: 76efdb5cc4e0217f2f6543aef1b5689d0c5375420d34970da6f29b1b995593ef6045b71bb32bb6741bc3157e41870ab56d2006ba228f708d7e3dac6923cc9b21
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
- # Statesman::MultiState
2
- ![Build](https://github.com/chaadow/statesman-multi_state/actions/workflows/ruby.yml/badge.svg)
1
+ # Statesman::MultiState
2
+ [![Gem](https://img.shields.io/gem/v/statesman-multi_state?style=for-the-badge)](https://rubygems.org/gems/statesman-multi_state) [![Build Status](https://img.shields.io/github/actions/workflow/status/chaadow/statesman-multi_state/ruby.yml?style=for-the-badge)](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:, transition_name: transition_klass.to_s.underscore.pluralize.to_sym)
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]
@@ -94,7 +94,7 @@ module Statesman
94
94
  field_name,
95
95
  nil,
96
96
  { state_machine_klass: state_machine_klass, transition_klass: transition_klass,
97
- transition_name: transition_name },
97
+ transition_name: transition_name, virtual_attribute_name: virtual_attribute_name },
98
98
  self
99
99
  )
100
100
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Statesman
4
4
  module MultiState
5
- VERSION = '0.1.1'
5
+ VERSION = '0.1.3'
6
6
  end
7
7
  end
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.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chedli Bourguiba
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-08 00:00:00.000000000 Z
11
+ date: 2023-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails