Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Fixes #379 #401

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "http://rubygems.org"
gemspec

gem 'rake'
gem 'rake', '< 11.0'

rails = ENV['RAILS'] || '4-2-stable'
arel = ENV['AREL'] || '6-0-stable'
Expand Down
4 changes: 2 additions & 2 deletions lib/squeel/nodes/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ class Order < Node
# @return The expression being ordered on. Might be an attribute, function, or operation
attr_reader :expr

# @return [Fixnum] 1 or -1, depending on ascending or descending direction, respectively
# @return [Integer] 1 or -1, depending on ascending or descending direction, respectively
attr_reader :direction

# Create a new Order node with the given expression and direction
# @param expr The expression to order on
# @param [Fixnum] direction 1 or -1, depending on the desired sort direction
# @param [Integer] direction 1 or -1, depending on the desired sort direction
def initialize(expr, direction = 1)
raise ArgumentError, "Direction #{direction} is not valid. Must be -1 or 1." unless [-1,1].include? direction
@expr, @direction = expr, direction
Expand Down
7 changes: 3 additions & 4 deletions lib/squeel/visitors/visitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def visit_without_hash_context_shift(k, v, parent)
# object if not passed as an SqlLiteral.
def quoted?(object)
case object
when Arel::Nodes::SqlLiteral, Bignum, Fixnum,
when Arel::Nodes::SqlLiteral, Integer
Arel::SelectManager
false
when NilClass
Expand Down Expand Up @@ -208,8 +208,7 @@ def visit_passthrough(object, parent)
object
end

alias :visit_Fixnum :visit_passthrough
alias :visit_Bignum :visit_passthrough
alias :visit_Integer :visit_passthrough

# Visit an array, which involves accepting any values we know how to
# accept, and skipping the rest.
Expand Down Expand Up @@ -448,7 +447,7 @@ def visit_ActiveRecord_Relation(o, parent)
#
# @param [ActiveRecord::Base] o The AR::Base object to visit
# @param parent The current parent object in the context
# @return [Fixnum] The id of the object
# @return [Integer] The id of the object
def visit_ActiveRecord_Base(o, parent)
o.id
end
Expand Down
2 changes: 1 addition & 1 deletion squeel.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gem::Specification.new do |s|

s.add_dependency 'activerecord', '>= 3.0'
s.add_dependency 'activesupport', '>= 3.0'
s.add_dependency 'polyamorous', '~> 1.1.0'
s.add_dependency 'polyamorous', '~> 1.3.0'
s.add_development_dependency 'rspec', '~> 2.6.0'
s.add_development_dependency 'faker', '~> 0.9.5'
s.add_development_dependency 'sqlite3', '~> 1.3.3'
Expand Down