active_press 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,6 +17,19 @@ class ActivePress::Post < ActivePress::Base
17
17
  scope :published, lambda { by_post_status('publish').before_now }
18
18
  scope :most_recent, order("post_date_gmt DESC")
19
19
 
20
+ # Basic post search.
21
+ # Requires FULLTEXT indexes on post_name and post_content
22
+ # ALTER TABLE wp_posts ADD FULLTEXT(post_name);
23
+ # ALTER TABLE wp_posts ADD FULLTEXT(post_content);
24
+ def self.search(query)
25
+ where(
26
+ ['(MATCH(post_name) against ?) OR (MATCH(post_content) against ?)',
27
+ query,
28
+ query
29
+ ]
30
+ )
31
+ end
32
+
20
33
  def self.by_year(d)
21
34
  where(:post_date_gmt => (d.beginning_of_year..d.end_of_year))
22
35
  end
@@ -1,3 +1,3 @@
1
1
  module ActivePress
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_press
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-01-10 00:00:00.000000000 Z
13
+ date: 2012-05-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
17
- requirement: &70206035389340 !ruby/object:Gem::Requirement
17
+ requirement: !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>'
@@ -22,10 +22,15 @@ dependencies:
22
22
  version: 3.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70206035389340
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>'
29
+ - !ruby/object:Gem::Version
30
+ version: 3.0.0
26
31
  - !ruby/object:Gem::Dependency
27
32
  name: activesupport
28
- requirement: &70206035388080 !ruby/object:Gem::Requirement
33
+ requirement: !ruby/object:Gem::Requirement
29
34
  none: false
30
35
  requirements:
31
36
  - - ! '>'
@@ -33,10 +38,15 @@ dependencies:
33
38
  version: 3.0.0
34
39
  type: :runtime
35
40
  prerelease: false
36
- version_requirements: *70206035388080
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>'
45
+ - !ruby/object:Gem::Version
46
+ version: 3.0.0
37
47
  - !ruby/object:Gem::Dependency
38
48
  name: rspec
39
- requirement: &70206035387140 !ruby/object:Gem::Requirement
49
+ requirement: !ruby/object:Gem::Requirement
40
50
  none: false
41
51
  requirements:
42
52
  - - ~>
@@ -44,10 +54,15 @@ dependencies:
44
54
  version: 2.6.0
45
55
  type: :development
46
56
  prerelease: false
47
- version_requirements: *70206035387140
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ~>
61
+ - !ruby/object:Gem::Version
62
+ version: 2.6.0
48
63
  - !ruby/object:Gem::Dependency
49
64
  name: shoulda-matchers
50
- requirement: &70206035386480 !ruby/object:Gem::Requirement
65
+ requirement: !ruby/object:Gem::Requirement
51
66
  none: false
52
67
  requirements:
53
68
  - - ! '>='
@@ -55,10 +70,15 @@ dependencies:
55
70
  version: '0'
56
71
  type: :development
57
72
  prerelease: false
58
- version_requirements: *70206035386480
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
59
79
  - !ruby/object:Gem::Dependency
60
80
  name: factory_girl
61
- requirement: &70206035385100 !ruby/object:Gem::Requirement
81
+ requirement: !ruby/object:Gem::Requirement
62
82
  none: false
63
83
  requirements:
64
84
  - - ! '>='
@@ -66,10 +86,15 @@ dependencies:
66
86
  version: '0'
67
87
  type: :development
68
88
  prerelease: false
69
- version_requirements: *70206035385100
89
+ version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ! '>='
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
70
95
  - !ruby/object:Gem::Dependency
71
96
  name: sqlite3
72
- requirement: &70206035374920 !ruby/object:Gem::Requirement
97
+ requirement: !ruby/object:Gem::Requirement
73
98
  none: false
74
99
  requirements:
75
100
  - - ! '>='
@@ -77,7 +102,12 @@ dependencies:
77
102
  version: '0'
78
103
  type: :development
79
104
  prerelease: false
80
- version_requirements: *70206035374920
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
81
111
  description: ! "\n ActivePress is a set of tools that help with accessing and\n
82
112
  \ manipulating the contents of a Wordpress database using Ruby.\n "
83
113
  email:
@@ -143,21 +173,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
143
173
  - - ! '>='
144
174
  - !ruby/object:Gem::Version
145
175
  version: '0'
146
- segments:
147
- - 0
148
- hash: -2588412272864828122
149
176
  required_rubygems_version: !ruby/object:Gem::Requirement
150
177
  none: false
151
178
  requirements:
152
179
  - - ! '>='
153
180
  - !ruby/object:Gem::Version
154
181
  version: '0'
155
- segments:
156
- - 0
157
- hash: -2588412272864828122
158
182
  requirements: []
159
183
  rubyforge_project: active_press
160
- rubygems_version: 1.8.6
184
+ rubygems_version: 1.8.24
161
185
  signing_key:
162
186
  specification_version: 3
163
187
  summary: ActivePress gives you access to Wordpress from Ruby