Skip to content

Commit

Permalink
Code quality improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
scarroll32 committed Nov 8, 2022
1 parent 4d234c8 commit 58115c8
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion lib/polyamorous.rb

This file was deleted.

4 changes: 2 additions & 2 deletions lib/ransack/nodes/condition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module Ransack
module Nodes
class Condition < Node
i18n_word :attribute, :predicate, :combinator, :value
i18n_alias :a => :attribute, :p => :predicate,
:m => :combinator, :v => :value
i18n_alias a: :attribute, p: :predicate,
m: :combinator, v: :value

attr_accessor :predicate

Expand Down
2 changes: 1 addition & 1 deletion lib/ransack/nodes/grouping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Grouping < Node
alias :m= :combinator=

i18n_word :condition, :and, :or
i18n_alias :c => :condition, :n => :and, :o => :or
i18n_alias c: :condition, n: :and, o: :or

delegate :each, :to => :values

Expand Down
2 changes: 1 addition & 1 deletion lib/ransack/nodes/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Ransack
module Nodes
class Node
attr_reader :context
delegate :contextualize, :to => :context
delegate :contextualize, to: :context
class_attribute :i18n_words
class_attribute :i18n_aliases
self.i18n_words = []
Expand Down
2 changes: 1 addition & 1 deletion lib/ransack/nodes/value.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Ransack
module Nodes
class Value < Node
attr_accessor :value
delegate :present?, :blank?, :to => :value
delegate :present?, :blank?, to: :value

def initialize(context, value = nil)
super(context)
Expand Down
2 changes: 1 addition & 1 deletion lib/ransack/ransacker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Ransacker

attr_reader :name, :type, :formatter, :args

delegate :call, :to => :@callable
delegate :call, to: :@callable

def initialize(klass, name, opts = {}, &block)
@klass, @name = klass, name
Expand Down
4 changes: 2 additions & 2 deletions lib/ransack/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ class Search

attr_reader :base, :context

delegate :object, :klass, :to => :context
delegate :object, :klass, to: :context
delegate :new_grouping, :new_condition,
:build_grouping, :build_condition,
:translate, :to => :base
:translate, to: :base

def initialize(object, params = {}, options = {})
strip_whitespace = options.fetch(:strip_whitespace, Ransack.options[:strip_whitespace])
Expand Down

0 comments on commit 58115c8

Please sign in to comment.