I hereby claim:
- I am rsl on github.
- I am russell_norris (https://keybase.io/russell_norris) on keybase.
- I have a public key ASDgNQUBm7StrbnoS6F1ktuBH7a-WNKukfZ5d6sSB5uCTQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 |
| # Snip snip snip | |
| devise_for :users, skip: [:registrations, :saml_authenticatable], controllers: {sessions: 'devise_sessions'} | |
| # Manually add user editing but disallow registrations [above] | |
| as :user do | |
| get 'users/edit' => 'devise_registrations#edit', as: 'edit_registration' | |
| patch 'users' => 'devise_registrations#update', as: 'registration' | |
| # To avoid conflict saml_authenticatable routes are manually defined here. | |
| # Also we override the controller. | |
| resource :session, as: 'saml_session', only: [], controller: 'devise_saml_sessions', path: '/companies/:id/saml' do |
| class User < ActiveRecord::Base | |
| # Owned events | |
| has_many :events, dependent: :nullify | |
| has_many :event_memberships, dependent: :nullify | |
| has_many :member_events, through: :event_memberships, source: :user | |
| end |
| class User < ActiveRecord::Base | |
| class ApplicationController < ActionController::Base | |
| whitelist_params user: [:name, :email], comment: [:body, :email] #... | |
| # Creates user_params, comment_params with expected whitelisting | |
| end |
| class PostsController < ApplicationController | |
| # Automatically create the strong parameters required method | |
| def PostsController.filter_parameters(options = {}) | |
| options[:for] = [options[:for]] if options[:for].is_a?(Symbol) | |
| options[:for].each do |action_name| | |
| define_method("#{action_name.to_s}_params") do | |
| base = options[:require].keys.first | |
| params.require(base).permit(*options[:require][base]) | |
| end |
| def foo | |
| return unless | |
| puts 'oh yeah' | |
| end | |
| def bar | |
| return if | |
| puts 'oh no' | |
| end |
| $('#foo').xsortable({ | |
| onDrag: function ($item, position, _super, event) { | |
| var $window = $(window); | |
| var itemTop = $item.offset().top; | |
| if (itemTop > ($window.scrollTop() + $window.height())) { | |
| if (!window.lastItemTop || (itemTop > window.lastItemTop)) { | |
| window.scrollBy(0, 10); | |
| } | |
| } else if (itemTop < $window.scrollTop()) { | |
| if (!window.lastItemTop || (itemTop < window.lastItemTop)) { |
| #survey_search { | |
| &.hide { | |
| display: none; | |
| } | |
| // Other rules | |
| } |