forked from mbleigh/acts-as-taggable-on
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.rb
58 lines (47 loc) · 1.26 KB
/
models.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
class TaggableModel < ActiveRecord::Base
acts_as_taggable
acts_as_taggable_on :languages
acts_as_taggable_on :skills
acts_as_taggable_on :needs, :offerings
has_many :untaggable_models
attr_reader :tag_list_submethod_called
def tag_list=v
@tag_list_submethod_called = true
super
end
end
class CachedModel < ActiveRecord::Base
acts_as_taggable
end
class OtherCachedModel < ActiveRecord::Base
acts_as_taggable_on :languages, :statuses, :glasses
end
class OtherTaggableModel < ActiveRecord::Base
acts_as_taggable_on :tags, :languages
acts_as_taggable_on :needs, :offerings
end
class InheritingTaggableModel < TaggableModel
end
class AlteredInheritingTaggableModel < TaggableModel
acts_as_taggable_on :parts
end
class TaggableUser < ActiveRecord::Base
acts_as_tagger
end
class InheritingTaggableUser < TaggableUser
end
class UntaggableModel < ActiveRecord::Base
belongs_to :taggable_model
end
class NonStandardIdTaggableModel < ActiveRecord::Base
primary_key = "an_id"
acts_as_taggable
acts_as_taggable_on :languages
acts_as_taggable_on :skills
acts_as_taggable_on :needs, :offerings
has_many :untaggable_models
end
class OrderedTaggableModel < ActiveRecord::Base
acts_as_ordered_taggable
acts_as_ordered_taggable_on :colours
end