-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work done on Saved Search. Added location to Projects, and notes and …
…retired to Tags. Changed the travis script to try to fix build errors. modified: .travis.yml -- doesn't use sh script, commands are directly in .travis file modified: Gemfile.lock modified: app/assets/javascripts/angular/controllers/login.js modified: app/assets/stylesheets/application.css.scss -- added bootstrap css back in modified: app/assets/templates/home.html modified: app/controllers/api/callbacks_controller.rb modified: app/models/audio_recording.rb modified: app/models/saved_search/saved_search_store.rb modified: app/models/saved_search/saved_search_store_body.rb modified: app/models/saved_search/saved_search_store_post.rb modified: app/models/saved_search/saved_search_store_pre.rb modified: app/views/layouts/application.html.erb new file: db/migrate/20130218060415_add_location_to_projects.rb new file: db/migrate/20130218060728_add_notes_and_retired_to_tags.rb -- added migrations modified: spec/controllers/sites_controller_spec.rb modified: spec/controllers/users_controller_spec.rb modified: spec/factories/audio_recording_factory.rb modified: spec/models/progress_spec.rb -- had to change, as it left entries in the database modified: spec/models/user_spec.rb modified: spec/requests/saved_search_request_spec.rb
- Loading branch information
Mark Cottman-Fields
committed
Feb 18, 2013
1 parent
27df1a3
commit 69c42dd
Showing
11 changed files
with
111 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,8 +41,11 @@ def failure | |
# returneddata = 0; dataitem = window.open('/security/auth/open_id/callback', 'dataitem'); dataitem.returneddata = returneddata; | ||
# to access the object: dataitem.returneddata | ||
|
||
Rails.logger.warn("Log in failed. Data: #{window_data.as_json}; Params: #{params}") | ||
|
||
respond_to do |format| | ||
format.json { render :json => window_data.as_json, :status => :unauthorized } | ||
format.js { render :json => window_data.as_json, :status => :unauthorized } | ||
format.xml { render :xml => window_data.to_xml, :status => :unauthorized } | ||
format.any { render :text => window_content(displayed_data, window_data), :status => :unauthorized } | ||
end | ||
|
@@ -55,11 +58,17 @@ def success_complete(canonical_data) | |
|
||
sign_in(user, :event => :authentication) | ||
|
||
current_user.reset_authentication_token! | ||
unless current_user.blank? | ||
current_user.reset_authentication_token! | ||
end | ||
|
||
content = Api::SessionsController.login_info(current_user, user, canonical_data[:authorization][:provider]) | ||
|
||
Rails.logger.debug("Log in succeeded. Data: #{content.as_json}; Params: #{params}") | ||
|
||
respond_to do |format| | ||
format.json { render :json => content.as_json, :status => :ok } | ||
format.js { render :json => content.as_json, :status => :ok } | ||
format.xml { render :xml => content.to_xml, :status => :ok } | ||
format.any { render :text => window_content(displayed_data, content), :status => :ok } | ||
end | ||
|
@@ -233,7 +242,7 @@ def twitter_info(raw) | |
|
||
# create a unique, dummy email, since twitter doesn't provide one | ||
# set dummy email to true, so that this email is never shown | ||
fake_email = raw['uid'].gsub(/[^0-9a-zA-Z]/,'_')+'[email protected]' | ||
fake_email = raw['uid'].gsub(/[^0-9a-zA-Z]/, '_')+'[email protected]' | ||
|
||
{ | ||
authorization: | ||
|
@@ -370,7 +379,7 @@ def create_or_update_user(canonical_data, user=nil) | |
|
||
new_user_name = canonical_data[:user][:user_name].blank? ? | ||
-1 * Random.rand(100000) : | ||
canonical_data[:user][:user_name].gsub(/[^0-9a-zA-Z]/,'_')+'_'+canonical_data[:authorization][:provider] | ||
canonical_data[:user][:user_name].gsub(/[^0-9a-zA-Z]/, '_')+'_'+canonical_data[:authorization][:provider] | ||
|
||
# HACK: for users created by external providers, dummy the user name with the .... field | ||
user = User.create!( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,23 @@ | ||
class SavedSearchStorePre | ||
include ActiveModel::Validations | ||
|
||
attr_accessor :created_by_id, :is_temporary | ||
|
||
validates :created_by_id, numericality: {only_integer: true, greater_than_or_equal_to: 1}, allow_nil: true | ||
validates :is_temporary, :inclusion => { :in => [true, false] }, allow_nil: true | ||
validates :is_temporary, :inclusion => {:in => [true, false]}, allow_nil: true | ||
|
||
def to_s | ||
self.to_json | ||
=begin | ||
msg = 'Saved Search Store Pre' | ||
unless @created_by_id.blank? | ||
msg = msg + " created by user with id #@created_by_id" | ||
end | ||
unless @is_temporary.blank? | ||
msg = msg + " is #{@is_temporary ? '' : 'not'} temporary" | ||
end | ||
msg | ||
=end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters