baza_models 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/baza_models.gemspec +3 -3
- data/lib/baza_models/model.rb +1 -1
- data/lib/baza_models/query.rb +5 -0
- data/lib/baza_models/ransacker.rb +0 -2
- data/spec/baza_models/query_spec.rb +3 -1
- data/spec/baza_models/ransacker_spec.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6dbce57502f93c9b90c5d5dba534b57b4db38d2a
|
4
|
+
data.tar.gz: 2b6dc34ac4dbfcfeb36b38ad8e49f07ea80c41ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90cdb2022ec8e2b869777e34cf83752f6074f045c1fff4c1489e013f3956b2f192410d56847401e9f954a6f92f44794e849ad809243ea274bd5e6aee5c7d5bdb
|
7
|
+
data.tar.gz: 3b6c290cc503f5314a8bcf3769ab003ea27d39b297bbf11fcd407f9bc05d903adabd722b37455c1e37cce72924cc538512e4dfb8f105ed95d09dd4c63a0208f6
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/baza_models.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: baza_models 0.0.
|
5
|
+
# stub: baza_models 0.0.5 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "baza_models"
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.5"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["kaspernj"]
|
14
|
-
s.date = "2016-04-
|
14
|
+
s.date = "2016-04-09"
|
15
15
|
s.description = "ActiveRecord like models for the Baza database framework"
|
16
16
|
s.email = "k@spernj.org"
|
17
17
|
s.extra_rdoc_files = [
|
data/lib/baza_models/model.rb
CHANGED
@@ -44,7 +44,7 @@ class BazaModels::Model
|
|
44
44
|
end
|
45
45
|
|
46
46
|
QUERY_METHODS = [
|
47
|
-
:all, :any?, :each, :empty?, :none?, :count, :find, :first, :find_first, :last, :length, :select, :includes,
|
47
|
+
:all, :any?, :each, :empty?, :none?, :count, :find, :first, :find_first, :last, :length, :size, :select, :includes,
|
48
48
|
:joins, :group, :where, :order, :limit, :to_a, :accessible_by, :ransack
|
49
49
|
].freeze
|
50
50
|
QUERY_METHODS.each do |query_method|
|
data/lib/baza_models/query.rb
CHANGED
@@ -91,18 +91,20 @@ describe BazaModels::Query do
|
|
91
91
|
end
|
92
92
|
end
|
93
93
|
|
94
|
-
it "#any? #empty? #none? #count #length" do
|
94
|
+
it "#any? #empty? #none? #count #length #size" do
|
95
95
|
expect(User.any?).to eq false
|
96
96
|
expect(User.empty?).to eq true
|
97
97
|
expect(User.none?).to eq true
|
98
98
|
expect(User.count).to eq 0
|
99
99
|
expect(User.length).to eq 0
|
100
|
+
expect(User.size).to eq 0
|
100
101
|
user.save!
|
101
102
|
expect(User.any?).to eq true
|
102
103
|
expect(User.empty?).to eq false
|
103
104
|
expect(User.none?).to eq false
|
104
105
|
expect(User.count).to eq 1
|
105
106
|
expect(User.length).to eq 1
|
107
|
+
expect(User.size).to eq 1
|
106
108
|
end
|
107
109
|
|
108
110
|
it "#find" do
|
@@ -40,4 +40,8 @@ describe BazaModels::Query do
|
|
40
40
|
query = Person.ransack(user_organization_name_cont: "Test")
|
41
41
|
expect(query.result.to_a).to eq [person]
|
42
42
|
end
|
43
|
+
|
44
|
+
it "ignores unknown parameters and doesn't raise exceptions" do
|
45
|
+
Person.ransack(custom_something: "Test").result
|
46
|
+
end
|
43
47
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: baza_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kaspernj
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: array_enumerator
|