activerecord 1.14.1 → 1.14.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activerecord might be problematic. Click here for more details.
- data/CHANGELOG +5 -0
- data/{rakefile → Rakefile} +9 -113
- data/lib/active_record/calculations.rb +2 -2
- data/lib/active_record/version.rb +1 -1
- metadata +3 -6
- data/test/fixtures/fixture_database.sqlite +0 -0
- data/test/fixtures/fixture_database.sqlite3 +0 -0
- data/test/fixtures/fixture_database_2.sqlite +0 -0
data/CHANGELOG
CHANGED
data/{rakefile → Rakefile}
RENAMED
@@ -18,7 +18,7 @@ RUBY_FORGE_PROJECT = "activerecord"
|
|
18
18
|
RUBY_FORGE_USER = "webster132"
|
19
19
|
|
20
20
|
PKG_FILES = FileList[
|
21
|
-
"lib/**/*", "test/**/*", "examples/**/*", "doc/**/*", "[A-Z]*", "install.rb", "
|
21
|
+
"lib/**/*", "test/**/*", "examples/**/*", "doc/**/*", "[A-Z]*", "install.rb", "Rakefile"
|
22
22
|
].exclude(/\bCVS\b|~$/)
|
23
23
|
|
24
24
|
|
@@ -101,7 +101,7 @@ spec = Gem::Specification.new do |s|
|
|
101
101
|
s.summary = "Implements the ActiveRecord pattern for ORM."
|
102
102
|
s.description = %q{Implements the ActiveRecord pattern (Fowler, PoEAA) for ORM. It ties database tables and classes together for business objects, like Customer or Subscription, that can find, save, and destroy themselves without resorting to manual SQL.}
|
103
103
|
|
104
|
-
s.files = [ "
|
104
|
+
s.files = [ "Rakefile", "install.rb", "README", "RUNNING_UNIT_TESTS", "CHANGELOG" ]
|
105
105
|
dist_dirs.each do |dir|
|
106
106
|
s.files = s.files + Dir.glob( "#{dir}/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
|
107
107
|
end
|
@@ -170,116 +170,12 @@ task :pdoc => [:rdoc] do
|
|
170
170
|
end
|
171
171
|
|
172
172
|
desc "Publish the release files to RubyForge."
|
173
|
-
task :release => [:package] do
|
174
|
-
|
175
|
-
|
176
|
-
if RUBY_FORGE_PROJECT then
|
177
|
-
require 'net/http'
|
178
|
-
require 'open-uri'
|
179
|
-
|
180
|
-
project_uri = "http://rubyforge.org/projects/#{RUBY_FORGE_PROJECT}/"
|
181
|
-
project_data = open(project_uri) { |data| data.read }
|
182
|
-
group_id = project_data[/[?&]group_id=(\d+)/, 1]
|
183
|
-
raise "Couldn't get group id" unless group_id
|
184
|
-
|
185
|
-
# This echos password to shell which is a bit sucky
|
186
|
-
if ENV["RUBY_FORGE_PASSWORD"]
|
187
|
-
password = ENV["RUBY_FORGE_PASSWORD"]
|
188
|
-
else
|
189
|
-
print "#{RUBY_FORGE_USER}@rubyforge.org's password: "
|
190
|
-
password = STDIN.gets.chomp
|
191
|
-
end
|
192
|
-
|
193
|
-
login_response = Net::HTTP.start("rubyforge.org", 80) do |http|
|
194
|
-
data = [
|
195
|
-
"login=1",
|
196
|
-
"form_loginname=#{RUBY_FORGE_USER}",
|
197
|
-
"form_pw=#{password}"
|
198
|
-
].join("&")
|
199
|
-
http.post("/account/login.php", data)
|
200
|
-
end
|
173
|
+
task :release => [ :package ] do
|
174
|
+
`rubyforge login`
|
201
175
|
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
release_uri = "http://rubyforge.org/frs/admin/?group_id=#{group_id}"
|
207
|
-
release_data = open(release_uri, headers) { |data| data.read }
|
208
|
-
package_id = release_data[/[?&]package_id=(\d+)/, 1]
|
209
|
-
raise "Couldn't get package id" unless package_id
|
210
|
-
|
211
|
-
first_file = true
|
212
|
-
release_id = ""
|
213
|
-
|
214
|
-
files.each do |filename|
|
215
|
-
basename = File.basename(filename)
|
216
|
-
file_ext = File.extname(filename)
|
217
|
-
file_data = File.open(filename, "rb") { |file| file.read }
|
218
|
-
|
219
|
-
puts "Releasing #{basename}..."
|
220
|
-
|
221
|
-
release_response = Net::HTTP.start("rubyforge.org", 80) do |http|
|
222
|
-
release_date = Time.now.strftime("%Y-%m-%d %H:%M")
|
223
|
-
type_map = {
|
224
|
-
".zip" => "3000",
|
225
|
-
".tgz" => "3110",
|
226
|
-
".gz" => "3110",
|
227
|
-
".gem" => "1400"
|
228
|
-
}; type_map.default = "9999"
|
229
|
-
type = type_map[file_ext]
|
230
|
-
boundary = "rubyqMY6QN9bp6e4kS21H4y0zxcvoor"
|
231
|
-
|
232
|
-
query_hash = if first_file then
|
233
|
-
{
|
234
|
-
"group_id" => group_id,
|
235
|
-
"package_id" => package_id,
|
236
|
-
"release_name" => RELEASE_NAME,
|
237
|
-
"release_date" => release_date,
|
238
|
-
"type_id" => type,
|
239
|
-
"processor_id" => "8000", # Any
|
240
|
-
"release_notes" => "",
|
241
|
-
"release_changes" => "",
|
242
|
-
"preformatted" => "1",
|
243
|
-
"submit" => "1"
|
244
|
-
}
|
245
|
-
else
|
246
|
-
{
|
247
|
-
"group_id" => group_id,
|
248
|
-
"release_id" => release_id,
|
249
|
-
"package_id" => package_id,
|
250
|
-
"step2" => "1",
|
251
|
-
"type_id" => type,
|
252
|
-
"processor_id" => "8000", # Any
|
253
|
-
"submit" => "Add This File"
|
254
|
-
}
|
255
|
-
end
|
256
|
-
|
257
|
-
query = "?" + query_hash.map do |(name, value)|
|
258
|
-
[name, URI.encode(value)].join("=")
|
259
|
-
end.join("&")
|
260
|
-
|
261
|
-
data = [
|
262
|
-
"--" + boundary,
|
263
|
-
"Content-Disposition: form-data; name=\"userfile\"; filename=\"#{basename}\"",
|
264
|
-
"Content-Type: application/octet-stream",
|
265
|
-
"Content-Transfer-Encoding: binary",
|
266
|
-
"", file_data, ""
|
267
|
-
].join("\x0D\x0A")
|
268
|
-
|
269
|
-
release_headers = headers.merge(
|
270
|
-
"Content-Type" => "multipart/form-data; boundary=#{boundary}"
|
271
|
-
)
|
272
|
-
|
273
|
-
target = first_file ? "/frs/admin/qrs.php" : "/frs/admin/editrelease.php"
|
274
|
-
http.post(target + query, data, release_headers)
|
275
|
-
end
|
276
|
-
|
277
|
-
if first_file then
|
278
|
-
release_id = release_response.body[/release_id=(\d+)/, 1]
|
279
|
-
raise("Couldn't get release id") unless release_id
|
280
|
-
end
|
281
|
-
|
282
|
-
first_file = false
|
283
|
-
end
|
176
|
+
for ext in %w( gem )
|
177
|
+
release_command = "rubyforge add_release activerecord activerecord 'REL #{PKG_VERSION}' pkg/activerecord-#{PKG_VERSION}.#{ext}"
|
178
|
+
puts release_command
|
179
|
+
system(release_command)
|
284
180
|
end
|
285
|
-
end
|
181
|
+
end
|
@@ -145,7 +145,7 @@ module ActiveRecord
|
|
145
145
|
protected
|
146
146
|
def construct_calculation_sql(aggregate, aggregate_alias, options) #:nodoc:
|
147
147
|
scope = scope(:find)
|
148
|
-
sql =
|
148
|
+
sql = "SELECT #{aggregate} AS #{aggregate_alias}"
|
149
149
|
sql << ", #{options[:group_field]} AS #{options[:group_alias]}" if options[:group]
|
150
150
|
sql << " FROM #{table_name} "
|
151
151
|
add_joins!(sql, options, scope)
|
@@ -154,7 +154,7 @@ module ActiveRecord
|
|
154
154
|
sql << " HAVING #{options[:having]}" if options[:group] && options[:having]
|
155
155
|
sql << " ORDER BY #{options[:order]}" if options[:order]
|
156
156
|
add_limit!(sql, options)
|
157
|
-
sql
|
157
|
+
sql
|
158
158
|
end
|
159
159
|
|
160
160
|
def execute_simple_calculation(operation, column_name, column, aggregate, aggregate_alias, options) #:nodoc:
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: activerecord
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.14.
|
7
|
-
date: 2006-04-
|
6
|
+
version: 1.14.2
|
7
|
+
date: 2006-04-09 00:00:00 -05:00
|
8
8
|
summary: Implements the ActiveRecord pattern for ORM.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -28,7 +28,7 @@ cert_chain:
|
|
28
28
|
authors:
|
29
29
|
- David Heinemeier Hansson
|
30
30
|
files:
|
31
|
-
-
|
31
|
+
- Rakefile
|
32
32
|
- install.rb
|
33
33
|
- README
|
34
34
|
- RUNNING_UNIT_TESTS
|
@@ -196,9 +196,6 @@ files:
|
|
196
196
|
- test/fixtures/developers_projects.yml
|
197
197
|
- test/fixtures/entrant.rb
|
198
198
|
- test/fixtures/entrants.yml
|
199
|
-
- test/fixtures/fixture_database.sqlite
|
200
|
-
- test/fixtures/fixture_database.sqlite3
|
201
|
-
- test/fixtures/fixture_database_2.sqlite
|
202
199
|
- test/fixtures/fk_test_has_fk.yml
|
203
200
|
- test/fixtures/fk_test_has_pk.yml
|
204
201
|
- test/fixtures/flowers.jpg
|
Binary file
|
Binary file
|
Binary file
|