polo 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 93d97d6214a9996ab4d60db51dac14a7514ccfae
4
- data.tar.gz: a0937d10b02b9ea5121ed3527d8b7f4c628a602d
3
+ metadata.gz: ca29093a04bba002958e166ec8881900c45ca74c
4
+ data.tar.gz: a0039ac801dbc56df94c5533cbaae90da1e42e9a
5
5
  SHA512:
6
- metadata.gz: d1d44682ff8d768dbf124e2972d5783ab20a70b0e8efb88746aab542661b15d5ec20c3f7f9a95b4d82ec98330f260d589f21a230bac993d6910e32db9fb4e7e4
7
- data.tar.gz: 2f8daca89230ddf32012e8489275048c1af86912dd22ae4c8299b5e725b381b6b27c06bd6a33775df0c7afc3b4a759135857ab676c2753707dd5292232bcf310
6
+ metadata.gz: 11938c67cf755be0cd4e22b0a7266daaf2cdc22b3aa3f3b86e4741b52ae476f30d679bbcfb7af690a79bee42ae6790f23912cc419777fdd2b177c31a7876b100
7
+ data.tar.gz: 6e4d16920f4fa794371c56ae089e063d65ef0c03133414e7eb16f9496bfa88c3b7e44d23a7b05e68441903e920ff386752ddba0cc9bb38679b55cdfe54196e81
data/Appraisals CHANGED
@@ -13,3 +13,7 @@ end
13
13
  appraise "rails42" do
14
14
  gem "activerecord", "4.2.3"
15
15
  end
16
+
17
+ appraise "rails50" do
18
+ gem "activerecord", "5.0.0"
19
+ end
@@ -1,3 +1,13 @@
1
+ ## 0.5
2
+
3
+ ### Breaking Changes
4
+
5
+ - None
6
+
7
+ ### Added
8
+ - [#43](https://github.com/IFTTT/polo/pull/43) Rails 5 support
9
+ - [#44](https://github.com/IFTTT/polo/pull/44) Remove all Rails 5 deprecation notices
10
+
1
11
  ## 0.4.1
2
12
 
3
13
  ### Breaking Changes
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "5.0.0"
6
+
7
+ gemspec :path => "../"
@@ -69,7 +69,7 @@ module Polo
69
69
  # wouldn't be properly serialized automatically. That's why explict
70
70
  # 'type_cast' call are necessary.
71
71
  #
72
- module ActiveRecordFourOrGreater
72
+ module ActiveRecordFour
73
73
  def insert_values(record)
74
74
  connection = ActiveRecord::Base.connection
75
75
  values = record.send(:arel_attributes_with_values_for_create, record.attribute_names)
@@ -80,10 +80,34 @@ module Polo
80
80
  end
81
81
  end
82
82
 
83
+ # Internal: Returns an object's attribute definitions along with
84
+ # their set values (for Rails >= 5.x).
85
+ #
86
+ # Serializers have changed again in rails 5.
87
+ # We now use the type_caster from the arel_table.
88
+ #
89
+ module ActiveRecordFive
90
+ # Based on the codepath used in Rails 5
91
+ def raw_sql(record)
92
+ values = record.send(:arel_attributes_with_values_for_create, record.attribute_names)
93
+ model = record.class
94
+ substitutes, binds = model.unscoped.substitute_values(values)
95
+
96
+ insert_manager = model.arel_table.create_insert
97
+ insert_manager.insert substitutes
98
+
99
+ model.connection.unprepared_statement do
100
+ model.connection.to_sql(insert_manager, binds)
101
+ end
102
+ end
103
+ end
104
+
83
105
  if ActiveRecord::VERSION::MAJOR < 4
84
106
  include ActiveRecordLessThanFour
107
+ elsif ActiveRecord::VERSION::MAJOR == 4
108
+ include ActiveRecordFour
85
109
  else
86
- include ActiveRecordFourOrGreater
110
+ prepend ActiveRecordFive
87
111
  end
88
112
  end
89
113
  end
@@ -1,3 +1,3 @@
1
1
  module Polo
2
- VERSION = "0.4.1"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Netto Farah
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-09 00:00:00.000000000 Z
11
+ date: 2016-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -117,6 +117,7 @@ files:
117
117
  - gemfiles/rails40.gemfile
118
118
  - gemfiles/rails41.gemfile
119
119
  - gemfiles/rails42.gemfile
120
+ - gemfiles/rails50.gemfile
120
121
  - lib/polo.rb
121
122
  - lib/polo/adapters/mysql.rb
122
123
  - lib/polo/adapters/postgres.rb
@@ -146,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
147
  version: '0'
147
148
  requirements: []
148
149
  rubyforge_project:
149
- rubygems_version: 2.4.5.1
150
+ rubygems_version: 2.4.8
150
151
  signing_key:
151
152
  specification_version: 4
152
153
  summary: Bring life back to your development environment with samples from production