Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Renamed systems to applications

  • Loading branch information...
commit ea9b5eb0896cdb7fcb17c907494a70e1cc2abe1c 1 parent b39a4e4
David Heinemeier Hansson authored
0  app/controllers/application.rb → app/controllers/application_controller.rb
View
File renamed without changes
6 app/models/system.rb → app/models/application.rb
View
@@ -1,9 +1,9 @@
-class System < ActiveRecord::Base
+class Application < ActiveRecord::Base
has_many :locales
def to_hash
- locales.each_with_object({}) do |locale, system|
- system[locale.name] = locale.to_hash
+ locales.each_with_object({}) do |locale, application|
+ application[locale.name] = locale.to_hash
end
end
2  app/models/locale.rb
View
@@ -1,5 +1,5 @@
class Locale < ActiveRecord::Base
- belongs_to :system
+ belongs_to :application
has_many :translations, :include => :phrase
def to_hash
11 db/migrate/20081029154007_rename_systems_to_applications.rb
View
@@ -0,0 +1,11 @@
+class RenameSystemsToApplications < ActiveRecord::Migration
+ def self.up
+ rename_table :systems, :applications
+ rename_column :locales, :system_id, :application_id
+ end
+
+ def self.down
+ rename_table :applications, :systems
+ rename_column :locales, :application_id, :system_id
+ end
+end
16 db/schema.rb
View
@@ -9,24 +9,24 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20081029150556) do
+ActiveRecord::Schema.define(:version => 20081029154007) do
- create_table "locales", :force => true do |t|
+ create_table "applications", :force => true do |t|
t.string "name"
+ t.text "location"
t.datetime "created_at"
t.datetime "updated_at"
- t.integer "system_id"
end
- create_table "phrases", :force => true do |t|
- t.text "key"
+ create_table "locales", :force => true do |t|
+ t.string "name"
t.datetime "created_at"
t.datetime "updated_at"
+ t.integer "application_id"
end
- create_table "systems", :force => true do |t|
- t.string "name"
- t.text "location"
+ create_table "phrases", :force => true do |t|
+ t.text "key"
t.datetime "created_at"
t.datetime "updated_at"
end
0  test/fixtures/systems.yml → test/fixtures/applications.yml
View
File renamed without changes
0  test/fixtures/systems/basecamp-yml → test/fixtures/applications/basecamp-yml
View
File renamed without changes
6 test/fixtures/locales.yml
View
@@ -1,11 +1,11 @@
en-US:
name: en-US
- system: basecamp
+ application: basecamp
da:
name: da
- system: basecamp
+ application: basecamp
se:
name: se
- system: basecamp
+ application: basecamp
13 test/unit/application_test.rb
View
@@ -0,0 +1,13 @@
+require 'test_helper'
+
+class ApplicationTest < ActiveSupport::TestCase
+ test "dumping application as yml" do
+ begin
+ applications(:basecamp).location = RAILS_ROOT + "/tmp/"
+ applications(:basecamp).dump
+ assert_equal File.read(fixture_path + "/applications/basecamp-yml"), File.read(RAILS_ROOT + "/tmp/locales.yml")
+ ensure
+ File.delete(RAILS_ROOT + "/tmp/locales.yml")
+ end
+ end
+end
13 test/unit/system_test.rb
View
@@ -1,13 +0,0 @@
-require 'test_helper'
-
-class SystemTest < ActiveSupport::TestCase
- test "dumping system as yml" do
- begin
- systems(:basecamp).location = RAILS_ROOT + "/tmp/"
- systems(:basecamp).dump
- assert_equal File.read(fixture_path + "/systems/basecamp-yml"), File.read(RAILS_ROOT + "/tmp/locales.yml")
- ensure
- File.delete(RAILS_ROOT + "/tmp/locales.yml")
- end
- end
-end
Please sign in to comment.
Something went wrong with that request. Please try again.