mongoid_autoinc_id 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -3,5 +3,5 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in mongoid_autoinc_id.gemspec
4
4
  gemspec
5
5
  group :development, :test do
6
- gem "mongoid", git: 'git://github.com/mongoid/mongoid.git'
6
+ gem "mongoid", '3.0.0.rc' #git: 'git://github.com/mongoid/mongoid.git'
7
7
  end
@@ -1,3 +1,3 @@
1
1
  module MongoidAutoincId
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -4,8 +4,8 @@ require File.expand_path('../lib/mongoid_autoinc_id/version', __FILE__)
4
4
  Gem::Specification.new do |gem|
5
5
  gem.authors = ["doabit"]
6
6
  gem.email = ["doinsist@gmail.com"]
7
- gem.description = %q{Auto increment id for mongoid 3.0.0}
8
- gem.summary = %q{Auto increment id for mongoid 3.0.0}
7
+ gem.description = %q{Auto increment id for mongoid 3.0}
8
+ gem.summary = %q{Auto increment id for mongoid 3.0}
9
9
  gem.homepage = ""
10
10
 
11
11
  gem.files = `git ls-files`.split($\)
@@ -14,6 +14,6 @@ Gem::Specification.new do |gem|
14
14
  gem.name = "mongoid_autoinc_id"
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = MongoidAutoincId::VERSION
17
- gem.add_dependency 'mongoid', '~> 3.0.0'
17
+ gem.add_dependency 'mongoid', '~> 3.0.0.rc'
18
18
  gem.add_development_dependency 'rspec', '~> 2.10.0'
19
19
  end
@@ -0,0 +1,13 @@
1
+ # encoding: UTF-8
2
+ class City
3
+ include Mongoid::Document
4
+ field :name, type: String
5
+ embeds_many :areas, cascade_callbacks: true
6
+ accepts_nested_attributes_for :areas , :allow_destroy => true, :reject_if => lambda { |a| a[:name].blank? }
7
+ end
8
+
9
+ class Area
10
+ include Mongoid::Document
11
+ field :name, type: String
12
+ embedded_in :city
13
+ end
@@ -42,4 +42,9 @@ describe "Mongoid::AutoIncrement" do
42
42
  post = Post.new
43
43
  post.id.should be(nil)
44
44
  end
45
+
46
+ it "should create id for embedded document" do
47
+ city = City.create(name: 'city', areas: [{name: 'area'}])
48
+ city.areas.first.id.should == 1
49
+ end
45
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid_autoinc_id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-11 00:00:00.000000000 Z
12
+ date: 2012-06-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mongoid
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 3.0.0
21
+ version: 3.0.0.rc
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 3.0.0
29
+ version: 3.0.0.rc
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: rspec
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  - - ~>
44
44
  - !ruby/object:Gem::Version
45
45
  version: 2.10.0
46
- description: Auto increment id for mongoid 3.0.0
46
+ description: Auto increment id for mongoid 3.0
47
47
  email:
48
48
  - doinsist@gmail.com
49
49
  executables: []
@@ -62,6 +62,7 @@ files:
62
62
  - lib/mongoid_autoinc_id/version.rb
63
63
  - mongoid_autoinc_id.gemspec
64
64
  - spec/app/models/category.rb
65
+ - spec/app/models/city.rb
65
66
  - spec/app/models/post.rb
66
67
  - spec/autoinc_id_spec.rb
67
68
  - spec/config/mongoid.yml
@@ -89,9 +90,10 @@ rubyforge_project:
89
90
  rubygems_version: 1.8.21
90
91
  signing_key:
91
92
  specification_version: 3
92
- summary: Auto increment id for mongoid 3.0.0
93
+ summary: Auto increment id for mongoid 3.0
93
94
  test_files:
94
95
  - spec/app/models/category.rb
96
+ - spec/app/models/city.rb
95
97
  - spec/app/models/post.rb
96
98
  - spec/autoinc_id_spec.rb
97
99
  - spec/config/mongoid.yml