summaryrefslogtreecommitdiff
path: root/vendor/plugins/thinking-sphinx/spec/fixtures/models.rb
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2011-02-10 14:19:00 +0100
committerhukl <contact@smyck.org>2011-02-10 14:19:00 +0100
commit7379daad1c73bd3610ed296436250b417ac3673d (patch)
tree04f722efc678de9d3aa5bf8f1c96e3be33b18bc4 /vendor/plugins/thinking-sphinx/spec/fixtures/models.rb
parent91633ac4419d839661e35ae8f2efe5c9089cfb67 (diff)
removed thinking_sphinx plugin and replaced it with gem.
also tuned dependencies
Diffstat (limited to 'vendor/plugins/thinking-sphinx/spec/fixtures/models.rb')
-rw-r--r--vendor/plugins/thinking-sphinx/spec/fixtures/models.rb94
1 files changed, 0 insertions, 94 deletions
diff --git a/vendor/plugins/thinking-sphinx/spec/fixtures/models.rb b/vendor/plugins/thinking-sphinx/spec/fixtures/models.rb
deleted file mode 100644
index 0e62906..0000000
--- a/vendor/plugins/thinking-sphinx/spec/fixtures/models.rb
+++ /dev/null
@@ -1,94 +0,0 @@
1class Person < ActiveRecord::Base
2 belongs_to :team, :polymorphic => :true
3 has_many :contacts
4
5 has_many :friendships
6 has_many :friends, :through => :friendships
7
8 has_many :tags
9
10 has_many :football_teams, :through => :tags
11
12 define_index do
13 indexes [first_name, middle_initial, last_name], :as => :name
14 indexes team.name, :as => :team_name
15 indexes contacts.phone_number, :as => :phone_numbers
16 indexes city, :prefixes => true
17 indexes state, :infixes => true
18
19 has [first_name, middle_initial, last_name], :as => :name_sort
20 has team.name, :as => :team_name_sort
21
22 has [:id, :team_id], :as => :ids
23 has team(:id), :as => :team_id
24
25 has contacts.phone_number, :as => :phone_number_sort
26 has contacts(:id), :as => :contact_ids
27
28 has birthday
29
30 has friendships.person_id, :as => :friendly_ids
31
32 set_property :delta => true
33 end
34end
35
36class Parent < Person
37end
38
39class Child < Person
40 belongs_to :parent
41 define_index do
42 indexes [parent.first_name, parent.middle_initial, parent.last_name], :as => :parent_name
43 end
44end
45
46class Contact < ActiveRecord::Base
47 belongs_to :person
48end
49
50class Tag < ActiveRecord::Base
51 belongs_to :person
52 belongs_to :football_team
53 belongs_to :cricket_team
54end
55
56class FootballTeam < ActiveRecord::Base
57 has_many :tags
58end
59
60class CricketTeam < ActiveRecord::Base
61 define_index do
62 indexes :name
63 has "SELECT cricket_team_id, id FROM tags", :source => :query, :as => :tags
64 end
65end
66
67class Friendship < ActiveRecord::Base
68 belongs_to :person
69 belongs_to :friend, :class_name => "Person", :foreign_key => :friend_id
70
71 define_index do
72 has person_id, friend_id
73 end
74end
75
76class Alpha < ActiveRecord::Base
77 define_index do
78 indexes :name, :sortable => true
79
80 set_property :field_weights => {"name" => 10}
81 end
82end
83
84class Beta < ActiveRecord::Base
85 define_index do
86 indexes :name, :sortable => true
87
88 set_property :delta => true
89 end
90end
91
92class Search < ActiveRecord::Base
93 #
94end \ No newline at end of file