selections 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -12,4 +12,9 @@
12
12
 
13
13
  ## 0.1.3
14
14
 
15
- * Fixing issue with dependencies on Rubygems
15
+ * Fixing issue with dependencies on Rubygems
16
+
17
+ ## 0.1.5
18
+
19
+ * Fixed issue with options and html_options order
20
+
@@ -16,11 +16,11 @@ module Selections
16
16
  # * +system_code+ - Overrides the automatic system_code name based on the fieldname and looks up the list of items in Selection
17
17
 
18
18
  def selections(field, options = {}, html_options = {})
19
- SelectionTag.new(self, object, field, html_options, options).to_tag
19
+ SelectionTag.new(self, object, field, options, html_options).to_tag
20
20
  end
21
21
 
22
22
  class SelectionTag #:nodoc:
23
- attr_reader :form, :object, :field, :html_options, :options, :selection, :field_id, :system_code_name
23
+ attr_reader :form, :object, :field, :options, :html_options, :selection, :field_id, :system_code_name
24
24
 
25
25
  def initialize(form, object, field, options, html_options)
26
26
  @form = form
@@ -59,7 +59,7 @@ module Selections
59
59
  options[:selected] = selected_item
60
60
  form.select field_id, items.map { |item| [item.name, item.id] }, options, html_options
61
61
  else
62
- "Could not find system_code of '#{system_code_name}' or '#{form.object_name}_#{system_code_name}'"
62
+ "Could not find system_code of '#{system_code_name}' or '#{form.object_name}_#{system_code_name}' - #{options}"
63
63
  end
64
64
  end
65
65
 
@@ -1,3 +1,3 @@
1
1
  module Selections
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -50,6 +50,14 @@ describe SelectionTag do
50
50
  end
51
51
  end
52
52
 
53
+ context "system_code override" do
54
+ it "meme" do
55
+ hello = Selection.create(name: "hello")
56
+ parent
57
+ expect(new_form(options: {system_code: :hello} ).system_code).to eq hello
58
+ end
59
+ end
60
+
53
61
  it "finds with form model prefixed" do
54
62
  model_parent
55
63
  expect(edit_form.system_code).to eq(model_parent)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selections
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: