dynamic_models 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/dynamic_models.gemspec +2 -2
- data/lib/dynamic_models.rb +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/dynamic_models.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{dynamic_models}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Craig Ulliott"]
|
12
|
-
s.date = %q{2011-07-
|
12
|
+
s.date = %q{2011-07-08}
|
13
13
|
s.description = %q{Methods to get and build models directly from parameters. Useful for DRYing up code, specifically very dynamic code for things like admin tools.}
|
14
14
|
s.email = %q{craigulliott@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/dynamic_models.rb
CHANGED
@@ -18,7 +18,7 @@ module DynamicModels
|
|
18
18
|
# returns a new model, it can be set with an optional hash
|
19
19
|
def new_model(defaults = {})
|
20
20
|
new_model = model_name.camelize.constantize.new(defaults)
|
21
|
-
new_model.send("#{parent_model.class.name.
|
21
|
+
new_model.send("#{parent_model.class.name.underscore}=", parent_model) if parent_model
|
22
22
|
return new_model
|
23
23
|
end
|
24
24
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: dynamic_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Craig Ulliott
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-07-
|
13
|
+
date: 2011-07-08 00:00:00 -05:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -92,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
92
92
|
requirements:
|
93
93
|
- - ">="
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
hash:
|
95
|
+
hash: 2503576804666409791
|
96
96
|
segments:
|
97
97
|
- 0
|
98
98
|
version: "0"
|