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
#!/usr/bin/env ruby | |
require 'soap/wsdlDriver' | |
class Login | |
attr_accessor :userName | |
attr_accessor :password | |
def initialize(userName = nil, password = nil) | |
@userName = userName | |
@password = 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
# used to make a LOT of data nice and easy to loop through in the view | |
orders = orders.group_by(&:ItemCode) | |
orders.each do |key, order| | |
orders[key] = order.group_by(&:year) | |
orders[key].each do |k, year| | |
orders[key][k] = year.group_by(&:month) | |
total = 0 | |
orders[key][k].each do |m, data| |
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 prepare(user) | |
can :manage, :all do |action, object_class, object| | |
# Check first to see if the object is public | |
if (object.has_attribute?("public") and object.public) | |
true | |
elsif(user.present?) | |
user.permissions.find_all_by_action(action).any? do |permission| | |
permission.object_type.constantize == object_class && | |
(object.nil? || permission.object_id.nil? || permission.object_id == object.id) | |
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
undefined local variable or method `request' for Notifier:Class |
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
source :gemcutter | |
gem "amqp" | |
gem "eventmachine" | |
gem "em-websocket" | |
gem "twitter-stream" | |
gem "uuid |
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
/Users/lawrencecurtis/.rvm/gems/ruby-1.8.7-p174/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in `const_missing': uninitialized constant NewRelic::CollectionHelper (NameError) | |
from /Users/lawrencecurtis/.rvm/gems/ruby-1.8.7-p174/bundler/gems/rpm-828bb5d/ui/helpers/developer_mode_helper.rb:4 | |
from /Users/lawrencecurtis/.rvm/gems/ruby-1.8.7-p174/bundler/gems/rpm-828bb5d/lib/new_relic/rack/developer_mode.rb:11 | |
from /Users/lawrencecurtis/.rvm/gems/ruby-1.8.7-p174/bundler/gems/rpm-828bb5d/lib/new_relic/rack_app.rb:6 | |
from config.ru:4 | |
from /Users/lawrencecurtis/.rvm/gems/ruby-1.8.7-p174/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval' | |
from /Users/lawrencecurtis/.rvm/gems/ruby-1.8.7-p174/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize' | |
from config.ru:1:in `new' | |
from config.ru:1 |
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 Note < ActiveRecord::Base | |
def file= file | |
if file.present? | |
# do something with the file | |
if /image/.match(file.content_type) | |
type = "Image" | |
elsif /video/.match(file.content_type) | |
type = "Video" | |
else | |
type = "Other" |
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
/Users/lawrencecurtis/.rvm/gems/ruby-1.8.7-p174/bundler/gems/rails-3bdaa09/activemodel/lib/active_model/attribute_methods.rb:364:in `method_missing' | |
/Users/lawrencecurtis/.rvm/gems/ruby-1.8.7-p174/bundler/gems/rails-3bdaa09/activerecord/lib/active_record/attribute_methods.rb:46:in `method_missing' | |
state_machine (0.9.3) lib/state_machine/integrations/active_record.rb:420:in `attributes=' | |
/Users/lawrencecurtis/.rvm/gems/ruby-1.8.7-p174/bundler/gems/rails-3bdaa09/activerecord/lib/active_record/base.rb:1349:in `initialize' | |
state_machine (0.9.3) lib/state_machine/integrations/active_record.rb:408:in `initialize' | |
/Users/lawrencecurtis/.rvm/gems/ruby-1.8.7-p174/bundler/gems/rails-3bdaa09/activerecord/lib/active_record/reflection.rb:180:in `new' | |
/Users/lawrencecurtis/.rvm/gems/ruby-1.8.7-p174/bundler/gems/rails-3bdaa09/activerecord/lib/active_record/reflection.rb:180:in `build_association' | |
/Users/lawrencecurtis/.rvm/gems/ruby-1.8.7-p174/bundler/gems/rails-3bdaa09/activerecord/lib/active_record/associations/associatio |
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
source :gemcutter | |
gem 'rails', :git => "git://github.com/rails/rails.git" | |
gem 'thinking-sphinx', | |
:git => 'git://github.com/freelancing-god/thinking-sphinx.git', | |
:branch => 'rails3', | |
:require => 'thinking_sphinx' | |
gem 'mysql' | |
gem 'RedCloth' | |
gem 'authlogic', :git => 'git://github.com/odorcicd/authlogic.git', :branch => 'rails3' |
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 DesignsController < ApplicationController | |
def index | |
@designs = Design.accepted | |
@designs = @designs.order("#{params[:order]} DESC") if params[:order].present? | |
@designs = @designs.order(:description) | |
respond_to do |format| | |
format.html | |
format.js { render :json => @designs } | |
end | |
end |
OlderNewer