openid_active_record_store 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,13 +7,17 @@ module OpenidActiveRecordStore
7
7
  end
8
8
  class Railtie < Rails::Railtie
9
9
  rake_tasks do
10
+ require 'rails/generators/migration'
11
+ include Rails::Generators::Migration
12
+ require 'rails/generators/active_record'
13
+ extend ActiveRecord::Generators::Migration
10
14
  namespace :openid_active_record_store do
11
15
  namespace :install do
12
16
 
13
17
  files = File.expand_path("../../db/migrate/*.rb", __FILE__)
14
18
  sources = FileList[files]
15
19
  targets = sources.map do |source|
16
- ts = Time.now.to_f.to_s.sub('.', '')
20
+ ts = next_migration_number('db/migrate')
17
21
  "db/migrate/#{ts}_#{File.basename(source)}"
18
22
  end
19
23
 
@@ -1,9 +1,10 @@
1
1
  require 'test/unit'
2
+ require 'rails'
2
3
  require 'openid_active_record_store'
3
4
  require 'active_record'
4
5
 
5
6
  db = {
6
- :adapter => :mysql2,
7
+ :adapter => :mysql2,
7
8
  :database => 'openid_active_record_store'
8
9
  }
9
10
 
@@ -14,11 +15,11 @@ system "echo 'create database #{db[:database]};' | mysql5 -uroot"
14
15
 
15
16
  ActiveRecord::Base.establish_connection db
16
17
 
17
- Dir['app/models/*.rb'].each do |model|
18
- require File.expand_path(model)
19
- end
20
-
21
- Dir['db/migrations/*.rb'].each do |migration|
18
+ Dir['db/migrate/*.rb'].each do |migration|
22
19
  require migration
23
20
  Object.const_get(File.basename(migration, '.rb').camelize).up
21
+ end
22
+
23
+ Dir['app/models/*.rb'].each do |model|
24
+ require File.expand_path(model)
24
25
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openid_active_record_store
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - James Tucker
@@ -16,8 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-05-24 00:00:00 -07:00
20
- default_executable:
19
+ date: 2011-05-24 00:00:00 Z
21
20
  dependencies:
22
21
  - !ruby/object:Gem::Dependency
23
22
  name: rails
@@ -53,7 +52,6 @@ files:
53
52
  - lib/openid_active_record_store.rb
54
53
  - test/openid_store_active_record_test.rb
55
54
  - test/test_helper.rb
56
- has_rdoc: true
57
55
  homepage: http://github.com/wildfireapp/openid_active_record_store
58
56
  licenses:
59
57
  - MIT
@@ -83,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
81
  requirements: []
84
82
 
85
83
  rubyforge_project:
86
- rubygems_version: 1.5.2
84
+ rubygems_version: 1.8.3
87
85
  signing_key:
88
86
  specification_version: 3
89
87
  summary: An ActiveRecord store for OpenID