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
| index do | |
| id_column | |
| column :name | |
| column "Properties" do |o| | |
| o.properties.size | |
| end | |
| column "Added", :created_at | |
| column "Updated", :updated_at | |
| default_actions | |
| 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
| 04:24:53:website >> rails s | |
| => Booting WEBrick | |
| => Rails 4.0.0 application starting in development on http://0.0.0.0:3000 | |
| => Run `rails server -h` for more startup options | |
| => Ctrl-C to shutdown server | |
| /Users/mwlang/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-4.0.0/lib/active_record/core.rb:103: warning: already initialized constant #<Module:0x007fe037e05e60>::AttrNames | |
| /Users/mwlang/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-4.0.0/lib/active_record/core.rb:103: warning: previous definition of AttrNames was here | |
| /Users/mwlang/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-4.0.0/lib/active_record/core.rb:103: warning: already initialized constant #<Module:0x007fe039291e10>::AttrNames | |
| /Users/mwlang/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-4.0.0/lib/active_record/core.rb:103: warning: previous definition of AttrNames was here | |
| /Users/mwlang/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-4.0.0/lib/active_record/core.rb:103: warning: already initialized constant #<Module:0x007fe0394c29f0>::AttrNames |
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
| activerecord (4.0.0) lib/active_record/associations/association_scope.rb:13:in `initialize' | |
| activerecord (4.0.0) lib/active_record/associations/association.rb:100:in `new' | |
| activerecord (4.0.0) lib/active_record/associations/association.rb:100:in `association_scope' | |
| activerecord (4.0.0) lib/active_record/associations/association.rb:84:in `scope' | |
| activerecord (4.0.0) lib/active_record/associations/singular_association.rb:42:in `find_target' | |
| activerecord (4.0.0) lib/active_record/associations/association.rb:139:in `load_target' | |
| activerecord (4.0.0) lib/active_record/associations/association.rb:52:in `reload' | |
| activerecord (4.0.0) lib/active_record/associations/singular_association.rb:9:in `reader' | |
| activerecord (4.0.0) lib/active_record/associations/builder/association.rb:70:in `status' | |
| formtastic (2.2.1) lib/formtastic/inputs/base/fileish.rb:9:in `block in file?' |
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 Attorney < ActiveRecord::Base | |
| # Added :uniq qualifier, not without some strife. First, in the Agile 1.2 dev book, | |
| # they incorrectly called the parameter ":unique". Then, when you get a .count | |
| # on this association (attorney.community_organizations.count), it returns the non- | |
| # unique count. So, instead, to receive an accurate count that respects the :uniq | |
| # parameter, use .size, so attorney.community_organizations.size. | |
| has_many :community_organizations, | |
| :through => :affiliations, | |
| :conditions => %{community_organization_type_id != #{CommunityOrganizationType::PROFESSIONAL_TYPE_ID}}, | |
| :order => 'name', |
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 Practice < ActiveRecord::Base | |
| default_scope order(:name) | |
| has_many :attorneys, -> { where(active: true)}, :through => :attorney_practice_links | |
| has_many :attorneys_only, -> {where(active: true, is_attorney: true) }, | |
| :through => :attorney_practice_links, | |
| :include => [:position], | |
| :source => :attorney | |
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
| has_and_belongs_to_many :normal_events, | |
| :join_table => 'events_practices', | |
| :conditions => "type = 'NormalEvent' AND status_id = #{Status[:published].id}", | |
| :association_foreign_key => "event_id", | |
| :order => 'starts_on ASC' | |
| has_and_belongs_to_many :normal_events_future, | |
| :class_name => 'NormalEvent', | |
| :join_table => 'events_practices', | |
| :conditions => "type = 'NormalEvent' AND status_id = #{Status[:published].id} AND starts_on >= '#{0.days.ago.to_s(:db)}'", | |
| :association_foreign_key => "event_id", |
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
| require "bundler/capistrano" | |
| require 'rvm/capistrano' | |
| set :rvm_ruby_string, '2.0.0' | |
| set :rvm_type, :system | |
| set :application, "demo" | |
| set :server_address, "rackspace" | |
| set :use_sudo, false | |
| set :use_monit, false |
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
| # Injects a default REMOTE_USER into the headers so your Ruby app sees someone as being | |
| # "logged in" (authenticated) as would normally happen when the web server has been configured | |
| # to do basic or digest authentication before passing through to the web app. | |
| module Rack | |
| class EnsureRemoteUser | |
| def initialize(app) | |
| logger.debug "Ensure REMOTE_USER module initialized!" | |
| @app = app | |
| 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 Rack | |
| class NoCache | |
| def initialize(app) | |
| @app = app | |
| end | |
| def call(env) | |
| status, headers, body = @app.call(env) | |
| headers['Pragma'] = 'no-cache' |
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
| ------------- | |
| 4. API access | |
| ------------- | |
| The API allows other applications running on the same system to get p0f's | |
| current opinion about a particular host. This is useful for integrating it with | |
| spam filters, web apps, and so on. | |
| Clients are welcome to connect to the unix socket specified with -s using the |