netzke-basepack 0.9.0 → 0.10.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/Gemfile +4 -1
- data/README.md +8 -3
- data/lib/netzke/basepack/data_adapters/active_record_adapter.rb +6 -6
- data/lib/netzke/basepack/grid.rb +1 -1
- data/lib/netzke/basepack/version.rb +1 -1
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05ea131f48d4e9160ab59013eab24339cf2a02ee
|
4
|
+
data.tar.gz: 4427f9834bed24c2bec295f3c544161bd6652946
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6778f91db1e4b96735be0bd362fd3c9a11cabab98e9b903ff0cd1813102bb4dd3ef995dbcbf0e85e2d4c8bf021e9a46eb916b82ae7c569ef982241a520249659
|
7
|
+
data.tar.gz: f90e509fd7744280fa280ac75283d7762919617575bb3b927bf36eb0a779f8c468015ea9a04d4c5e034d28a64bc382837da828d904a99d619ea6afb68681d925
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -9,6 +9,9 @@ gemspec
|
|
9
9
|
|
10
10
|
gem 'carrierwave'
|
11
11
|
|
12
|
+
gem 'protected_attributes'
|
13
|
+
|
14
|
+
# This partial duplication of gemspec is required for rails_app to run
|
12
15
|
group :test do
|
13
16
|
gem 'rspec'
|
14
17
|
gem 'factory_girl'
|
@@ -17,9 +20,9 @@ group :test do
|
|
17
20
|
gem 'cucumber-rails', require: false
|
18
21
|
gem 'database_cleaner'
|
19
22
|
gem 'rspec-rails'
|
23
|
+
gem 'netzke-testing', '0.10.0.rc1'
|
20
24
|
end
|
21
25
|
|
22
26
|
group :test, :development do
|
23
27
|
gem 'pry-rails'
|
24
|
-
gem 'netzke-testing'
|
25
28
|
end
|
data/README.md
CHANGED
@@ -1,9 +1,14 @@
|
|
1
|
-
# Netzke Basepack [![
|
1
|
+
# Netzke Basepack [![Build Status](https://travis-ci.org/netzke/netzke-basepack.png?branch=master)](https://travis-ci.org/netzke/netzke-basepack) [![Code Climate](https://codeclimate.com/github/netzke/netzke-basepack.png)](https://codeclimate.com/github/netzke/netzke-basepack)
|
2
2
|
|
3
3
|
[RDocs](http://rdoc.info/github/netzke/netzke-basepack)
|
4
4
|
|
5
5
|
A pack of pre-built [Netzke](http://netzke.org) components that can be used as building blocks for your webapps.
|
6
6
|
|
7
|
+
*Notes on versioning:*
|
8
|
+
* [![Gem Version](https://badge.fury.io/rb/netzke-basepack.png)](http://badge.fury.io/rb/netzke-basepack) is the latest *released* version
|
9
|
+
* for the version under development (master), check [version.rb](https://github.com/netzke/netzke-core/blob/master/lib/netzke/core/version.rb)
|
10
|
+
* for other versions, check corresponding [branches](https://github.com/netzke/netzke-core/branches)
|
11
|
+
|
7
12
|
## Included components
|
8
13
|
|
9
14
|
Basepack includes the following components:
|
@@ -23,8 +28,8 @@ enhancing any grid with live search functionality
|
|
23
28
|
|
24
29
|
## Requirements
|
25
30
|
|
26
|
-
* Ruby
|
27
|
-
* Rails ~>
|
31
|
+
* Ruby ~> 1.9.2
|
32
|
+
* Rails ~> 4.0.0
|
28
33
|
* Ext JS ~> 4.2.0
|
29
34
|
|
30
35
|
## Installation
|
@@ -50,7 +50,7 @@ module Netzke::Basepack::DataAdapters
|
|
50
50
|
# addressing the n+1 query problem
|
51
51
|
columns.each do |c|
|
52
52
|
assoc, method = c[:name].split('__')
|
53
|
-
relation = relation.includes(assoc.to_sym) if method
|
53
|
+
relation = relation.includes(assoc.to_sym).references(assoc.to_sym) if method
|
54
54
|
end
|
55
55
|
|
56
56
|
# apply sorting if needed
|
@@ -84,7 +84,7 @@ module Netzke::Basepack::DataAdapters
|
|
84
84
|
relation.order("#{@model_class.table_name}.#{assoc} #{dir}")
|
85
85
|
else
|
86
86
|
assoc = @model_class.reflect_on_association(assoc.to_sym)
|
87
|
-
relation.includes(assoc.name).order("#{assoc.klass.table_name}.#{method} #{dir}")
|
87
|
+
relation.includes(assoc.name).references(assoc.klass.table_name.to_sym).order("#{assoc.klass.table_name}.#{method} #{dir}")
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
@@ -98,7 +98,7 @@ module Netzke::Basepack::DataAdapters
|
|
98
98
|
# addressing the n+1 query problem
|
99
99
|
columns.each do |c|
|
100
100
|
assoc, method = c[:name].split('__')
|
101
|
-
relation = relation.includes(assoc.to_sym) if method
|
101
|
+
relation = relation.includes(assoc.to_sym).references(assoc.to_sym) if method
|
102
102
|
end
|
103
103
|
|
104
104
|
relation.count
|
@@ -128,7 +128,7 @@ module Netzke::Basepack::DataAdapters
|
|
128
128
|
if assoc
|
129
129
|
# Options for an asssociation attribute
|
130
130
|
|
131
|
-
relation = assoc.klass.
|
131
|
+
relation = assoc.klass.all
|
132
132
|
relation = relation.extend_with(attr[:scope]) if attr[:scope]
|
133
133
|
|
134
134
|
if assoc.klass.column_names.include?(assoc_method)
|
@@ -140,7 +140,7 @@ module Netzke::Basepack::DataAdapters
|
|
140
140
|
else
|
141
141
|
query.downcase!
|
142
142
|
# an expensive search!
|
143
|
-
relation.
|
143
|
+
relation.to_a.map{ |r| [r.id, r.send(assoc_method)] }.select{ |id,value| value.to_s.downcase.include?(query) }
|
144
144
|
end
|
145
145
|
|
146
146
|
else
|
@@ -304,7 +304,7 @@ module Netzke::Basepack::DataAdapters
|
|
304
304
|
|
305
305
|
# An ActiveRecord::Relation instance encapsulating all the necessary conditions.
|
306
306
|
def get_relation(params = {})
|
307
|
-
relation = @model_class.
|
307
|
+
relation = @model_class.all
|
308
308
|
|
309
309
|
query = params[:query]
|
310
310
|
|
data/lib/netzke/basepack/grid.rb
CHANGED
@@ -402,7 +402,7 @@ module Netzke
|
|
402
402
|
if f[:value].is_a?(Hash)
|
403
403
|
val = {}
|
404
404
|
f[:value].each do |k,v|
|
405
|
-
val[k] = (v.is_a?(Time) || v.is_a?(Date) || v.is_a?(ActiveSupport::TimeWithZone)) ?
|
405
|
+
val[k] = (v.is_a?(Time) || v.is_a?(Date) || v.is_a?(ActiveSupport::TimeWithZone)) ? Netzke::Core::JsonLiteral.new("new Date('#{v.strftime("%m/%d/%Y")}')") : v
|
406
406
|
end
|
407
407
|
else
|
408
408
|
val = f[:value]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: netzke-basepack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Gorin
|
@@ -14,30 +14,30 @@ dependencies:
|
|
14
14
|
name: netzke-core
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.10.0.rc2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.10.0.rc2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 4.0.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
|
-
version:
|
40
|
+
version: 4.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sqlite3
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: netzke-testing
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - '
|
87
|
+
- - '='
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 0.10.0.rc1
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - '
|
94
|
+
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 0.10.0.rc1
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rspec-rails
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -203,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
203
203
|
- !ruby/object:Gem::Version
|
204
204
|
version: 1.3.4
|
205
205
|
requirements: []
|
206
|
-
rubyforge_project:
|
206
|
+
rubyforge_project:
|
207
207
|
rubygems_version: 2.1.10
|
208
208
|
signing_key:
|
209
209
|
specification_version: 4
|