flipflop 2.7.0 → 2.7.1

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: 5d280de2ff4eb5a0d3437866c2f6d08e6069564183d670cb437cc7741e7eeac3
4
- data.tar.gz: e16c3770910db3cfc4a442e2094acf44426651f0456235992f8ea0166e53e6d9
3
+ metadata.gz: 69f214599b32e0544ade72b6c07a928af76acc4355a3730395239182fa0a5107
4
+ data.tar.gz: 6b5f36a45bbd650e123976dd372ce8be63e546485f7cb2cfe2313d65723b45d3
5
5
  SHA512:
6
- metadata.gz: b2ab3024b4106125d0f67a6333c5d2fc6b6e32d744e3fca9775894e9291cca0e2ecb3b74d6343598fc91c44cf0077b7496e79dade91fa27ce6418bb7fb3a534a
7
- data.tar.gz: 6c55c846ba7759fa595485283a8d7d5eeaeb919e238a5752310b8bbfb6915f486cf4f750ab96acef3ec94da4295dab144fd6673e5802a0b26d4b3481d16654ba
6
+ metadata.gz: c9631d29ec55a231c775a5b7df53ecd7a8704f2a7e97b3c845ce8fcefa0629111ab921759e39d34db0c8d5e41a38e1d05dfdbe487e620950623cb928fde82c60
7
+ data.tar.gz: 343a0dc013172165af8f10bf81417d1e1cfb47784886a77dc7dc03d9dd69bba9f14973b96aeed1da188f14a8d4a4e7ba5a2d1a74fa00d82dbf38b120fd19ee0b
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 2.7.1
2
+
3
+ * Admin page redirection enhancements after updating a feature switch. Now after flipping a switch it will take you back to the section that you were navigating previously. This is very helpful when having several feature switches.
4
+
1
5
  ## 2.7.0
2
6
 
3
7
  * Removing .css extension from render partial and adding it to html handler to correctly render the erb file.
@@ -4,12 +4,12 @@ module Flipflop
4
4
 
5
5
  def update
6
6
  FeatureSet.current.switch!(feature_key, strategy_key, enable?)
7
- redirect_to(features_url)
7
+ redirect_to features_url(anchor: "#{feature_key}-#{strategy_key}".parameterize)
8
8
  end
9
9
 
10
10
  def destroy
11
11
  FeatureSet.current.clear!(feature_key, strategy_key)
12
- redirect_to(features_url)
12
+ redirect_to features_url(anchor: "#{feature_key}-#{strategy_key}".parameterize)
13
13
  end
14
14
 
15
15
  private
@@ -41,7 +41,7 @@
41
41
  </td>
42
42
 
43
43
  <% @feature_set.strategies.each do |strategy| -%>
44
- <td class="toggle" data-strategy="<%= strategy.name.dasherize.parameterize %>">
44
+ <td class="toggle" data-strategy="<%= strategy.name.dasherize.parameterize %>" id="<%= "#{feature.key}-#{strategy.key}".parameterize %>">
45
45
  <div class="toolbar">
46
46
  <%= form_tag(@feature_set.switch_url(strategy, feature), method: :put) do -%>
47
47
  <div class="group">
@@ -15,10 +15,10 @@ module Flipflop
15
15
  FeatureSet.current.add(feature)
16
16
  end
17
17
 
18
- def strategy(strategy = nil, **options)
18
+ def strategy(strategy = nil, **options, &block)
19
19
  if block_given?
20
20
  options[:name] = strategy.to_s
21
- options[:lambda] = Proc.new
21
+ options[:lambda] = Proc.new &block
22
22
  strategy = Strategies::LambdaStrategy
23
23
  end
24
24
 
@@ -1,3 +1,3 @@
1
1
  module Flipflop
2
- VERSION = "2.7.0"
2
+ VERSION = "2.7.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flipflop
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.0
4
+ version: 2.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Annesley
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-06-29 00:00:00.000000000 Z
13
+ date: 2023-03-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport