ransack 2.3.0 → 2.4.2

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 (87) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +3 -0
  3. data/.github/SECURITY.md +12 -0
  4. data/.github/workflows/cronjob.yml +105 -0
  5. data/.github/workflows/rubocop.yml +20 -0
  6. data/.github/workflows/test.yml +154 -0
  7. data/.rubocop.yml +44 -0
  8. data/CHANGELOG.md +31 -1
  9. data/CONTRIBUTING.md +13 -11
  10. data/Gemfile +19 -5
  11. data/README.md +119 -54
  12. data/bug_report_templates/test-ransack-scope-and-column-same-name.rb +78 -0
  13. data/bug_report_templates/test-ransacker-arel-present-predicate.rb +71 -0
  14. data/docs/img/create_release.png +0 -0
  15. data/docs/release_process.md +20 -0
  16. data/{polyamorous/lib/polyamorous/activerecord_5.2.1_ruby_2 → lib/polyamorous/activerecord_5.2_ruby_2}/join_association.rb +4 -2
  17. data/{polyamorous/lib/polyamorous/activerecord_5.2.1_ruby_2 → lib/polyamorous/activerecord_5.2_ruby_2}/join_dependency.rb +0 -2
  18. data/lib/polyamorous/activerecord_5.2_ruby_2/reflection.rb +11 -0
  19. data/lib/polyamorous/activerecord_6.0_ruby_2/join_association.rb +1 -0
  20. data/{polyamorous/lib → lib}/polyamorous/activerecord_6.0_ruby_2/join_dependency.rb +0 -1
  21. data/lib/polyamorous/activerecord_6.0_ruby_2/reflection.rb +1 -0
  22. data/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb +74 -0
  23. data/lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb +93 -0
  24. data/{polyamorous/lib → lib}/polyamorous/activerecord_6.1_ruby_2/reflection.rb +0 -1
  25. data/lib/polyamorous/activerecord_6.2_ruby_2/join_association.rb +1 -0
  26. data/lib/polyamorous/activerecord_6.2_ruby_2/join_dependency.rb +1 -0
  27. data/lib/polyamorous/activerecord_6.2_ruby_2/reflection.rb +1 -0
  28. data/{polyamorous/lib → lib}/polyamorous/join.rb +0 -0
  29. data/{polyamorous/lib → lib/polyamorous}/polyamorous.rb +3 -8
  30. data/{polyamorous/lib → lib}/polyamorous/swapping_reflection_class.rb +0 -0
  31. data/{polyamorous/lib → lib}/polyamorous/tree_node.rb +0 -0
  32. data/lib/ransack.rb +3 -4
  33. data/lib/ransack/adapters/active_record/base.rb +4 -0
  34. data/lib/ransack/adapters/active_record/context.rb +51 -80
  35. data/lib/ransack/adapters/active_record/ransack/constants.rb +13 -1
  36. data/lib/ransack/adapters/active_record/ransack/context.rb +2 -6
  37. data/lib/ransack/adapters/active_record/ransack/nodes/condition.rb +11 -4
  38. data/lib/ransack/configuration.rb +17 -1
  39. data/lib/ransack/constants.rb +2 -5
  40. data/lib/ransack/helpers.rb +1 -1
  41. data/lib/ransack/helpers/form_builder.rb +8 -14
  42. data/lib/ransack/locale/sk.yml +70 -0
  43. data/lib/ransack/nodes/attribute.rb +1 -1
  44. data/lib/ransack/nodes/condition.rb +7 -1
  45. data/lib/ransack/nodes/grouping.rb +1 -1
  46. data/lib/ransack/nodes/sort.rb +1 -1
  47. data/lib/ransack/nodes/value.rb +1 -1
  48. data/lib/ransack/predicate.rb +2 -1
  49. data/lib/ransack/search.rb +3 -1
  50. data/lib/ransack/translate.rb +3 -3
  51. data/lib/ransack/version.rb +1 -1
  52. data/ransack.gemspec +8 -23
  53. data/spec/blueprints/articles.rb +1 -1
  54. data/spec/blueprints/comments.rb +1 -1
  55. data/spec/blueprints/notes.rb +1 -1
  56. data/spec/blueprints/tags.rb +1 -1
  57. data/spec/console.rb +5 -5
  58. data/spec/helpers/polyamorous_helper.rb +1 -10
  59. data/spec/helpers/ransack_helper.rb +1 -1
  60. data/spec/{ransack → polyamorous}/join_association_spec.rb +7 -0
  61. data/spec/{ransack → polyamorous}/join_dependency_spec.rb +0 -0
  62. data/spec/{ransack → polyamorous}/join_spec.rb +0 -0
  63. data/spec/ransack/adapters/active_record/base_spec.rb +9 -6
  64. data/spec/ransack/adapters/active_record/context_spec.rb +19 -18
  65. data/spec/ransack/configuration_spec.rb +10 -0
  66. data/spec/ransack/helpers/form_helper_spec.rb +16 -16
  67. data/spec/ransack/nodes/grouping_spec.rb +2 -2
  68. data/spec/ransack/predicate_spec.rb +39 -1
  69. data/spec/ransack/search_spec.rb +105 -17
  70. data/spec/spec_helper.rb +9 -5
  71. data/spec/support/schema.rb +8 -3
  72. metadata +41 -177
  73. data/.travis.yml +0 -49
  74. data/polyamorous/lib/polyamorous/activerecord_5.0_ruby_2/join_association.rb +0 -2
  75. data/polyamorous/lib/polyamorous/activerecord_5.0_ruby_2/join_dependency.rb +0 -2
  76. data/polyamorous/lib/polyamorous/activerecord_5.1_ruby_2/join_association.rb +0 -31
  77. data/polyamorous/lib/polyamorous/activerecord_5.1_ruby_2/join_dependency.rb +0 -112
  78. data/polyamorous/lib/polyamorous/activerecord_5.2.0_ruby_2/join_association.rb +0 -31
  79. data/polyamorous/lib/polyamorous/activerecord_5.2.0_ruby_2/join_dependency.rb +0 -112
  80. data/polyamorous/lib/polyamorous/activerecord_5.2.0_ruby_2/reflection.rb +0 -12
  81. data/polyamorous/lib/polyamorous/activerecord_5.2.1_ruby_2/reflection.rb +0 -2
  82. data/polyamorous/lib/polyamorous/activerecord_6.0_ruby_2/join_association.rb +0 -2
  83. data/polyamorous/lib/polyamorous/activerecord_6.0_ruby_2/reflection.rb +0 -2
  84. data/polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb +0 -2
  85. data/polyamorous/lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb +0 -2
  86. data/polyamorous/lib/polyamorous/version.rb +0 -3
  87. data/polyamorous/polyamorous.gemspec +0 -35
