modalfields 1.1.8 → 1.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/modalfields/modalfields.rb +11 -1
- data/modalfields.gemspec +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.9
|
@@ -18,6 +18,16 @@ module ModalFields
|
|
18
18
|
SPECIFIERS = [:indexed, :unique, :required]
|
19
19
|
COMMON_ATTRIBUTES = {:default=>nil, :null=>true}
|
20
20
|
|
21
|
+
if defined?(ActiveSupport::BasicObject) && ActiveSupport::BasicObject.instance_methods.map(&:to_sym).include?(:instance_eval)
|
22
|
+
DslBase = ActiveSupport::BasicObject
|
23
|
+
elsif defined?(BasicObject) && BasicObject.instance_methods.map(&:to_sym).include?(:instance_eval)
|
24
|
+
DslBase = BasicObject
|
25
|
+
else
|
26
|
+
class DslBase
|
27
|
+
instance_methods.each { |m| undef_method m unless m =~ /^(__|instance_eval)/ }
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
21
31
|
class FieldDeclaration < Struct.new(:name, :type, :specifiers, :attributes)
|
22
32
|
|
23
33
|
def self.declare(name, type, *args)
|
@@ -58,7 +68,7 @@ module ModalFields
|
|
58
68
|
end
|
59
69
|
|
60
70
|
|
61
|
-
class DefinitionsDsl <
|
71
|
+
class DefinitionsDsl < DslBase
|
62
72
|
def field(name, attributes={})
|
63
73
|
::ModalFields.definitions[name.to_sym] = COMMON_ATTRIBUTES.merge(attributes)
|
64
74
|
end
|
data/modalfields.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "modalfields"
|
8
|
-
s.version = "1.1.
|
8
|
+
s.version = "1.1.9"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Javier Goizueta"]
|
12
|
-
s.date = "2012-06-
|
12
|
+
s.date = "2012-06-15"
|
13
13
|
s.description = "ModelFields is a Rails plugin that adds fields declarations to your models."
|
14
14
|
s.email = "jgoizueta@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modalfields
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.9
|
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-06-
|
12
|
+
date: 2012-06-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -214,7 +214,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
214
214
|
version: '0'
|
215
215
|
segments:
|
216
216
|
- 0
|
217
|
-
hash:
|
217
|
+
hash: 4469226081052746804
|
218
218
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
219
219
|
none: false
|
220
220
|
requirements:
|