This file contains hidden or 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
class UsersController < Clearance::UsersController | |
def edit | |
... | |
end | |
end |
This file contains hidden or 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
# in the engine | |
ActionController::Routing::Routes.draw do |map| | |
map.resources :users, :controller => 'clearance/users' do |users| | |
users.resource :password, | |
:controller => 'clearance/passwords', | |
:only => [:create, :edit, :update] | |
end | |
# in the app | |
ActionController::Routing::Routes.draw do |map| |
This file contains hidden or 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
has been removed from the module tree but is still active |
This file contains hidden or 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
class Clearance::SessionsController < ApplicationController | |
unloadable | |
end |
This file contains hidden or 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
class ActionController::Routing::RouteSet | |
def load_routes_with_clearance! | |
clearance_routes = File.join(File.dirname(__FILE__), | |
*%w[.. config clearance_routes.rb]) | |
unless configuration_files.include? clearance_routes | |
add_configuration_file(clearance_routes) | |
end | |
load_routes_without_clearance! | |
end |
This file contains hidden or 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
class UsersController < Clearance::UsersController | |
def edit | |
... | |
end | |
end | |
ActionController::Routing::Routes.draw do |map| | |
map.resources :users | |
end |
This file contains hidden or 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
script/generate clearance_features |
This file contains hidden or 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
class User < ActiveRecord::Base | |
encrypt_with_public_key :secret, | |
:key_pair => File.join(RAILS_ROOT,'config','keypair.pem'), | |
end | |
user.secret.decrypt 'password' |
This file contains hidden or 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
class ArticleTest < ActiveSupport::TestCase | |
should_validate_presence_of :title, :abstract, :body, :author | |
should "submit to crossref after being saved" do | |
title = 'a title' | |
request = mock('crossref-request', :submit => true) | |
CrossrefRequest. | |
expects(:new). | |
with(:title => title, ...). | |
returns(request) |
This file contains hidden or 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
class Article < ActiveRecord::Base | |
after_create :submit_to_crossref | |
private | |
def submit_to_crossref | |
CrossrefRequest.new(:title => title, | |
# other info for the request | |
:author => author).submit | |
end |