enum_help 0.0.8 → 0.0.9

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
  SHA1:
3
- metadata.gz: 42f7cdd1735452d6cd1aa40beacdb8ea085bce61
4
- data.tar.gz: e58011f45e85f1245b6a443cc4f17fe3a2dc864a
3
+ metadata.gz: 66948f4f12b02670eca05becf8556dc1c4b765f7
4
+ data.tar.gz: f2a5ffef59a3f708dddaa285df1e4cd1cb17a8d1
5
5
  SHA512:
6
- metadata.gz: 542fe66c3050f4f3647ea52ccb610297c5e1892431425d7e441f870c5fa682a9e005b69cb5feb788cfe18e65097bb6b2a61ad40c17a63117ca72be64b19f092a
7
- data.tar.gz: 07506b5652aa6e5b1e065638d8a3fe095e7e8a414cfaad2aa044cd61eac4309d69428a973009a87adc17eae1d36f45494c54280434806956e7c4acf87672846e
6
+ metadata.gz: d276091006d58d131fe38c1467a5fdf595592814cbfeb6a519fedd4200f9ee16d106de237f5cbb7916e0aa5bd6126e8cc62b197dd28a3b4880f9519fa53115a4
7
+ data.tar.gz: c999f3fa91dd5c9485c6c7069cf5872b4fc762e78f8e7956a9681d5e46ea2a1206a2555d079e03cc57038ab8c2826c145e5a9606d3eeaedc5b282244527bb074
data/README.md CHANGED
@@ -47,7 +47,7 @@ You can call:
47
47
  order.status_i18n # if you have an i18n file defined as following, it will return "未支付".
48
48
  # > 未支付
49
49
 
50
- In _form.html.erb using simple form:
50
+ In _form.html.erb using simple_form:
51
51
 
52
52
  <%= f.input :status %>
53
53
 
@@ -80,6 +80,15 @@ I18n local file example:
80
80
  failed: 失败
81
81
  destroyed: 已删除
82
82
 
83
+
84
+ ## Notice
85
+ If you want to use enum feature,
86
+ field of your table can't be named with reference.
87
+ When it is named with 'reference' and define enum in model file, there will be raise an error as below:
88
+
89
+ NoMethodError: super: no superclass method `enum' for...
90
+
91
+
83
92
  ## Thanks
84
93
  * [mrhead](https://github.com/mrhead)
85
94
  * [Jin Lee](https://github.com/neojin)
@@ -6,8 +6,9 @@ module EnumHelp
6
6
 
7
7
  def default_input_type_with_enum(*args, &block)
8
8
  att_name = (args.first || @attribute_name).to_s
9
+
9
10
  return :enum if (args.last.is_a?(Hash) ? args.last[:as] : @options[:as]).nil? &&
10
- object.class.respond_to?(att_name.pluralize)
11
+ object.class.respond_to?(att_name.pluralize) && att_name.pluralize != "references"
11
12
 
12
13
  default_input_type_without_enum(*args, &block)
13
14
  end
@@ -1,3 +1,3 @@
1
1
  module EnumHelp
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enum_help
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lester Zhao
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-01 00:00:00.000000000 Z
11
+ date: 2014-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler