attribute_enums 0.1.8 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -3
- data/.rspec +1 -0
- data/CHANGELOG +4 -0
- data/Gemfile +1 -1
- data/README.markdown +61 -59
- data/attribute_enums.gemspec +5 -16
- data/lib/attribute_enums.rb +0 -4
- data/lib/attribute_enums/active_record.rb +122 -0
- data/lib/attribute_enums/common.rb +168 -0
- data/lib/attribute_enums/railtie.rb +2 -2
- data/lib/attribute_enums/version.rb +1 -1
- data/spec/common_and_active_record/ask_methods_options_spec.rb +58 -0
- data/spec/common_and_active_record/attribute_name_spec.rb +7 -0
- data/spec/common_and_active_record/boolean_options_spec.rb +43 -0
- data/spec/common_and_active_record/default_options_spec.rb +77 -0
- data/spec/common_and_active_record/i18n_options_spec.rb +116 -0
- data/spec/common_and_active_record/in_options_spec.rb +38 -0
- data/spec/common_and_active_record/readme_user_example_spec.rb +87 -0
- data/spec/common_and_active_record/scopeds_options_spec.rb +114 -0
- data/spec/common_and_active_record/validate_options_spec.rb +82 -0
- data/spec/spec_helper.rb +5 -12
- data/spec/support/locales/person_en.yml +14 -0
- data/spec/support/locales/person_zh-CN.yml +14 -0
- data/spec/support/locales/user_en.yml +7 -15
- data/spec/support/models/person.rb +23 -0
- metadata +34 -229
- data/Guardfile +0 -22
- data/lib/attribute_enums/active_record_extension.rb +0 -88
- data/spec/models/active_record/user_spec.rb +0 -67
- data/spec/rails3_0_app/.gitignore +0 -4
- data/spec/rails3_0_app/.rspec +0 -1
- data/spec/rails3_0_app/Gemfile +0 -13
- data/spec/rails3_0_app/Rakefile +0 -7
- data/spec/rails3_0_app/app/controllers/application_controller.rb +0 -3
- data/spec/rails3_0_app/app/helpers/application_helper.rb +0 -2
- data/spec/rails3_0_app/app/models/user.rb +0 -2
- data/spec/rails3_0_app/app/views/layouts/application.html.erb +0 -14
- data/spec/rails3_0_app/config.ru +0 -4
- data/spec/rails3_0_app/config/application.rb +0 -44
- data/spec/rails3_0_app/config/boot.rb +0 -6
- data/spec/rails3_0_app/config/database.yml +0 -19
- data/spec/rails3_0_app/config/environment.rb +0 -6
- data/spec/rails3_0_app/config/environments/development.rb +0 -26
- data/spec/rails3_0_app/config/environments/production.rb +0 -49
- data/spec/rails3_0_app/config/environments/test.rb +0 -35
- data/spec/rails3_0_app/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/rails3_0_app/config/initializers/inflections.rb +0 -10
- data/spec/rails3_0_app/config/initializers/mime_types.rb +0 -5
- data/spec/rails3_0_app/config/initializers/secret_token.rb +0 -7
- data/spec/rails3_0_app/config/initializers/session_store.rb +0 -8
- data/spec/rails3_0_app/config/locales/en.yml +0 -5
- data/spec/rails3_0_app/config/routes.rb +0 -58
- data/spec/rails3_0_app/db/migrate/20111129011508_create_users.rb +0 -14
- data/spec/rails3_0_app/db/schema.rb +0 -23
- data/spec/rails3_0_app/db/seeds.rb +0 -7
- data/spec/rails3_0_app/lib/tasks/.gitkeep +0 -0
- data/spec/rails3_0_app/public/404.html +0 -26
- data/spec/rails3_0_app/public/422.html +0 -26
- data/spec/rails3_0_app/public/500.html +0 -26
- data/spec/rails3_0_app/public/favicon.ico +0 -0
- data/spec/rails3_0_app/public/images/rails.png +0 -0
- data/spec/rails3_0_app/public/index.html +0 -239
- data/spec/rails3_0_app/public/robots.txt +0 -5
- data/spec/rails3_0_app/public/stylesheets/.gitkeep +0 -0
- data/spec/rails3_0_app/script/rails +0 -6
- data/spec/rails3_0_app/vendor/plugins/.gitkeep +0 -0
@@ -0,0 +1,114 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ":scopeds options" do
|
4
|
+
|
5
|
+
describe "string attribute" do
|
6
|
+
describe "default methods" do
|
7
|
+
let(:model_klass) do
|
8
|
+
_person = Person.dup
|
9
|
+
_person.instance_eval do
|
10
|
+
include AttributeEnums::ActiveRecord
|
11
|
+
attribute_enums :gender, in: [:male, :female], scopeds: true
|
12
|
+
end
|
13
|
+
_person
|
14
|
+
end
|
15
|
+
|
16
|
+
it do
|
17
|
+
model_klass.should respond_to(:male)
|
18
|
+
model_klass.should respond_to(:female)
|
19
|
+
end
|
20
|
+
it do
|
21
|
+
gender_a = model_klass.create!(gender: :male)
|
22
|
+
gender_b = model_klass.create!(gender: :male)
|
23
|
+
gender_c = model_klass.create!(gender: :female)
|
24
|
+
model_klass.male.map(&:id).should == [gender_a.id, gender_b.id]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
describe "prefix methods" do
|
30
|
+
let(:model_klass) do
|
31
|
+
_person = Person.dup
|
32
|
+
_person.instance_eval do
|
33
|
+
include AttributeEnums::ActiveRecord
|
34
|
+
attribute_enums :gender, in: [:male, :female], scopeds: {prefix: 'gender_'}
|
35
|
+
end
|
36
|
+
_person
|
37
|
+
end
|
38
|
+
|
39
|
+
it do
|
40
|
+
model_klass.should respond_to(:gender_male)
|
41
|
+
end
|
42
|
+
it do
|
43
|
+
model_klass.delete_all
|
44
|
+
gender_a = model_klass.create!(gender: :male)
|
45
|
+
gender_b = model_klass.create!(gender: :male)
|
46
|
+
gender_c = model_klass.create!(gender: :female)
|
47
|
+
model_klass.gender_male.map(&:id).should == [gender_a.id, gender_b.id]
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
describe "boolean attribute" do
|
54
|
+
describe "only true methods" do
|
55
|
+
let(:model_klass) do
|
56
|
+
_person = Person.dup
|
57
|
+
_person.instance_eval do
|
58
|
+
include AttributeEnums::ActiveRecord
|
59
|
+
attribute_enums :enable, boolean: true, scopeds: true
|
60
|
+
end
|
61
|
+
_person
|
62
|
+
end
|
63
|
+
|
64
|
+
it do
|
65
|
+
model_klass.should respond_to(:enable)
|
66
|
+
end
|
67
|
+
it do
|
68
|
+
model_klass.should_not respond_to(:disable)
|
69
|
+
end
|
70
|
+
it do
|
71
|
+
model_klass.delete_all
|
72
|
+
gender_a = model_klass.create!(enable: true)
|
73
|
+
gender_b = model_klass.create!(enable: true)
|
74
|
+
gender_c = model_klass.create!(enable: false)
|
75
|
+
model_klass.enable.map(&:id).should == [gender_a.id, gender_b.id]
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
describe "has true and false methods" do
|
80
|
+
let(:model_klass) do
|
81
|
+
_person = Person.dup
|
82
|
+
_person.instance_eval do
|
83
|
+
include AttributeEnums::ActiveRecord
|
84
|
+
attribute_enums :enable, boolean: true, scopeds: :disable
|
85
|
+
end
|
86
|
+
_person
|
87
|
+
end
|
88
|
+
|
89
|
+
it do
|
90
|
+
model_klass.should respond_to(:enable)
|
91
|
+
end
|
92
|
+
it do
|
93
|
+
model_klass.delete_all
|
94
|
+
gender_a = model_klass.create!(enable: true)
|
95
|
+
gender_b = model_klass.create!(enable: true)
|
96
|
+
gender_c = model_klass.create!(enable: false)
|
97
|
+
model_klass.enable.map(&:id).should == [gender_a.id, gender_b.id]
|
98
|
+
end
|
99
|
+
|
100
|
+
it do
|
101
|
+
model_klass.should respond_to(:disable)
|
102
|
+
end
|
103
|
+
it do
|
104
|
+
model_klass.delete_all
|
105
|
+
gender_a = model_klass.create!(enable: true)
|
106
|
+
gender_b = model_klass.create!(enable: true)
|
107
|
+
gender_c = model_klass.create!(enable: false)
|
108
|
+
model_klass.disable.map(&:id).should == [gender_c.id]
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
|
114
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ":validate options" do
|
4
|
+
|
5
|
+
describe "string attribute" do
|
6
|
+
let(:model_klass) do
|
7
|
+
_person = Person.dup
|
8
|
+
_person.instance_eval do
|
9
|
+
include AttributeEnums::ActiveRecord
|
10
|
+
attribute_enums :gender, in: [:male, :female], validate: true
|
11
|
+
end
|
12
|
+
_person.stub_chain('model_name.human').and_return(:Person)
|
13
|
+
_person.stub_chain('model_name.i18n_key').and_return(:person)
|
14
|
+
_person
|
15
|
+
end
|
16
|
+
|
17
|
+
subject { model_klass.new }
|
18
|
+
|
19
|
+
context "valid" do
|
20
|
+
it do
|
21
|
+
subject.gender = :male
|
22
|
+
subject.valid?
|
23
|
+
subject.errors[:gender].should == []
|
24
|
+
end
|
25
|
+
it do
|
26
|
+
subject.gender = 'female'
|
27
|
+
subject.valid?
|
28
|
+
subject.errors[:gender].should == []
|
29
|
+
end
|
30
|
+
end
|
31
|
+
context "invalid" do
|
32
|
+
it do
|
33
|
+
subject.gender = nil
|
34
|
+
subject.valid?
|
35
|
+
subject.errors[:gender].should_not == []
|
36
|
+
end
|
37
|
+
it do
|
38
|
+
subject.gender = :unknow
|
39
|
+
subject.valid?
|
40
|
+
subject.errors[:gender].should_not == []
|
41
|
+
end
|
42
|
+
it do
|
43
|
+
I18n.stub(:translate).and_return('mock_error')
|
44
|
+
subject.gender = :unknow
|
45
|
+
subject.valid?
|
46
|
+
subject.errors[:gender].should == ['mock_error']
|
47
|
+
end
|
48
|
+
it do
|
49
|
+
subject.gender = :unknow
|
50
|
+
subject.valid?
|
51
|
+
subject.errors[:gender][0].should match(/is not included in the list/)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe "allow_nil" do
|
56
|
+
let(:model_klass) do
|
57
|
+
_person = Person.dup
|
58
|
+
_person.instance_eval do
|
59
|
+
include AttributeEnums::ActiveRecord
|
60
|
+
attribute_enums :gender, in: [:male, :female], validate: {allow_nil: true}
|
61
|
+
end
|
62
|
+
_person.stub_chain('model_name.human').and_return(:Person)
|
63
|
+
_person.stub_chain('model_name.i18n_key').and_return(:person)
|
64
|
+
_person
|
65
|
+
end
|
66
|
+
|
67
|
+
subject { model_klass.new }
|
68
|
+
|
69
|
+
it do
|
70
|
+
subject.gender = nil
|
71
|
+
subject.valid?
|
72
|
+
subject.errors[:gender].should == []
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
|
78
|
+
describe "boolean attribute" do
|
79
|
+
# this option is invalid boolean attribute.
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,22 +1,15 @@
|
|
1
|
-
#
|
1
|
+
#coding: utf-8
|
2
2
|
require "rubygems"
|
3
3
|
require "bundler/setup"
|
4
|
-
require "pry"
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
ActiveRecord::Migrator.migrate(File.expand_path("../rails3_0_app/db/migrate", __FILE__))
|
5
|
+
require "attribute_enums/active_record"
|
6
|
+
require 'i18n'
|
7
|
+
|
10
8
|
I18n.load_path << Dir[ File.expand_path("../support/locales/**/*.{rb,yml}", __FILE__) ]
|
11
9
|
I18n.reload!
|
12
10
|
|
13
|
-
|
14
|
-
#loading rspec
|
15
|
-
require 'rspec/rails'
|
16
|
-
require 'rspec/autorun'
|
17
|
-
require 'capybara/rspec'
|
18
|
-
require 'timecop'
|
19
11
|
Dir[File.expand_path("../support/**/*.rb", __FILE__)].each {|f| require f}
|
12
|
+
|
20
13
|
RSpec.configure do |config|
|
21
14
|
config.mock_with :rspec
|
22
15
|
end
|
@@ -1,17 +1,9 @@
|
|
1
1
|
en:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
enums:
|
10
|
-
user:
|
11
|
-
gender:
|
12
|
-
female: Girl
|
13
|
-
male: Boy
|
14
|
-
enable:
|
15
|
-
"true": "Yes"
|
16
|
-
"false": "No"
|
2
|
+
enums:
|
3
|
+
status:
|
4
|
+
pending: Pending
|
5
|
+
accredited: Accredited
|
6
|
+
removed:
|
7
|
+
"true": "Yes"
|
8
|
+
"false": "No"
|
17
9
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'active_record'
|
2
|
+
require 'sqlite3'
|
3
|
+
|
4
|
+
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
|
5
|
+
|
6
|
+
ActiveRecord::Schema.define do
|
7
|
+
create_table "persons", :force => true do |t|
|
8
|
+
t.string :gender
|
9
|
+
t.boolean :enable
|
10
|
+
end
|
11
|
+
create_table "users", :force => true do |t|
|
12
|
+
t.string :status
|
13
|
+
t.string :gender
|
14
|
+
t.boolean :removed
|
15
|
+
t.boolean :enable
|
16
|
+
end
|
17
|
+
end
|
18
|
+
class Person < ActiveRecord::Base
|
19
|
+
self.table_name = "persons"
|
20
|
+
end
|
21
|
+
class User < ActiveRecord::Base
|
22
|
+
self.table_name = "users"
|
23
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attribute_enums
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,26 +9,10 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-03-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :development
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '0'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: rake
|
15
|
+
name: activerecord
|
32
16
|
requirement: !ruby/object:Gem::Requirement
|
33
17
|
none: false
|
34
18
|
requirements:
|
@@ -44,7 +28,7 @@ dependencies:
|
|
44
28
|
- !ruby/object:Gem::Version
|
45
29
|
version: '0'
|
46
30
|
- !ruby/object:Gem::Dependency
|
47
|
-
name:
|
31
|
+
name: sqlite3
|
48
32
|
requirement: !ruby/object:Gem::Requirement
|
49
33
|
none: false
|
50
34
|
requirements:
|
@@ -60,39 +44,7 @@ dependencies:
|
|
60
44
|
- !ruby/object:Gem::Version
|
61
45
|
version: '0'
|
62
46
|
- !ruby/object:Gem::Dependency
|
63
|
-
name:
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
|
-
requirements:
|
67
|
-
- - ! '>='
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
70
|
-
type: :development
|
71
|
-
prerelease: false
|
72
|
-
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- - ! '>='
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: '0'
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
|
-
name: rails
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
|
-
requirements:
|
83
|
-
- - ~>
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: '3.0'
|
86
|
-
type: :development
|
87
|
-
prerelease: false
|
88
|
-
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- - ~>
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: '3.0'
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: sqlite3-ruby
|
47
|
+
name: i18n
|
96
48
|
requirement: !ruby/object:Gem::Requirement
|
97
49
|
none: false
|
98
50
|
requirements:
|
@@ -114,111 +66,15 @@ dependencies:
|
|
114
66
|
requirements:
|
115
67
|
- - ~>
|
116
68
|
- !ruby/object:Gem::Version
|
117
|
-
version: 2.
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
|
-
requirements:
|
123
|
-
- - ~>
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: 2.7.0
|
126
|
-
- !ruby/object:Gem::Dependency
|
127
|
-
name: capybara
|
128
|
-
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
|
-
requirements:
|
131
|
-
- - ! '>='
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
version: '0'
|
69
|
+
version: 2.13.0
|
134
70
|
type: :development
|
135
71
|
prerelease: false
|
136
|
-
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
|
-
requirements:
|
139
|
-
- - ! '>='
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
version: '0'
|
142
|
-
- !ruby/object:Gem::Dependency
|
143
|
-
name: timecop
|
144
|
-
requirement: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
|
-
requirements:
|
147
|
-
- - ! '>='
|
148
|
-
- !ruby/object:Gem::Version
|
149
|
-
version: '0'
|
150
|
-
type: :development
|
151
|
-
prerelease: false
|
152
|
-
version_requirements: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
|
-
requirements:
|
155
|
-
- - ! '>='
|
156
|
-
- !ruby/object:Gem::Version
|
157
|
-
version: '0'
|
158
|
-
- !ruby/object:Gem::Dependency
|
159
|
-
name: pry
|
160
|
-
requirement: !ruby/object:Gem::Requirement
|
161
|
-
none: false
|
162
|
-
requirements:
|
163
|
-
- - ! '>='
|
164
|
-
- !ruby/object:Gem::Version
|
165
|
-
version: '0'
|
166
|
-
type: :development
|
167
|
-
prerelease: false
|
168
|
-
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
none: false
|
170
|
-
requirements:
|
171
|
-
- - ! '>='
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
version: '0'
|
174
|
-
- !ruby/object:Gem::Dependency
|
175
|
-
name: pry-padrino
|
176
|
-
requirement: !ruby/object:Gem::Requirement
|
177
|
-
none: false
|
178
|
-
requirements:
|
179
|
-
- - ! '>='
|
180
|
-
- !ruby/object:Gem::Version
|
181
|
-
version: '0'
|
182
|
-
type: :development
|
183
|
-
prerelease: false
|
184
|
-
version_requirements: !ruby/object:Gem::Requirement
|
185
|
-
none: false
|
186
|
-
requirements:
|
187
|
-
- - ! '>='
|
188
|
-
- !ruby/object:Gem::Version
|
189
|
-
version: '0'
|
190
|
-
- !ruby/object:Gem::Dependency
|
191
|
-
name: activerecord
|
192
|
-
requirement: !ruby/object:Gem::Requirement
|
193
|
-
none: false
|
194
|
-
requirements:
|
195
|
-
- - ~>
|
196
|
-
- !ruby/object:Gem::Version
|
197
|
-
version: '3.0'
|
198
|
-
type: :runtime
|
199
|
-
prerelease: false
|
200
|
-
version_requirements: !ruby/object:Gem::Requirement
|
201
|
-
none: false
|
202
|
-
requirements:
|
203
|
-
- - ~>
|
204
|
-
- !ruby/object:Gem::Version
|
205
|
-
version: '3.0'
|
206
|
-
- !ruby/object:Gem::Dependency
|
207
|
-
name: activesupport
|
208
|
-
requirement: !ruby/object:Gem::Requirement
|
209
|
-
none: false
|
210
|
-
requirements:
|
211
|
-
- - ~>
|
212
|
-
- !ruby/object:Gem::Version
|
213
|
-
version: '3.0'
|
214
|
-
type: :runtime
|
215
|
-
prerelease: false
|
216
72
|
version_requirements: !ruby/object:Gem::Requirement
|
217
73
|
none: false
|
218
74
|
requirements:
|
219
75
|
- - ~>
|
220
76
|
- !ruby/object:Gem::Version
|
221
|
-
version:
|
77
|
+
version: 2.13.0
|
222
78
|
description: A model attribute enums plugin for Rails3. like 'symbolize' gem.
|
223
79
|
email:
|
224
80
|
- vkill.net@gmail.com
|
@@ -227,56 +83,31 @@ extensions: []
|
|
227
83
|
extra_rdoc_files: []
|
228
84
|
files:
|
229
85
|
- .gitignore
|
86
|
+
- .rspec
|
230
87
|
- CHANGELOG
|
231
88
|
- Gemfile
|
232
|
-
- Guardfile
|
233
89
|
- README.markdown
|
234
90
|
- Rakefile
|
235
91
|
- attribute_enums.gemspec
|
236
92
|
- lib/attribute_enums.rb
|
237
|
-
- lib/attribute_enums/
|
93
|
+
- lib/attribute_enums/active_record.rb
|
94
|
+
- lib/attribute_enums/common.rb
|
238
95
|
- lib/attribute_enums/railtie.rb
|
239
96
|
- lib/attribute_enums/version.rb
|
240
|
-
- spec/
|
241
|
-
- spec/
|
242
|
-
- spec/
|
243
|
-
- spec/
|
244
|
-
- spec/
|
245
|
-
- spec/
|
246
|
-
- spec/
|
247
|
-
- spec/
|
248
|
-
- spec/
|
249
|
-
- spec/rails3_0_app/config.ru
|
250
|
-
- spec/rails3_0_app/config/application.rb
|
251
|
-
- spec/rails3_0_app/config/boot.rb
|
252
|
-
- spec/rails3_0_app/config/database.yml
|
253
|
-
- spec/rails3_0_app/config/environment.rb
|
254
|
-
- spec/rails3_0_app/config/environments/development.rb
|
255
|
-
- spec/rails3_0_app/config/environments/production.rb
|
256
|
-
- spec/rails3_0_app/config/environments/test.rb
|
257
|
-
- spec/rails3_0_app/config/initializers/backtrace_silencers.rb
|
258
|
-
- spec/rails3_0_app/config/initializers/inflections.rb
|
259
|
-
- spec/rails3_0_app/config/initializers/mime_types.rb
|
260
|
-
- spec/rails3_0_app/config/initializers/secret_token.rb
|
261
|
-
- spec/rails3_0_app/config/initializers/session_store.rb
|
262
|
-
- spec/rails3_0_app/config/locales/en.yml
|
263
|
-
- spec/rails3_0_app/config/routes.rb
|
264
|
-
- spec/rails3_0_app/db/migrate/20111129011508_create_users.rb
|
265
|
-
- spec/rails3_0_app/db/schema.rb
|
266
|
-
- spec/rails3_0_app/db/seeds.rb
|
267
|
-
- spec/rails3_0_app/lib/tasks/.gitkeep
|
268
|
-
- spec/rails3_0_app/public/404.html
|
269
|
-
- spec/rails3_0_app/public/422.html
|
270
|
-
- spec/rails3_0_app/public/500.html
|
271
|
-
- spec/rails3_0_app/public/favicon.ico
|
272
|
-
- spec/rails3_0_app/public/images/rails.png
|
273
|
-
- spec/rails3_0_app/public/index.html
|
274
|
-
- spec/rails3_0_app/public/robots.txt
|
275
|
-
- spec/rails3_0_app/public/stylesheets/.gitkeep
|
276
|
-
- spec/rails3_0_app/script/rails
|
277
|
-
- spec/rails3_0_app/vendor/plugins/.gitkeep
|
97
|
+
- spec/common_and_active_record/ask_methods_options_spec.rb
|
98
|
+
- spec/common_and_active_record/attribute_name_spec.rb
|
99
|
+
- spec/common_and_active_record/boolean_options_spec.rb
|
100
|
+
- spec/common_and_active_record/default_options_spec.rb
|
101
|
+
- spec/common_and_active_record/i18n_options_spec.rb
|
102
|
+
- spec/common_and_active_record/in_options_spec.rb
|
103
|
+
- spec/common_and_active_record/readme_user_example_spec.rb
|
104
|
+
- spec/common_and_active_record/scopeds_options_spec.rb
|
105
|
+
- spec/common_and_active_record/validate_options_spec.rb
|
278
106
|
- spec/spec_helper.rb
|
107
|
+
- spec/support/locales/person_en.yml
|
108
|
+
- spec/support/locales/person_zh-CN.yml
|
279
109
|
- spec/support/locales/user_en.yml
|
110
|
+
- spec/support/models/person.rb
|
280
111
|
homepage: https://github.com/vkill/attribute_enums
|
281
112
|
licenses: []
|
282
113
|
post_install_message:
|
@@ -302,43 +133,17 @@ signing_key:
|
|
302
133
|
specification_version: 3
|
303
134
|
summary: A model attribute enums plugin for Rails3. like 'symbolize' gem.
|
304
135
|
test_files:
|
305
|
-
- spec/
|
306
|
-
- spec/
|
307
|
-
- spec/
|
308
|
-
- spec/
|
309
|
-
- spec/
|
310
|
-
- spec/
|
311
|
-
- spec/
|
312
|
-
- spec/
|
313
|
-
- spec/
|
314
|
-
- spec/rails3_0_app/config.ru
|
315
|
-
- spec/rails3_0_app/config/application.rb
|
316
|
-
- spec/rails3_0_app/config/boot.rb
|
317
|
-
- spec/rails3_0_app/config/database.yml
|
318
|
-
- spec/rails3_0_app/config/environment.rb
|
319
|
-
- spec/rails3_0_app/config/environments/development.rb
|
320
|
-
- spec/rails3_0_app/config/environments/production.rb
|
321
|
-
- spec/rails3_0_app/config/environments/test.rb
|
322
|
-
- spec/rails3_0_app/config/initializers/backtrace_silencers.rb
|
323
|
-
- spec/rails3_0_app/config/initializers/inflections.rb
|
324
|
-
- spec/rails3_0_app/config/initializers/mime_types.rb
|
325
|
-
- spec/rails3_0_app/config/initializers/secret_token.rb
|
326
|
-
- spec/rails3_0_app/config/initializers/session_store.rb
|
327
|
-
- spec/rails3_0_app/config/locales/en.yml
|
328
|
-
- spec/rails3_0_app/config/routes.rb
|
329
|
-
- spec/rails3_0_app/db/migrate/20111129011508_create_users.rb
|
330
|
-
- spec/rails3_0_app/db/schema.rb
|
331
|
-
- spec/rails3_0_app/db/seeds.rb
|
332
|
-
- spec/rails3_0_app/lib/tasks/.gitkeep
|
333
|
-
- spec/rails3_0_app/public/404.html
|
334
|
-
- spec/rails3_0_app/public/422.html
|
335
|
-
- spec/rails3_0_app/public/500.html
|
336
|
-
- spec/rails3_0_app/public/favicon.ico
|
337
|
-
- spec/rails3_0_app/public/images/rails.png
|
338
|
-
- spec/rails3_0_app/public/index.html
|
339
|
-
- spec/rails3_0_app/public/robots.txt
|
340
|
-
- spec/rails3_0_app/public/stylesheets/.gitkeep
|
341
|
-
- spec/rails3_0_app/script/rails
|
342
|
-
- spec/rails3_0_app/vendor/plugins/.gitkeep
|
136
|
+
- spec/common_and_active_record/ask_methods_options_spec.rb
|
137
|
+
- spec/common_and_active_record/attribute_name_spec.rb
|
138
|
+
- spec/common_and_active_record/boolean_options_spec.rb
|
139
|
+
- spec/common_and_active_record/default_options_spec.rb
|
140
|
+
- spec/common_and_active_record/i18n_options_spec.rb
|
141
|
+
- spec/common_and_active_record/in_options_spec.rb
|
142
|
+
- spec/common_and_active_record/readme_user_example_spec.rb
|
143
|
+
- spec/common_and_active_record/scopeds_options_spec.rb
|
144
|
+
- spec/common_and_active_record/validate_options_spec.rb
|
343
145
|
- spec/spec_helper.rb
|
146
|
+
- spec/support/locales/person_en.yml
|
147
|
+
- spec/support/locales/person_zh-CN.yml
|
344
148
|
- spec/support/locales/user_en.yml
|
149
|
+
- spec/support/models/person.rb
|