acts_as_relation 0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile +1 -1
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -3
- data/acts_as_relation.gemspec +3 -1
- data/init.rb +1 -0
- data/lib/active_record/acts_as_relation.rb +15 -11
- data/lib/version.rb +1 -1
- data/spec/{acts_as_relation/acts_as_relation_spec.rb → acts_as_relation_spec.rb} +19 -4
- data/spec/acts_as_superclass_spec.rb +14 -0
- data/spec/dummy/.rspec +1 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/models/pen.rb +6 -0
- data/spec/dummy/app/models/pencil.rb +3 -0
- data/spec/dummy/app/models/product.rb +11 -0
- data/spec/dummy/app/models/store.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +64 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +58 -0
- data/spec/dummy/db/migrate/001_create_stores.rb +9 -0
- data/spec/dummy/db/migrate/002_create_products.rb +10 -0
- data/spec/dummy/db/migrate/003_create_pens.rb +9 -0
- data/spec/dummy/db/migrate/004_create_pencils.rb +8 -0
- data/spec/dummy/db/schema.rb +44 -0
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/spec_helper.rb +9 -6
- metadata +161 -26
- data/spec/acts_as_migration/acts_as_migratoin_spec.rb +0 -24
- data/spec/acts_as_migration/models.rb +0 -7
- data/spec/acts_as_migration/schema.rb +0 -33
- data/spec/acts_as_relation/models.rb +0 -25
- data/spec/acts_as_relation/schema.rb +0 -28
@@ -0,0 +1,44 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# This file is auto-generated from the current state of the database. Instead
|
3
|
+
# of editing this file, please use the migrations feature of Active Record to
|
4
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
+
#
|
6
|
+
# Note that this schema.rb definition is the authoritative source for your
|
7
|
+
# database schema. If you need to create the application database on another
|
8
|
+
# system, you should be using db:schema:load, not running all the migrations
|
9
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
|
+
#
|
12
|
+
# It's strongly recommended to check this file into your version control system.
|
13
|
+
|
14
|
+
ActiveRecord::Schema.define(:version => 4) do
|
15
|
+
|
16
|
+
create_table "pencils", :force => true do |t|
|
17
|
+
t.datetime "created_at", :null => false
|
18
|
+
t.datetime "updated_at", :null => false
|
19
|
+
end
|
20
|
+
|
21
|
+
create_table "pens", :force => true do |t|
|
22
|
+
t.integer "as_pen_id"
|
23
|
+
t.string "as_pen_type"
|
24
|
+
t.string "color"
|
25
|
+
t.datetime "created_at", :null => false
|
26
|
+
t.datetime "updated_at", :null => false
|
27
|
+
end
|
28
|
+
|
29
|
+
create_table "products", :force => true do |t|
|
30
|
+
t.integer "producible_id"
|
31
|
+
t.string "producible_type"
|
32
|
+
t.string "name"
|
33
|
+
t.float "price"
|
34
|
+
t.datetime "created_at", :null => false
|
35
|
+
t.datetime "updated_at", :null => false
|
36
|
+
end
|
37
|
+
|
38
|
+
create_table "stores", :force => true do |t|
|
39
|
+
t.string "name"
|
40
|
+
t.datetime "created_at", :null => false
|
41
|
+
t.datetime "updated_at", :null => false
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
File without changes
|
File without changes
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/404.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/422.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/500.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
23
|
+
</div>
|
24
|
+
</body>
|
25
|
+
</html>
|
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
data/spec/spec_helper.rb
CHANGED
@@ -1,10 +1,13 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
require File.expand_path("../dummy/config/environment", __FILE__)
|
4
|
+
require 'rspec/rails'
|
5
|
+
require 'rspec/autorun'
|
3
6
|
|
4
|
-
|
7
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
8
|
+
# in spec/support/ and its subdirectories.
|
9
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
|
5
10
|
|
6
11
|
RSpec.configure do |config|
|
7
|
-
config.
|
8
|
-
config.run_all_when_everything_filtered = true
|
9
|
-
config.filter_run :focus
|
12
|
+
config.infer_base_class_for_anonymous_controllers = false
|
10
13
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_relation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: bundler
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :development
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: sqlite3
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ! '>='
|
@@ -43,10 +53,15 @@ dependencies:
|
|
43
53
|
version: '0'
|
44
54
|
type: :development
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
|
-
name: rspec
|
49
|
-
requirement:
|
63
|
+
name: rspec-rails
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ! '>='
|
@@ -54,10 +69,47 @@ dependencies:
|
|
54
69
|
version: '0'
|
55
70
|
type: :development
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
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: '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: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: database_cleaner
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
58
110
|
- !ruby/object:Gem::Dependency
|
59
111
|
name: activerecord
|
60
|
-
requirement:
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
61
113
|
none: false
|
62
114
|
requirements:
|
63
115
|
- - ! '>='
|
@@ -65,7 +117,12 @@ dependencies:
|
|
65
117
|
version: '0'
|
66
118
|
type: :runtime
|
67
119
|
prerelease: false
|
68
|
-
version_requirements:
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
69
126
|
description: This 'acts_as' extension provides multi-table inheritance for rails models.
|
70
127
|
email: hsn.zamani@gmail.com
|
71
128
|
executables: []
|
@@ -75,19 +132,59 @@ files:
|
|
75
132
|
- .gitignore
|
76
133
|
- .rspec
|
77
134
|
- Gemfile
|
135
|
+
- MIT-LICENSE
|
78
136
|
- README.rdoc
|
79
137
|
- Rakefile
|
80
138
|
- acts_as_relation.gemspec
|
139
|
+
- init.rb
|
81
140
|
- lib/active_record/acts_as_relation.rb
|
82
141
|
- lib/active_record/acts_as_relation_superclass_migration.rb
|
83
142
|
- lib/acts_as_relation.rb
|
84
143
|
- lib/version.rb
|
85
|
-
- spec/
|
86
|
-
- spec/
|
87
|
-
- spec/
|
88
|
-
- spec/
|
89
|
-
- spec/
|
90
|
-
- spec/
|
144
|
+
- spec/acts_as_relation_spec.rb
|
145
|
+
- spec/acts_as_superclass_spec.rb
|
146
|
+
- spec/dummy/.rspec
|
147
|
+
- spec/dummy/README.rdoc
|
148
|
+
- spec/dummy/Rakefile
|
149
|
+
- spec/dummy/app/assets/javascripts/application.js
|
150
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
151
|
+
- spec/dummy/app/controllers/application_controller.rb
|
152
|
+
- spec/dummy/app/helpers/application_helper.rb
|
153
|
+
- spec/dummy/app/mailers/.gitkeep
|
154
|
+
- spec/dummy/app/models/.gitkeep
|
155
|
+
- spec/dummy/app/models/pen.rb
|
156
|
+
- spec/dummy/app/models/pencil.rb
|
157
|
+
- spec/dummy/app/models/product.rb
|
158
|
+
- spec/dummy/app/models/store.rb
|
159
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
160
|
+
- spec/dummy/config.ru
|
161
|
+
- spec/dummy/config/application.rb
|
162
|
+
- spec/dummy/config/boot.rb
|
163
|
+
- spec/dummy/config/database.yml
|
164
|
+
- spec/dummy/config/environment.rb
|
165
|
+
- spec/dummy/config/environments/development.rb
|
166
|
+
- spec/dummy/config/environments/production.rb
|
167
|
+
- spec/dummy/config/environments/test.rb
|
168
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
169
|
+
- spec/dummy/config/initializers/inflections.rb
|
170
|
+
- spec/dummy/config/initializers/mime_types.rb
|
171
|
+
- spec/dummy/config/initializers/secret_token.rb
|
172
|
+
- spec/dummy/config/initializers/session_store.rb
|
173
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
174
|
+
- spec/dummy/config/locales/en.yml
|
175
|
+
- spec/dummy/config/routes.rb
|
176
|
+
- spec/dummy/db/migrate/001_create_stores.rb
|
177
|
+
- spec/dummy/db/migrate/002_create_products.rb
|
178
|
+
- spec/dummy/db/migrate/003_create_pens.rb
|
179
|
+
- spec/dummy/db/migrate/004_create_pencils.rb
|
180
|
+
- spec/dummy/db/schema.rb
|
181
|
+
- spec/dummy/lib/assets/.gitkeep
|
182
|
+
- spec/dummy/log/.gitkeep
|
183
|
+
- spec/dummy/public/404.html
|
184
|
+
- spec/dummy/public/422.html
|
185
|
+
- spec/dummy/public/500.html
|
186
|
+
- spec/dummy/public/favicon.ico
|
187
|
+
- spec/dummy/script/rails
|
91
188
|
- spec/spec_helper.rb
|
92
189
|
homepage: http://github.com/hzamani/acts_as_relation
|
93
190
|
licenses: []
|
@@ -109,15 +206,53 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
206
|
version: '0'
|
110
207
|
requirements: []
|
111
208
|
rubyforge_project:
|
112
|
-
rubygems_version: 1.8.
|
209
|
+
rubygems_version: 1.8.21
|
113
210
|
signing_key:
|
114
211
|
specification_version: 3
|
115
212
|
summary: Easy multi-table inheritance for rails
|
116
213
|
test_files:
|
117
|
-
- spec/
|
118
|
-
- spec/
|
119
|
-
- spec/
|
120
|
-
- spec/
|
121
|
-
- spec/
|
122
|
-
- spec/
|
214
|
+
- spec/acts_as_relation_spec.rb
|
215
|
+
- spec/acts_as_superclass_spec.rb
|
216
|
+
- spec/dummy/.rspec
|
217
|
+
- spec/dummy/README.rdoc
|
218
|
+
- spec/dummy/Rakefile
|
219
|
+
- spec/dummy/app/assets/javascripts/application.js
|
220
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
221
|
+
- spec/dummy/app/controllers/application_controller.rb
|
222
|
+
- spec/dummy/app/helpers/application_helper.rb
|
223
|
+
- spec/dummy/app/mailers/.gitkeep
|
224
|
+
- spec/dummy/app/models/.gitkeep
|
225
|
+
- spec/dummy/app/models/pen.rb
|
226
|
+
- spec/dummy/app/models/pencil.rb
|
227
|
+
- spec/dummy/app/models/product.rb
|
228
|
+
- spec/dummy/app/models/store.rb
|
229
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
230
|
+
- spec/dummy/config.ru
|
231
|
+
- spec/dummy/config/application.rb
|
232
|
+
- spec/dummy/config/boot.rb
|
233
|
+
- spec/dummy/config/database.yml
|
234
|
+
- spec/dummy/config/environment.rb
|
235
|
+
- spec/dummy/config/environments/development.rb
|
236
|
+
- spec/dummy/config/environments/production.rb
|
237
|
+
- spec/dummy/config/environments/test.rb
|
238
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
239
|
+
- spec/dummy/config/initializers/inflections.rb
|
240
|
+
- spec/dummy/config/initializers/mime_types.rb
|
241
|
+
- spec/dummy/config/initializers/secret_token.rb
|
242
|
+
- spec/dummy/config/initializers/session_store.rb
|
243
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
244
|
+
- spec/dummy/config/locales/en.yml
|
245
|
+
- spec/dummy/config/routes.rb
|
246
|
+
- spec/dummy/db/migrate/001_create_stores.rb
|
247
|
+
- spec/dummy/db/migrate/002_create_products.rb
|
248
|
+
- spec/dummy/db/migrate/003_create_pens.rb
|
249
|
+
- spec/dummy/db/migrate/004_create_pencils.rb
|
250
|
+
- spec/dummy/db/schema.rb
|
251
|
+
- spec/dummy/lib/assets/.gitkeep
|
252
|
+
- spec/dummy/log/.gitkeep
|
253
|
+
- spec/dummy/public/404.html
|
254
|
+
- spec/dummy/public/422.html
|
255
|
+
- spec/dummy/public/500.html
|
256
|
+
- spec/dummy/public/favicon.ico
|
257
|
+
- spec/dummy/script/rails
|
123
258
|
- spec/spec_helper.rb
|