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
| // Based on code found at: http://ejohn.org/blog/jquery-livesearch/ | |
| (function($) { | |
| $.fn.liveUpdate = function(list, options){ | |
| var list = $(list), | |
| original = list.html(); | |
| options = $.extend({}, options); | |
| if ( list.length ) { | |
| var rows = list.children('li'), | |
| cache = rows.map(function(){ | |
| return $.trim($(this).text().toLowerCase()); |
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 ActiveRecord | |
| module ChangeableAttribute | |
| def self.included(base) | |
| base.extend ClassMethods | |
| end | |
| module ClassMethods | |
| def changeable_attribute_writer(*attrbs) | |
| attrbs.each do |attrb| |
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 ActionView | |
| module Helpers | |
| module OptimisticLockingFormFor | |
| def self.included(base) | |
| base.alias_method_chain :form_for, :optimistic_locking | |
| end | |
| def form_for_with_optimistic_locking(record_or_name_or_array, *args, &block) | |
| form_for_without_optimistic_locking(record_or_name_or_array, *args) do |form_with_locking| |
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($) { | |
| $.fn.disable = function(){ | |
| return this.attr('disabled', 'disabled'); | |
| }; | |
| $.fn.enable = function(){ | |
| return this.removeAttr('disabled'); | |
| }; | |
| $.fn.findOrAppend = function(selector, html){ | |
| var results = this.find(selector); |
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
| // Example Usage: | |
| // $('form.some-class').fieldsTabIndexFocus([ | |
| // 'input#record_name', 'textarea#record_description', 'select#some-input', | |
| // 'fieldset#some-id li' | |
| // ], 'input#record_name:first'); | |
| (function($) { | |
| $.tabIndexManagers = []; | |
| $.tabIndexManager = function(form, fields){ | |
| this.fields = fields; |
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
| simple = yes?("Should we do a simple install?") | |
| gem 'mocha', :version => '>= 0.9.5', :env => 'test' | |
| gem 'factory_girl', :lib => 'factory_girl', :source => 'http://gemcutter.org', :version => '>= 1.2.0', :env => 'test' | |
| gem 'shoulda', :lib => 'shoulda/rails', :source => 'http://gemcutter.org', :env => 'test' | |
| gem 'authlogic' | |
| gem "formtastic", :source => 'http://gemcutter.org' | |
| gem 'validation_reflection' | |
| unless simple | |
| gem "matthuhiggins-foreigner", :lib => "foreigner" | |
| 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
| diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb | |
| index bb9e1dc..68a898d 100644 | |
| --- a/app/controllers/invitations_controller.rb | |
| +++ b/app/controllers/invitations_controller.rb | |
| @@ -1,20 +1,16 @@ | |
| class InvitationsController < ApplicationController | |
| + before_filter :require_analyst | |
| + | |
| def new | |
| @invitation = Invitation.new |
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
| en: | |
| datetime: | |
| distance_in_words: | |
| x_weeks: | |
| one: '1 week' | |
| other: "{{count}} weeks" | |
| x_hours: | |
| one: "1 hour" | |
| other: "{{count}} hours" | |
| x_years: |
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 ActiveSupport::TestCase | |
| protected | |
| # Use this to destroy ActiveRecord models you created and stored in instance variables. | |
| # Pass in the names of the instance variables: | |
| # | |
| # teardown do | |
| # destroy_and_nil(*%w(contact_details user product)) | |
| # end |