activerecord_any_of 0.0.1

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.
Files changed (52) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +83 -0
  3. data/Rakefile +38 -0
  4. data/lib/activerecord_any_of.rb +53 -0
  5. data/lib/activerecord_any_of/version.rb +3 -0
  6. data/test/activerecord_any_of_test.rb +27 -0
  7. data/test/dummy/README.rdoc +261 -0
  8. data/test/dummy/Rakefile +7 -0
  9. data/test/dummy/app/assets/javascripts/application.js +15 -0
  10. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  11. data/test/dummy/app/controllers/application_controller.rb +3 -0
  12. data/test/dummy/app/helpers/application_helper.rb +2 -0
  13. data/test/dummy/app/models/author.rb +4 -0
  14. data/test/dummy/app/models/post.rb +4 -0
  15. data/test/dummy/app/models/special_post.rb +2 -0
  16. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  17. data/test/dummy/config.ru +4 -0
  18. data/test/dummy/config/application.rb +59 -0
  19. data/test/dummy/config/boot.rb +10 -0
  20. data/test/dummy/config/database.yml +25 -0
  21. data/test/dummy/config/environment.rb +5 -0
  22. data/test/dummy/config/environments/development.rb +37 -0
  23. data/test/dummy/config/environments/production.rb +67 -0
  24. data/test/dummy/config/environments/test.rb +37 -0
  25. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  26. data/test/dummy/config/initializers/inflections.rb +15 -0
  27. data/test/dummy/config/initializers/mime_types.rb +5 -0
  28. data/test/dummy/config/initializers/secret_token.rb +7 -0
  29. data/test/dummy/config/initializers/session_store.rb +8 -0
  30. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  31. data/test/dummy/config/locales/en.yml +5 -0
  32. data/test/dummy/config/routes.rb +58 -0
  33. data/test/dummy/db/development.sqlite3 +0 -0
  34. data/test/dummy/db/migrate/20130617172335_create_authors.rb +9 -0
  35. data/test/dummy/db/migrate/20130617173313_create_posts.rb +12 -0
  36. data/test/dummy/db/schema.rb +31 -0
  37. data/test/dummy/db/test.sqlite3 +0 -0
  38. data/test/dummy/log/development.log +90 -0
  39. data/test/dummy/log/test.log +372 -0
  40. data/test/dummy/public/404.html +26 -0
  41. data/test/dummy/public/422.html +26 -0
  42. data/test/dummy/public/500.html +25 -0
  43. data/test/dummy/public/favicon.ico +0 -0
  44. data/test/dummy/script/rails +6 -0
  45. data/test/dummy/test/fixtures/authors.yml +7 -0
  46. data/test/dummy/test/fixtures/posts.yml +13 -0
  47. data/test/dummy/test/unit/author_test.rb +7 -0
  48. data/test/dummy/test/unit/post_test.rb +7 -0
  49. data/test/fixtures/authors.yml +11 -0
  50. data/test/fixtures/posts.yml +76 -0
  51. data/test/test_helper.rb +15 -0
  52. metadata +186 -0
