diff options
| author | hukl <contact@smyck.org> | 2011-02-10 14:19:00 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2011-02-10 14:19:00 +0100 |
| commit | 7379daad1c73bd3610ed296436250b417ac3673d (patch) | |
| tree | 04f722efc678de9d3aa5bf8f1c96e3be33b18bc4 /vendor/plugins/thinking-sphinx/spec/fixtures/models.rb | |
| parent | 91633ac4419d839661e35ae8f2efe5c9089cfb67 (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.rb | 94 |
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 @@ | |||
| 1 | class 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 | ||
| 34 | end | ||
| 35 | |||
| 36 | class Parent < Person | ||
| 37 | end | ||
| 38 | |||
| 39 | class 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 | ||
| 44 | end | ||
| 45 | |||
| 46 | class Contact < ActiveRecord::Base | ||
| 47 | belongs_to :person | ||
| 48 | end | ||
| 49 | |||
| 50 | class Tag < ActiveRecord::Base | ||
| 51 | belongs_to :person | ||
| 52 | belongs_to :football_team | ||
| 53 | belongs_to :cricket_team | ||
| 54 | end | ||
| 55 | |||
| 56 | class FootballTeam < ActiveRecord::Base | ||
| 57 | has_many :tags | ||
| 58 | end | ||
| 59 | |||
| 60 | class 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 | ||
| 65 | end | ||
| 66 | |||
| 67 | class 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 | ||
| 74 | end | ||
| 75 | |||
| 76 | class Alpha < ActiveRecord::Base | ||
| 77 | define_index do | ||
| 78 | indexes :name, :sortable => true | ||
| 79 | |||
| 80 | set_property :field_weights => {"name" => 10} | ||
| 81 | end | ||
| 82 | end | ||
| 83 | |||
| 84 | class Beta < ActiveRecord::Base | ||
| 85 | define_index do | ||
| 86 | indexes :name, :sortable => true | ||
| 87 | |||
| 88 | set_property :delta => true | ||
| 89 | end | ||
| 90 | end | ||
| 91 | |||
| 92 | class Search < ActiveRecord::Base | ||
| 93 | # | ||
| 94 | end \ No newline at end of file | ||
