sql_mapper 0.0.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/sql_mapper.rb +3 -3
  2. metadata +59 -9
data/lib/sql_mapper.rb CHANGED
@@ -16,7 +16,7 @@ module ActiveRecord
16
16
  end
17
17
 
18
18
  def map(name, sql, result_class=nil)
19
- mapping = QueryMapping.new name, sql, (result_class || @result_class)
19
+ mapping = QueryMapping.new name, sql, result_class
20
20
  @queries[name] = mapping
21
21
  end
22
22
 
@@ -30,7 +30,7 @@ module ActiveRecord
30
30
  attr_reader :key
31
31
  attr_accessor :sql, :result_class
32
32
 
33
- def initialize(key, sql, result_class=Context.result_class)
33
+ def initialize(key, sql, result_class=nil)
34
34
  @key = key
35
35
  @sql = sql
36
36
  @result_class = result_class
@@ -118,7 +118,7 @@ module ActiveRecord
118
118
  mapping = Context.instance.queries[opts[:query]]
119
119
  raise "No query named #{opts[:query]} found" if mapping.nil?
120
120
  sql = mapping.sql
121
- result_class = mapping.result_class
121
+ result_class = mapping.result_class || result_class
122
122
  end
123
123
 
124
124
  if opts.include? :params
metadata CHANGED
@@ -3,10 +3,10 @@ name: sql_mapper
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
+ - 1
6
7
  - 0
7
8
  - 0
8
- - 1
9
- version: 0.0.1
9
+ version: 1.0.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Lance Woodson
@@ -32,9 +32,23 @@ dependencies:
32
32
  type: :runtime
33
33
  version_requirements: *id001
34
34
  - !ruby/object:Gem::Dependency
35
- name: pg
35
+ name: mysql
36
36
  prerelease: false
37
37
  requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 2
43
+ - 8
44
+ - 1
45
+ version: 2.8.1
46
+ type: :development
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: pg
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
38
52
  requirements:
39
53
  - - ">="
40
54
  - !ruby/object:Gem::Version
@@ -44,11 +58,11 @@ dependencies:
44
58
  - 0
45
59
  version: 0.11.0
46
60
  type: :development
47
- version_requirements: *id002
61
+ version_requirements: *id003
48
62
  - !ruby/object:Gem::Dependency
49
63
  name: sqlite3
50
64
  prerelease: false
51
- requirement: &id003 !ruby/object:Gem::Requirement
65
+ requirement: &id004 !ruby/object:Gem::Requirement
52
66
  requirements:
53
67
  - - ">="
54
68
  - !ruby/object:Gem::Version
@@ -58,8 +72,44 @@ dependencies:
58
72
  - 4
59
73
  version: 1.3.4
60
74
  type: :development
61
- version_requirements: *id003
62
- description: Object-to-sql mapping support for ActiveRecord.
75
+ version_requirements: *id004
76
+ - !ruby/object:Gem::Dependency
77
+ name: rspec
78
+ prerelease: false
79
+ requirement: &id005 !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ segments:
84
+ - 0
85
+ version: "0"
86
+ type: :development
87
+ version_requirements: *id005
88
+ - !ruby/object:Gem::Dependency
89
+ name: cucumber
90
+ prerelease: false
91
+ requirement: &id006 !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ segments:
96
+ - 0
97
+ version: "0"
98
+ type: :development
99
+ version_requirements: *id006
100
+ - !ruby/object:Gem::Dependency
101
+ name: ruby-debug
102
+ prerelease: false
103
+ requirement: &id007 !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ segments:
108
+ - 0
109
+ version: "0"
110
+ type: :development
111
+ version_requirements: *id007
112
+ description: ActiveRecord extension that provides large performance improvements when you need large sets of read-only data and do not need the magic of ActiveRecord.
63
113
  email: lance@webmaneuvers.com
64
114
  executables: []
65
115
 
@@ -70,7 +120,7 @@ extra_rdoc_files: []
70
120
  files:
71
121
  - lib/sql_mapper.rb
72
122
  has_rdoc: true
73
- homepage: http://rubygems.org/gems/sql_mapper
123
+ homepage: https://github.com/lwoodson/sql_mapper
74
124
  licenses: []
75
125
 
76
126
  post_install_message:
@@ -98,6 +148,6 @@ rubyforge_project:
98
148
  rubygems_version: 1.3.6
99
149
  signing_key:
100
150
  specification_version: 3
101
- summary: Object-to-sql mapping support for ActiveRecord
151
+ summary: ActiveRecord extension that provides large performance improvements when you need large sets of read-only data and do not need the magic of ActiveRecord.
102
152
  test_files: []
103
153