wpdb 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +6 -14
  2. data/README.md +4 -4
  3. data/lib/wpdb.rb +6 -1
  4. data/lib/wpdb/version.rb +1 -1
  5. metadata +5 -5
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- N2FlNmJhMzFjYmY2MGY3NGVhMGRmYWRiMGExZDU3MGFjZWViMzA0MQ==
5
- data.tar.gz: !binary |-
6
- ZjIwYjEwMzM4NjZjZjcyMWQ4MTNkYzMwOGY5Y2VlYzE4MGU5OTJmYQ==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- MTFmYWQ0ZGUyOTUyZGI4YzkxN2Y5MDdjYmM2YjIzNjEwNjE3YjA3NmYwODkz
10
- MmNlMjEyYjJjZGU4YzJjYTc3ZWJmOGQ0ODliYmQxMjc3NTRjMjkyNjRlMDkw
11
- ZGIzNzk4NmMwZTU4OGFlYjJmZDA2NTViZTJlYmZjODMyNjFkNGU=
12
- data.tar.gz: !binary |-
13
- OTJmMWJlMmE5MjJkMjhmNWZmZTEwYmQ5OTJiZWYwYjgwOWIxNWYzM2EyZTQ3
14
- ZjIzOWNmMTU1NzgxMjE2YTFjZWJjM2VhY2I0MjBjNWU5YzViNGJiODM3YjQx
15
- ZjVkYWE2ZDI3OGFkZGU0MTU0ZmZkZGQ5OWY0YTcwYWYzZjYwYWE=
2
+ SHA1:
3
+ metadata.gz: 511eea5cb41f7dff352b472c0075f58f120f61cb
4
+ data.tar.gz: a701f2b626cb392e2f5e13f00c0ddcd711dc183d
5
+ SHA512:
6
+ metadata.gz: 78cd4fc76618146b1952d0f50fa68ccc3f400401fc73d217c683cd3f50b5d461c20dec18ce1d7252c188bca5bdecccb493bb9f8679905348935223baab925882
7
+ data.tar.gz: 8c956e7938fdf2841f33e0b5248cbdf2a2b28b1a469ff91a25d912276f545e2c063a90898384bfd730a6f64bcc51f01ef6ebe516b95194548978d1a3b6291740
data/README.md CHANGED
@@ -16,8 +16,8 @@ ActiveRecord::Base.establish_connection(
16
16
  )
17
17
 
18
18
  wp_post = Wpdb::WpPost.posts.last
19
- puts wp_post.attributes
20
- puts wp_post.wp_comments.map(&:attributes)
21
- puts wp_post.categories
22
- puts wp_post.tags
19
+ puts wp_post.post_title
20
+ puts wp_post.wp_comments.count
21
+ puts wp_post.wp_categories
22
+ puts wp_post.wp_tags
23
23
  ```
@@ -6,7 +6,8 @@ module Wpdb
6
6
  has_many :wp_term_relationships, foreign_key: :object_id
7
7
  has_many :wp_term_taxonomies, through: :wp_term_relationships
8
8
 
9
- scope :posts, -> { where(post_type: 'post') }
9
+ scope :posts, -> { where(post_type: 'post') }
10
+ scope :pages, -> { where(post_type: 'page') }
10
11
  scope :published, -> { where(post_status: 'publish')}
11
12
 
12
13
  def wp_tags
@@ -20,6 +21,10 @@ module Wpdb
20
21
 
21
22
  class WpComment < ActiveRecord::Base
22
23
  belongs_to :wp_post
24
+
25
+ scope :approved, -> { where(comment_approved: "1") }
26
+ scope :spam, -> { where(comment_approved: "spam") }
27
+ scope :trash, -> { where(comment_approved: "trash") }
23
28
  end
24
29
 
25
30
  class WpTermRelationship < ActiveRecord::Base
@@ -1,3 +1,3 @@
1
1
  module Wpdb
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wpdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Behan
@@ -28,14 +28,14 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
@@ -77,12 +77,12 @@ require_paths:
77
77
  - lib
78
78
  required_ruby_version: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - ! '>='
85
+ - - '>='
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  requirements: []