dhole 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d8e0e9a8352ec12b20b9e5627a6ac5b9af79f1c
4
- data.tar.gz: ba83f7fa819f8e9ce74c939fb54f55ffbd62508d
3
+ metadata.gz: fad7982921bbd52b8f4aee1acabaa8dc5025100e
4
+ data.tar.gz: a906701d7c62cca0e2c216fbf9f17390576ec0d1
5
5
  SHA512:
6
- metadata.gz: 02343b3b7ccfb477e323802aed90e6ed38435469cfe0eea26b842f629c7a6bc61b1b708f42bc6e21906fbca2f6c6b103c77fb9ade7e76686678ec44369052939
7
- data.tar.gz: ad28c850b7509344ec1599e4ad80cbe45b0cb0bb7a3d75002bcddac8817dfdd2019e6ad4d9056a2102ff58542f76f59512cbe616544b00c19ec7b6de1e2fa94e
6
+ metadata.gz: 97461fe302094a913cf53bda2192e39a1560c44b7ee194cf3767ba94f360ac07a0f949e13a4ef2516775530de5090385760ebcd05ff394d0cdad74c18aaac133
7
+ data.tar.gz: 13ccc3876363e39f24960a35e703ca7ef5c2f8c088f9aa400a914197221878eddaa6c8de143712e5cc61022b3b63a268ac0ab47797ce484fddda5bf4fd594f27
@@ -8,16 +8,22 @@ module Dhole
8
8
  CategoryLink.where(cl_to: cat_title) || []
9
9
  end
10
10
  def member_page_titles
11
- members.select{|cl| cl.cl_type == 'page'}.map {|cl| Page.find(cl.cl_from).page_title}
11
+ page_ids = members.select{|cl| cl.cl_type == 'page'}.map(&:cl_from)
12
+ Page.find(page_ids).map(&:page_title)
12
13
  end
13
14
  def member_file_titles
14
- members.select{|cl| cl.cl_type == 'file'}.map {|cl| Image.find(cl.cl_from).img_name}
15
+ file_page_ids = members.select{|cl| cl.cl_type == 'file'}.map(&:cl_from)
16
+ Page.find(file_page_ids).map(&:page_title) # img_name == page_title
15
17
  end
18
+ # careful! mass instantiation!
16
19
  def member_pages
17
- members.select{|cl| cl.cl_type == 'page'}.map {|cl| Page.find(cl.cl_from)}
20
+ page_ids = members.select{|cl| cl.cl_type == 'page'}.map(&:cl_from)
21
+ Page.find(page_ids)
18
22
  end
23
+ # careful! mass instantiation!
19
24
  def member_files
20
- members.select{|cl| cl.cl_type == 'file'}.map {|cl| Image.find(cl.cl_from)}
25
+ file_titles = members_file_titles
26
+ Image.find(file_titles)
21
27
  end
22
28
  # return only members of specified type ('file','page', 'subcat')
23
29
  def members_by_type(mtype)
@@ -7,5 +7,9 @@ module Dhole
7
7
  has_many :imagelinks, class_name: 'ImageLink', foreign_key: 'il_from'
8
8
  #has_many :images, through: :imagelinks, class_name: 'Image'
9
9
  belongs_to :latest_revision, class_name: 'Revision', foreign_key: 'page_latest'
10
+
11
+ def is_file?
12
+ page_namespace == 6
13
+ end
10
14
  end
11
15
  end
@@ -1,3 +1,3 @@
1
1
  module Dhole
2
- VERSION = "0.0.13"
2
+ VERSION = "0.0.14"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dhole
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Asaf Bartov