arel_extensions 0.8.0 → 0.8.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 087006edf929bdce808d6e2ba04a9e39923caa51
4
- data.tar.gz: 0aaa1834a9d6939366ce9bda87dbacc3e60db044
3
+ metadata.gz: e2104e8ef91fafcff70f47ea78a4cea88c637369
4
+ data.tar.gz: 4e6ca2e45bb57191050efc6c39485c4c537f81d3
5
5
  SHA512:
6
- metadata.gz: 26248a966e70e85b6b4baf615e273d1fe80661be799f44d119ef244e83f3d8a37c09fe14e488746eda992bb84595a9e2821fcf1f3535648ccb3da0159c420c55
7
- data.tar.gz: a4e60ee3fa48f9dbff4a50a3c73edec8ed3c172372b69e2cb1ef6587eabb1b03acef5c625a824c8b536a490b033f1785b1a4541152b6fcacf66cebeb095ac794
6
+ metadata.gz: 2b2be3523655952655491ed46bc25f8edd11217ba50d41c6e96e0d02801d2c93664c288004dd02c7cb9ee3e45c9951507d5422ca0bd94a725196fa2757d9c09f
7
+ data.tar.gz: 731327576e59131f48b77c76cc69f5ae65af6816342b01920b2d3fa658d157f551dfdbb728cd5cd9eab7d8f96b128de4d3da8ccdece71c691ec4f606a86fd52c
data/.travis.yml CHANGED
@@ -6,6 +6,10 @@ before_install:
6
6
  # - sudo apt-get install -qq sqlite3
7
7
  #addons:
8
8
  # mariadb: '10.0'
9
+ gemfile:
10
+ - Gemfile
11
+ - gemfiles/rails3.gemfile
12
+ - gemfiles/rails5.gemfile
9
13
  services:
10
14
  - mysql
11
15
  - postgresql
@@ -36,10 +40,26 @@ jdk:
36
40
  # - openjdk6
37
41
  matrix:
38
42
  fast_finish: true
39
- # allow_failures:
43
+ exclude:
44
+ - jdk: openjdk7
45
+ rvm: rbx-2
46
+ - jdk: oraclejdk7
47
+ rvm: rbx-2
48
+ - jdk: openjdk7
49
+ rvm: 2.0.0
50
+ - jdk: oraclejdk7
51
+ rvm: 2.0.0
52
+ - jdk: openjdk7
53
+ rvm: 2.1
54
+ - jdk: oraclejdk7
55
+ rvm: 2.1
56
+ allow_failures:
40
57
  # - rvm: jruby-9.0.5.0
41
58
  # - rvm: jruby-head
42
- # - rvm: ruby-head
59
+ - rvm: ruby-head
60
+ gemfile: Gemfile
61
+ - rvm: ruby-head
62
+ gemfile: gemfiles/rails3.gemfile
43
63
  # - rvm: jruby-head
44
64
  bundler_args: --jobs 3 --retry 3
45
65
  notifications:
data/Gemfile CHANGED
@@ -5,6 +5,6 @@ gemspec
5
5
  group :test do
6
6
  gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
7
7
  # for JRuby
8
- gem "jdbc-sqlite3", :platform => :jrubyend
8
+ gem "jdbc-sqlite3", :platform => :jruby
9
9
  gem 'activerecord', '~> 4.0'
10
10
  end
data/README.md CHANGED
@@ -98,4 +98,17 @@ Examples :
98
98
 
99
99
  ## BULK INSERT / UPSERT
100
100
 