@@ -13,6 +13,18 @@ module Ransack
13
13
  formatter: proc { |v| "%#{escape_wildcards(v)}%" }
14
14
  }
15
15
  ],
16
+ ['i_cont'.freeze, {
17
+ arel_predicate: 'matches'.freeze,
18
+ formatter: proc { |v| "%#{escape_wildcards(v.downcase)}%" },
19
+ case_insensitive: true
20
+ }
21
+ ],
22
+ ['not_i_cont'.freeze, {
23
+ arel_predicate: 'does_not_match'.freeze,
24
+ formatter: proc { |v| "%#{escape_wildcards(v.downcase)}%" },
25
+ case_insensitive: true
26
+ }
27
+ ],
16
28
  ['start'.freeze, {
17
29
  arel_predicate: 'matches'.freeze,
18
30
  formatter: proc { |v| "#{escape_wildcards(v)}%" }
@@ -85,7 +97,7 @@ module Ransack
85
97
  arel_predicate: proc { |v| v ? EQ : NOT_EQ },
86
98
  compounds: false,
87
99
  type: :boolean,
88
- validator: proc { |v| BOOLEAN_VALUES.include?(v)},
100
+ validator: proc { |v| BOOLEAN_VALUES.include?(v) },
89
101
  formatter: proc { |v| nil }
90
102
  }
91
103
  ],
@@ -28,14 +28,10 @@ module Ransack
28
28
  @join_type = options[:join_type] || Polyamorous::OuterJoin
29
29
  @search_key = options[:search_key] || Ransack.options[:search_key]
30
30
  @associations_pot = {}
31
+ @tables_pot = {}
31
32
  @lock_associations = []
32
33
 
33
- if ::ActiveRecord::VERSION::STRING >= Constants::RAILS_5_2
34
- @base = @join_dependency.instance_variable_get(:@join_root)
35
- else
36
- @base = @join_dependency.join_root
37
- @engine = @base.base_klass.arel_engine
38
- end
34
+ @base = @join_dependency.instance_variable_get(:@join_root)
39
35
  end
40
36
 
41
37
  def bind_pair_for(key)
