enum_accessor 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -16,7 +16,7 @@ Add an integer column.
16
16
 
17
17
  ```ruby
18
18
  create_table :users do |t|
19
- t.column :gender, :integer, default: 0
19
+ t.integer :gender, default: 0
20
20
  end
21
21
  ```
22
22
 
@@ -97,10 +97,10 @@ and now `human_*` method returns a translated string. It defaults to English nic
97
97
 
98
98
  ```ruby
99
99
  I18n.locale = :ja
100
- user.human_gender # => '女'
100
+ user.human_gender # => '女'
101
101
 
102
102
  I18n.locale = :en
103
- user.human_gender # => 'Female'
103
+ user.human_gender # => 'Female'
104
104
  ```
105
105
 
106
106
  ## Why enum keys are internally stored as strings rather than symbols?
@@ -8,9 +8,9 @@ Gem::Specification.new do |gem|
8
8
  gem.version = EnumAccessor::VERSION
9
9
  gem.authors = ['Kenn Ejima']
10
10
  gem.email = ['kenn.ejima@gmail.com']
11
- gem.description = %q{Enum field support for ActiveModel with validations and i18n}
12
- gem.summary = %q{Enum field support for ActiveModel with validations and i18n}
13
- gem.homepage = ''
11
+ gem.description = %q{Simple enum fields for ActiveRecord}
12
+ gem.summary = %q{Simple enum fields for ActiveRecord}
13
+ gem.homepage = 'https://github.com/kenn/enum_accessor'
14
14
 
15
15
  gem.files = `git ls-files`.split($/)
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -1,3 +1,3 @@
1
1
  module EnumAccessor
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -52,6 +52,8 @@ describe EnumAccessor do
52
52
 
53
53
  it 'adds class methods' do
54
54
  User.genders.should == { :female => 0, :male => 1 }
55
+ User.genders[:female].should == 0
56
+ User.genders(:female).should == 0
55
57
  end
56
58
 
57
59
  it 'adds validation' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enum_accessor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -75,7 +75,7 @@ dependencies:
75
75
  - - ! '>='
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
- description: Enum field support for ActiveModel with validations and i18n
78
+ description: Simple enum fields for ActiveRecord
79
79
  email:
80
80
  - kenn.ejima@gmail.com
81
81
  executables: []
@@ -95,7 +95,7 @@ files:
95
95
  - spec/enum_accessor_spec.rb
96
96
  - spec/locales.yml
97
97
  - spec/spec_helper.rb
98
- homepage: ''
98
+ homepage: https://github.com/kenn/enum_accessor
99
99
  licenses: []
100
100
  post_install_message:
101
101
  rdoc_options: []
@@ -118,7 +118,7 @@ rubyforge_project:
118
118
  rubygems_version: 1.8.24
119
119
  signing_key:
120
120
  specification_version: 3
121
- summary: Enum field support for ActiveModel with validations and i18n
121
+ summary: Simple enum fields for ActiveRecord
122
122
  test_files:
123
123
  - spec/enum_accessor_spec.rb
124
124
  - spec/locales.yml