Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/rom 5 0 #30

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## v0.3.0 2019-07-10

### Added

* Added `rom-core` `5.0.2` support (alex-lairan)


## v0.2.0 2017-04-07

### Added
Expand Down
2 changes: 1 addition & 1 deletion lib/rom/mongo/struct.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module ROM
module Mongo
class Struct < ROM::Struct
constructor_type :symbolized
transform_keys(&:to_sym)
end
end
end
2 changes: 1 addition & 1 deletion lib/rom/mongo/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module ROM
module Mongo
VERSION = '0.2.0'.freeze
VERSION = '0.3.0'.freeze
end
end
2 changes: 1 addition & 1 deletion rom-mongo.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.add_runtime_dependency "rom-core", "~> 4.0"
spec.add_runtime_dependency "rom-core", "~> 5.0"
spec.add_runtime_dependency "mongo", "~> 2.2"
spec.add_runtime_dependency "origin"

Expand Down
8 changes: 2 additions & 6 deletions spec/integration/gateway_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@
it 'inserts a document into collection' do
id = BSON::ObjectId.new

result = commands.try do
commands.create.call(_id: id, name: 'joe', email: '[email protected]')
end
result = commands.create.call(_id: id, name: 'joe', email: '[email protected]')

expect(result)
.to match_array([{ _id: id, name: 'joe', email: '[email protected]' }])
Expand All @@ -71,9 +69,7 @@
it 'updates a document in the collection' do
jane = users.by_name('Jane').one!

result = commands.try do
commands.update.by_name('Jane').call(email: '[email protected]')
end
result = commands.update.by_name('Jane').call(email: '[email protected]')

expect(result).to match_array(
[{ '_id' => BSON::ObjectId.from_string(jane._id),
Expand Down
2 changes: 1 addition & 1 deletion spec/shared/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

schema do
# TODO: we need ROM::Mongo::Types (similar to ROM::SQL::Types)
attribute :_id, ROM::Types.Definition(BSON::ObjectId)
attribute :_id, ROM::Types.Nominal(BSON::ObjectId)
attribute :name, ROM::Types::String
attribute :email, ROM::Types::String
end
Expand Down