101
- TODO
101
+ Arel Extensions improves InsertManager by adding bulk_insert method, which allows to insert multiple rows in one insert.
102
+
103
+
104
+ ```
105
+ @cols = ['id', 'name', 'comments', 'created_at']
106
+ @data = [
107
+ [23, 'name1', "sdfdsfdsfsdf", '2016-01-01'],
108
+ [25, 'name2', "sdfds234sfsdf", '2016-01-01']
109
+ ]
110
+
111
+ insert_manager = Arel::InsertManager.new(User).into(User.arel_table)
112
+ insert_manager.bulk_insert(@cols, @data)
113
+ User.connection.execute(insert_manager.to_sql)
114
+ ```
@@ -4,7 +4,7 @@ $:.push File.expand_path("../lib", __FILE__)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "arel_extensions"
7
- s.version = '0.8.0'
7
+ s.version = '0.8.1'
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Yann Azoury", "Mathilde Pechdi", "Félix Bellanger"]
10
10
  s.email = ["yann.azoury@faveod.com", "mathilde.pechdimaldjian@gmail.com", "felix.bellanger@faveod.com"]
@@ -0,0 +1,16 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'arel', '~> 7.0'
4
+
5
+ group :development, :test do
6
+ gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
7
+ # for JRuby
8
+ gem "jdbc-sqlite3", :platform => :jruby
9
+ gem 'activesupport', '~> 5'
10
+ gem 'activemodel', '~> 5'
11
+ gem 'activerecord', '~> 5'
12
+ gem 'rdoc'
13
+ gem 'rake'
14
+ end
15
+
16
+ gemspec :path => "../"
@@ -0,0 +1,16 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'arel', '~> 5.0'
4
+
5
+ group :development, :test do
6
+ gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
7
+ # for JRuby
8
+ gem "jdbc-sqlite3", :platform => :jruby
9
+ gem 'activesupport', '~> 3.2'
10
+ gem 'activemodel', '~> 3.2'
11
+ gem 'activerecord', '~> 3.2'
12
+ gem 'rdoc'
13
+ gem 'rake'
14
+ end
15
+
16
+ gemspec :path => "../"
@@ -1,23 +1,6 @@
1
1
  module ArelExtensions
2
2
  module Nodes
3
- class Soundex < Arel::Nodes::Function
4
-
5
-
6
- def initialize other, aliaz = nil
7
- tab = Array.new
8
- tab << other
9
- super(tab, aliaz)
10
- end
11
-
12
- def expr
13
- @expressions.first
14
- end
15
-
16
-
17
- def as other
18
- Arel::Nodes::As.new self, Arel::Nodes::SqlLiteral.new(other)
19
- end
20
-
3
+ class Soundex < Function
21
4
  end
22
5
  end
23
6
  end
@@ -19,7 +19,7 @@ module ArelExtensions
19
19
 
20
20
  #SOUNDEX function returns a character string containing the phonetic representation of char.
21
21
  def soundex
22
- ArelExtensions::Nodes::Soundex.new self
22
+ ArelExtensions::Nodes::Soundex.new [self]
23
23
  end
24
24
 
25
25
  def imatches others, escape = nil
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module ArelExtensions
3
- VERSION = "0.8.0".freeze
3
+ VERSION = "0.8.1".freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arel_extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yann Azoury
@@ -129,8 +129,8 @@ files:
129
129
  - Rakefile
130
130
  - arel_extensions.gemspec
131
131
  - functions.html
132
- - gemfiles/Gemfile.rails3
133
- - gemfiles/Gemfile.rails5
132
+ - gemfiles/rails5.gemfile
133
+ - gemfiles/rasil3.gemfile
134
134
  - init/mssql.sql
135
135
  - init/mysql.sql
136
136
  - init/oracle.sql
@@ -1,10 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec
4
-
5
- group :test do
6
- gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
7
- # for JRuby
8
- gem "jdbc-sqlite3", :platform => :jrubyend
9
- gem 'activerecord', '~> 3.0'
10
- end
@@ -1,10 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec
4
-
5
- group :test do
6
- gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
7
- # for JRuby
8
- gem "jdbc-sqlite3", :platform => :jrubyend
9
- gem 'activerecord', '~> 5.0'
10
- end