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 type="text/javascript"> | |
| var $j = jQuery.noConflict(); | |
| $j(function() { | |
| $j('#sidebar-products-group a').each(function() { | |
| if($j(this).text().substring(0, 4) == 'ALL:') { | |
| $j(this).css('fontWeight', 'bold'); | |
| } else if($j(this).text() == 'All Categories') { | |
| $j('#sidebar-products-group .body').append($j(this).clone().text('View All Products')); |
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 define_model_callbacks(*callbacks) | |
| options = callbacks.extract_options! | |
| options = { | |
| :terminator => "result == false", | |
| :scope => [:kind, :name], | |
| :only => [:before, :around, :after] | |
| }.merge(options) | |
| types = Array.wrap(options.delete(:only)) |
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 self.extended(base) | |
| base.class_eval do | |
| include ActiveSupport::Callbacks | |
| 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
| >> category = Category.create(:name => 'Vinyl Records') | |
| => #<Category id: 1, name: "Vinyl Records", created_at: "2011-08-03 15:46:11", updated_at: "2011-08-03 15:46:11"> | |
| ?> category.settings | |
| => #<ActiveConfiguration::SettingManager:0x10e7d1950 @configurable=#<Category id: 1, name: "Vinyl Records", created_at: "2011-08-03 15:46:11", updated_at: "2011-08-03 15:46:11">> | |
| ?> category.settings[:sort] | |
| => {:value=>"alphabetical", :modifier=>nil} | |
| ?> category.settings[:sort][:value] |
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 Category < ActiveRecord::Base | |
| configure do | |
| option :sort do | |
| default 'alphabetical' | |
| restrict 'alphabetical', 'manual' | |
| end | |
| option :limit do | |
| format 'fixnum' | |
| 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 Category < ActiveRecord::Base | |
| configure do | |
| option :sort do | |
| default 'alphabetical' | |
| restrict 'alphabetical', 'manual' | |
| end | |
| option :limit do | |
| format 'fixnum' | |
| 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
| {% flickr_set tsmango 72157625102245887 %} |
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
| --- | |
| layout: post | |
| title: "How I Keep Limited Pressing Running" | |
| alias: /post/6301645915/how-i-keep-limited-pressing-running/index.html | |
| --- |
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
| ActionController::Base.wrap_parameters :format => [:json] |
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
| Comment.find(:all, :conditions => ['thread_id IN (?)', ['2A', '2B', '2C']]) |