tyler-composite_primary_keys 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +0 -8
- data/Manifest.txt +0 -1
- data/Rakefile +65 -0
- data/init.rb +2 -0
- data/install.rb +30 -0
- data/lib/composite_primary_keys/association_preload.rb +2 -19
- data/lib/composite_primary_keys/associations.rb +2 -2
- data/lib/composite_primary_keys/base.rb +2 -6
- data/lib/composite_primary_keys/calculations.rb +1 -2
- data/lib/composite_primary_keys/version.rb +3 -3
- data/loader.rb +24 -0
- data/tmp/test.db +0 -0
- data/website/index.html +199 -0
- data/website/index.txt +159 -0
- data/website/javascripts/rounded_corners_lite.inc.js +285 -0
- data/website/stylesheets/screen.css +126 -0
- data/website/template.js +3 -0
- data/website/template.rhtml +53 -0
- data/website/version-raw.js +3 -0
- data/website/version-raw.txt +2 -0
- data/website/version.js +4 -0
- data/website/version.txt +3 -0
- metadata +78 -59
- data/lib/adapter_helper/oracle_enhanced.rb +0 -12
- data/lib/composite_primary_keys/connection_adapters/abstract_adapter.rb +0 -9
- data/lib/composite_primary_keys/connection_adapters/oracle_enhanced_adapter.rb +0 -17
- data/test/connections/native_oracle_enhanced/connection.rb +0 -20
- data/test/fixtures/article_group.rb +0 -4
- data/test/fixtures/article_groups.yml +0 -7
- data/test/fixtures/dorm.rb +0 -3
- data/test/fixtures/dorms.yml +0 -2
- data/test/fixtures/kitchen_sink.rb +0 -3
- data/test/fixtures/kitchen_sinks.yml +0 -5
- data/test/fixtures/restaurant.rb +0 -6
- data/test/fixtures/restaurants.yml +0 -5
- data/test/fixtures/restaurants_suburbs.yml +0 -11
- data/test/fixtures/room.rb +0 -10
- data/test/fixtures/room_assignment.rb +0 -4
- data/test/fixtures/room_assignments.yml +0 -4
- data/test/fixtures/room_attribute.rb +0 -3
- data/test/fixtures/room_attribute_assignment.rb +0 -5
- data/test/fixtures/room_attribute_assignments.yml +0 -4
- data/test/fixtures/room_attributes.yml +0 -3
- data/test/fixtures/rooms.yml +0 -3
- data/test/fixtures/student.rb +0 -4
- data/test/fixtures/students.yml +0 -2
- data/test/test_exists.rb +0 -29
data/test/fixtures/room.rb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
class Room < ActiveRecord::Base
|
2
|
-
set_primary_keys :dorm_id, :room_id
|
3
|
-
belongs_to :dorm
|
4
|
-
has_many :room_attribute_assignments, :foreign_key => [:dorm_id, :room_id]
|
5
|
-
has_many :room_attributes, :through => :room_attribute_assignments
|
6
|
-
|
7
|
-
def find_custom_room_attributes
|
8
|
-
room_attributes.find(:all, :conditions => ["room_attributes.name != ?", "keg"])
|
9
|
-
end
|
10
|
-
end
|
data/test/fixtures/rooms.yml
DELETED
data/test/fixtures/student.rb
DELETED
data/test/fixtures/students.yml
DELETED
data/test/test_exists.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'abstract_unit'
|
2
|
-
require 'fixtures/article'
|
3
|
-
require 'fixtures/department'
|
4
|
-
|
5
|
-
class TestExists < Test::Unit::TestCase
|
6
|
-
fixtures :articles, :departments
|
7
|
-
|
8
|
-
def test_single_key_exists_giving_id
|
9
|
-
assert Article.exists?(1)
|
10
|
-
end
|
11
|
-
|
12
|
-
def test_single_key_exists_giving_condition
|
13
|
-
assert Article.exists?(['name = ?', 'Article One'])
|
14
|
-
end
|
15
|
-
|
16
|
-
def test_composite_key_exists_giving_ids_as_string
|
17
|
-
assert Department.exists?('1,1,')
|
18
|
-
end
|
19
|
-
|
20
|
-
def test_composite_key_exists_giving_ids_as_array
|
21
|
-
assert Department.exists?([1,1])
|
22
|
-
assert_equal(false, Department.exists?([1111,1111]))
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_composite_key_exists_giving_ids_as_condition
|
26
|
-
assert Department.exists?(['department_id = ? and location_id = ?', 1, 1])
|
27
|
-
assert_equal(false, Department.exists?(['department_id = ? and location_id = ?', 11111, 11111]))
|
28
|
-
end
|
29
|
-
end
|