selection_options_for 0.0.7 → 0.0.8

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.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v0.0.8
2
+ ## v0.0.7
3
+ * updated the tests
4
+ * removed support for 2-argument option setup
5
+ * added reference to https://github.com/mwindholtz/state_objects
6
+
1
7
  ## v0.0.6
2
8
 
3
9
  * Better support for Rails 3.2
data/README.md CHANGED
@@ -4,6 +4,11 @@ This code allows you to keep the display labels in the model
4
4
  when the DB holds only a 1 character flag.
5
5
  and when the code requires symbolic references to the value to use in algorithms
6
6
 
7
+ ## Note
8
+ Please see also the new 'state_objects' Gem
9
+ StateObjects also supports behavior changes based on state and reduces conditional logic.
10
+ https://github.com/mwindholtz/state_objects
11
+
7
12
  ## Installation
8
13
 
9
14
  Add this line to your application's Gemfile:
@@ -26,8 +31,8 @@ Or install it yourself as:
26
31
  and when the code requires symbolic references to the value to use in algorithms
27
32
 
28
33
  * element 0 of the array passed in is always the logical symbol
29
- * If a 2-element Array is passed in, [key, label] and the first letter of label is the DB value
30
- * If a 3-element Array is passed in, [key, DB value, label]
34
+ * 3-element Array is passed in, [key, DB value, label]
35
+ * Removed: (2-element Array. This is no longer supported)
31
36
  * Any other type passed in throws an error
32
37
 
33
38
  ## Limitations:
@@ -37,9 +42,9 @@ Or install it yourself as:
37
42
 
38
43
  class Article < ActiveRecord::Base
39
44
  selection_options_for :file_type_option,
40
- [:pdf, 'PDF'],
41
- [:html, 'HTML'],
42
- [:msword, 'MS-Word']
45
+ [:pdf, 'P', 'PDF'],
46
+ [:html, 'H', 'HTML'],
47
+ [:msword, 'M', 'MS-Word']
43
48
  [:text, 'X', 'Textfile']
44
49
  end
45
50
 
@@ -105,13 +110,11 @@ In the example below 'R' is stored in the database when
105
110
 
106
111
  class Article < ActiveRecord::Base
107
112
  selection_options_for :payment_method_option,
108
- [:basic, 'Basic'],
109
- [:cash, 'Cash Account'],
110
- [:cc, 'R','Credit Card Account']
113
+ [:basic, 'B', 'Basic'],
114
+ [:cash, 'C', 'Cash Account'],
115
+ [:cc, 'R','Credit Card Account']
111
116
  end
112
117
 
113
-
114
-
115
118
  <%= select :article, :payment_method_option, Article.payment_method_options %>
116
119
 
117
120
 
@@ -124,7 +127,6 @@ In the example below 'R' is stored in the database when
124
127
 
125
128
  ### Example #4 in a java_script list
126
129
 
127
-
128
130
  payment_method_option_js_list
129
131
 
130
132
 
@@ -1,3 +1,3 @@
1
1
  module SelectionOptionsFor
2
- VERSION = "0.0.7" unless defined? SelectionOptionsFor::VERSION
2
+ VERSION = "0.0.8" unless defined? SelectionOptionsFor::VERSION
3
3
  end
Binary file
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selection_options_for
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -70,6 +70,7 @@ files:
70
70
  - pkg/selection_options_for-0.0.5.gem
71
71
  - pkg/selection_options_for-0.0.6.gem
72
72
  - pkg/selection_options_for-0.0.7.gem
73
+ - pkg/selection_options_for-0.0.8.gem
73
74
  - selection_options_for.gemspec
74
75
  - test/selection_options_for_ex_test.rb
75
76
  - test/selection_options_for_test.rb