Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updating campfire

  • Loading branch information...
commit 96ca26492888190b692f6b8db16646be41f589d3 1 parent f531f07
Mike Skalnik skalnik authored
5 app/models/campfire.rb
View
@@ -8,15 +8,14 @@ def send_message(message)
end
def tinder_room
- @tinder_room ||= self.name ? tinder.rooms.select { |r| r.name == room }[0] : tinder.rooms[0]
+ @tinder_room ||= self.room ? tinder.find_room_by_name(room) : tinder.rooms[0]
end
private
def tinder
return @tinder if @tinder
- @tinder = Tinder::Campfire.new domain, :ssl => true
- @tinder.login login, password
+ @tinder = Tinder::Campfire.new domain, :token => key, :ssl => true
@tinder
end
2  config/environment.rb
View
@@ -19,7 +19,7 @@
:secret => 'SEKRITSEKRITSEKRITSEKRITSEKRITSEKRITSEKRITSEKRITSEKRIT!'
}
- config.gem 'tinder', :version => '1.4.0'
+ config.gem 'tinder', :version => '>=1.4.0'
config.gem 'twitter-text'
config.gem 'fastercsv', :version => '1.2.3'
config.gem 'googlecharts', :lib => "gchart", :version => '1.3.6'
2  config/gems.yml
View
@@ -1,5 +1,5 @@
---
-- :version: = 1.4.0
+- :version: ">= 1.4.0"
:name: tinder
- :name: twitter-text
- :version: ">= 0.6"
11 db/migrate/20100702185317_update_campfire_to_use_keys.rb
View
@@ -0,0 +1,11 @@
+class UpdateCampfireToUseKeys < ActiveRecord::Migration
+ def self.up
+ remove_column :campfires, :password
+ rename_column :campfires, :login, :key
+ end
+
+ def self.down
+ rename_column :campfires, :key, :login
+ add_column :campfires, :password
+ end
+end
5 db/schema.rb
View
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20100630014806) do
+ActiveRecord::Schema.define(:version => 20100702185317) do
create_table "bj_config", :primary_key => "bj_config_id", :force => true do |t|
t.string "hostname"
@@ -61,8 +61,7 @@
create_table "campfires", :force => true do |t|
t.string "domain"
- t.string "login"
- t.string "password"
+ t.string "key"
t.string "room"
t.integer "user_id"
t.datetime "created_at"
Please sign in to comment.
Something went wrong with that request. Please try again.