@@ -30,7 +30,7 @@ module Ransack
30
30
  def format_predicate(attribute)
31
31
  arel_pred = arel_predicate_for_attribute(attribute)
32
32
  arel_values = formatted_values_for_attribute(attribute)
33
- predicate = attribute.attr.public_send(arel_pred, arel_values)
33
+ predicate = attr_value_for_attribute(attribute).public_send(arel_pred, arel_values)
34
34
 
35
35
  if in_predicate?(predicate)
36
36
  predicate.right = predicate.right.map do |pr|
@@ -47,12 +47,19 @@ module Ransack
47
47
  end
48
48
 
49
49
  def casted_array?(predicate)
50
- predicate.respond_to?(:val) && predicate.val.is_a?(Array)
50
+ (predicate.respond_to?(:value) && predicate.value.is_a?(Array)) || # Rails 6.1
51
+ (predicate.respond_to?(:val) && predicate.val.is_a?(Array)) # Rails 5.2, 6.0
51
52
  end
52
53
 
53
54
  def format_values_for(predicate)
54
- predicate.val.map do |value|
55
- value.is_a?(String) ? Arel::Nodes.build_quoted(value) : value
55
+ value = if predicate.respond_to?(:value)
56
+ predicate.value # Rails 6.1
57
+ else
58
+ predicate.val # Rails 5.2, 6.0
59
+ end
60
+
61
+ value.map do |val|
62
+ val.is_a?(String) ? Arel::Nodes.build_quoted(val) : val
56
63
  end
57
64
  end
58
65
 
@@ -33,7 +33,8 @@ module Ransack
33
33
  :up_arrow => '▼'.freeze,
34
34
  :down_arrow => '▲'.freeze,
35
35
  :default_arrow => nil,
36
- :sanitize_scope_args => true
36
+ :sanitize_scope_args => true,
37
+ :postgres_fields_sort_option => nil
37
38
  }
38
39
 
39
40
  def configure
@@ -141,6 +142,21 @@ module Ransack
141
142
  self.options[:sanitize_scope_args] = boolean
142
143
  end
143
144
 
145
+ # The `NULLS FIRST` and `NULLS LAST` options can be used to determine
146
+ # whether nulls appear before or after non-null values in the sort ordering.
147
+ #
148
+ # User may want to configure it like this:
149
+ #
150
+ # Ransack.configure do |c|
151
+ # c.postgres_fields_sort_option = :nulls_first # or :nulls_last
152
+ # end
153
+ #
154
+ # See this feature: https://www.postgresql.org/docs/13/queries-order.html
155
+ #
156
+ def postgres_fields_sort_option=(setting)
157
+ self.options[:postgres_fields_sort_option] = setting
158
+ end
159
+
144
160
  # By default, Ransack displays sort order indicator arrows in sort links.
145
161
  # The default may be globally overridden in an initializer file like
146
162
  # `config/initializers/ransack.rb` as follows:
@@ -36,7 +36,7 @@ module Ransack
36
36
  'lt'.freeze, 'lteq'.freeze,
37
37
  'gt'.freeze, 'gteq'.freeze,
38
38
  'in'.freeze, 'not_in'.freeze
39
- ].freeze
39
+ ].freeze
40
40
  A_S_I = ['a'.freeze, 's'.freeze, 'i'.freeze].freeze
41
41
 
42
42
  EQ = 'eq'.freeze
@@ -45,13 +45,10 @@ module Ransack
45
45
  NOT_EQ_ALL = 'not_eq_all'.freeze
46
46
  CONT = 'cont'.freeze
47
47
 
48
- RAILS_5_1 = '5.1'.freeze
49
- RAILS_5_2 = '5.2'.freeze
50
- RAILS_5_2_0 = '5.2.0'.freeze
51
48
  RAILS_6_0 = '6.0.0'.freeze
49
+ RAILS_6_1 = '6.1.0'.freeze
52
50
 
53
51
  RANSACK_SLASH_SEARCHES = 'ransack/searches'.freeze
54
52
  RANSACK_SLASH_SEARCHES_SLASH_SEARCH = 'ransack/searches/search'.freeze
55
53
  end
56
54
  end
57
-
@@ -1,2 +1,2 @@
1
1
  require 'ransack/helpers/form_builder'
2
- require 'ransack/helpers/form_helper'
2
+ require 'ransack/helpers/form_helper'
@@ -7,17 +7,11 @@ module ActionView::Helpers::Tags
7
7
  class Base
