scoped_search 4.3.0 → 5.0.0
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.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +25 -37
- data/.gitignore +2 -1
- data/Appraisals +16 -0
- data/CHANGELOG.rdoc +9 -0
- data/Gemfile +1 -1
- data/README.rdoc +2 -2
- data/appraisal.gemfile +3 -0
- data/gemfiles/modular/rails-6 +25 -0
- data/gemfiles/modular/rspec +1 -0
- data/lib/scoped_search/auto_complete_builder.rb +4 -1
- data/lib/scoped_search/query_builder.rb +7 -4
- data/lib/scoped_search/version.rb +1 -1
- data/scoped_search.gemspec +3 -2
- data/spec/integration/auto_complete_spec.rb +44 -3
- data/spec/integration/ext_method_spec.rb +127 -0
- data/spec/integration/relation_querying_spec.rb +53 -53
- data/spec/spec_helper.rb +0 -3
- metadata +14 -16
- data/Gemfile.activerecord42 +0 -19
- data/Gemfile.activerecord50 +0 -17
- data/Gemfile.activerecord51 +0 -17
- data/Gemfile.activerecord52 +0 -17
- data/Gemfile.activerecord52_with_activesupport52 +0 -18
- data/Gemfile.activerecord60 +0 -17
- data/Gemfile.activerecord60_with_activesupport60 +0 -18
- data/Gemfile.activerecord61 +0 -17
- data/Gemfile.activerecord61_with_activesupport61 +0 -18
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b246204885d3b4432baebaa00e7dea9407e8938dc078fa0bc726e587f4a12122
|
|
4
|
+
data.tar.gz: 81f9dd75acb77c0d9eb6165528493bdb1e93fbd8ccf71c91bacbe6e2585d3ef7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 714a96861d37c99dac22c3e6d33dccbf18d2287191944abc112048942d2dbef04957ce932ba0f645b3e53e00f702ba70b379512485b0ce96a09d414010d4bf54
|
|
7
|
+
data.tar.gz: 62d2fdfbd14f777db4c0f0f090d061ddcdd775108d948a6c3d796927b7b840b9622197d4e416c46dbbc7ce9d1ad8fdcf35eae5817183e7b48ee481808e7071dc
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
name: Ruby
|
|
9
9
|
|
|
10
|
-
on:
|
|
10
|
+
on: # yamllint disable-line rule:truthy
|
|
11
|
+
- pull_request
|
|
11
12
|
|
|
12
13
|
env:
|
|
13
14
|
TESTOPTS: --verbose
|
|
@@ -19,31 +20,18 @@ jobs:
|
|
|
19
20
|
fail-fast: false
|
|
20
21
|
matrix:
|
|
21
22
|
ruby_version:
|
|
22
|
-
- 2.7
|
|
23
|
-
- 3.0
|
|
23
|
+
- '2.7'
|
|
24
|
+
- '3.0'
|
|
25
|
+
- '3.3'
|
|
24
26
|
- ruby-head
|
|
25
27
|
- jruby-head
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
exclude:
|
|
35
|
-
- ruby_version: 2.7.1
|
|
36
|
-
gemfile: Gemfile.activerecord52
|
|
37
|
-
- ruby_version: 2.7.1
|
|
38
|
-
gemfile: Gemfile.activerecord52_with_activesupport52
|
|
39
|
-
- ruby_version: 3.0.0
|
|
40
|
-
gemfile: Gemfile.activerecord52
|
|
41
|
-
- ruby_version: 3.0.0
|
|
42
|
-
gemfile: Gemfile.activerecord52_with_activesupport52
|
|
43
|
-
- ruby_version: ruby-head
|
|
44
|
-
gemfile: Gemfile.activerecord52
|
|
45
|
-
- ruby_version: ruby-head
|
|
46
|
-
gemfile: Gemfile.activerecord52_with_activesupport52
|
|
28
|
+
appraisal:
|
|
29
|
+
- rails-6.0
|
|
30
|
+
- rails-6.0-activesupport
|
|
31
|
+
- rails-6.1
|
|
32
|
+
- rails-6.1-activesupport
|
|
33
|
+
- rails-7.0
|
|
34
|
+
- rails-7.0-activesupport
|
|
47
35
|
services:
|
|
48
36
|
postgres:
|
|
49
37
|
image: postgres:12.1
|
|
@@ -59,18 +47,18 @@ jobs:
|
|
|
59
47
|
MYSQL_DATABASE: scoped_search_test
|
|
60
48
|
|
|
61
49
|
env:
|
|
62
|
-
BUNDLE_GEMFILE:
|
|
50
|
+
BUNDLE_GEMFILE: appraisal.gemfile
|
|
63
51
|
|
|
64
52
|
steps:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
53
|
+
- uses: actions/checkout@v6
|
|
54
|
+
- name: Set up Ruby ${{ matrix.ruby_version }}
|
|
55
|
+
uses: ruby/setup-ruby@v1
|
|
56
|
+
with:
|
|
57
|
+
ruby-version: ${{ matrix.ruby_version }}
|
|
58
|
+
bundler-cache: true
|
|
59
|
+
- name: Generate gemfiles
|
|
60
|
+
run: bundle exec appraisal generate
|
|
61
|
+
- name: Appraisal for ${{ matrix.ruby_version }} ${{ matrix.appraisal }}
|
|
62
|
+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
|
|
63
|
+
- name: Tests for ${{ matrix.ruby_version }} ${{ matrix.appraisal }}
|
|
64
|
+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec rake
|
data/.gitignore
CHANGED
data/Appraisals
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
['6.0', '6.1', '7.0'].each do |version|
|
|
2
|
+
appraise "rails-#{version}" do
|
|
3
|
+
gem 'actionview', "~> #{version}.0"
|
|
4
|
+
gem 'activerecord', "~> #{version}.0"
|
|
5
|
+
eval_gemfile 'modular/rails-6'
|
|
6
|
+
eval_gemfile 'modular/rspec'
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
appraise "rails-#{version}-activesupport" do
|
|
10
|
+
gem 'actionview', "~> #{version}.0"
|
|
11
|
+
gem 'activerecord', "~> #{version}.0"
|
|
12
|
+
gem 'activesupport', "~> #{version}.0"
|
|
13
|
+
eval_gemfile 'modular/rails-6'
|
|
14
|
+
eval_gemfile 'modular/rspec'
|
|
15
|
+
end
|
|
16
|
+
end
|
data/CHANGELOG.rdoc
CHANGED
|
@@ -6,6 +6,15 @@ Please add an entry to the "Unreleased changes" section in your pull requests.
|
|
|
6
6
|
|
|
7
7
|
=== Unreleased changes
|
|
8
8
|
|
|
9
|
+
=== Version 5.0.0
|
|
10
|
+
|
|
11
|
+
- Drop Rails versions older than 6.0
|
|
12
|
+
- Add support for Ruby 3.3 and Rails 7.0
|
|
13
|
+
- Add virtual field check to to_null_sql method in query builder
|
|
14
|
+
|
|
15
|
+
=== Version 4.3.1
|
|
16
|
+
- Autocomplete now offers only relevant options available through scopes set on associations (#233)
|
|
17
|
+
|
|
9
18
|
=== Version 4.3.0
|
|
10
19
|
|
|
11
20
|
- Prevent scoped_search from modifying an empty string on newer rubies (#229)
|
data/Gemfile
CHANGED
data/README.rdoc
CHANGED
|
@@ -22,8 +22,8 @@ Add the following line in your Gemfile, and run <tt>bundle install</tt>:
|
|
|
22
22
|
|
|
23
23
|
gem "scoped_search"
|
|
24
24
|
|
|
25
|
-
Scoped search
|
|
26
|
-
previous versions
|
|
25
|
+
Scoped search 5.x supports Rails 6.
|
|
26
|
+
Use previous versions to support older versions of Rails or Ruby.
|
|
27
27
|
|
|
28
28
|
== Usage
|
|
29
29
|
|
data/appraisal.gemfile
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Ruby 3 has moved various gems from default gems to bundled gems
|
|
2
|
+
# Prior to activesupport 7.0.9 these were not listed
|
|
3
|
+
# See https://stdgems.org/ for more
|
|
4
|
+
if RUBY_VERSION >= '3.4'
|
|
5
|
+
gem 'base64'
|
|
6
|
+
gem 'benchmark'
|
|
7
|
+
gem 'bigdecimal'
|
|
8
|
+
gem 'logger'
|
|
9
|
+
gem 'mutex_m'
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
group :mysql do
|
|
13
|
+
gem 'activerecord-jdbcmysql-adapter', platforms: :jruby
|
|
14
|
+
gem 'mysql2', '> 0.5', platforms: :ruby
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
group :postgresql do
|
|
18
|
+
gem 'activerecord-jdbcpostgresql-adapter', platforms: :jruby
|
|
19
|
+
gem 'pg', '>= 0.18', '< 2.0', platforms: :ruby
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
group :sqlite do
|
|
23
|
+
gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
|
|
24
|
+
gem 'sqlite3', '~> 1.4', platforms: :ruby
|
|
25
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gem 'rspec', '~> 3.0'
|
|
@@ -207,6 +207,7 @@ module ScopedSearch
|
|
|
207
207
|
|
|
208
208
|
def complete_value_from_db(field, special_values, val)
|
|
209
209
|
count = 20 - special_values.count
|
|
210
|
+
|
|
210
211
|
completer_scope(field)
|
|
211
212
|
.where(@options[:value_filter])
|
|
212
213
|
.where(value_conditions(field.quoted_field, val))
|
|
@@ -224,7 +225,9 @@ module ScopedSearch
|
|
|
224
225
|
|
|
225
226
|
if field.klass != field.definition.klass
|
|
226
227
|
reflection = field.definition.reflection_by_name(field.definition.klass, field.relation)
|
|
227
|
-
|
|
228
|
+
sub_scope = reflection.active_record.joins(reflection.name)
|
|
229
|
+
sub_scope = sub_scope.select("#{field.klass.table_name}.#{field.klass.primary_key}")
|
|
230
|
+
scope = scope.where(field.klass.primary_key => sub_scope)
|
|
228
231
|
end
|
|
229
232
|
|
|
230
233
|
scope.respond_to?(:reorder) ? scope.reorder(Arel.sql(field.quoted_field)) : scope.scoped(:order => field.quoted_field)
|
|
@@ -307,8 +307,7 @@ module ScopedSearch
|
|
|
307
307
|
|
|
308
308
|
join_reflections.zip(table_names.zip(join_reflections.drop(1))).reduce(sql) do |acc, (reflection, (previous_table, next_reflection))|
|
|
309
309
|
fk1, pk1 = if reflection.respond_to?(:join_keys)
|
|
310
|
-
|
|
311
|
-
reflection.join_keys(*klass).values # We are joining the tables "in reverse", so the PK and FK are swapped
|
|
310
|
+
reflection.join_keys.values # We are joining the tables "in reverse", so the PK and FK are swapped
|
|
312
311
|
else
|
|
313
312
|
[reflection.join_primary_key, reflection.join_foreign_key] #ActiveRecord 6.1
|
|
314
313
|
end
|
|
@@ -426,8 +425,7 @@ module ScopedSearch
|
|
|
426
425
|
def reflection_keys(reflection)
|
|
427
426
|
pk = reflection.klass.primary_key
|
|
428
427
|
fk = reflection.options[:foreign_key]
|
|
429
|
-
|
|
430
|
-
fk ||= reflection.respond_to?(:foreign_key) ? reflection.foreign_key : reflection.primary_key_name
|
|
428
|
+
fk ||= reflection.foreign_key
|
|
431
429
|
reflection.macro == :belongs_to ? [fk, pk] : [pk, fk]
|
|
432
430
|
end
|
|
433
431
|
|
|
@@ -495,6 +493,11 @@ module ScopedSearch
|
|
|
495
493
|
field = definition.field_by_name(rhs.value)
|
|
496
494
|
raise ScopedSearch::QueryNotSupported, "Field '#{rhs.value}' not recognized for searching!" unless field
|
|
497
495
|
|
|
496
|
+
if field.virtual?
|
|
497
|
+
sql_operator = operator == :notnull ? 'IS NOT NULL' : 'IS NULL'
|
|
498
|
+
return field.to_ext_method_sql(rhs.value, sql_operator, nil, &block)
|
|
499
|
+
end
|
|
500
|
+
|
|
498
501
|
if field.key_field
|
|
499
502
|
yield(:parameter, rhs.value.to_s.sub(/^.*\./,''))
|
|
500
503
|
end
|
data/scoped_search.gemspec
CHANGED
|
@@ -29,8 +29,9 @@ Gem::Specification.new do |gem|
|
|
|
29
29
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
30
30
|
gem.require_paths = ["lib"]
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
gem.
|
|
32
|
+
# https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html
|
|
33
|
+
gem.required_ruby_version = '>= 2.5.0'
|
|
34
|
+
gem.add_runtime_dependency('activerecord', '>= 6.0')
|
|
34
35
|
gem.add_development_dependency('rspec', '~> 3.0')
|
|
35
36
|
gem.add_development_dependency('rake')
|
|
36
37
|
|
|
@@ -45,6 +45,16 @@ ScopedSearch::RSpec::Database.test_databases.each do |db|
|
|
|
45
45
|
t.integer :foo_id
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
+
ActiveRecord::Migration.create_table(:asds, :force => true) do |t|
|
|
49
|
+
t.integer :baz_id
|
|
50
|
+
t.string :string
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
ActiveRecord::Migration.create_table(:qwes, :force => true) do |t|
|
|
54
|
+
t.integer :asd_id
|
|
55
|
+
t.string :string
|
|
56
|
+
end
|
|
57
|
+
|
|
48
58
|
class ::Bar < ActiveRecord::Base
|
|
49
59
|
belongs_to :foo
|
|
50
60
|
end
|
|
@@ -71,34 +81,61 @@ ScopedSearch::RSpec::Database.test_databases.each do |db|
|
|
|
71
81
|
|
|
72
82
|
class ::Baz < ActiveRecord::Base
|
|
73
83
|
belongs_to :foo, -> { where(string: 'foo') }
|
|
84
|
+
has_one :asd, -> { where(string: 'foo') }
|
|
85
|
+
has_one :qwe, through: :asd
|
|
74
86
|
|
|
75
|
-
scoped_search :on => :string, :relation => :foo, :complete_value => true
|
|
87
|
+
scoped_search :on => :string, :relation => :foo, :complete_value => true, :rename => 'foos.string'.to_sym
|
|
88
|
+
scoped_search :on => :string, :relation => :asd, :complete_value => true, :rename => 'asds.string'.to_sym
|
|
89
|
+
scoped_search :on => :string, :relation => :qwe, :complete_value => true, :rename => 'qwes.string'.to_sym
|
|
76
90
|
end
|
|
77
91
|
|
|
78
92
|
class ::Infoo < ::Foo
|
|
79
93
|
end
|
|
80
94
|
|
|
95
|
+
class ::Asd < ActiveRecord::Base
|
|
96
|
+
belongs_to :baz
|
|
97
|
+
has_one :qwe
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
class ::Qwe < ActiveRecord::Base
|
|
101
|
+
belongs_to :asd
|
|
102
|
+
end
|
|
103
|
+
|
|
81
104
|
@qux_1 = Qux.create!()
|
|
82
105
|
@qux_2 = Qux.create!()
|
|
83
106
|
@foo_1 = Foo.create!(:string => 'foo', :another => 'temp 1', :explicit => 'baz', :int => 9 , :date => 'February 8, 2011' , :unindexed => 10, :qux => @qux_1)
|
|
84
107
|
@foo_2 = Foo.create!(:string => 'foo', :another => 'temp 2', :explicit => 'baz', :int => 10 , :date => 'February 8, 2011' , :unindexed => 10, :qux => @qux_2)
|
|
85
|
-
Foo.create!(:string => 'bar', :another => 'temp "2"', :explicit => 'baz', :int => 22 , :date => 'February 10, 2011', :unindexed => 10)
|
|
108
|
+
@foo_3 = Foo.create!(:string => 'bar', :another => 'temp "2"', :explicit => 'baz', :int => 22 , :date => 'February 10, 2011', :unindexed => 10)
|
|
86
109
|
Foo.create!(:string => 'baz', :another => nil, :explicit => nil , :int => nil, :date => nil , :unindexed => nil)
|
|
87
110
|
20.times { Foo.create!(:explicit => "aaa") }
|
|
88
111
|
|
|
112
|
+
@baz_1 = Baz.create!(:foo => @foo_1)
|
|
113
|
+
@baz_2 = Baz.create!(:foo => @foo_2)
|
|
114
|
+
Baz.create!(:foo => @foo_3)
|
|
115
|
+
|
|
89
116
|
Bar.create!(:related => 'lala', :foo => @foo_1)
|
|
90
117
|
Bar.create!(:related => 'another lala', :foo => @foo_1)
|
|
118
|
+
|
|
119
|
+
@asd_1 = Asd.create!(:string => 'foo', :baz => @baz_1)
|
|
120
|
+
@asd_2 = Asd.create!(:string => 'bar', :baz => @baz_2)
|
|
121
|
+
Qwe.create!(:asd => @asd_1, :string => 'qwe1')
|
|
122
|
+
Qwe.create!(:asd => @asd_2, :string => 'qwe2')
|
|
91
123
|
end
|
|
92
124
|
|
|
93
125
|
after(:all) do
|
|
94
126
|
ActiveRecord::Migration.drop_table(:foos)
|
|
95
127
|
ActiveRecord::Migration.drop_table(:bars)
|
|
96
128
|
ActiveRecord::Migration.drop_table(:bazs)
|
|
129
|
+
ActiveRecord::Migration.drop_table(:asds)
|
|
130
|
+
ActiveRecord::Migration.drop_table(:qwes)
|
|
97
131
|
|
|
98
132
|
Object.send :remove_const, :Foo
|
|
99
133
|
Object.send :remove_const, :Bar
|
|
100
134
|
Object.send :remove_const, :Baz
|
|
135
|
+
Object.send :remove_const, :Qux
|
|
101
136
|
Object.send :remove_const, :Infoo
|
|
137
|
+
Object.send :remove_const, :Asd
|
|
138
|
+
Object.send :remove_const, :Qwe
|
|
102
139
|
|
|
103
140
|
ScopedSearch::RSpec::Database.close_connection
|
|
104
141
|
end
|
|
@@ -282,7 +319,11 @@ ScopedSearch::RSpec::Database.test_databases.each do |db|
|
|
|
282
319
|
|
|
283
320
|
context 'autocompleting with scopes' do
|
|
284
321
|
it 'should honor the scope' do
|
|
285
|
-
|
|
322
|
+
Baz.complete_for('foos.string =').should == ['foos.string = "foo"']
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
it 'should honor scope on the through relation' do
|
|
326
|
+
Baz.complete_for('qwes.string =').should == ['qwes.string = "qwe1"']
|
|
286
327
|
end
|
|
287
328
|
end
|
|
288
329
|
end
|
|
@@ -46,4 +46,131 @@ ScopedSearch::RSpec::Database.test_databases.each do |db|
|
|
|
46
46
|
@class.search_for('beta = 42').should == [@two]
|
|
47
47
|
end
|
|
48
48
|
end
|
|
49
|
+
|
|
50
|
+
describe ScopedSearch, "ext_method with has/not has on a #{db} database" do
|
|
51
|
+
|
|
52
|
+
before(:all) do
|
|
53
|
+
ScopedSearch::RSpec::Database.establish_named_connection(db)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
after(:all) do
|
|
57
|
+
ScopedSearch::RSpec::Database.close_connection
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
context 'on a direct field' do
|
|
61
|
+
before(:all) do
|
|
62
|
+
@class = ScopedSearch::RSpec::Database.create_model(alpha: :integer) do |klass|
|
|
63
|
+
klass.send(:define_singleton_method, :test_ext_has) do |key, operator, value|
|
|
64
|
+
if value.nil?
|
|
65
|
+
case operator
|
|
66
|
+
when 'IS NOT NULL'
|
|
67
|
+
{ conditions: "#{klass.table_name}.alpha > 1" }
|
|
68
|
+
when 'IS NULL'
|
|
69
|
+
{ conditions: "#{klass.table_name}.alpha IS NULL OR #{klass.table_name}.alpha <= 1" }
|
|
70
|
+
end
|
|
71
|
+
else
|
|
72
|
+
{ conditions: "#{klass.table_name}.alpha = ?", parameter: [value.to_i] }
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
klass.scoped_search on: :alpha, ext_method: :test_ext_has
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
@included = @class.create!(alpha: 2)
|
|
79
|
+
@excluded = @class.create!(alpha: 1)
|
|
80
|
+
@null_record = @class.create!(alpha: nil)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
after(:all) do
|
|
84
|
+
ScopedSearch::RSpec::Database.drop_model(@class)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
it 'should delegate set? to ext_method' do
|
|
88
|
+
@class.search_for('set? alpha').should == [@included]
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
it 'should delegate null? to ext_method' do
|
|
92
|
+
results = @class.search_for('null? alpha')
|
|
93
|
+
results.should include(@excluded)
|
|
94
|
+
results.should include(@null_record)
|
|
95
|
+
results.length.should == 2
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
it 'should still find records via value search' do
|
|
99
|
+
@class.search_for('alpha = 2').should == [@included]
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
context 'on a relation field' do
|
|
104
|
+
before(:all) do
|
|
105
|
+
@main = ScopedSearch::RSpec::Database.create_model(name: :string) {}
|
|
106
|
+
|
|
107
|
+
@related = ScopedSearch::RSpec::Database.create_model(
|
|
108
|
+
value: :string,
|
|
109
|
+
promoted: :boolean,
|
|
110
|
+
main_id: :integer
|
|
111
|
+
) do |klass|
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
related_table = @related.table_name
|
|
115
|
+
main_table = @main.table_name
|
|
116
|
+
related_class = @related
|
|
117
|
+
main_class = @main
|
|
118
|
+
|
|
119
|
+
@related.belongs_to main_table.to_sym, foreign_key: :main_id
|
|
120
|
+
@main.has_many related_table.to_sym, foreign_key: :main_id
|
|
121
|
+
|
|
122
|
+
@main.send(:define_singleton_method, :test_ext_promoted) do |key, operator, value|
|
|
123
|
+
if value.nil?
|
|
124
|
+
subquery = related_class.where(promoted: true).select(:main_id).to_sql
|
|
125
|
+
case operator
|
|
126
|
+
when 'IS NOT NULL'
|
|
127
|
+
{ conditions: "#{main_table}.id IN (#{subquery})" }
|
|
128
|
+
when 'IS NULL'
|
|
129
|
+
{ conditions: "#{main_table}.id NOT IN (#{subquery})" }
|
|
130
|
+
end
|
|
131
|
+
else
|
|
132
|
+
{ joins: related_table.to_sym,
|
|
133
|
+
conditions: "#{related_table}.value #{operator} ? AND #{related_table}.promoted = ?",
|
|
134
|
+
parameter: [value, true] }
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
@main.scoped_search(
|
|
139
|
+
relation: related_table.to_sym,
|
|
140
|
+
on: :value,
|
|
141
|
+
rename: :promoted_items,
|
|
142
|
+
ext_method: :test_ext_promoted
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
@record_a = @main.create!(name: 'a')
|
|
146
|
+
@related.create!(value: 'item1', promoted: true, main_id: @record_a.id)
|
|
147
|
+
|
|
148
|
+
@record_b = @main.create!(name: 'b')
|
|
149
|
+
@related.create!(value: 'item2', promoted: false, main_id: @record_b.id)
|
|
150
|
+
|
|
151
|
+
@record_c = @main.create!(name: 'c')
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
after(:all) do
|
|
155
|
+
ScopedSearch::RSpec::Database.drop_model(@related)
|
|
156
|
+
ScopedSearch::RSpec::Database.drop_model(@main)
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
it 'should delegate set? to ext_method, not raw relation' do
|
|
160
|
+
@main.search_for('set? promoted_items').should == [@record_a]
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
it 'should delegate null? to ext_method, not raw relation' do
|
|
164
|
+
results = @main.search_for('null? promoted_items')
|
|
165
|
+
results.should include(@record_b)
|
|
166
|
+
results.should include(@record_c)
|
|
167
|
+
results.length.should == 2
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
it 'should still use ext_method for value search' do
|
|
171
|
+
@main.search_for('promoted_items = item1').should == [@record_a]
|
|
172
|
+
@main.search_for('promoted_items = item2').should == []
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
end
|
|
49
176
|
end
|
|
@@ -249,13 +249,13 @@ ScopedSearch::RSpec::Database.test_databases.each do |db|
|
|
|
249
249
|
before do
|
|
250
250
|
|
|
251
251
|
# Create some tables
|
|
252
|
-
ActiveRecord::Migration.create_table(:mars) { |t| t.integer :koo_id; t.integer :
|
|
253
|
-
ActiveRecord::Migration.create_table(:
|
|
252
|
+
ActiveRecord::Migration.create_table(:mars) { |t| t.integer :koo_id; t.integer :zab_id }
|
|
253
|
+
ActiveRecord::Migration.create_table(:zabs) { |t| t.string :related }
|
|
254
254
|
ActiveRecord::Migration.create_table(:koos) { |t| t.string :foo }
|
|
255
255
|
|
|
256
256
|
# The related classes
|
|
257
|
-
class Mar < ActiveRecord::Base; belongs_to :
|
|
258
|
-
class
|
|
257
|
+
class Mar < ActiveRecord::Base; belongs_to :zab; belongs_to :koo; end
|
|
258
|
+
class Zab < ActiveRecord::Base; has_many :mars; end
|
|
259
259
|
|
|
260
260
|
# The class on which to call search_for
|
|
261
261
|
class Koo < ActiveRecord::Base
|
|
@@ -263,38 +263,38 @@ ScopedSearch::RSpec::Database.test_databases.each do |db|
|
|
|
263
263
|
# having the source option here is not needed for the statement correctness.
|
|
264
264
|
# It is here to fail the code introduced in 2.6.2 that wrongly detected source instead of source_type
|
|
265
265
|
# as an indication for a polymorphic relation.
|
|
266
|
-
has_many :
|
|
266
|
+
has_many :zabs, :through => :mars, :source => :zab
|
|
267
267
|
|
|
268
|
-
scoped_search :relation => :
|
|
268
|
+
scoped_search :relation => :zabs, :on => :related
|
|
269
269
|
end
|
|
270
270
|
|
|
271
271
|
@koo_1 = Koo.create!(:foo => 'foo')
|
|
272
272
|
@koo_2 = Koo.create!(:foo => 'foo too')
|
|
273
273
|
@koo_3 = Koo.create!(:foo => 'foo three')
|
|
274
274
|
|
|
275
|
-
@
|
|
276
|
-
@
|
|
275
|
+
@zab_1 = Zab.create(:related => 'zab')
|
|
276
|
+
@zab_2 = Zab.create(:related => 'zab too!')
|
|
277
277
|
|
|
278
|
-
@bar_1 = Mar.create!(:koo => @koo_1, :
|
|
278
|
+
@bar_1 = Mar.create!(:koo => @koo_1, :zab => @zab_1)
|
|
279
279
|
@bar_2 = Mar.create!(:koo => @koo_1)
|
|
280
|
-
@bar_3 = Mar.create!(:koo => @koo_2, :
|
|
281
|
-
@bar_3 = Mar.create!(:koo => @koo_2, :
|
|
282
|
-
@bar_3 = Mar.create!(:koo => @koo_2, :
|
|
280
|
+
@bar_3 = Mar.create!(:koo => @koo_2, :zab => @zab_1)
|
|
281
|
+
@bar_3 = Mar.create!(:koo => @koo_2, :zab => @zab_2)
|
|
282
|
+
@bar_3 = Mar.create!(:koo => @koo_2, :zab => @zab_2)
|
|
283
283
|
@bar_4 = Mar.create!(:koo => @koo_3)
|
|
284
284
|
end
|
|
285
285
|
|
|
286
286
|
after do
|
|
287
|
-
ActiveRecord::Migration.drop_table(:
|
|
287
|
+
ActiveRecord::Migration.drop_table(:zabs)
|
|
288
288
|
ActiveRecord::Migration.drop_table(:mars)
|
|
289
289
|
ActiveRecord::Migration.drop_table(:koos)
|
|
290
290
|
end
|
|
291
291
|
|
|
292
|
-
it "should find the two records that are related to a
|
|
293
|
-
Koo.search_for('
|
|
292
|
+
it "should find the two records that are related to a zab record" do
|
|
293
|
+
Koo.search_for('zab').length.should == 2
|
|
294
294
|
end
|
|
295
295
|
|
|
296
|
-
it "should find the two records that are related to a
|
|
297
|
-
Koo.search_for('related=
|
|
296
|
+
it "should find the two records that are related to a zab record" do
|
|
297
|
+
Koo.search_for('related=zab AND related="zab too!"').length.should == 1
|
|
298
298
|
end
|
|
299
299
|
end
|
|
300
300
|
|
|
@@ -303,27 +303,27 @@ ScopedSearch::RSpec::Database.test_databases.each do |db|
|
|
|
303
303
|
before do
|
|
304
304
|
|
|
305
305
|
# Create some tables
|
|
306
|
-
ActiveRecord::Migration.create_table(:zars) { |t| t.integer :
|
|
307
|
-
ActiveRecord::Migration.create_table(:
|
|
306
|
+
ActiveRecord::Migration.create_table(:zars) { |t| t.integer :zab_id }
|
|
307
|
+
ActiveRecord::Migration.create_table(:zabs) { |t| t.string :related }
|
|
308
308
|
ActiveRecord::Migration.create_table(:zoos) { |t| t.integer :zar_id; t.string :foo }
|
|
309
309
|
|
|
310
310
|
# The related classes
|
|
311
|
-
class Zar < ActiveRecord::Base; belongs_to :
|
|
312
|
-
class
|
|
311
|
+
class Zar < ActiveRecord::Base; belongs_to :zab; has_many :zoos; end
|
|
312
|
+
class Zab < ActiveRecord::Base; has_many :zars; end
|
|
313
313
|
|
|
314
314
|
# The class on which to call search_for
|
|
315
315
|
class Zoo < ActiveRecord::Base
|
|
316
316
|
belongs_to :zar
|
|
317
|
-
has_many :
|
|
317
|
+
has_many :zabs, :through => :zar
|
|
318
318
|
|
|
319
|
-
scoped_search :relation => :
|
|
319
|
+
scoped_search :relation => :zabs, :on => :related
|
|
320
320
|
end
|
|
321
321
|
|
|
322
|
-
|
|
323
|
-
|
|
322
|
+
zab_1 = Zab.create(:related => 'zab')
|
|
323
|
+
zab_2 = Zab.create(:related => 'zab too!')
|
|
324
324
|
|
|
325
|
-
zar_1 = Zar.create!( :
|
|
326
|
-
zar_2 = Zar.create!( :
|
|
325
|
+
zar_1 = Zar.create!( :zab => zab_1)
|
|
326
|
+
zar_2 = Zar.create!( :zab => zab_2)
|
|
327
327
|
|
|
328
328
|
Zoo.create!(:zar => zar_1, :foo => 'foo')
|
|
329
329
|
Zoo.create!(:zar => zar_1, :foo => 'foo too')
|
|
@@ -331,17 +331,17 @@ ScopedSearch::RSpec::Database.test_databases.each do |db|
|
|
|
331
331
|
end
|
|
332
332
|
|
|
333
333
|
after do
|
|
334
|
-
ActiveRecord::Migration.drop_table(:
|
|
334
|
+
ActiveRecord::Migration.drop_table(:zabs)
|
|
335
335
|
ActiveRecord::Migration.drop_table(:zars)
|
|
336
336
|
ActiveRecord::Migration.drop_table(:zoos)
|
|
337
337
|
end
|
|
338
338
|
|
|
339
|
-
it "should find the three records that are related to a
|
|
340
|
-
Zoo.search_for('
|
|
339
|
+
it "should find the three records that are related to a zab record" do
|
|
340
|
+
Zoo.search_for('zab').length.should == 3
|
|
341
341
|
end
|
|
342
342
|
|
|
343
|
-
it "should find no records that are related to a
|
|
344
|
-
Zoo.search_for('related=
|
|
343
|
+
it "should find no records that are related to a zab record" do
|
|
344
|
+
Zoo.search_for('related=zab AND related="zab too!"').length.should == 0
|
|
345
345
|
end
|
|
346
346
|
end
|
|
347
347
|
|
|
@@ -392,8 +392,8 @@ ScopedSearch::RSpec::Database.test_databases.each do |db|
|
|
|
392
392
|
@tag_2 = Tag.create!(:foo => 'foo too')
|
|
393
393
|
@tag_3 = Tag.create!(:foo => 'foo three')
|
|
394
394
|
|
|
395
|
-
@dog_1 = Dog.create(:related => '
|
|
396
|
-
@dog_2 = Dog.create(:related => '
|
|
395
|
+
@dog_1 = Dog.create(:related => 'zab')
|
|
396
|
+
@dog_2 = Dog.create(:related => 'zab too!')
|
|
397
397
|
@cat_1 = Cat.create(:related => 'mitzi')
|
|
398
398
|
|
|
399
399
|
@owner_1 = Owner.create(:name => 'Fred', :dogs => [@dog_1])
|
|
@@ -429,11 +429,11 @@ ScopedSearch::RSpec::Database.test_databases.each do |db|
|
|
|
429
429
|
end
|
|
430
430
|
|
|
431
431
|
it "should find the two tags that are related to a dog record" do
|
|
432
|
-
Tag.search_for('dog=
|
|
432
|
+
Tag.search_for('dog=zab').length.should == 2
|
|
433
433
|
end
|
|
434
434
|
|
|
435
435
|
it "should find the 3 tags that are related to dogs record" do
|
|
436
|
-
Tag.search_for('
|
|
436
|
+
Tag.search_for('zab').length.should == 3
|
|
437
437
|
end
|
|
438
438
|
end
|
|
439
439
|
|
|
@@ -547,22 +547,22 @@ ScopedSearch::RSpec::Database.test_databases.each do |db|
|
|
|
547
547
|
before do
|
|
548
548
|
|
|
549
549
|
# Create some tables with namespaces
|
|
550
|
-
ActiveRecord::Migration.create_table(:zan_mars) { |t| t.integer :koo_id; t.integer :
|
|
551
|
-
ActiveRecord::Migration.create_table(:
|
|
550
|
+
ActiveRecord::Migration.create_table(:zan_mars) { |t| t.integer :koo_id; t.integer :zab_id }
|
|
551
|
+
ActiveRecord::Migration.create_table(:zan_zabs) { |t| t.string :related }
|
|
552
552
|
ActiveRecord::Migration.create_table(:zan_koos) { |t| t.string :foo }
|
|
553
553
|
|
|
554
554
|
# The related classes
|
|
555
|
-
module Zan; class Mar < ActiveRecord::Base; belongs_to :
|
|
556
|
-
module Zan; class
|
|
555
|
+
module Zan; class Mar < ActiveRecord::Base; belongs_to :zab; belongs_to :koo; self.table_name = "zan_mars"; end; end
|
|
556
|
+
module Zan; class Zab < ActiveRecord::Base; has_many :mars; self.table_name = "zan_zabs"; end; end
|
|
557
557
|
|
|
558
558
|
# The class on which to call search_for
|
|
559
559
|
module Zan
|
|
560
560
|
class Koo < ActiveRecord::Base
|
|
561
561
|
has_many :mars, :class_name => "Zan::Mar"
|
|
562
|
-
has_many :
|
|
562
|
+
has_many :zabs, :through => :mars
|
|
563
563
|
self.table_name = "zan_koos"
|
|
564
564
|
|
|
565
|
-
scoped_search :relation => :
|
|
565
|
+
scoped_search :relation => :zabs, :on => :related
|
|
566
566
|
end
|
|
567
567
|
end
|
|
568
568
|
|
|
@@ -570,29 +570,29 @@ ScopedSearch::RSpec::Database.test_databases.each do |db|
|
|
|
570
570
|
@koo_2 = Zan::Koo.create!(:foo => 'foo too')
|
|
571
571
|
@koo_3 = Zan::Koo.create!(:foo => 'foo three')
|
|
572
572
|
|
|
573
|
-
@
|
|
574
|
-
@
|
|
573
|
+
@zab_1 = Zan::Zab.create(:related => 'zab')
|
|
574
|
+
@zab_2 = Zan::Zab.create(:related => 'zab too!')
|
|
575
575
|
|
|
576
|
-
@bar_1 = Zan::Mar.create!(:koo => @koo_1, :
|
|
576
|
+
@bar_1 = Zan::Mar.create!(:koo => @koo_1, :zab => @zab_1)
|
|
577
577
|
@bar_2 = Zan::Mar.create!(:koo => @koo_1)
|
|
578
|
-
@bar_3 = Zan::Mar.create!(:koo => @koo_2, :
|
|
579
|
-
@bar_3 = Zan::Mar.create!(:koo => @koo_2, :
|
|
580
|
-
@bar_3 = Zan::Mar.create!(:koo => @koo_2, :
|
|
578
|
+
@bar_3 = Zan::Mar.create!(:koo => @koo_2, :zab => @zab_1)
|
|
579
|
+
@bar_3 = Zan::Mar.create!(:koo => @koo_2, :zab => @zab_2)
|
|
580
|
+
@bar_3 = Zan::Mar.create!(:koo => @koo_2, :zab => @zab_2)
|
|
581
581
|
@bar_4 = Zan::Mar.create!(:koo => @koo_3)
|
|
582
582
|
end
|
|
583
583
|
|
|
584
584
|
after do
|
|
585
|
-
ActiveRecord::Migration.drop_table(:
|
|
585
|
+
ActiveRecord::Migration.drop_table(:zan_zabs)
|
|
586
586
|
ActiveRecord::Migration.drop_table(:zan_mars)
|
|
587
587
|
ActiveRecord::Migration.drop_table(:zan_koos)
|
|
588
588
|
end
|
|
589
589
|
|
|
590
|
-
it "should find the two records that are related to a
|
|
591
|
-
Zan::Koo.search_for('
|
|
590
|
+
it "should find the two records that are related to a zab record" do
|
|
591
|
+
Zan::Koo.search_for('zab').length.should == 2
|
|
592
592
|
end
|
|
593
593
|
|
|
594
|
-
it "should find the one record that is related to two
|
|
595
|
-
Zan::Koo.search_for('related=
|
|
594
|
+
it "should find the one record that is related to two zab records" do
|
|
595
|
+
Zan::Koo.search_for('related=zab AND related="zab too!"').length.should == 1
|
|
596
596
|
end
|
|
597
597
|
end
|
|
598
598
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: scoped_search
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 5.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Amos Benari
|
|
8
8
|
- Willem van Bergen
|
|
9
9
|
- Wes Hays
|
|
10
|
+
autorequire:
|
|
10
11
|
bindir: bin
|
|
11
12
|
cert_chain: []
|
|
12
|
-
date:
|
|
13
|
+
date: 2026-08-05 00:00:00.000000000 Z
|
|
13
14
|
dependencies:
|
|
14
15
|
- !ruby/object:Gem::Dependency
|
|
15
16
|
name: activerecord
|
|
@@ -17,14 +18,14 @@ dependencies:
|
|
|
17
18
|
requirements:
|
|
18
19
|
- - ">="
|
|
19
20
|
- !ruby/object:Gem::Version
|
|
20
|
-
version:
|
|
21
|
+
version: '6.0'
|
|
21
22
|
type: :runtime
|
|
22
23
|
prerelease: false
|
|
23
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
24
25
|
requirements:
|
|
25
26
|
- - ">="
|
|
26
27
|
- !ruby/object:Gem::Version
|
|
27
|
-
version:
|
|
28
|
+
version: '6.0'
|
|
28
29
|
- !ruby/object:Gem::Dependency
|
|
29
30
|
name: rspec
|
|
30
31
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -141,32 +142,27 @@ email:
|
|
|
141
142
|
executables: []
|
|
142
143
|
extensions: []
|
|
143
144
|
extra_rdoc_files:
|
|
145
|
+
- README.rdoc
|
|
144
146
|
- CHANGELOG.rdoc
|
|
145
147
|
- CONTRIBUTING.rdoc
|
|
146
148
|
- LICENSE
|
|
147
|
-
- README.rdoc
|
|
148
149
|
files:
|
|
149
150
|
- ".github/workflows/ruby.yml"
|
|
150
151
|
- ".gitignore"
|
|
151
152
|
- ".travis.yml"
|
|
153
|
+
- Appraisals
|
|
152
154
|
- CHANGELOG.rdoc
|
|
153
155
|
- CONTRIBUTING.rdoc
|
|
154
156
|
- Gemfile
|
|
155
|
-
- Gemfile.activerecord42
|
|
156
|
-
- Gemfile.activerecord50
|
|
157
|
-
- Gemfile.activerecord51
|
|
158
|
-
- Gemfile.activerecord52
|
|
159
|
-
- Gemfile.activerecord52_with_activesupport52
|
|
160
|
-
- Gemfile.activerecord60
|
|
161
|
-
- Gemfile.activerecord60_with_activesupport60
|
|
162
|
-
- Gemfile.activerecord61
|
|
163
|
-
- Gemfile.activerecord61_with_activesupport61
|
|
164
157
|
- LICENSE
|
|
165
158
|
- README.rdoc
|
|
166
159
|
- Rakefile
|
|
167
160
|
- app/assets/images/spinner.gif
|
|
168
161
|
- app/assets/javascripts/scoped_search.js
|
|
169
162
|
- app/assets/stylesheets/scoped_search.scss
|
|
163
|
+
- appraisal.gemfile
|
|
164
|
+
- gemfiles/modular/rails-6
|
|
165
|
+
- gemfiles/modular/rspec
|
|
170
166
|
- lib/scoped_search.rb
|
|
171
167
|
- lib/scoped_search/auto_complete_builder.rb
|
|
172
168
|
- lib/scoped_search/compass.rb
|
|
@@ -213,6 +209,7 @@ homepage: https://github.com/wvanbergen/scoped_search/wiki
|
|
|
213
209
|
licenses:
|
|
214
210
|
- MIT
|
|
215
211
|
metadata: {}
|
|
212
|
+
post_install_message:
|
|
216
213
|
rdoc_options:
|
|
217
214
|
- "--title"
|
|
218
215
|
- scoped_search
|
|
@@ -226,14 +223,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
226
223
|
requirements:
|
|
227
224
|
- - ">="
|
|
228
225
|
- !ruby/object:Gem::Version
|
|
229
|
-
version: 2.
|
|
226
|
+
version: 2.5.0
|
|
230
227
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
231
228
|
requirements:
|
|
232
229
|
- - ">="
|
|
233
230
|
- !ruby/object:Gem::Version
|
|
234
231
|
version: '0'
|
|
235
232
|
requirements: []
|
|
236
|
-
rubygems_version: 3.
|
|
233
|
+
rubygems_version: 3.5.22
|
|
234
|
+
signing_key:
|
|
237
235
|
specification_version: 4
|
|
238
236
|
summary: Easily search you ActiveRecord models with a simple query language using
|
|
239
237
|
a named scope
|
data/Gemfile.activerecord42
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
gemspec
|
|
3
|
-
|
|
4
|
-
gem 'actionview', '~> 4.2.0'
|
|
5
|
-
gem 'activerecord', '~> 4.2.0'
|
|
6
|
-
|
|
7
|
-
gem 'nokogiri', '~> 1.6.0' if RUBY_VERSION.start_with?('2.0')
|
|
8
|
-
|
|
9
|
-
platforms :jruby do
|
|
10
|
-
gem 'activerecord-jdbcsqlite3-adapter'
|
|
11
|
-
gem 'activerecord-jdbcmysql-adapter'
|
|
12
|
-
gem 'activerecord-jdbcpostgresql-adapter'
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
platforms :ruby do
|
|
16
|
-
gem 'sqlite3', '~> 1.3.6'
|
|
17
|
-
gem 'mysql2', '>= 0.3.13', '< 0.5'
|
|
18
|
-
gem 'pg', '~> 0.15'
|
|
19
|
-
end
|
data/Gemfile.activerecord50
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
gemspec
|
|
3
|
-
|
|
4
|
-
gem 'actionview', '~> 5.0.0'
|
|
5
|
-
gem 'activerecord', '~> 5.0.0'
|
|
6
|
-
|
|
7
|
-
platforms :jruby do
|
|
8
|
-
gem 'activerecord-jdbcsqlite3-adapter'
|
|
9
|
-
gem 'activerecord-jdbcmysql-adapter'
|
|
10
|
-
gem 'activerecord-jdbcpostgresql-adapter'
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
platforms :ruby do
|
|
14
|
-
gem 'sqlite3', '~> 1.3.6'
|
|
15
|
-
gem 'mysql2', '>= 0.3.18', '< 0.5'
|
|
16
|
-
gem 'pg', '~> 0.18'
|
|
17
|
-
end
|
data/Gemfile.activerecord51
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
gemspec
|
|
3
|
-
|
|
4
|
-
gem 'actionview', '~> 5.1.0'
|
|
5
|
-
gem 'activerecord', '~> 5.1.0'
|
|
6
|
-
|
|
7
|
-
platforms :jruby do
|
|
8
|
-
gem 'activerecord-jdbcsqlite3-adapter'
|
|
9
|
-
gem 'activerecord-jdbcmysql-adapter'
|
|
10
|
-
gem 'activerecord-jdbcpostgresql-adapter'
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
platforms :ruby do
|
|
14
|
-
gem 'sqlite3', '~> 1.3.6'
|
|
15
|
-
gem 'mysql2', '>= 0.3.18', '< 0.5'
|
|
16
|
-
gem 'pg', '~> 0.18'
|
|
17
|
-
end
|
data/Gemfile.activerecord52
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
gemspec
|
|
3
|
-
|
|
4
|
-
gem 'actionview', '~> 5.2.0'
|
|
5
|
-
gem 'activerecord', '~> 5.2.0'
|
|
6
|
-
|
|
7
|
-
platforms :jruby do
|
|
8
|
-
gem 'activerecord-jdbcsqlite3-adapter'
|
|
9
|
-
gem 'activerecord-jdbcmysql-adapter'
|
|
10
|
-
gem 'activerecord-jdbcpostgresql-adapter'
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
platforms :ruby do
|
|
14
|
-
gem 'sqlite3', '~> 1.3.6'
|
|
15
|
-
gem 'mysql2', '>= 0.3.18', '< 0.5'
|
|
16
|
-
gem 'pg', '~> 0.18'
|
|
17
|
-
end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
gemspec
|
|
3
|
-
|
|
4
|
-
gem 'actionview', '~> 5.2.0'
|
|
5
|
-
gem 'activerecord', '~> 5.2.0'
|
|
6
|
-
gem 'activesupport', '~> 5.2.0'
|
|
7
|
-
|
|
8
|
-
platforms :jruby do
|
|
9
|
-
gem 'activerecord-jdbcsqlite3-adapter'
|
|
10
|
-
gem 'activerecord-jdbcmysql-adapter'
|
|
11
|
-
gem 'activerecord-jdbcpostgresql-adapter'
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
platforms :ruby do
|
|
15
|
-
gem 'sqlite3', '~> 1.3.6'
|
|
16
|
-
gem 'mysql2', '>= 0.3.18', '< 0.5'
|
|
17
|
-
gem 'pg', '~> 0.18'
|
|
18
|
-
end
|
data/Gemfile.activerecord60
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
gemspec
|
|
3
|
-
|
|
4
|
-
gem 'actionview', '~> 6.0.0'
|
|
5
|
-
gem 'activerecord', '~> 6.0.0'
|
|
6
|
-
|
|
7
|
-
platforms :jruby do
|
|
8
|
-
gem 'activerecord-jdbcsqlite3-adapter'
|
|
9
|
-
gem 'activerecord-jdbcmysql-adapter'
|
|
10
|
-
gem 'activerecord-jdbcpostgresql-adapter'
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
platforms :ruby do
|
|
14
|
-
gem 'sqlite3', '~> 1.4'
|
|
15
|
-
gem 'mysql2', '> 0.5'
|
|
16
|
-
gem 'pg', '>= 0.18', '< 2.0'
|
|
17
|
-
end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
gemspec
|
|
3
|
-
|
|
4
|
-
gem 'actionview', '~> 6.0.0'
|
|
5
|
-
gem 'activerecord', '~> 6.0.0'
|
|
6
|
-
gem 'activesupport', '~> 6.0.0'
|
|
7
|
-
|
|
8
|
-
platforms :jruby do
|
|
9
|
-
gem 'activerecord-jdbcsqlite3-adapter'
|
|
10
|
-
gem 'activerecord-jdbcmysql-adapter'
|
|
11
|
-
gem 'activerecord-jdbcpostgresql-adapter'
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
platforms :ruby do
|
|
15
|
-
gem 'sqlite3', '~> 1.4'
|
|
16
|
-
gem 'mysql2', '> 0.5'
|
|
17
|
-
gem 'pg', '>= 0.18', '< 2.0'
|
|
18
|
-
end
|
data/Gemfile.activerecord61
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
gemspec
|
|
3
|
-
|
|
4
|
-
gem 'actionview', '~> 6.1.0'
|
|
5
|
-
gem 'activerecord', '~> 6.1.0'
|
|
6
|
-
|
|
7
|
-
platforms :jruby do
|
|
8
|
-
gem 'activerecord-jdbcsqlite3-adapter'
|
|
9
|
-
gem 'activerecord-jdbcmysql-adapter'
|
|
10
|
-
gem 'activerecord-jdbcpostgresql-adapter'
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
platforms :ruby do
|
|
14
|
-
gem 'sqlite3', '~> 1.4'
|
|
15
|
-
gem 'mysql2', '> 0.5'
|
|
16
|
-
gem 'pg', '>= 0.18', '< 2.0'
|
|
17
|
-
end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
gemspec
|
|
3
|
-
|
|
4
|
-
gem 'actionview', '~> 6.1.0'
|
|
5
|
-
gem 'activerecord', '~> 6.1.0'
|
|
6
|
-
gem 'activesupport', '~> 6.1.0'
|
|
7
|
-
|
|
8
|
-
platforms :jruby do
|
|
9
|
-
gem 'activerecord-jdbcsqlite3-adapter'
|
|
10
|
-
gem 'activerecord-jdbcmysql-adapter'
|
|
11
|
-
gem 'activerecord-jdbcpostgresql-adapter'
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
platforms :ruby do
|
|
15
|
-
gem 'sqlite3', '~> 1.4'
|
|
16
|
-
gem 'mysql2', '> 0.5'
|
|
17
|
-
gem 'pg', '>= 0.18', '< 2.0'
|
|
18
|
-
end
|