songkick-oauth2-provider 0.10.1 → 0.10.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ === 0.10.2 / 2012-10-31
2
+
3
+ * Stop Model::Authorization#scope being set to an empty string and returned as
4
+ such in Provider::Exchange responses
5
+
6
+
1
7
  === 0.10.1 / 2012-10-29
2
8
 
3
9
  * Add uniqueness constraints to the database for various Authorization properties
@@ -96,14 +96,17 @@ behavior:
96
96
  === Schema
97
97
 
98
98
  Add the <tt>Songkick::OAuth2::Provider</tt> tables to your app's schema. This is
99
- done using <tt>Songkick::OAuth2::Model::Schema.up</tt>, which can be used inside
100
- an <tt>ActiveRecord</tt> migration like so:
101
-
102
- class CreateOauth2ProviderModels < ActiveRecord::Migration
103
- def up
104
- Songkick::OAuth2::Model::Schema.up
105
- end
106
- end
99
+ done using <tt>Songkick::OAuth2::Model::Schema.migrate</tt>, which will run all
100
+ the gem's migrations that have not yet been applied to your database.
101
+
102
+ Songkick::OAuth2::Model::Schema.migrate
103
+ I, [2012-10-31T14:52:33.801428 #7002] INFO -- : Migrating to SongkickOauth2SchemaOriginalSchema (20120828112156)
104
+ == SongkickOauth2SchemaOriginalSchema: migrating =============================
105
+ -- create_table(:oauth2_clients)
106
+ -> 0.0029s
107
+ -- add_index(:oauth2_clients, [:client_id])
108
+ -> 0.0009s
109
+ ...
107
110
 
108
111
 
109
112
  === Model Mixins
@@ -79,7 +79,7 @@ module Songkick
79
79
 
80
80
  scopes = instance.scopes + (attributes[:scopes] || [])
81
81
  scopes += attributes[:scope].split(/\s+/) if attributes[:scope]
82
- instance.scope = scopes.entries.join(' ')
82
+ instance.scope = scopes.empty? ? nil : scopes.entries.join(' ')
83
83
 
84
84
  instance.save && instance
85
85
 
@@ -2,10 +2,13 @@ module Songkick
2
2
  module OAuth2
3
3
 
4
4
  class Schema
5
- def self.up
5
+ def self.migrate
6
6
  ActiveRecord::Base.logger ||= Logger.new(StringIO.new)
7
7
  ActiveRecord::Migrator.up(migrations_path)
8
8
  end
9
+ class << self
10
+ alias :up :migrate
11
+ end
9
12
 
10
13
  def self.migrations_path
11
14
  File.expand_path('../schema', __FILE__)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: songkick-oauth2-provider
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-29 00:00:00.000000000 Z
12
+ date: 2012-10-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord