dailycred 0.1.42 → 0.1.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/dailycred.gemspec CHANGED
@@ -15,5 +15,5 @@ Gem::Specification.new do |gem|
15
15
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
16
16
  gem.name = "dailycred"
17
17
  gem.require_paths = ["lib"]
18
- gem.version = "0.1.42"
18
+ gem.version = "0.1.43"
19
19
  end
@@ -1,4 +1,5 @@
1
1
  class PostsController < ApplicationController
2
+ before_filter :authenticate
2
3
  # GET /posts
3
4
  # GET /posts.json
4
5
 
@@ -9,6 +9,10 @@
9
9
  <body>
10
10
 
11
11
  <%= yield %>
12
+ <%= link_to 'login', connect_path %>
13
+ <% if !current_user.nil? %>
14
+ <%= debug current_user %>
15
+ <% end %>
12
16
 
13
17
  </body>
14
18
  </html>
@@ -0,0 +1,5 @@
1
+ class AddColumnToPosts < ActiveRecord::Migration
2
+ def change
3
+ add_column :posts, :created, :timestamp
4
+ end
5
+ end
data/dummy/db/schema.rb CHANGED
@@ -11,12 +11,13 @@
11
11
  #
12
12
  # It's strongly recommended to check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20121002192037) do
14
+ ActiveRecord::Schema.define(:version => 20121108192739) do
15
15
 
16
16
  create_table "posts", :force => true do |t|
17
17
  t.string "title"
18
18
  t.datetime "created_at", :null => false
19
19
  t.datetime "updated_at", :null => false
20
+ t.datetime "created"
20
21
  end
21
22
 
22
23
  create_table "users", :force => true do |t|
@@ -42,6 +42,7 @@ module Dailycred
42
42
 
43
43
  ActiveSupport.on_load(:action_controller) do
44
44
  include Dailycred::Helpers
45
+ helper Dailycred::Helpers
45
46
  end
46
47
  end
47
48
  end
@@ -25,10 +25,10 @@ module Dailycred
25
25
  end
26
26
 
27
27
  def login_path(params={})
28
- "/auth/dailycred"
28
+ connect_path params
29
29
  end
30
30
 
31
- def connect_path(params)
31
+ def connect_path(params={})
32
32
  url = "#{request.protocol}#{request.host_with_port}/auth/dailycred"
33
33
  p = []
34
34
  params.each do |k,v|
@@ -46,6 +46,7 @@ module Dailycred
46
46
  end
47
47
 
48
48
  def redirect_to_auth opts={}
49
+ p 'redirecting to auth'
49
50
  conf = Rails.configuration.DAILYCRED_OPTIONS
50
51
  path = !conf[:after_auth].nil? ? conf[:after_auth] : dailycred_engine.auth_info_path
51
52
  redirect_to path, opts
@@ -5,7 +5,7 @@ class CreateUsers < ActiveRecord::Migration
5
5
  t.string :provider
6
6
  t.string :uid
7
7
  t.string :email
8
- t.bigint :created
8
+ t.timestamp :created
9
9
  t.string :username
10
10
  t.boolean :verified
11
11
  t.boolean :admin
@@ -28,7 +28,7 @@ class CreateUsers < ActiveRecord::Migration
28
28
  safe_column :users, :provider, :string
29
29
  safe_column :users, :uid, :string
30
30
  safe_column :users, :email, :string
31
- safe_column :users, :created, :integer
31
+ safe_column :users, :created, :timestamp
32
32
  safe_column :users, :username, :string
33
33
  safe_column :users, :verified, :booleanied
34
34
  safe_column :users, :admin, :boolean
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dailycred
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.42
4
+ version: 0.1.43
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-11-05 00:00:00.000000000 Z
12
+ date: 2012-11-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth
@@ -122,6 +122,7 @@ files:
122
122
  - dummy/db/migrate/20120925172903_create_users.rb
123
123
  - dummy/db/migrate/20120926012555_create_posts.rb
124
124
  - dummy/db/migrate/20121002192037_update_users_2.rb
125
+ - dummy/db/migrate/20121108192739_add_column_to_posts.rb
125
126
  - dummy/db/schema.rb
126
127
  - dummy/db/seeds.rb
127
128
  - dummy/lib/assets/.gitkeep