custom_fields 2.4.0.rc3 → 2.4.0.rc4

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: 8d51809c1199b4dd3f4b1c838bc16e52d8525aa2
4
- data.tar.gz: f1cca192e50d07693cf760a65df948d46ea579e7
3
+ metadata.gz: 8162bf466478ef2edd666967a9b5b719925456ad
4
+ data.tar.gz: 663b7c71aa66a5aea37d513b72ef5bcf1df0f56d
5
5
  SHA512:
6
- metadata.gz: c9cad7eda7ee7f531b71d2664f853bb9c900f05ddb07c4626fe68b9e78f0d77eca3925dc9f1f4db43b0f95490dabf3e24b40739d494ad97405da737875ef3085
7
- data.tar.gz: f4ec54520214329dab35dc37724bfe713dcb66a0d56b6fa0984e74554a0270516d54609adca3ddf25f03c65953a70acb75385894f8189bb7908a469c61dcb2db
6
+ metadata.gz: e8e5465400c8ad36381c687b8466bd1f0f8778e3f06d8b91ee01d85e35c2da46982fb2714503763d9ba843dd96747aaa367982994a375f3e20e7de851b860cc4
7
+ data.tar.gz: 7d72957c190985562b8a3b92a13c8e8df599b4fd9a3488d4fe4fddff6da63f3f5556821cf67858a889c15add3dc052d87bf80c05bbe7e672096f6efab075860f
@@ -48,6 +48,7 @@ end
48
48
  types/integer
49
49
  types/float
50
50
  types/money
51
+ types/color
51
52
  types/relationship_default
52
53
  types/belongs_to
53
54
  types/has_many
@@ -6,7 +6,7 @@ module CustomFields
6
6
  include ::Mongoid::Timestamps
7
7
 
8
8
  AVAILABLE_TYPES = %w(default string text email date date_time boolean file select float integer
9
- money tags relationship_default belongs_to has_many many_to_many)
9
+ money tags color relationship_default belongs_to has_many many_to_many)
10
10
 
11
11
  ## types ##
12
12
  AVAILABLE_TYPES.each do |type|
@@ -7,8 +7,8 @@ module CustomFields
7
7
  included do
8
8
 
9
9
  ## types ##
10
- %w(default string text email date date_time boolean file select float integer money
11
- belongs_to has_many many_to_many tags).each do |type|
10
+ %w(default string text email date date_time boolean file select
11
+ float integer money color belongs_to has_many many_to_many tags).each do |type|
12
12
  include "CustomFields::Types::#{type.camelize}::Target".constantize
13
13
  end
14
14
 
@@ -0,0 +1,55 @@
1
+ module CustomFields
2
+
3
+ module Types
4
+
5
+ module Color
6
+
7
+ module Field; end
8
+
9
+ module Target
10
+
11
+ extend ActiveSupport::Concern
12
+
13
+ module ClassMethods
14
+
15
+ # Add a color field
16
+ #
17
+ # @param [ Class ] klass The class to modify
18
+ # @param [ Hash ] rule It contains the name of the field and if it is required or not
19
+ #
20
+ def apply_color_custom_field(klass, rule)
21
+ apply_custom_field(klass, rule)
22
+ end
23
+
24
+ # Build a hash storing the raw value for
25
+ # a color custom field of an instance.
26
+ #
27
+ # @param [ Object ] instance An instance of the class enhanced by the custom_fields
28
+ # @param [ String ] name The name of the color custom field
29
+ #
30
+ # @return [ Hash ] field name => raw value
31
+ #
32
+ def color_attribute_get(instance, name)
33
+ self.default_attribute_get(instance, name)
34
+ end
35
+
36
+ # Set the value for the instance and the color field specified by
37
+ # the 2 params.
38
+ #
39
+ # @param [ Object ] instance An instance of the class enhanced by the custom_fields
40
+ # @param [ String ] name The name of the color custom field
41
+ # @param [ Hash ] attributes The attributes used to fetch the values
42
+ #
43
+ def color_attribute_set(instance, name, attributes)
44
+ self.default_attribute_set(instance, name, attributes)
45
+ end
46
+
47
+ end
48
+
49
+ end
50
+
51
+ end
52
+
53
+ end
54
+
55
+ end
@@ -1,5 +1,5 @@
1
1
  module CustomFields #:nodoc
2
2
 
3
- VERSION = '2.4.0.rc3'
3
+ VERSION = '2.4.0.rc4'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: custom_fields
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0.rc3
4
+ version: 2.4.0.rc4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Didier Lafforgue
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-12 00:00:00.000000000 Z
11
+ date: 2015-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongoid
@@ -227,6 +227,7 @@ files:
227
227
  - lib/custom_fields/target_helpers.rb
228
228
  - lib/custom_fields/types/belongs_to.rb
229
229
  - lib/custom_fields/types/boolean.rb
230
+ - lib/custom_fields/types/color.rb
230
231
  - lib/custom_fields/types/date.rb
231
232
  - lib/custom_fields/types/date_time.rb
232
233
  - lib/custom_fields/types/default.rb
@@ -263,7 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
264
  version: '2.4'
264
265
  requirements: []
265
266
  rubyforge_project:
266
- rubygems_version: 2.2.0
267
+ rubygems_version: 2.4.5
267
268
  signing_key:
268
269
  specification_version: 4
269
270
  summary: Custom fields extension for Mongoid.