8
8
  private
9
9
  if defined? ::ActiveRecord
10
- if ::ActiveRecord::VERSION::STRING < '5.2'
11
- def value(object)
12
- object.send @method_name if object # use send instead of public_send
13
- end
14
- else # rails/rails#29791
15
- def value
16
- if @allow_method_names_outside_object
17
- object.send @method_name if object && object.respond_to?(@method_name, true)
18
- else
19
- object.send @method_name if object
20
- end
10
+ def value
11
+ if @allow_method_names_outside_object
12
+ object.send @method_name if object && object.respond_to?(@method_name, true)
13
+ else
14
+ object.send @method_name if object
21
15
  end
22
16
  end
23
17
  end
@@ -51,9 +45,9 @@ module Ransack
51
45
  end
52
46
 
53
47
  def attribute_select(options = nil, html_options = nil, action = nil)
54
- options = options || {}
55
- html_options = html_options || {}
56
- action = action || Constants::SEARCH
48
+ options ||= {}
49
+ html_options ||= {}
50
+ action ||= Constants::SEARCH
57
51
  default = options.delete(:default)
58
52
  raise ArgumentError, formbuilder_error_message(
59
53
  "#{action}_select") unless object.respond_to?(:context)
@@ -0,0 +1,70 @@
1
+ sk:
2
+ ransack:
3
+ search: "vyhľadávanie"
4
+ predicate: "predikát"
5
+ and: "a"
6
+ or: "alebo"
7
+ any: "akýkoľvek"
8
+ all: "každý"
9
+ combinator: "kombinátor"
10
+ attribute: "atribút"
11
+ value: "hodnota"
12
+ condition: "podmienka"
13
+ sort: "poradie"
14
+ asc: "vzostupne"
15
+ desc: "zostupne"
16
+ predicates:
17
+ eq: "sa rovná"
18
+ eq_any: "sa rovná akémukoľvek"
19
+ eq_all: "sa rovná všetkým"
20
+ not_eq: "sa nerovná"
21
+ not_eq_any: "sa nerovná akémukoľvek"
22
+ not_eq_all: "sa nerovná všetkým"
23
+ matches: "zodpovedá"
24
+ matches_any: "zodpovedá akémukoľvek"
25
+ matches_all: "zodpovedá všetkým"
26
+ does_not_match: "nezodpovedá"
27
+ does_not_match_any: "nezodpovedá akémukoľvek"
28
+ does_not_match_all: "nezodpovedá všetkým"
29
+ lt: "menší ako"
30
+ lt_any: "menší ako akýkoľvek"
31
+ lt_all: "menší ako všetky"
32
+ lteq: "menší alebo rovný"
33
+ lteq_any: "menší alebo rovný akémukoľvek"
34
+ lteq_all: "menší alebo rovný všetkým"
35
+ gt: "väčší ako"
36
+ gt_any: "väčší ako akýkoľvek"
37
+ gt_all: "väčší ako všetky"
38
+ gteq: "väčší alebo rovný"
39
+ gteq_any: "väčší alebo rovný akémukoľvek"
40
+ gteq_all: "väčší alebo rovný všetkým"
41
+ in: "v"
42
+ in_any: "v akejkoľvek"
43
+ in_all: "vo všetkých"
44
+ not_in: "nie je v"
45
+ not_in_any: "nie je v akejkoľvek"
46
+ not_in_all: "nie je vo všetkých"
47
+ cont: "obsahuje"
48
+ cont_any: "obsahuje akúkoľvek"
49
+ cont_all: "obsahuje všetky"
50
+ not_cont: "neobsahuje"
51
+ not_cont_any: "neobsahuje akúkoľvek"
52
+ not_cont_all: "neobsahuje všetky"
53
+ start: "začína na"
54
+ start_any: "začína s akoukoľvek"
55
+ start_all: "začína so všetkými"
56
+ not_start: "nezačíná s"
57
+ not_start_any: "nezačíná s akoukoľvek"
58
+ not_start_all: "nezačíná so všetkými"
59
+ end: "končí s"
60
+ end_any: "končí s akoukoľvek"
61
+ end_all: "končí so všetkými"
62
+ not_end: "nekončí s"
63
+ not_end_any: "nekončí s akoukoľvek"
64
+ not_end_all: "nekončí so všetkými"
65
+ 'true': "je pravdivé"
66
+ 'false': "nie je pravdivé"
67
+ present: "je vyplnené"
68
+ blank: "je prázdne"
69
+ 'null': "je null"
70
+ not_null: "nie je null"
@@ -30,7 +30,7 @@ module Ransack
30
30
 
