featured_model 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ begin
9
9
  gem.description = %Q{Additional steps that add a bunch of functionality for creating models with one line}
10
10
  gem.email = "stephen@bendyworks.com"
11
11
  gem.homepage = "http://github.com/bendyworks/featured_model"
12
- gem.authors = ["bendycode", 'listrophy', 'arta', 'randland']
12
+ gem.authors = ["bendycode", 'listrophy', 'arta', 'randland', 'jaym3s']
13
13
  gem.add_development_dependency "fixjour"
14
14
  # gem.add_development_dependency "cucumber"
15
15
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.4
@@ -1,15 +1,15 @@
1
1
  # Generated by jeweler
2
- # DO NOT EDIT THIS FILE
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{featured_model}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["bendycode", "listrophy", "arta", "randland"]
12
- s.date = %q{2009-10-30}
11
+ s.authors = ["bendycode", "listrophy", "arta", "randland", "jaym3s"]
12
+ s.date = %q{2010-03-17}
13
13
  s.description = %q{Additional steps that add a bunch of functionality for creating models with one line}
14
14
  s.email = %q{stephen@bendyworks.com}
15
15
  s.extra_rdoc_files = [
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
34
34
  s.homepage = %q{http://github.com/bendyworks/featured_model}
35
35
  s.rdoc_options = ["--charset=UTF-8"]
36
36
  s.require_paths = ["lib"]
37
- s.rubygems_version = %q{1.3.5}
37
+ s.rubygems_version = %q{1.3.6}
38
38
  s.summary = %q{Fancy steps for creating models}
39
39
  s.test_files = [
40
40
  "spec/spec_helper.rb"
@@ -53,3 +53,4 @@ Gem::Specification.new do |s|
53
53
  s.add_dependency(%q<fixjour>, [">= 0"])
54
54
  end
55
55
  end
56
+
@@ -24,16 +24,11 @@ def create_dynamic_instance model_name, args
24
24
  when 'with' ; attributes[key.gsub(/ /, '_').to_sym] = value
25
25
  when 'for'
26
26
  associated_model, lookup_attribute = key.split(' with ').map {|x| x.gsub(/ /, '_')}
27
+
28
+ # TODO: add an "as ____" clause in order to allow differently named foreign keys.
27
29
  fk_name = associated_model
28
- klass = Address
29
30
 
30
- # TODO: Pick up these aliases dynamically from the ActiveRecord declarations.
31
- # it should not live here
32
- if associated_model == 'address'
33
- fk_name = 'shipping_address'
34
- else
35
- klass = associated_model.classify.constantize
36
- end
31
+ klass = associated_model.classify.constantize
37
32
 
38
33
  attributes[fk_name + '_id'] = klass.first(:conditions => {lookup_attribute => value}).id
39
34
  else ; raise('unknown join word "%s"' % parsing_state)
metadata CHANGED
@@ -1,30 +1,38 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: featured_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 4
9
+ version: 0.1.4
5
10
  platform: ruby
6
11
  authors:
7
12
  - bendycode
8
13
  - listrophy
9
14
  - arta
10
15
  - randland
16
+ - jaym3s
11
17
  autorequire:
12
18
  bindir: bin
13
19
  cert_chain: []
14
20
 
15
- date: 2009-10-30 00:00:00 -05:00
21
+ date: 2010-03-17 00:00:00 -05:00
16
22
  default_executable:
17
23
  dependencies:
18
24
  - !ruby/object:Gem::Dependency
19
25
  name: fixjour
20
- type: :development
21
- version_requirement:
22
- version_requirements: !ruby/object:Gem::Requirement
26
+ prerelease: false
27
+ requirement: &id001 !ruby/object:Gem::Requirement
23
28
  requirements:
24
29
  - - ">="
25
30
  - !ruby/object:Gem::Version
31
+ segments:
32
+ - 0
26
33
  version: "0"
27
- version:
34
+ type: :development
35
+ version_requirements: *id001
28
36
  description: Additional steps that add a bunch of functionality for creating models with one line
29
37
  email: stephen@bendyworks.com
30
38
  executables: []
@@ -61,18 +69,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
61
69
  requirements:
62
70
  - - ">="
63
71
  - !ruby/object:Gem::Version
72
+ segments:
73
+ - 0
64
74
  version: "0"
65
- version:
66
75
  required_rubygems_version: !ruby/object:Gem::Requirement
67
76
  requirements:
68
77
  - - ">="
69
78
  - !ruby/object:Gem::Version
79
+ segments:
80
+ - 0
70
81
  version: "0"
71
- version:
72
82
  requirements: []
73
83
 
74
84
  rubyforge_project:
75
- rubygems_version: 1.3.5
85
+ rubygems_version: 1.3.6
76
86
  signing_key:
77
87
  specification_version: 3
78
88
  summary: Fancy steps for creating models