statesman-multi_state 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a9378684e0c78e8d531c24c8471836c9bc8622b48574c91d9d2a7e1fd84b2c8
4
- data.tar.gz: 6f0b45c1209e420cf240bc2cf6e25095cf02b84d3b7c64f9e23c10a88d627534
3
+ metadata.gz: da663a5e7b1efa3dd4494fee8bcd665783b2abaf4decc948d9b538c800439833
4
+ data.tar.gz: 31fadae9e9c629c966a5ad0f23db3cee60cf27e7536491d48b2e78d7248c9318
5
5
  SHA512:
6
- metadata.gz: ecb9417ce2ab341e6802da12b7c16c798e67a5e224edde1764e8387e20cd0d7acecb84b2aa2935854b8d1069de71edf58d04eec2f4a0cbe9aceed9c1661dca6e
7
- data.tar.gz: fdd791478bfebf064b84801126fe22e1ceed791f0d96b4076166610ec861cbec4f126ff825cf26931bed0bf7b827bae3a053b9c57b5b502ce4d01af0f359c6bc
6
+ metadata.gz: 51fefdd8d1620a90dd189f5299cacc04242542111f3d259920f431058d8f9a62e5c7b112f0dca05d11700082976aff8dfd6d1fc3de7f4058f930450e687c10e3
7
+ data.tar.gz: 52c6bcbad70363cad930ead5cc0a2f368871dbc9c34787909e7be3ed5f9c5f4bf9525cb29f39c3e8152439f00e7fe48d27b040b91d4e3a2632710a5c604be6ea
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]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Statesman
4
4
  module MultiState
5
- VERSION = '0.1.1'
5
+ VERSION = '0.1.2'
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.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: 2022-10-08 00:00:00.000000000 Z
11
+ date: 2023-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails