ilog 0.2.2 → 0.3.0

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
  SHA256:
3
- metadata.gz: d90996ffe9b01418ea68764dcfa267de964960ae4948232bd792035dc3ab1f66
4
- data.tar.gz: e7edca0b6f865652727ccd91f2cc72d145972261cc643328fddc426b952a16fd
3
+ metadata.gz: a59357fc2d646d76b131e85407422af3723483b49485ca796615b5f1cc09927f
4
+ data.tar.gz: f62e7875dace03f9f9e29b8a28d0f0404f88279feb620845da45ace9d097a283
5
5
  SHA512:
6
- metadata.gz: 652ebdecc652d5d56bb6bfbb460b8f18e8350a522a6c8cac7e4a7c100bbed1274c77b691cadffb43d4490783a42909c1a68b46a89da6767c2e5eb7951567b77b
7
- data.tar.gz: e99111431450d50e432509c7293d3004dbab293ed15a5e018a53d170c0b2fef76d5b9d12ce9c1f06c414e0dda4057364aae1b366a2a7b1827e0074f9976578ce
6
+ metadata.gz: 4c812f5beae0e8745fe4e9c20551c88039ab7ee268af5fdc901fc047ec00fac37566db56e7900650eaf491280875425fd0609f9544815e46fd4e031fd98d0b41
7
+ data.tar.gz: ec0f17d1b33b42908290b875a55b0d69f01a5e388bba9c29ff69838ec5cc1265aa0df36343cdefe61edec6da3da47878fd32c9c45140db604e00ebd14cf9c307
@@ -15,12 +15,12 @@ module Ilog
15
15
  def perform function, params, input = nil
16
16
  # @posts = ::Post.send(function, input)
17
17
  # @stuffs = ::Stuff.send(function, input)
18
- @posts = ::Post.with_all
19
- @stuffs = ::Stuff.with_all
18
+ @posts = ::Post.includes(['title', 'slug', 'timestamp', 'peoples', 'keywords']).all
19
+ @stuffs = ::Stuff.includes(['title', 'slug', 'timestamp', 'peoples', 'keywords']).all
20
20
 
21
21
  @posts.merge @stuffs
22
22
 
23
- @items = @posts.order('timestamps.publish')
23
+ @items = @posts.order('timestamps.publish DESC')
24
24
  @items = self.paginate(@items, params)
25
25
 
26
26
  @count = {
@@ -69,7 +69,7 @@ module Ilog
69
69
 
70
70
  return {
71
71
  'current_page' => @page,
72
- 'data' => JSON.parse(@items_selected.to_json(:include => ::Post.dimensions + ::Post.groupings, :methods => [:kind, :uniq])),
72
+ 'data' => JSON.parse(@items_selected.to_json(:include => ['title', 'slug', 'timestamp', 'peoples', 'keywords'], :methods => [:kind, :uniq])),
73
73
  'first_page_url' => '', # $this->url(1),
74
74
  'from' => '', # $this->firstItem(),
75
75
  'last_page' => @last_page, #$this->lastPage(),
@@ -1,5 +1,6 @@
1
1
  module Item
2
- def self.retrive_all
3
- return self::with_all.all
4
- end
2
+ # !!!THE BELOW TRICK FROM PHP DIDN'T WORK!!!!
3
+ # def self.with_all
4
+ # self.includes(['title', 'slug', 'timestamp', 'people', 'keyword']).all
5
+ # end
5
6
  end
@@ -1,8 +1,7 @@
1
1
  require 'iatelier/models/book'
2
2
 
3
3
  class Post < Book
4
- include Item
5
- @@dimensions = ['title', 'slug', 'timestamp']
6
- @@groupings = ['peoples', 'keywords']
7
- @@roles = ['mention']
4
+ DIMENSIONS = ['title', 'slug', 'timestamp']
5
+ GROUPINGS = ['peoples', 'keywords']
6
+ ROLES = ['mention']
8
7
  end
@@ -2,7 +2,7 @@ require 'iatelier/models/book'
2
2
 
3
3
  class Stuff < Book
4
4
  include Item
5
- @@dimensions = ['title', 'slug', 'timestamp']
6
- @@groupings = ['peoples', 'keywords']
7
- @@roles = ['mention', 'author']
5
+ DIMENSIONS = ['title', 'slug', 'timestamp']
6
+ GROUPINGS = ['peoples', 'keywords']
7
+ ROLES = ['mention', 'author']
8
8
  end
data/lib/ilog/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ilog
2
- VERSION = "0.2.2"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ilog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - captainhusaynpinguin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-23 00:00:00.000000000 Z
11
+ date: 2020-01-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Providing a digital log implementation of traditional paper baed logs.
14
14
  email: