mamechiwa 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mamechiwa/version.rb +1 -1
- data/lib/mamechiwa.rb +4 -2
- metadata +2 -2
data/lib/mamechiwa/version.rb
CHANGED
data/lib/mamechiwa.rb
CHANGED
@@ -27,7 +27,7 @@ module Mamechiwa
|
|
27
27
|
class_eval do
|
28
28
|
define_method :initialize_with_mame do
|
29
29
|
unless @mame_embedded
|
30
|
-
group = self.class.mame_group_field.
|
30
|
+
group = self.class.mame_group_field.length > 0 ? self.send(self.class.mame_group_field).to_s : ""
|
31
31
|
|
32
32
|
if self.class.mame_config[group] && self.class.mame_config[group][:class]
|
33
33
|
@mame_embedded = self.class.mame_config[group][:class].new(self, field)
|
@@ -71,7 +71,9 @@ module Mamechiwa
|
|
71
71
|
|
72
72
|
def mame_group(name)
|
73
73
|
self.mame_scope = name
|
74
|
-
|
74
|
+
mame_config[mame_scope][:attrs] ||= []
|
75
|
+
mame_config[mame_scope][:validator] = Proc.new{ }
|
76
|
+
yield self if block_given?
|
75
77
|
self.mame_scope = ""
|
76
78
|
end
|
77
79
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mamechiwa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
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-
|
12
|
+
date: 2012-05-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|