31
31
  def type
32
32
  if ransacker
33
- return ransacker.type
33
+ ransacker.type
34
34
  else
35
35
  context.type_for(self)
36
36
  end
@@ -127,7 +127,6 @@ module Ransack
127
127
  alias :m= :combinator=
128
128
  alias :m :combinator
129
129
 
130
-
131
130
  # == build_attribute
132
131
  #
133
132
  # This method was originally called from Nodes::Grouping#new_condition
@@ -255,6 +254,13 @@ module Ransack
255
254
  end
256
255
  end
257
256
 
257
+ def attr_value_for_attribute(attr)
258
+ return attr.attr if ActiveRecord::Base.connection.adapter_name == "PostgreSQL"
259
+
260
+ predicate.case_insensitive ? attr.attr.lower : attr.attr
261
+ rescue
262
+ attr.attr
263
+ end
258
264
 
259
265
  def default_type
260
266
  predicate.type || (attributes.first && attributes.first.type)
@@ -108,7 +108,7 @@ module Ransack
108
108
  alias :g= :groupings=
109
109
 
110
110
  def method_missing(method_id, *args)
111
- method_name = method_id.to_s
111
+ method_name = method_id.to_s.dup
112
112
  writer = method_name.sub!(/\=$/, ''.freeze)
113
113
  if attribute_method?(method_name)
114
114
  if writer
@@ -9,7 +9,7 @@ module Ransack
9
9
  class << self
10
10
  def extract(context, str)
11
11
  return unless str
12
- attr, direction = str.split(/\s+/,2)
12
+ attr, direction = str.split(/\s+/, 2)
13
13
  self.new(context).build(name: attr, dir: direction)
14
14
  end
15
15
  end
@@ -50,7 +50,7 @@ module Ransack
50
50
  y, m, d = *[val].flatten
51
51
  m ||= 1
52
52
  d ||= 1
53
- Date.new(y,m,d) rescue nil
53
+ Date.new(y, m, d) rescue nil
54
54
  end
55
55
  end
56
56
 
@@ -1,7 +1,7 @@
1
1
  module Ransack
2
2
  class Predicate
3
3
  attr_reader :name, :arel_predicate, :type, :formatter, :validator,
4
- :compound, :wants_array
4
+ :compound, :wants_array, :case_insensitive
5
5
 
6
6
  class << self
7
7
 
@@ -42,6 +42,7 @@ module Ransack
42
42
  @compound = opts[:compound]
43
43
  @wants_array = opts.fetch(:wants_array,
44
44
  @compound || Constants::IN_NOT_IN.include?(@arel_predicate))
45
+ @case_insensitive = opts[:case_insensitive]
45
46
  end
46
47
 
47
48
  def eql?(other)
@@ -18,6 +18,7 @@ module Ransack
18
18
  params = params.to_unsafe_h if params.respond_to?(:to_unsafe_h)
19
19
  if params.is_a? Hash
20
20
  params = params.dup
21
+ params = params.transform_values { |v| v.is_a?(String) ? v.strip : v }
21
22
  params.delete_if { |k, v| [*v].all?{ |i| i.blank? && i != false } }
22
23
  else
23
24
  params = {}
@@ -29,6 +30,7 @@ module Ransack
29
30
  )
30
31
  @scope_args = {}
31
32
  @sorts ||= []
33
+ @ignore_unknown_conditions = options[:ignore_unknown_conditions] == false ? false : true
32
34
  build(params.with_indifferent_access)
33
35
  end
34
36
 
@@ -44,7 +46,7 @@ module Ransack
44
46
  base.send("#{key}=", value)
45
47
  elsif @context.ransackable_scope?(key, @context.object)
46
48
  add_scope(key, value)
47
- elsif !Ransack.options[:ignore_unknown_conditions]
49
+ elsif !Ransack.options[:ignore_unknown_conditions] || !@ignore_unknown_conditions
48
50
  raise ArgumentError, "Invalid search term #{key}"
49
51
  end
50
52
  end
@@ -50,7 +50,7 @@ module Ransack
50
50
 
51
51
  defaults << options.delete(:default) if options[:default]
52
52
  options.reverse_merge! count: 1, default: defaults
53
- I18n.translate(defaults.shift, options.merge(interpolations))
53
+ I18n.translate(defaults.shift, **options.merge(interpolations))
54
54
  end
