custom_fields 1.0.0.beta.10 → 1.0.0.beta.11

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -6,7 +6,7 @@ Manage custom fields to a mongoid document or a collection. This module is one o
6
6
  Requirements
7
7
  =======
8
8
 
9
- ActiveSupport 3.0, MongoDB 1.6 and mongoid 2.0.0.rc.7
9
+ ActiveSupport 3.0.7, MongoDB 1.6 and Mongoid 2.0.1
10
10
 
11
11
 
12
12
  Example
@@ -67,7 +67,17 @@ module CustomFields
67
67
  field :#{singular_name}_custom_fields_counter, :type => Integer, :default => 0
68
68
  field :#{singular_name}_custom_fields_version, :type => Integer, :default => 0
69
69
 
70
- embeds_many :#{singular_name}_custom_fields, :class_name => '#{dynamic_custom_field_class_name}'
70
+ embeds_many :#{singular_name}_custom_fields, :class_name => '#{dynamic_custom_field_class_name}' do
71
+ def build(attributes = {}, type = nil, &block)
72
+ instantiated(type).tap do |doc|
73
+ append(doc, default_options(:binding => true))
74
+ doc.write_attributes(attributes)
75
+ doc.identify
76
+ block.call(doc) if block
77
+ end
78
+ end
79
+ alias :new :build
80
+ end
71
81
 
72
82
  attr_accessor :invalidate_#{singular_name}_klass_flag
73
83
 
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module CustomFields
3
- VERSION = "1.0.0.beta.10"
3
+ VERSION = "1.0.0.beta.11"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: custom_fields
3
3
  version: !ruby/object:Gem::Version
4
- hash: 62196375
4
+ hash: 62196373
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
9
  - 0
10
10
  - beta
11
- - 10
12
- version: 1.0.0.beta.10
11
+ - 11
12
+ version: 1.0.0.beta.11
13
13
  platform: ruby
14
14
  authors:
15
15
  - Didier Lafforgue
@@ -17,47 +17,44 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-05-01 00:00:00 +02:00
20
+ date: 2011-05-16 00:00:00 +02:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
- name: mongoid
25
24
  prerelease: false
26
- requirement: &id001 !ruby/object:Gem::Requirement
25
+ version_requirements: &id001 !ruby/object:Gem::Requirement
27
26
  none: false
28
27
  requirements:
29
28
  - - ~>
30
29
  - !ruby/object:Gem::Version
31
- hash: 15424091
30
+ hash: 13
32
31
  segments:
33
32
  - 2
34
33
  - 0
35
- - 0
36
- - rc
37
- - 7
38
- version: 2.0.0.rc.7
34
+ - 1
35
+ version: 2.0.1
39
36
  type: :runtime
40
- version_requirements: *id001
37
+ requirement: *id001
38
+ name: mongoid
41
39
  - !ruby/object:Gem::Dependency
42
- name: activesupport
43
40
  prerelease: false
44
- requirement: &id002 !ruby/object:Gem::Requirement
41
+ version_requirements: &id002 !ruby/object:Gem::Requirement
45
42
  none: false
46
43
  requirements:
47
44
  - - ">="
48
45
  - !ruby/object:Gem::Version
49
- hash: 15
46
+ hash: 9
50
47
  segments:
51
48
  - 3
52
49
  - 0
53
- - 4
54
- version: 3.0.4
50
+ - 7
51
+ version: 3.0.7
55
52
  type: :runtime
56
- version_requirements: *id002
53
+ requirement: *id002
54
+ name: activesupport
57
55
  - !ruby/object:Gem::Dependency
58
- name: locomotive_carrierwave
59
56
  prerelease: false
60
- requirement: &id003 !ruby/object:Gem::Requirement
57
+ version_requirements: &id003 !ruby/object:Gem::Requirement
61
58
  none: false
62
59
  requirements:
63
60
  - - ">="
@@ -67,7 +64,8 @@ dependencies:
67
64
  - 0
68
65
  version: "0"
69
66
  type: :runtime
70
- version_requirements: *id003
67
+ requirement: *id003
68
+ name: locomotive_carrierwave
71
69
  description: Manage custom fields to a mongoid document or a collection. This module is one of the core features we implemented in our custom cms named Locomotive.
72
70
  email:
73
71
  - didier@nocoffee.fr