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
| function rr { | |
| cwd=`pwd` | |
| not_found=true | |
| while [[ "`pwd`" != "/" && $not_found == true ]]; do | |
| if [[ ( -f '.rails_root' ) || ( -d 'app' && -d 'config' ) ]]; then | |
| not_found=false | |
| cd `pwd` | |
| continue | |
| fi | |
| cd .. |
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
| def setup_environment | |
| # Configure Rails Environment | |
| ENV["RAILS_ENV"] ||= 'test' | |
| require File.expand_path("../dummy/config/environment", __FILE__) | |
| require 'rspec/rails' | |
| require 'capybara/rspec' | |
| require 'factory_girl_rails' |
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
| 2012-03-05T20:32:02+00:00 heroku[web.1]: Stopping process with SIGKILL | |
| 2012-03-05T20:32:04+00:00 heroku[web.1]: Process exited with status 137 | |
| 2012-03-05T20:32:06+00:00 app[web.1]: [2012-03-05 20:32:06] INFO WEBrick 1.3.1 | |
| 2012-03-05T20:32:06+00:00 app[web.1]: [2012-03-05 20:32:06] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux] | |
| 2012-03-05T20:32:06+00:00 app[web.1]: [2012-03-05 20:32:06] INFO WEBrick::HTTPServer#start: pid=1 port=56080 | |
| 2012-03-05T20:32:07+00:00 heroku[web.1]: State changed from starting to up | |
| 2012-03-05T20:34:01+00:00 heroku[run.1]: State changed from created to starting | |
| 2012-03-05T20:34:07+00:00 app[run.1]: Awaiting client | |
| 2012-03-05T20:34:07+00:00 app[run.1]: Starting process with command `bundle exec rake db:migrate` | |
| 2012-03-05T20:34:08+00:00 heroku[run.1]: State changed from starting to up |
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
| # Generates the link to determine where the site bar switch button returns to. | |
| def site_bar_switch_link | |
| if admin? ? admin_switch_link : frontend_switch_link | |
| end | |
| def admin_switch_link | |
| link_url = session[:website_return_to].present? ? session[:website_return_to] : | |
| refinery.root_path(:locale => (Refinery::I18n.default_frontend_locale if Refinery.i18n_enabled?)) | |
| link_to t('.switch_to_your_website', site_bar_translate_locale_args), link_url, {:class => 'btn btn-primary'} |
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
| # Generates the link to determine where the site bar switch button returns to. | |
| def site_bar_switch_link(html_options = {}) | |
| if admin? ? admin_switch_link(html_options) : frontend_switch_link(html_options) | |
| end | |
| def admin_switch_link(html_options = {}) | |
| link_to t('.switch_to_your_website', site_bar_translate_locale_args), | |
| session[:website_return_to] || refinery.root_path(:locale => (Refinery::I18n.default_frontend_locale if Refinery.i18n_enabled?)), | |
| html_options | |
| 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
| # Add this: | |
| gem 'cells' |
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
| FactoryGirl.define do | |
| factory :user do | |
| sequence(:email) { |n| "email#{n}@example.com" } | |
| password "secret" | |
| factory :admin do | |
| after_build {|u| u.roles << :admin } | |
| end | |
| 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
| module Admin | |
| class UsersController < ::AuthenticatedController | |
| load_and_authorize_resource | |
| def index | |
| users = User.untrashed | |
| render_with :users => users | |
| end | |
| def trashed |
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
| options = { | |
| 'x-amz-metadata-directive' => 'REPLACE', | |
| 'Content-Type' => 'application/pdf', | |
| 'Content-Disposition' => nil | |
| } | |
| count = 0 | |
| files = directory.files.each do |file| | |
| next unless file.key =~ /pdf\z/i | |
| count += 1 |