@@ -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'
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ name: MyString
5
+
6
+ two:
7
+ name: MyString
@@ -0,0 +1,13 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ title: MyString
5
+ body: MyText
6
+ user_id:
7
+ type:
8
+
9
+ two:
10
+ title: MyString
11
+ body: MyText
12
+ user_id:
13
+ type:
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class AuthorTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class PostTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,11 @@
1
+ david:
2
+ id: 1
3
+ name: David
4
+
5
+ mary:
6
+ id: 2
7
+ name: Mary
8
+
9
+ bob:
10
+ id: 3
11
+ name: Bob
@@ -0,0 +1,76 @@
1
+ welcome:
2
+ id: 1
3
+ author_id: 1
4
+ title: Welcome to the weblog
5
+ body: Such a lovely day
6
+ type: Post
7
+
8
+ thinking:
9
+ id: 2
10
+ author_id: 1
11
+ title: So I was thinking
12
+ body: Like I hopefully always am
13
+ type: SpecialPost
14
+
15
+ authorless:
16
+ id: 3
17
+ author_id: 0
18
+ title: I don't have any comments
19
+ body: I just don't want to
20
+ type: Post
21
+
22
+ sti_comments:
23
+ id: 4
24
+ author_id: 1
25
+ title: sti comments
26
+ body: hello
27
+ type: Post
28
+
29
+ sti_post_and_comments:
30
+ id: 5
31
+ author_id: 1
32
+ title: sti me
33
+ body: hello
34
+ type: StiPost
35
+
36
+ sti_habtm:
37
+ id: 6
38
+ author_id: 1
39
+ title: habtm sti test
40
+ body: hello
41
+ type: Post
42
+
43
+ eager_other:
44
+ id: 7
45
+ author_id: 2
46
+ title: eager loading with OR'd conditions
47
+ body: hello
48
+ type: Post
49
+
50
+ misc_by_bob:
51
+ id: 8
52
+ author_id: 3
53
+ title: misc post by bob
54
+ body: hello
55
+ type: Post
56
+
57
+ misc_by_mary:
58
+ id: 9
59
+ author_id: 2
60
+ title: misc post by mary
61
+ body: hello
62
+ type: Post
63
+
64
+ other_by_bob:
65
+ id: 10
66
+ author_id: 3
67
+ title: other post by bob
68
+ body: hello
69
+ type: Post
70
+
71
+ other_by_mary:
72
+ id: 11
73
+ author_id: 2
74
+ title: other post by mary
75
+ body: hello
76
+ type: Post
@@ -0,0 +1,15 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # Load support files
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
11
+
12
+ # Load fixtures from the engine
13
+ if ActiveSupport::TestCase.method_defined?(:fixture_path=)
14
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
15
+ end
metadata ADDED
@@ -0,0 +1,186 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: activerecord_any_of
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Olivier El Mekki
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-06-18 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 3.2.13
22
+ - - <
23
+ - !ruby/object:Gem::Version
24
+ version: '5'
25
+ type: :runtime
26
+ prerelease: false
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: 3.2.13
33
+ - - <
34
+ - !ruby/object:Gem::Version
35
+ version: '5'
36
+ - !ruby/object:Gem::Dependency
37
+ name: sqlite3
38
+ requirement: !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ! '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ description: Any_of allows to compute dynamic OR queries.
53
+ email:
54
+ - olivier@el-mekki.com
55
+ executables: []
56
+ extensions: []
57
+ extra_rdoc_files: []
58
+ files:
59
+ - lib/activerecord_any_of/version.rb
60
+ - lib/activerecord_any_of.rb
61
+ - MIT-LICENSE
62
+ - Rakefile
63
+ - README.md
64
+ - test/fixtures/authors.yml
65
+ - test/fixtures/posts.yml
66
+ - test/test_helper.rb
67
+ - test/activerecord_any_of_test.rb
68
+ - test/dummy/README.rdoc
69
+ - test/dummy/db/development.sqlite3
70
+ - test/dummy/db/test.sqlite3
71
+ - test/dummy/db/schema.rb
72
+ - test/dummy/db/migrate/20130617173313_create_posts.rb
73
+ - test/dummy/db/migrate/20130617172335_create_authors.rb
74
+ - test/dummy/app/views/layouts/application.html.erb
75
+ - test/dummy/app/models/post.rb
76
+ - test/dummy/app/models/author.rb
77
+ - test/dummy/app/models/special_post.rb
78
+ - test/dummy/app/helpers/application_helper.rb
79
+ - test/dummy/app/controllers/application_controller.rb
80
+ - test/dummy/app/assets/javascripts/application.js
81
+ - test/dummy/app/assets/stylesheets/application.css
82
+ - test/dummy/test/fixtures/authors.yml
83
+ - test/dummy/test/fixtures/posts.yml
84
+ - test/dummy/test/unit/post_test.rb
85
+ - test/dummy/test/unit/author_test.rb
86
+ - test/dummy/Rakefile
87
+ - test/dummy/log/test.log
88
+ - test/dummy/log/development.log
89
+ - test/dummy/script/rails
90
+ - test/dummy/config/application.rb
91
+ - test/dummy/config/database.yml
92
+ - test/dummy/config/boot.rb
93
+ - test/dummy/config/routes.rb
94
+ - test/dummy/config/environment.rb
95
+ - test/dummy/config/environments/test.rb
96
+ - test/dummy/config/environments/production.rb
97
+ - test/dummy/config/environments/development.rb
98
+ - test/dummy/config/locales/en.yml
99
+ - test/dummy/config/initializers/session_store.rb
100
+ - test/dummy/config/initializers/wrap_parameters.rb
101
+ - test/dummy/config/initializers/mime_types.rb
102
+ - test/dummy/config/initializers/secret_token.rb
103
+ - test/dummy/config/initializers/inflections.rb
104
+ - test/dummy/config/initializers/backtrace_silencers.rb
105
+ - test/dummy/config.ru
106
+ - test/dummy/public/500.html
107
+ - test/dummy/public/422.html
108
+ - test/dummy/public/favicon.ico
109
+ - test/dummy/public/404.html
110
+ homepage: https://github.com/oelmekki/activerecord_any_of
111
+ licenses: []
112
+ post_install_message:
113
+ rdoc_options: []
114
+ require_paths:
115
+ - lib
116
+ required_ruby_version: !ruby/object:Gem::Requirement
117
+ none: false
118
+ requirements:
119
+ - - ! '>='
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
122
+ segments:
123
+ - 0
124
+ hash: 56738611833640131
125
+ required_rubygems_version: !ruby/object:Gem::Requirement
126
+ none: false
127
+ requirements:
128
+ - - ! '>='
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ segments:
132
+ - 0
133
+ hash: 56738611833640131
134
+ requirements: []
135
+ rubyforge_project:
136
+ rubygems_version: 1.8.24
137
+ signing_key:
138
+ specification_version: 3
139
+ summary: Mongoid's any_of like implementation for activerecord
140
+ test_files:
141
+ - test/fixtures/authors.yml
142
+ - test/fixtures/posts.yml
143
+ - test/test_helper.rb
144
+ - test/activerecord_any_of_test.rb
145
+ - test/dummy/README.rdoc
146
+ - test/dummy/db/development.sqlite3
147
+ - test/dummy/db/test.sqlite3
148
+ - test/dummy/db/schema.rb
149
+ - test/dummy/db/migrate/20130617173313_create_posts.rb
150
+ - test/dummy/db/migrate/20130617172335_create_authors.rb
151
+ - test/dummy/app/views/layouts/application.html.erb
152
+ - test/dummy/app/models/post.rb
153
+ - test/dummy/app/models/author.rb
154
+ - test/dummy/app/models/special_post.rb
155
+ - test/dummy/app/helpers/application_helper.rb
156
+ - test/dummy/app/controllers/application_controller.rb
157
+ - test/dummy/app/assets/javascripts/application.js
158
+ - test/dummy/app/assets/stylesheets/application.css
159
+ - test/dummy/test/fixtures/authors.yml
160
+ - test/dummy/test/fixtures/posts.yml
161
+ - test/dummy/test/unit/post_test.rb
162
+ - test/dummy/test/unit/author_test.rb
163
+ - test/dummy/Rakefile
164
+ - test/dummy/log/test.log
165
+ - test/dummy/log/development.log
166
+ - test/dummy/script/rails
167
+ - test/dummy/config/application.rb
168
+ - test/dummy/config/database.yml
169
+ - test/dummy/config/boot.rb
170
+ - test/dummy/config/routes.rb
171
+ - test/dummy/config/environment.rb
172
+ - test/dummy/config/environments/test.rb
173
+ - test/dummy/config/environments/production.rb
174
+ - test/dummy/config/environments/development.rb
175
+ - test/dummy/config/locales/en.yml
176
+ - test/dummy/config/initializers/session_store.rb
177
+ - test/dummy/config/initializers/wrap_parameters.rb
178
+ - test/dummy/config/initializers/mime_types.rb
179
+ - test/dummy/config/initializers/secret_token.rb
180
+ - test/dummy/config/initializers/inflections.rb
181
+ - test/dummy/config/initializers/backtrace_silencers.rb
182
+ - test/dummy/config.ru
183
+ - test/dummy/public/500.html
184
+ - test/dummy/public/422.html
185
+ - test/dummy/public/favicon.ico
186
+ - test/dummy/public/404.html