objectreload-simple_enumerations 0.1.5 → 0.1.6

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.
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 1
4
- :patch: 5
4
+ :patch: 6
5
5
  :build:
@@ -2,7 +2,7 @@ module Wijet
2
2
  module FormHelper
3
3
  def select_enumeration(method)
4
4
  @template.select_tag "#{@object_name}[#{method}]",
5
- @template.options_from_collection_for_select(Wijet::SimpleEnumerations::EnumerationString::Enumeration[method], :to_s, :to_s , @object.send(method).to_s)
5
+ @template.options_from_collection_for_select(Enumeration[method], :to_s, :to_s , @object.send(method).to_s)
6
6
  end
7
7
  end
8
8
  end
@@ -6,20 +6,20 @@ module Wijet
6
6
 
7
7
  module ClassMethods
8
8
  def has_enumerated(name)
9
- EnumerationString::Enumeration.setup
9
+ Enumeration.setup
10
10
 
11
11
  name = name.to_s
12
12
 
13
13
  define_method("#{name}=") do |value|
14
14
  value = value.to_s
15
- unless EnumerationString::Enumeration[name].include?(value) or value.blank?
15
+ unless Enumeration[name].include?(value) or value.blank?
16
16
  raise ArgumentError, "'#{value}' is not a value of enumeration '#{name}'"
17
17
  end
18
18
  write_attribute(name, value)
19
19
  end
20
20
 
21
21
  define_method(name) do
22
- EnumerationString::Enumeration.new(attributes[name])
22
+ Enumeration.new(attributes[name])
23
23
  end
24
24
  end
25
25
  end
@@ -56,3 +56,5 @@ module Wijet
56
56
  end
57
57
  end
58
58
  end
59
+
60
+ include Wijet::SimpleEnumerations::EnumerationString
@@ -1,5 +1,5 @@
1
1
  class Symbol
2
2
  def ==(object)
3
- object.kind_of?(Wijet::SimpleEnumerations::EnumerationString::Enumeration) ? object == self : super
3
+ object.kind_of?(Enumeration) ? object == self : super
4
4
  end
5
5
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{objectreload-simple_enumerations}
8
- s.version = "0.1.5"
8
+ s.version = "0.1.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Mariusz Pietrzyk", "Mateusz Drozdzynski"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 5
9
- version: 0.1.5
8
+ - 6
9
+ version: 0.1.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mariusz Pietrzyk