vorpal 0.0.7.rc3 → 0.0.7

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: 9f2563f7c44050a5908ff5d2d3d08e9d35a343db
4
- data.tar.gz: 569a5eb41e1278bb6b28f8e49eab416e4b38cfa5
3
+ metadata.gz: 813b5c4649667d1289ba85df9114c3badab734ed
4
+ data.tar.gz: e1e1deb869ccc9b6577b87f9122c056ff0803d62
5
5
  SHA512:
6
- metadata.gz: e45f9c3942c256d2fcda1c360dda4e51da9d777d8381ab7bd0dfa1fcaf6db6901a3699ab4d9110d7f850556c43fc7a345af6406eda03c7748702e69c09a06269
7
- data.tar.gz: e24ffc7f449a88ad55a9af19cb4a043f389ae34e3788f466b7354a34eda83f3846562d72efda14493ed8995e05bee9a8c5c9d0d21a73e827e4d07210768ab058
6
+ metadata.gz: 9b7692c298e0f63b8bf1723d2846899e8ac62adc9434e1f01c234e2c027c579752e2bf8d2e95d58c93df9a6d28243b4c9a00f694222608ea825dc3cdad08d7ef
7
+ data.tar.gz: 5e5a6b4280a7a94e8f1c1cc0564fb1718af715e3390819caa477f3a99db3f401e15255d37f6f0dfaae48b49eb037a753a4271442e01bcb9c7a5233cef4c5c7f5
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.1.6
data/README.md CHANGED
@@ -25,6 +25,8 @@ We say 'framelet' because it doesn't attempt to give you all the goodies that OR
25
25
 
26
26
  This last point is incredibly important because applications that grow organically can get very far without needing to separate persistence and domain logic. But when they do, Vorpal will play nicely with all that legacy code.
27
27
 
28
+ For more details on why we created Vorpal, see [The Pitch](https://github.com/nulogy/vorpal/wiki#the-pitch).
29
+
28
30
  ## Installation
29
31
 
30
32
  Add this line to your application's Gemfile:
@@ -32,7 +32,7 @@ module Vorpal
32
32
  # @param class_config [ClassConfig]
33
33
  # @return [[Object]] An array of entities.
34
34
  def load_by_id(class_config, ids)
35
- class_config.db_class.where(id: ids).all
35
+ class_config.db_class.where(id: ids).to_a
36
36
  end
37
37
 
38
38
  # Loads instances of the given class whose foreign key has the given value.
@@ -43,7 +43,7 @@ module Vorpal
43
43
  def load_by_foreign_key(class_config, id, foreign_key_info)
44
44
  arel = class_config.db_class.where(foreign_key_info.fk_column => id)
45
45
  arel = arel.where(foreign_key_info.fk_type_column => foreign_key_info.fk_type) if foreign_key_info.polymorphic?
46
- arel.order(:id).all
46
+ arel.order(:id).to_a
47
47
  end
48
48
 
49
49
  # Fetches primary key values to be used for new entities.
@@ -104,7 +104,7 @@ module Vorpal
104
104
 
105
105
  # See {AggregateMapper#load_many}.
106
106
  def load_many
107
- db_roots = self.all
107
+ db_roots = self.to_a
108
108
  @vorpal_aggregate_mapper.load_many(db_roots)
109
109
  end
110
110
 
@@ -1,3 +1,3 @@
1
1
  module Vorpal
2
- VERSION = "0.0.7.rc3"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -1,10 +1,9 @@
1
1
  require 'active_record'
2
- require 'pg' # or 'mysql2' or 'sqlite3'
3
- # require 'logger'
2
+ require 'pg'
4
3
 
5
4
  # Change the following to reflect your database settings
6
5
  ActiveRecord::Base.establish_connection(
7
- adapter: 'postgresql', # or 'mysql2' or 'sqlite3'
6
+ adapter: 'postgresql',
8
7
  host: 'localhost',
9
8
  database: 'vorpal_test',
10
9
  username: 'vorpal',
@@ -18,21 +17,27 @@ RSpec.configure do |config|
18
17
  config.include DbHelpers
19
18
 
20
19
  # implements `use_transactional_fixtures = true`
21
- # from lib/active_record/fixtures.rb
22
- # works with Rails 3.2. Probably not with Rails 4
23
20
  config.before(:each) do
24
- # ActiveRecord::Base.logger = Logger.new(STDOUT)
25
21
  connection = ActiveRecord::Base.connection
26
- connection.increment_open_transactions
27
- connection.transaction_joinable = false
28
- connection.begin_db_transaction
22
+ if ActiveRecord::VERSION::MAJOR == 3
23
+ # from lib/active_record/fixtures.rb
24
+ connection.increment_open_transactions
25
+ connection.transaction_joinable = false
26
+ connection.begin_db_transaction
27
+ else
28
+ connection.begin_transaction(joinable: false)
29
+ end
29
30
  end
30
31
 
31
32
  config.after(:each) do
32
33
  connection = ActiveRecord::Base.connection
33
- if connection.open_transactions != 0
34
- connection.rollback_db_transaction
35
- connection.decrement_open_transactions
34
+ if ActiveRecord::VERSION::MAJOR == 3
35
+ if connection.open_transactions != 0
36
+ connection.rollback_db_transaction
37
+ connection.decrement_open_transactions
38
+ end
39
+ else
40
+ connection.rollback_transaction if connection.transaction_open?
36
41
  end
37
42
  ActiveRecord::Base.clear_active_connections!
38
43
  end
data/vorpal.gemspec CHANGED
@@ -24,8 +24,8 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.add_development_dependency "rake", "~> 10.0"
26
26
  spec.add_development_dependency "rspec", "~> 3.0"
27
- spec.add_development_dependency "activerecord", "~> 3.2.0"
27
+ spec.add_development_dependency "activerecord", "~> 4.0.0"
28
28
  spec.add_development_dependency "pg", "~> 0.17.0"
29
29
  spec.add_development_dependency "virtus", "~> 1.0"
30
- spec.add_development_dependency "activerecord-import", "~> 0.3.1"
30
+ spec.add_development_dependency "activerecord-import", "~> 0.10.0"
31
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vorpal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7.rc3
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Kirby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-02 00:00:00.000000000 Z
11
+ date: 2016-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simple_serializer
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 3.2.0
89
+ version: 4.0.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 3.2.0
96
+ version: 4.0.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: pg
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 0.3.1
131
+ version: 0.10.0
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 0.3.1
138
+ version: 0.10.0
139
139
  description: An ORM framelet that fits on top of ActiveRecord to give you 'Data Mapper'
140
140
  semantics.
141
141
  email:
@@ -145,6 +145,7 @@ extensions: []
145
145
  extra_rdoc_files: []
146
146
  files:
147
147
  - ".gitignore"
148
+ - ".ruby-version"
148
149
  - ".yardopts"
149
150
  - CHANGELOG.md
150
151
  - Gemfile
@@ -192,9 +193,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
192
193
  version: '0'
193
194
  required_rubygems_version: !ruby/object:Gem::Requirement
194
195
  requirements:
195
- - - ">"
196
+ - - ">="
196
197
  - !ruby/object:Gem::Version
197
- version: 1.3.1
198
+ version: '0'
198
199
  requirements: []
199
200
  rubyforge_project:
200
201
  rubygems_version: 2.4.8