55
55
 
56
56
  def association(key, options = {})
@@ -67,7 +67,7 @@ module Ransack
67
67
  end
68
68
  defaults << context.traverse(key).model_name.human
69
69
  options = { :count => 1, :default => defaults }
70
- I18n.translate(defaults.shift, options)
70
+ I18n.translate(defaults.shift, **options)
71
71
  end
72
72
 
73
73
  private
@@ -83,7 +83,7 @@ module Ransack
83
83
  options = { count: 1, default: defaults }
84
84
  interpolations = build_interpolations(associated_class)
85
85
 
86
- I18n.translate(defaults.shift, options.merge(interpolations))
86
+ I18n.translate(defaults.shift, **options.merge(interpolations))
87
87
  end
88
88
 
89
89
  def default_attribute_name
@@ -1,3 +1,3 @@
1
1
  module Ransack
2
- VERSION = '2.3.0'
2
+ VERSION = '2.4.2'
3
3
  end
@@ -1,4 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
+
2
3
  $:.push File.expand_path("../lib", __FILE__)
3
4
  require "ransack/version"
4
5
 
@@ -6,36 +7,20 @@ Gem::Specification.new do |s|
6
7
  s.name = "ransack"
7
8
  s.version = Ransack::VERSION
8
9
  s.platform = Gem::Platform::RUBY
9
- s.authors = ["Ernie Miller", "Ryan Bigg", "Jon Atack","Sean Carroll"]
10
- s.email = ["ernie@erniemiller.org", "radarlistener@gmail.com", "jonnyatack@gmail.com","sfcarroll@gmail.com"]
10
+ s.authors = ["Ernie Miller", "Ryan Bigg", "Jon Atack", "Sean Carroll"]
11
+ s.email = ["ernie@erniemiller.org", "radarlistener@gmail.com", "jonnyatack@gmail.com", "sfcarroll@gmail.com"]
11
12
  s.homepage = "https://github.com/activerecord-hackery/ransack"
12
13
  s.summary = %q{Object-based searching for Active Record and Mongoid (currently).}
13
14
  s.description = %q{Ransack is the successor to the MetaSearch gem. It improves and expands upon MetaSearch's functionality, but does not have a 100%-compatible API.}
14
- s.required_ruby_version = '>= 1.9'
15
+ s.required_ruby_version = '>= 2.6'
15
16
  s.license = 'MIT'
16
17
 
17
- s.add_dependency 'actionpack', '>= 5.0'
18
- s.add_dependency 'activerecord', '>= 5.0'
19
- s.add_dependency 'activesupport', '>= 5.0'
18
+ s.add_dependency 'activerecord', '>= 5.2.4'
19
+ s.add_dependency 'activesupport', '>= 5.2.4'
20
20
  s.add_dependency 'i18n'
21
- s.add_dependency 'polyamorous', Ransack::VERSION.to_s
22
- s.add_development_dependency 'rspec', '~> 3'
23
- s.add_development_dependency 'machinist', '~> 1.0.6'
24
- s.add_development_dependency 'faker', '~> 0.9.5'
25
- s.add_development_dependency 'sqlite3', ::Gem::Version.new(ENV['RAILS'].gsub(/^v/, '')) >= ::Gem::Version.new('6-0-stable') ? '~> 1.4.1' : '~> 1.3.3'
26
- s.add_development_dependency 'pg', '~> 0.21'
27
- s.add_development_dependency 'mysql2', '0.3.20'
28
- s.add_development_dependency 'pry', '0.10'
29
- s.add_development_dependency 'byebug'
30
21
 
31
22
  s.files = `git ls-files`.split("\n")
32
-
33
- s.test_files = `git ls-files -- {test,spec,features}/*`
34
- .split("\n")
35
-
36
- s.executables = `git ls-files -- bin/*`
37
- .split("\n")
38
- .map { |f| File.basename(f) }
39
-
23
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
24
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
40
25
  s.require_paths = ["lib"]
41
26
  end
@@ -2,4 +2,4 @@ Article.blueprint do
2
2
  person
3
3
  title
4
4
  body
5
- end
5
+ end
@@ -2,4 +2,4 @@ Comment.blueprint do
2
2
  article
3
3
  person
4
4
  body
5
- end
5
+ end
@@ -2,4 +2,4 @@ Note.blueprint do
2
2
  note
3
3
  notable_type { "Article" }
4
4
  notable_id
5
- end
5
+ end