forest_liana 1.7.10 → 1.8.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
  SHA1:
3
- metadata.gz: 3f2a59c7557554688b8b010fb63ddbee7abe9bb5
4
- data.tar.gz: 549c364c345a1d5208e40bd122b9ec89e19c7dae
3
+ metadata.gz: 42d70331dad05c58e7417e826f585cb24c9fd97e
4
+ data.tar.gz: eb76f6900c25d8bc8379231d656ab366d019880b
5
5
  SHA512:
6
- metadata.gz: 5f79cc38a20bdb0c16433f462f647f52f484590058e1a8c187f52e7f39f23b8252f0585d94ad2fd2fc4d5bb13e524f55e719bb75fd0245f1172a44130cad7546
7
- data.tar.gz: 88a5d634939beeaadae83972945774297477e3fa52585f1b951e69ceb09086ee525b8bbf8ba3f46e4f4d304b38ed452c581cf7eacb51066d4791eacffc9e091c
6
+ metadata.gz: 66a1d6a7251d16a8c997d32e25ee65e868482c3e91c2256f6bcc7125104fef996cdd65803f461220696a93509af5eb738a9475fa4619ba5c829a59587ca1be63
7
+ data.tar.gz: 046b1d338e24e6a2523640617df0c939c8226452a8c4204f7f0312bc5795573f0120ca5bea4e8d4f63705445a3af28d7272c0e24107c6efa25f701132bfb581c
@@ -56,6 +56,10 @@ module ForestLiana
56
56
  end
57
57
  end
58
58
 
59
+ def initialize(is_smart_collection = false)
60
+ @is_smart_collection = is_smart_collection
61
+ end
62
+
59
63
  def serializer_for(active_record_class)
60
64
  serializer = Class.new {
61
65
  include JSONAPI::Serializer
@@ -154,73 +158,75 @@ module ForestLiana
154
158
  end
155
159
  }
156
160
 
157
- attributes(active_record_class).each do |attribute|
158
- serializer.attribute(attribute)
159
- end
161
+ unless @is_smart_collection
162
+ attributes(active_record_class).each do |attribute|
163
+ serializer.attribute(attribute)
164
+ end
160
165
 
161
- # NOTICE: Format time type fields during the serialization.
162
- attributes_time(active_record_class).each do |attribute|
163
- serializer.attribute(attribute) do |x|
164
- value = object.send(attribute)
165
- if value
166
- match = /(\d{2}:\d{2}:\d{2})/.match(value.to_s)
167
- (match && match[1]) ? match[1] : nil
168
- else
169
- nil
166
+ # NOTICE: Format time type fields during the serialization.
167
+ attributes_time(active_record_class).each do |attribute|
168
+ serializer.attribute(attribute) do |x|
169
+ value = object.send(attribute)
170
+ if value
171
+ match = /(\d{2}:\d{2}:\d{2})/.match(value.to_s)
172
+ (match && match[1]) ? match[1] : nil
173
+ else
174
+ nil
175
+ end
170
176
  end
171
177
  end
172
- end
173
178
 
174
- # NOTICE: Format serialized fields.
175
- attributes_serialized(active_record_class).each do |attribute, serialization|
176
- serializer.attribute(attribute) do |x|
177
- value = object.send(attribute)
178
- value ? value.to_json : nil
179
+ # NOTICE: Format serialized fields.
180
+ attributes_serialized(active_record_class).each do |attr, serialization|
181
+ serializer.attribute(attr) do |x|
182
+ value = object.send(attr)
183
+ value ? value.to_json : nil
184
+ end
179
185
  end
180
- end
181
186
 
182
- # NOTICE: Format CarrierWave url attribute
183
- if active_record_class.respond_to?(:mount_uploader)
184
- active_record_class.uploaders.each do |key, value|
185
- serializer.attribute(key) { |x| object.send(key).try(:url) }
187
+ # NOTICE: Format CarrierWave url attribute
188
+ if active_record_class.respond_to?(:mount_uploader)
189
+ active_record_class.uploaders.each do |key, value|
190
+ serializer.attribute(key) { |x| object.send(key).try(:url) }
191
+ end
186
192
  end
187
- end
188
193
 
189
- # NOTICE: Format Paperclip url attribute
190
- if active_record_class.respond_to?(:attachment_definitions)
191
- active_record_class.attachment_definitions.each do |key, value|
192
- serializer.attribute(key) { |x| object.send(key) }
194
+ # NOTICE: Format Paperclip url attribute
195
+ if active_record_class.respond_to?(:attachment_definitions)
196
+ active_record_class.attachment_definitions.each do |key, value|
197
+ serializer.attribute(key) { |x| object.send(key) }
198
+ end
193
199
  end
194
- end
195
200
 
196
- # NOTICE: Format ActsAsTaggable attribute
197
- if active_record_class.respond_to?(:acts_as_taggable) &&
198
- active_record_class.acts_as_taggable.respond_to?(:to_a)
199
- active_record_class.acts_as_taggable.to_a.each do |key, value|
200
- serializer.attribute(key) do |x|
201
- object.send(key).map(&:name)
201
+ # NOTICE: Format ActsAsTaggable attribute
202
+ if active_record_class.respond_to?(:acts_as_taggable) &&
203
+ active_record_class.acts_as_taggable.respond_to?(:to_a)
204
+ active_record_class.acts_as_taggable.to_a.each do |key, value|
205
+ serializer.attribute(key) do |x|
206
+ object.send(key).map(&:name)
207
+ end
202
208
  end
203
209
  end
204
- end
205
210
 
206
- SchemaUtils.associations(active_record_class).each do |a|
207
- begin
208
- if SchemaUtils.model_included?(a.klass)
209
- serializer.send(serializer_association(a), a.name) {
210
- if [:has_one, :belongs_to].include?(a.macro)
211
- begin
212
- object.send(a.name)
213
- rescue ActiveRecord::RecordNotFound
214
- nil
211
+ SchemaUtils.associations(active_record_class).each do |a|
212
+ begin
213
+ if SchemaUtils.model_included?(a.klass)
214
+ serializer.send(serializer_association(a), a.name) {
215
+ if [:has_one, :belongs_to].include?(a.macro)
216
+ begin
217
+ object.send(a.name)
218
+ rescue ActiveRecord::RecordNotFound
219
+ nil
220
+ end
221
+ else
222
+ []
215
223
  end
216
- else
217
- []
218
- end
219
- }
224
+ }
225
+ end
226
+ rescue NameError
227
+ # NOTICE: Let this error silent, a bad association warning will be
228
+ # displayed in the schema adapter.
220
229
  end
221
- rescue NameError
222
- # NOTICE: Let this error silent, a bad association warning will be
223
- # displayed in the schema adapter.
224
230
  end
225
231
  end
226
232
 
@@ -281,12 +287,16 @@ module ForestLiana
281
287
  end
282
288
 
283
289
  def attributes(active_record_class)
290
+ return [] if @is_smart_collection
291
+
284
292
  active_record_class.column_names.select do |column_name|
285
293
  !association?(active_record_class, column_name)
286
294
  end
287
295
  end
288
296
 
289
297
  def attributes_time(active_record_class)
298
+ return [] if @is_smart_collection
299
+
290
300
  active_record_class.column_names.select do |column_name|
291
301
  if Rails::VERSION::MAJOR > 4
292
302
  active_record_class.column_for_attribute(column_name).type == :time
@@ -297,6 +307,8 @@ module ForestLiana
297
307
  end
298
308
 
299
309
  def attributes_serialized(active_record_class)
310
+ return [] if @is_smart_collection
311
+
300
312
  if Rails::VERSION::MAJOR >= 5
301
313
  attributes(active_record_class).select do |attribute|
302
314
  active_record_class.type_for_attribute(attribute).class ==
@@ -4,8 +4,8 @@ module ForestLiana
4
4
  @resource = resource
5
5
  @params = params
6
6
  @count_needs_includes = false
7
- @field_names_requested = field_names_requested
8
7
  @current_collection = get_current_collection(@resource.table_name)
8
+ @field_names_requested = field_names_requested
9
9
  get_segment()
10
10
  end
11
11
 
@@ -47,9 +47,22 @@ module ForestLiana
47
47
  includes = SchemaUtils.one_associations(@resource)
48
48
  .select { |association| SchemaUtils.model_included?(association.klass) }
49
49
  .map(&:name)
50
+ includes_for_smart_search = []
51
+
52
+ if @current_collection && @current_collection.search_fields
53
+ includes_for_smart_search = @current_collection.search_fields
54
+ .select { |field| field.include? '.' }
55
+ .map { |field| field.split('.').first.to_sym }
56
+
57
+ includes_has_many = SchemaUtils.many_associations(@resource)
58
+ .select { |association| SchemaUtils.model_included?(association.klass) }
59
+ .map(&:name)
60
+
61
+ includes_for_smart_search = includes_for_smart_search & includes_has_many
62
+ end
50
63
 
51
64
  if @field_names_requested
52
- includes & @field_names_requested
65
+ (includes & @field_names_requested).concat(includes_for_smart_search)
53
66
  else
54
67
  includes
55
68
  end
@@ -83,7 +83,8 @@ module ForestLiana
83
83
  end
84
84
 
85
85
  if (@params['searchExtended'].to_i == 1)
86
- SchemaUtils.one_associations(@resource).map(&:name).each do |association|
86
+ SchemaUtils.one_associations(@resource).map(&:name).each do
87
+ |association|
87
88
  if @collection.search_fields
88
89
  association_search = @collection.search_fields.map do |field|
89
90
  if field.include?('.') && field.split('.')[0] == association.to_s
@@ -97,11 +98,34 @@ module ForestLiana
97
98
  resource.klass.columns.each do |column|
98
99
  if !(column.respond_to?(:array) && column.array) &&
99
100
  (column.type == :string || column.type == :text)
100
- column_name = format_column_name(resource.table_name,
101
- column.name)
102
- if @collection.search_fields.nil? || (association_search && association_search.include?(column.name))
103
- conditions << "LOWER(#{column_name}) LIKE " +
104
- "'%#{@params[:search].downcase}%'"
101
+ if @collection.search_fields.nil? || (association_search &&
102
+ association_search.include?(column.name))
103
+ conditions << association_search_condition(resource.table_name,
104
+ column.name)
105
+ end
106
+ end
107
+ end
108
+ end
109
+ end
110
+
111
+ if @collection.search_fields
112
+ SchemaUtils.many_associations(@resource).map(&:name).each do
113
+ |association|
114
+ association_search = @collection.search_fields.map do |field|
115
+ if field.include?('.') && field.split('.')[0] == association.to_s
116
+ field.split('.')[1]
117
+ end
118
+ end
119
+ association_search = association_search.compact
120
+ unless association_search.empty?
121
+ resource = @resource.reflect_on_association(association.to_sym)
122
+ resource.klass.columns.each do |column|
123
+ if !(column.respond_to?(:array) && column.array) &&
124
+ (column.type == :string || column.type == :text)
125
+ if association_search.include?(column.name)
126
+ conditions << association_search_condition(resource.table_name,
127
+ column.name)
128
+ end
105
129
  end
106
130
  end
107
131
  end
@@ -115,6 +139,11 @@ module ForestLiana
115
139
  @records
116
140
  end
117
141
 
142
+ def association_search_condition table_name, column_name
143
+ column_name = format_column_name(table_name, column_name)
144
+ "LOWER(#{column_name}) LIKE '%#{@params[:search].downcase}%'"
145
+ end
146
+
118
147
  def filter_param
119
148
  if @params[:filterType] && @params[:filter]
120
149
  conditions = []
@@ -11,6 +11,16 @@ module ForestLiana::Collection
11
11
  self.collection_name = collection_name.to_s
12
12
  self.is_read_only = opts[:read_only] || false
13
13
  self.is_searchable = opts[:is_searchable] || false
14
+
15
+ # NOTICE: Creates dynamically the serializer if it's a Smart Collection.
16
+ if smart_collection? &&
17
+ !ForestLiana::UserSpace.const_defined?(serializer_name)
18
+
19
+ ForestLiana.names_overriden[self] = self.collection_name.to_s
20
+
21
+ ForestLiana::SerializerFactory.new(is_smart_collection: true)
22
+ .serializer_for(self)
23
+ end
14
24
  end
15
25
 
16
26
  def action(name, opts = {})
@@ -40,11 +50,14 @@ module ForestLiana::Collection
40
50
  field: name,
41
51
  :'is-read-only' => opts[:read_only],
42
52
  :'is-searchable' => opts['is_searchable'],
53
+ :'is-sortable' => opts[:is_sortable],
43
54
  :'is-virtual' => true
44
55
  })
45
56
 
46
- if serializer_name &&
47
- ForestLiana::UserSpace.const_defined?(serializer_name)
57
+ define_method(name) { self.data[name] } if smart_collection?
58
+
59
+ if serializer_name && ForestLiana::UserSpace.const_defined?(
60
+ serializer_name)
48
61
  ForestLiana::UserSpace.const_get(serializer_name).class_eval do
49
62
  attribute(name, &block)
50
63
  end
@@ -58,8 +71,10 @@ module ForestLiana::Collection
58
71
  type: ['String']
59
72
  })
60
73
 
61
- if serializer_name &&
62
- ForestLiana::UserSpace.const_defined?(serializer_name)
74
+ define_method(name) { self.data[name] } if smart_collection?
75
+
76
+ if serializer_name && ForestLiana::UserSpace.const_defined?(
77
+ serializer_name)
63
78
  ForestLiana::UserSpace.const_get(serializer_name).class_eval do
64
79
  has_many(name, name: name)
65
80
  end
@@ -73,6 +88,8 @@ module ForestLiana::Collection
73
88
  type: 'String'
74
89
  })
75
90
 
91
+ define_method(name) { self.data[name] } if smart_collection?
92
+
76
93
  if serializer_name && ForestLiana::UserSpace.const_defined?(
77
94
  serializer_name)
78
95
  ForestLiana::UserSpace.const_get(serializer_name).class_eval do
@@ -109,14 +126,17 @@ module ForestLiana::Collection
109
126
  end
110
127
 
111
128
  def serializer_name
112
- return if active_record_class.blank?
113
- class_name = active_record_class.table_name.classify
114
- module_name = class_name.deconstantize
129
+ if smart_collection?
130
+ "#{collection_name.to_s.classify}Serializer"
131
+ else
132
+ class_name = active_record_class.table_name.classify
133
+ module_name = class_name.deconstantize
115
134
 
116
- name = module_name if module_name
117
- name += class_name.demodulize
135
+ name = module_name if module_name
136
+ name += class_name.demodulize
118
137
 
119
- "ForestLiana::UserSpace::#{name}Serializer"
138
+ "ForestLiana::UserSpace::#{name}Serializer"
139
+ end
120
140
  end
121
141
 
122
142
  def serializer_name_for_reference(reference)
@@ -129,5 +149,15 @@ module ForestLiana::Collection
129
149
 
130
150
  "ForestLiana::UserSpace::#{name}Serializer"
131
151
  end
152
+
153
+ def smart_collection?
154
+ !active_record_class
155
+ end
156
+ end
157
+
158
+ attr_accessor :data
159
+
160
+ def initialize(data)
161
+ self.data = data
132
162
  end
133
163
  end
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "1.7.10"
2
+ VERSION = "1.8.0"
3
3
  end
Binary file
@@ -92840,3 +92840,429 @@ ForestLiana::PieStatGetterTest: test_Pie_stat_getter_with_an_aggregate_on_a_fore
92840
92840
  ForestLiana::RouteTest: test_Routes
92841
92841
  -----------------------------------
92842
92842
   (0.1ms) rollback transaction
92843
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
92844
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
92845
+  (0.1ms)  SELECT sql
92846
+ FROM sqlite_master
92847
+ WHERE name='index_belongs_to_class_name_fields_on_foo_id' AND type='index'
92848
+ UNION ALL
92849
+ SELECT sql
92850
+ FROM sqlite_temp_master
92851
+ WHERE name='index_belongs_to_class_name_fields_on_foo_id' AND type='index'
92852
+ 
92853
+  (0.1ms) SELECT sql
92854
+ FROM sqlite_master
92855
+ WHERE name='index_belongs_to_fields_on_has_many_field_id' AND type='index'
92856
+ UNION ALL
92857
+ SELECT sql
92858
+ FROM sqlite_temp_master
92859
+ WHERE name='index_belongs_to_fields_on_has_many_field_id' AND type='index'
92860
+
92861
+  (0.2ms)  SELECT sql
92862
+ FROM sqlite_master
92863
+ WHERE name='index_belongs_to_fields_on_has_many_class_name_field_id' AND type='index'
92864
+ UNION ALL
92865
+ SELECT sql
92866
+ FROM sqlite_temp_master
92867
+ WHERE name='index_belongs_to_fields_on_has_many_class_name_field_id' AND type='index'
92868
+ 
92869
+  (0.1ms) SELECT sql
92870
+ FROM sqlite_master
92871
+ WHERE name='index_belongs_to_fields_on_has_one_field_id' AND type='index'
92872
+ UNION ALL
92873
+ SELECT sql
92874
+ FROM sqlite_temp_master
92875
+ WHERE name='index_belongs_to_fields_on_has_one_field_id' AND type='index'
92876
+
92877
+  (0.4ms)  SELECT sql
92878
+ FROM sqlite_master
92879
+ WHERE name='index_has_many_fields_on_has_many_through_field_id' AND type='index'
92880
+ UNION ALL
92881
+ SELECT sql
92882
+ FROM sqlite_temp_master
92883
+ WHERE name='index_has_many_fields_on_has_many_through_field_id' AND type='index'
92884
+ 
92885
+  (0.1ms) SELECT sql
92886
+ FROM sqlite_master
92887
+ WHERE name='index_polymorphic_fields_on_has_one_field_id' AND type='index'
92888
+ UNION ALL
92889
+ SELECT sql
92890
+ FROM sqlite_temp_master
92891
+ WHERE name='index_polymorphic_fields_on_has_one_field_id' AND type='index'
92892
+
92893
+  (0.1ms)  SELECT sql
92894
+ FROM sqlite_master
92895
+ WHERE name='index_trees_on_owner_id' AND type='index'
92896
+ UNION ALL
92897
+ SELECT sql
92898
+ FROM sqlite_temp_master
92899
+ WHERE name='index_trees_on_owner_id' AND type='index'
92900
+ 
92901
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
92902
+  (0.1ms) begin transaction
92903
+ Fixture Delete (1.2ms) DELETE FROM "belongs_to_fields"
92904
+ Fixture Insert (0.4ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (1, 1, 1)
92905
+ Fixture Insert (0.1ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (2, 2, 1)
92906
+ Fixture Insert (0.1ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (3, 3, 1)
92907
+ Fixture Insert (0.1ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (4, 4, 2)
92908
+ Fixture Insert (0.1ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (5, 5, 2)
92909
+ Fixture Insert (0.1ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (6, 6, 2)
92910
+ Fixture Insert (0.1ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (7, 7, 3)
92911
+ Fixture Insert (0.1ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (8, 8, 3)
92912
+ Fixture Insert (0.0ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (9, 9, 3)
92913
+ Fixture Insert (0.0ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (10, 10, 4)
92914
+ Fixture Insert (0.0ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (11, 11, 4)
92915
+ Fixture Insert (0.1ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (12, 12, 4)
92916
+ Fixture Insert (0.0ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (13, 13, 5)
92917
+ Fixture Insert (0.0ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (14, 14, 5)
92918
+ Fixture Insert (0.0ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (15, 15, 5)
92919
+ Fixture Insert (0.0ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (16, 16, 6)
92920
+ Fixture Insert (0.0ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (17, 17, 6)
92921
+ Fixture Insert (0.1ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (18, 18, 6)
92922
+ Fixture Insert (0.0ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (19, 19, 7)
92923
+ Fixture Insert (0.1ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (20, 20, 7)
92924
+ Fixture Insert (0.0ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (21, 21, 7)
92925
+ Fixture Insert (0.0ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (22, 22, 7)
92926
+ Fixture Insert (0.1ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (23, 23, 8)
92927
+ Fixture Insert (0.0ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (24, 24, 8)
92928
+ Fixture Insert (0.0ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (25, 25, 9)
92929
+ Fixture Insert (0.0ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (26, 26, 9)
92930
+ Fixture Insert (0.0ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (27, 27, 9)
92931
+ Fixture Insert (0.0ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (28, 28, 10)
92932
+ Fixture Insert (0.0ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (29, 29, 10)
92933
+ Fixture Insert (0.1ms) INSERT INTO "belongs_to_fields" ("id", "has_one_field_id", "has_many_field_id") VALUES (30, 30, 10)
92934
+ Fixture Delete (0.7ms) DELETE FROM "has_many_fields"
92935
+ Fixture Insert (0.2ms) INSERT INTO "has_many_fields" ("id") VALUES (1)
92936
+ Fixture Insert (0.1ms) INSERT INTO "has_many_fields" ("id") VALUES (2)
92937
+ Fixture Insert (0.1ms) INSERT INTO "has_many_fields" ("id") VALUES (3)
92938
+ Fixture Insert (0.1ms) INSERT INTO "has_many_fields" ("id") VALUES (4)
92939
+ Fixture Insert (0.1ms) INSERT INTO "has_many_fields" ("id", "has_many_through_field_id") VALUES (5, 3)
92940
+ Fixture Insert (0.1ms) INSERT INTO "has_many_fields" ("id", "has_many_through_field_id") VALUES (6, 2)
92941
+ Fixture Insert (0.1ms) INSERT INTO "has_many_fields" ("id") VALUES (7)
92942
+ Fixture Insert (0.2ms) INSERT INTO "has_many_fields" ("id", "has_many_through_field_id") VALUES (8, 2)
92943
+ Fixture Insert (0.2ms) INSERT INTO "has_many_fields" ("id") VALUES (9)
92944
+ Fixture Insert (0.6ms) INSERT INTO "has_many_fields" ("id") VALUES (10)
92945
+ Fixture Delete (0.7ms) DELETE FROM "has_many_through_fields"
92946
+ Fixture Insert (0.2ms) INSERT INTO "has_many_through_fields" ("id") VALUES (1)
92947
+ Fixture Insert (0.1ms) INSERT INTO "has_many_through_fields" ("id") VALUES (2)
92948
+ Fixture Insert (0.1ms) INSERT INTO "has_many_through_fields" ("id") VALUES (3)
92949
+ Fixture Insert (0.1ms) INSERT INTO "has_many_through_fields" ("id") VALUES (4)
92950
+ Fixture Insert (0.1ms) INSERT INTO "has_many_through_fields" ("id") VALUES (5)
92951
+ Fixture Insert (0.1ms) INSERT INTO "has_many_through_fields" ("id") VALUES (6)
92952
+ Fixture Insert (0.1ms) INSERT INTO "has_many_through_fields" ("id") VALUES (7)
92953
+ Fixture Insert (0.1ms) INSERT INTO "has_many_through_fields" ("id") VALUES (8)
92954
+ Fixture Insert (0.1ms) INSERT INTO "has_many_through_fields" ("id") VALUES (9)
92955
+ Fixture Insert (0.1ms) INSERT INTO "has_many_through_fields" ("id") VALUES (10)
92956
+ Fixture Delete (0.4ms) DELETE FROM "has_one_fields"
92957
+ Fixture Insert (0.1ms) INSERT INTO "has_one_fields" ("id") VALUES (1)
92958
+ Fixture Insert (0.1ms) INSERT INTO "has_one_fields" ("id") VALUES (2)
92959
+ Fixture Insert (0.1ms) INSERT INTO "has_one_fields" ("id") VALUES (3)
92960
+ Fixture Insert (0.1ms) INSERT INTO "has_one_fields" ("id") VALUES (4)
92961
+ Fixture Insert (0.1ms) INSERT INTO "has_one_fields" ("id") VALUES (5)
92962
+ Fixture Insert (0.1ms) INSERT INTO "has_one_fields" ("id") VALUES (6)
92963
+ Fixture Insert (0.1ms) INSERT INTO "has_one_fields" ("id") VALUES (7)
92964
+ Fixture Insert (0.1ms) INSERT INTO "has_one_fields" ("id") VALUES (8)
92965
+ Fixture Insert (0.1ms) INSERT INTO "has_one_fields" ("id") VALUES (9)
92966
+ Fixture Insert (0.1ms) INSERT INTO "has_one_fields" ("id") VALUES (10)
92967
+ Fixture Insert (0.1ms) INSERT INTO "has_one_fields" ("id") VALUES (11)
92968
+ Fixture Insert (0.1ms) INSERT INTO "has_one_fields" ("id") VALUES (12)
92969
+ Fixture Insert (0.1ms) INSERT INTO "has_one_fields" ("id") VALUES (13)
92970
+ Fixture Insert (0.1ms) INSERT INTO "has_one_fields" ("id") VALUES (14)
92971
+ Fixture Insert (0.1ms) INSERT INTO "has_one_fields" ("id") VALUES (15)
92972
+ Fixture Insert (0.1ms) INSERT INTO "has_one_fields" ("id") VALUES (16)
92973
+ Fixture Insert (0.2ms) INSERT INTO "has_one_fields" ("id") VALUES (17)
92974
+ Fixture Insert (0.0ms) INSERT INTO "has_one_fields" ("id") VALUES (18)
92975
+ Fixture Insert (0.0ms) INSERT INTO "has_one_fields" ("id") VALUES (19)
92976
+ Fixture Insert (0.0ms) INSERT INTO "has_one_fields" ("id") VALUES (20)
92977
+ Fixture Insert (0.0ms) INSERT INTO "has_one_fields" ("id") VALUES (21)
92978
+ Fixture Insert (0.0ms) INSERT INTO "has_one_fields" ("id") VALUES (22)
92979
+ Fixture Insert (0.0ms) INSERT INTO "has_one_fields" ("id") VALUES (23)
92980
+ Fixture Insert (0.0ms) INSERT INTO "has_one_fields" ("id") VALUES (24)
92981
+ Fixture Insert (0.0ms) INSERT INTO "has_one_fields" ("id") VALUES (25)
92982
+ Fixture Insert (0.0ms) INSERT INTO "has_one_fields" ("id") VALUES (26)
92983
+ Fixture Insert (0.0ms) INSERT INTO "has_one_fields" ("id") VALUES (27)
92984
+ Fixture Insert (0.0ms) INSERT INTO "has_one_fields" ("id") VALUES (28)
92985
+ Fixture Insert (0.1ms) INSERT INTO "has_one_fields" ("id") VALUES (29)
92986
+ Fixture Insert (0.0ms) INSERT INTO "has_one_fields" ("id") VALUES (30)
92987
+ Fixture Delete (0.3ms) DELETE FROM "owners"
92988
+ Fixture Insert (0.1ms) INSERT INTO "owners" ("id", "name", "created_at", "updated_at") VALUES (1, 'Sandro Munda', '2016-05-30 09:00:00.000000', '2017-06-27 20:00:00.000000')
92989
+ Fixture Insert (0.0ms) INSERT INTO "owners" ("id", "name", "created_at", "updated_at") VALUES (2, 'Arnaud Besnier', '2017-05-02 09:00:00.000000', '2017-06-28 08:00:00.000000')
92990
+ Fixture Insert (0.0ms) INSERT INTO "owners" ("id", "name", "created_at", "updated_at") VALUES (3, 'John Doe', '2015-05-02 09:00:00.000000', '2016-06-28 08:00:00.000000')
92991
+ Fixture Delete (0.1ms) DELETE FROM "serialize_fields"
92992
+ Fixture Insert (0.0ms) INSERT INTO "serialize_fields" ("id", "field") VALUES (1, 'value 1')
92993
+ Fixture Insert (0.0ms) INSERT INTO "serialize_fields" ("id", "field") VALUES (2, 'value 2')
92994
+ Fixture Insert (0.0ms) INSERT INTO "serialize_fields" ("id", "field") VALUES (3, 'value 3')
92995
+ Fixture Insert (0.0ms) INSERT INTO "serialize_fields" ("id", "field") VALUES (4, 'value 4')
92996
+ Fixture Insert (0.1ms) INSERT INTO "serialize_fields" ("id", "field") VALUES (5, 'value 5')
92997
+ Fixture Delete (0.4ms) DELETE FROM "string_fields"
92998
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (1, 'Test 1')
92999
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (2, 'Test 2')
93000
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (3, 'Test 3')
93001
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (4, 'Test 4')
93002
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (5, 'Test 5')
93003
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (6, 'Test 6')
93004
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (7, 'Test 7')
93005
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (8, 'Test 8')
93006
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (9, 'Test 9')
93007
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (10, 'Test 10')
93008
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (11, 'Test 11')
93009
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (12, 'Test 12')
93010
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (13, 'Test 13')
93011
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (14, 'Test 14')
93012
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (15, 'Test 15')
93013
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (16, 'Test 16')
93014
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (17, 'Test 17')
93015
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (18, 'Test 18')
93016
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (19, 'Test 19')
93017
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (20, 'Test 20')
93018
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (21, 'Test 21')
93019
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (22, 'Test 22')
93020
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (23, 'Test 23')
93021
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (24, 'Test 24')
93022
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (25, 'Test 25')
93023
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (26, 'Test 26')
93024
+ Fixture Insert (0.1ms) INSERT INTO "string_fields" ("id", "field") VALUES (27, 'Test 27')
93025
+ Fixture Insert (0.0ms) INSERT INTO "string_fields" ("id", "field") VALUES (28, 'Test 28')
93026
+ Fixture Insert (0.0ms) INSERT INTO "string_fields" ("id", "field") VALUES (29, 'Test 29')
93027
+ Fixture Insert (0.0ms) INSERT INTO "string_fields" ("id", "field") VALUES (30, 'Test 30')
93028
+ Fixture Delete (0.6ms) DELETE FROM "trees"
93029
+ Fixture Insert (2.2ms) INSERT INTO "trees" ("id", "name", "owner_id", "created_at", "updated_at") VALUES (1, 'Oak', 1, '2010-02-11 11:00:00.000000', '2010-02-11 11:00:00.000000')
93030
+ Fixture Insert (0.1ms) INSERT INTO "trees" ("id", "name", "owner_id", "created_at", "updated_at") VALUES (2, 'Mapple', 2, '2010-02-15 21:00:00.000000', '2010-02-15 21:00:00.000000')
93031
+ Fixture Insert (0.1ms) INSERT INTO "trees" ("id", "name", "owner_id", "created_at", "updated_at") VALUES (3, 'Mapple', 2, '2012-04-11 12:00:00.000000', '2012-04-11 12:00:00.000000')
93032
+ Fixture Insert (0.0ms) INSERT INTO "trees" ("id", "name", "owner_id", "created_at", "updated_at") VALUES (4, 'Oak', 2, '2015-06-18 09:00:00.000000', '2015-06-18 09:00:00.000000')
93033
+ Fixture Insert (0.0ms) INSERT INTO "trees" ("id", "name", "owner_id", "created_at", "updated_at") VALUES (5, 'Oak', 3, '2014-06-18 09:00:00.000000', '2014-06-18 09:00:00.000000')
93034
+ Fixture Insert (0.0ms) INSERT INTO "trees" ("id", "name", "owner_id", "created_at", "updated_at") VALUES (6, 'Oak', 3, '2017-09-19 20:00:44.000000', '2017-09-19 20:00:44.000000')
93035
+ Fixture Insert (0.0ms) INSERT INTO "trees" ("id", "name", "owner_id", "created_at", "updated_at") VALUES (7, 'Sequoia', 1, '2017-09-19 20:00:44.000000', '2017-09-19 20:00:44.000000')
93036
+ Fixture Insert (0.1ms) INSERT INTO "trees" ("id", "name", "owner_id", "created_at", "updated_at") VALUES (8, 'Fir', 1, '2017-09-19 20:00:44.000000', '2017-09-19 20:00:44.000000')
93037
+  (0.9ms) commit transaction
93038
+  (0.1ms) begin transaction
93039
+ --------------------------------------------------------------------------------------------
93040
+ ForestLiana::ValueStatGetterTest: test_Value_stat_getter_with_a_filter_on_a_belongs_to_field
93041
+ --------------------------------------------------------------------------------------------
93042
+  (0.3ms) SELECT DISTINCT COUNT(DISTINCT "belongs_to_fields"."id") FROM "belongs_to_fields" LEFT OUTER JOIN "has_one_fields" ON "has_one_fields"."id" = "belongs_to_fields"."has_one_field_id" LEFT OUTER JOIN "has_many_fields" ON "has_many_fields"."id" = "belongs_to_fields"."has_many_field_id" LEFT OUTER JOIN "has_many_class_name_fields" ON "has_many_class_name_fields"."id" = "belongs_to_fields"."has_many_class_name_field_id" WHERE ("has_one_fields"."id" = '3')
93043
+  (0.1ms) rollback transaction
93044
+  (0.1ms) begin transaction
93045
+ -----------------------------------------------------------------------------
93046
+ ForestLiana::ValueStatGetterTest: test_Value_stat_getter_with_a_simple_filter
93047
+ -----------------------------------------------------------------------------
93048
+  (0.5ms) SELECT DISTINCT COUNT(DISTINCT "boolean_fields"."id") FROM "boolean_fields" WHERE ("boolean_fields"."field" = 1)
93049
+  (0.1ms) rollback transaction
93050
+  (0.1ms) begin transaction
93051
+ ---------------------------
93052
+ ForestLianaTest: test_truth
93053
+ ---------------------------
93054
+  (0.0ms) rollback transaction
93055
+  (0.0ms) begin transaction
93056
+ ------------------------------------------------------------------------------------------------------------
93057
+ ForestLiana::ResourceUpdaterTest: test_Update_a_record_on_a_"serialize"_attribute_with_a_well_formated_value
93058
+ ------------------------------------------------------------------------------------------------------------
93059
+ SerializeField Load (0.2ms) SELECT "serialize_fields".* FROM "serialize_fields" WHERE "serialize_fields"."id" = ? LIMIT 1 [["id", 1]]
93060
+  (0.1ms) SAVEPOINT active_record_1
93061
+ SQL (0.4ms) UPDATE "serialize_fields" SET "field" = ? WHERE "serialize_fields"."id" = ? [["field", "---\n- test\n- test\n"], ["id", 1]]
93062
+  (0.1ms) RELEASE SAVEPOINT active_record_1
93063
+  (0.7ms) rollback transaction
93064
+  (0.1ms) begin transaction
93065
+ ---------------------------------------------------------------------------------------------------------
93066
+ ForestLiana::ResourceUpdaterTest: test_Update_a_record_on_a_"serialize"_attribute_with_a_bad_format_value
93067
+ ---------------------------------------------------------------------------------------------------------
93068
+ SerializeField Load (0.2ms) SELECT "serialize_fields".* FROM "serialize_fields" WHERE "serialize_fields"."id" = ? LIMIT 1 [["id", 1]]
93069
+  (0.1ms) rollback transaction
93070
+  (0.1ms) begin transaction
93071
+ ------------------------------------------------------------------------------------------------------
93072
+ ForestLiana::ResourceUpdaterTest: test_Update_a_record_on_a_"serialize"_attribute_with_a_missing_value
93073
+ ------------------------------------------------------------------------------------------------------
93074
+ SerializeField Load (0.1ms) SELECT "serialize_fields".* FROM "serialize_fields" WHERE "serialize_fields"."id" = ? LIMIT 1 [["id", 1]]
93075
+  (0.1ms) SAVEPOINT active_record_1
93076
+  (0.1ms) RELEASE SAVEPOINT active_record_1
93077
+  (0.1ms) rollback transaction
93078
+  (0.2ms) begin transaction
93079
+ ---------------------------------------------------------------------------------------------------
93080
+ ForestLiana::ResourceUpdaterTest: test_Update_a_record_on_a_"serialize"_attribute_with_a_null_value
93081
+ ---------------------------------------------------------------------------------------------------
93082
+ SerializeField Load (0.6ms) SELECT "serialize_fields".* FROM "serialize_fields" WHERE "serialize_fields"."id" = ? LIMIT 1 [["id", 1]]
93083
+  (0.1ms) SAVEPOINT active_record_1
93084
+ SQL (0.3ms) UPDATE "serialize_fields" SET "field" = ? WHERE "serialize_fields"."id" = ? [["field", nil], ["id", 1]]
93085
+  (0.1ms) RELEASE SAVEPOINT active_record_1
93086
+  (0.4ms) rollback transaction
93087
+  (0.1ms) begin transaction
93088
+ ---------------------------------------------------------------------------------------
93089
+ ForestLiana::PieStatGetterTest: test_Pie_stat_getter_with_an_aggregate_on_a_foreign_key
93090
+ ---------------------------------------------------------------------------------------
93091
+  (1.0ms) SELECT COUNT(DISTINCT "belongs_to_fields"."id") AS count_id, belongs_to_fields.has_one_field_id AS belongs_to_fields_has_one_field_id FROM "belongs_to_fields" LEFT OUTER JOIN "has_one_fields" ON "has_one_fields"."id" = "belongs_to_fields"."has_one_field_id" LEFT OUTER JOIN "has_many_fields" ON "has_many_fields"."id" = "belongs_to_fields"."has_many_field_id" LEFT OUTER JOIN "has_many_class_name_fields" ON "has_many_class_name_fields"."id" = "belongs_to_fields"."has_many_class_name_field_id" GROUP BY belongs_to_fields.has_one_field_id ORDER BY count_id DESC
93092
+  (0.1ms) rollback transaction
93093
+  (0.1ms) begin transaction
93094
+ -----------------------------------------------------------------------------------------
93095
+ ForestLiana::PieStatGetterTest: test_Pie_stat_getter_with_an_aggregate_on_a_boolean_field
93096
+ -----------------------------------------------------------------------------------------
93097
+  (0.2ms) SELECT COUNT(*) AS count_all, boolean_fields.field AS boolean_fields_field FROM "boolean_fields" GROUP BY boolean_fields.field ORDER BY count_all DESC
93098
+  (0.0ms) rollback transaction
93099
+  (0.1ms) begin transaction
93100
+ -----------------------------------
93101
+ ForestLiana::RouteTest: test_Routes
93102
+ -----------------------------------
93103
+  (0.1ms) rollback transaction
93104
+  (0.2ms) begin transaction
93105
+ -------------------------------------------------------------------------
93106
+ ForestLiana::ResourcesGetterTest: test_HasMany_Getter_with_sort_parameter
93107
+ -------------------------------------------------------------------------
93108
+ Owner Load (0.2ms) SELECT "owners".* FROM "owners" WHERE "owners"."id" = ? LIMIT 1 [["id", 1]]
93109
+ SQL (0.3ms) SELECT "trees"."id" AS t0_r0, "trees"."name" AS t0_r1, "trees"."owner_id" AS t0_r2, "trees"."created_at" AS t0_r3, "trees"."updated_at" AS t0_r4, "owners"."id" AS t1_r0, "owners"."name" AS t1_r1, "owners"."created_at" AS t1_r2, "owners"."updated_at" AS t1_r3 FROM "trees" LEFT OUTER JOIN "owners" ON "owners"."id" = "trees"."owner_id" WHERE "trees"."owner_id" = ? ORDER BY trees.id DESC [["owner_id", 1]]
93110
+  (0.2ms) SELECT COUNT(DISTINCT count_column) FROM (SELECT "trees"."id" AS count_column FROM "trees" LEFT OUTER JOIN "owners" ON "owners"."id" = "trees"."owner_id" WHERE "trees"."owner_id" = ? LIMIT 15 OFFSET 0) subquery_for_count [["owner_id", 1]]
93111
+ SQL (0.2ms) SELECT "trees"."id" AS t0_r0, "trees"."name" AS t0_r1, "trees"."owner_id" AS t0_r2, "trees"."created_at" AS t0_r3, "trees"."updated_at" AS t0_r4, "owners"."id" AS t1_r0, "owners"."name" AS t1_r1, "owners"."created_at" AS t1_r2, "owners"."updated_at" AS t1_r3 FROM "trees" LEFT OUTER JOIN "owners" ON "owners"."id" = "trees"."owner_id" WHERE "trees"."owner_id" = ? ORDER BY trees.id DESC LIMIT 1 OFFSET 0 [["owner_id", 1]]
93112
+  (0.1ms) rollback transaction
93113
+  (0.1ms) begin transaction
93114
+ --------------------------------------------------------------------
93115
+ ForestLiana::ResourcesGetterTest: test_Sort_by_a_has_one_association
93116
+ --------------------------------------------------------------------
93117
+ SQL (0.4ms) SELECT "has_one_fields"."id" AS t0_r0, "belongs_to_fields"."id" AS t1_r0, "belongs_to_fields"."has_one_field_id" AS t1_r1, "belongs_to_fields"."has_many_class_name_field_id" AS t1_r2, "belongs_to_fields"."has_many_field_id" AS t1_r3, "belongs_to_class_name_fields"."id" AS t2_r0, "belongs_to_class_name_fields"."foo_id" AS t2_r1 FROM "has_one_fields" LEFT OUTER JOIN "belongs_to_fields" ON "belongs_to_fields"."has_one_field_id" = "has_one_fields"."id" LEFT OUTER JOIN "belongs_to_class_name_fields" ON "belongs_to_class_name_fields"."foo_id" = "has_one_fields"."id" ORDER BY "belongs_to_fields"."id" DESC LIMIT 10 OFFSET 0
93118
+  (0.3ms) SELECT COUNT(*) FROM "has_one_fields"
93119
+  (0.1ms) rollback transaction
93120
+  (0.1ms) begin transaction
93121
+ -------------------------------------------------------------------------------------------
93122
+ ForestLiana::ResourcesGetterTest: test_Filter_on_an_updated_at_field_of_the_main_collection
93123
+ -------------------------------------------------------------------------------------------
93124
+ SQL (0.2ms) SELECT "owners"."id" AS t0_r0, "owners"."name" AS t0_r1, "owners"."created_at" AS t0_r2, "owners"."updated_at" AS t0_r3 FROM "owners" WHERE ("owners"."updated_at" BETWEEN '2016-01-01 08:00:00 UTC' AND '2017-01-01 07:59:59 UTC') ORDER BY owners.created_at DESC LIMIT 10 OFFSET 0
93125
+  (0.1ms) SELECT COUNT(*) FROM "owners" WHERE ("owners"."updated_at" BETWEEN '2016-01-01 08:00:00 UTC' AND '2017-01-01 07:59:59 UTC')
93126
+  (0.1ms) rollback transaction
93127
+  (0.1ms) begin transaction
93128
+ -----------------------------------------------------------------
93129
+ ForestLiana::ResourcesGetterTest: test_StringField_page_1_size_15
93130
+ -----------------------------------------------------------------
93131
+ SQL (0.7ms) SELECT "string_fields"."id" AS t0_r0, "string_fields"."field" AS t0_r1 FROM "string_fields" ORDER BY string_fields.id DESC LIMIT 15 OFFSET 0
93132
+  (0.1ms) SELECT COUNT(*) FROM "string_fields"
93133
+  (0.1ms) rollback transaction
93134
+  (0.1ms) begin transaction
93135
+ ----------------------------------------------------------------
93136
+ ForestLiana::ResourcesGetterTest: test_Filter_on_ambiguous_field
93137
+ ----------------------------------------------------------------
93138
+ SQL (0.2ms) SELECT "trees"."id" AS t0_r0, "trees"."name" AS t0_r1, "trees"."owner_id" AS t0_r2, "trees"."created_at" AS t0_r3, "trees"."updated_at" AS t0_r4, "owners"."id" AS t1_r0, "owners"."name" AS t1_r1, "owners"."created_at" AS t1_r2, "owners"."updated_at" AS t1_r3 FROM "trees" LEFT OUTER JOIN "owners" ON "owners"."id" = "trees"."owner_id" WHERE ("trees"."created_at" > '2015-06-18 08:00:00') AND (owners.name = 'Arnaud Besnier') ORDER BY trees.created_at DESC LIMIT 10 OFFSET 0
93139
+  (0.1ms) SELECT COUNT(DISTINCT "trees"."id") FROM "trees" LEFT OUTER JOIN "owners" ON "owners"."id" = "trees"."owner_id" WHERE ("trees"."created_at" > '2015-06-18 08:00:00') AND (owners.name = 'Arnaud Besnier')
93140
+  (0.1ms) rollback transaction
93141
+  (0.1ms) begin transaction
93142
+ --------------------------------------------------------------------
93143
+ ForestLiana::ResourcesGetterTest: test_HasMany_Getter_page_1_size_15
93144
+ --------------------------------------------------------------------
93145
+ Owner Load (0.1ms) SELECT "owners".* FROM "owners" WHERE "owners"."id" = ? LIMIT 1 [["id", 1]]
93146
+ SQL (0.1ms) SELECT "trees"."id" AS t0_r0, "trees"."name" AS t0_r1, "trees"."owner_id" AS t0_r2, "trees"."created_at" AS t0_r3, "trees"."updated_at" AS t0_r4, "owners"."id" AS t1_r0, "owners"."name" AS t1_r1, "owners"."created_at" AS t1_r2, "owners"."updated_at" AS t1_r3 FROM "trees" LEFT OUTER JOIN "owners" ON "owners"."id" = "trees"."owner_id" WHERE "trees"."owner_id" = ? [["owner_id", 1]]
93147
+  (0.1ms) SELECT COUNT(DISTINCT count_column) FROM (SELECT "trees"."id" AS count_column FROM "trees" LEFT OUTER JOIN "owners" ON "owners"."id" = "trees"."owner_id" WHERE "trees"."owner_id" = ? LIMIT 15 OFFSET 0) subquery_for_count [["owner_id", 1]]
93148
+ SQL (0.2ms) SELECT "trees"."id" AS t0_r0, "trees"."name" AS t0_r1, "trees"."owner_id" AS t0_r2, "trees"."created_at" AS t0_r3, "trees"."updated_at" AS t0_r4, "owners"."id" AS t1_r0, "owners"."name" AS t1_r1, "owners"."created_at" AS t1_r2, "owners"."updated_at" AS t1_r3 FROM "trees" LEFT OUTER JOIN "owners" ON "owners"."id" = "trees"."owner_id" WHERE "trees"."owner_id" = ? ORDER BY "trees"."id" ASC LIMIT 1 OFFSET 0 [["owner_id", 1]]
93149
+  (0.1ms) rollback transaction
93150
+  (0.1ms) begin transaction
93151
+ -----------------------------------------------------------------------
93152
+ ForestLiana::ResourcesGetterTest: test_Sort_by_a_belongs_to_association
93153
+ -----------------------------------------------------------------------
93154
+ SQL (0.2ms) SELECT "belongs_to_fields"."id" AS t0_r0, "belongs_to_fields"."has_one_field_id" AS t0_r1, "belongs_to_fields"."has_many_class_name_field_id" AS t0_r2, "belongs_to_fields"."has_many_field_id" AS t0_r3, "has_one_fields"."id" AS t1_r0, "has_many_fields"."id" AS t2_r0, "has_many_fields"."has_many_through_field_id" AS t2_r1, "has_many_class_name_fields"."id" AS t3_r0 FROM "belongs_to_fields" LEFT OUTER JOIN "has_one_fields" ON "has_one_fields"."id" = "belongs_to_fields"."has_one_field_id" LEFT OUTER JOIN "has_many_fields" ON "has_many_fields"."id" = "belongs_to_fields"."has_many_field_id" LEFT OUTER JOIN "has_many_class_name_fields" ON "has_many_class_name_fields"."id" = "belongs_to_fields"."has_many_class_name_field_id" ORDER BY "has_one_fields"."id" ASC LIMIT 10 OFFSET 0
93155
+  (0.1ms) SELECT COUNT(*) FROM "belongs_to_fields"
93156
+  (0.1ms) rollback transaction
93157
+  (0.1ms) begin transaction
93158
+ ------------------------------------------------------------------------------------------------
93159
+ ForestLiana::ResourcesGetterTest: test_Filter_on_an_updated_at_field_of_an_associated_collection
93160
+ ------------------------------------------------------------------------------------------------
93161
+ SQL (0.2ms) SELECT "trees"."id" AS t0_r0, "trees"."name" AS t0_r1, "trees"."owner_id" AS t0_r2, "trees"."created_at" AS t0_r3, "trees"."updated_at" AS t0_r4, "owners"."id" AS t1_r0, "owners"."name" AS t1_r1, "owners"."created_at" AS t1_r2, "owners"."updated_at" AS t1_r3 FROM "trees" LEFT OUTER JOIN "owners" ON "owners"."id" = "trees"."owner_id" WHERE (owners.updated_at BETWEEN '2016-01-01 08:00:00 UTC' AND '2017-01-01 07:59:59 UTC') ORDER BY trees.created_at DESC LIMIT 10 OFFSET 0
93162
+  (0.2ms) SELECT COUNT(DISTINCT "trees"."id") FROM "trees" LEFT OUTER JOIN "owners" ON "owners"."id" = "trees"."owner_id" WHERE (owners.updated_at BETWEEN '2016-01-01 08:00:00 UTC' AND '2017-01-01 07:59:59 UTC')
93163
+  (0.0ms) rollback transaction
93164
+  (0.1ms) begin transaction
93165
+ -----------------------------------------------------------------
93166
+ ForestLiana::ResourcesGetterTest: test_StringField_page_2_size_10
93167
+ -----------------------------------------------------------------
93168
+ SQL (0.2ms) SELECT "string_fields"."id" AS t0_r0, "string_fields"."field" AS t0_r1 FROM "string_fields" ORDER BY string_fields.id DESC LIMIT 10 OFFSET 10
93169
+  (0.1ms) SELECT COUNT(*) FROM "string_fields"
93170
+  (0.1ms) rollback transaction
93171
+  (0.1ms) begin transaction
93172
+ -----------------------------------------------------------
93173
+ ForestLiana::ResourcesGetterTest: test_Filter_before_x_days
93174
+ -----------------------------------------------------------
93175
+ SQL (0.2ms) SELECT "trees"."id" AS t0_r0, "trees"."name" AS t0_r1, "trees"."owner_id" AS t0_r2, "trees"."created_at" AS t0_r3, "trees"."updated_at" AS t0_r4 FROM "trees" WHERE ("trees"."created_at" < '2017-09-19 19:59:44 UTC') ORDER BY trees.created_at DESC LIMIT 10 OFFSET 0
93176
+  (0.1ms) SELECT COUNT(*) FROM "trees" WHERE ("trees"."created_at" < '2017-09-19 19:59:44 UTC')
93177
+ Owner Load (0.1ms) SELECT "owners".* FROM "owners" WHERE "owners"."id" = ? LIMIT 1 [["id", 2]]
93178
+  (0.1ms) rollback transaction
93179
+  (0.1ms) begin transaction
93180
+ ------------------------------------------------------------------------------------
93181
+ ForestLiana::ResourcesGetterTest: test_Sort_on_an_ambiguous_field_name_with_a_filter
93182
+ ------------------------------------------------------------------------------------
93183
+ SQL (0.2ms) SELECT "trees"."id" AS t0_r0, "trees"."name" AS t0_r1, "trees"."owner_id" AS t0_r2, "trees"."created_at" AS t0_r3, "trees"."updated_at" AS t0_r4, "owners"."id" AS t1_r0, "owners"."name" AS t1_r1, "owners"."created_at" AS t1_r2, "owners"."updated_at" AS t1_r3 FROM "trees" LEFT OUTER JOIN "owners" ON "owners"."id" = "trees"."owner_id" WHERE (owners.name = 'Arnaud Besnier') ORDER BY trees.name DESC LIMIT 10 OFFSET 0
93184
+  (0.2ms) SELECT COUNT(DISTINCT "trees"."id") FROM "trees" LEFT OUTER JOIN "owners" ON "owners"."id" = "trees"."owner_id" WHERE (owners.name = 'Arnaud Besnier')
93185
+  (0.1ms) rollback transaction
93186
+  (0.1ms) begin transaction
93187
+ ---------------------------------------------------------------------------
93188
+ ForestLiana::ResourcesGetterTest: test_HasMany_Getter_with_search_parameter
93189
+ ---------------------------------------------------------------------------
93190
+ Owner Load (0.1ms) SELECT "owners".* FROM "owners" WHERE "owners"."id" = ? LIMIT 1 [["id", 1]]
93191
+ SQL (1.4ms) SELECT "trees"."id" AS t0_r0, "trees"."name" AS t0_r1, "trees"."owner_id" AS t0_r2, "trees"."created_at" AS t0_r3, "trees"."updated_at" AS t0_r4, "owners"."id" AS t1_r0, "owners"."name" AS t1_r1, "owners"."created_at" AS t1_r2, "owners"."updated_at" AS t1_r3 FROM "trees" LEFT OUTER JOIN "owners" ON "owners"."id" = "trees"."owner_id" WHERE "trees"."owner_id" = ? AND (LOWER("trees"."name") LIKE '%fir%') [["owner_id", 1]]
93192
+  (0.2ms) SELECT COUNT(DISTINCT count_column) FROM (SELECT "trees"."id" AS count_column FROM "trees" LEFT OUTER JOIN "owners" ON "owners"."id" = "trees"."owner_id" WHERE "trees"."owner_id" = ? AND (LOWER("trees"."name") LIKE '%fir%') LIMIT 15 OFFSET 0) subquery_for_count [["owner_id", 1]]
93193
+ SQL (0.2ms) SELECT "trees"."id" AS t0_r0, "trees"."name" AS t0_r1, "trees"."owner_id" AS t0_r2, "trees"."created_at" AS t0_r3, "trees"."updated_at" AS t0_r4, "owners"."id" AS t1_r0, "owners"."name" AS t1_r1, "owners"."created_at" AS t1_r2, "owners"."updated_at" AS t1_r3 FROM "trees" LEFT OUTER JOIN "owners" ON "owners"."id" = "trees"."owner_id" WHERE "trees"."owner_id" = ? AND (LOWER("trees"."name") LIKE '%fir%') ORDER BY "trees"."id" ASC LIMIT 1 OFFSET 0 [["owner_id", 1]]
93194
+  (0.1ms) rollback transaction
93195
+  (0.6ms) begin transaction
93196
+ ------------------------------------------------------------------------------------------------------
93197
+ ForestLiana::ResourcesGetterTest: test_Filter_equal_on_an_updated_at_field_of_an_associated_collection
93198
+ ------------------------------------------------------------------------------------------------------
93199
+ SQL (0.2ms) SELECT "trees"."id" AS t0_r0, "trees"."name" AS t0_r1, "trees"."owner_id" AS t0_r2, "trees"."created_at" AS t0_r3, "trees"."updated_at" AS t0_r4, "owners"."id" AS t1_r0, "owners"."name" AS t1_r1, "owners"."created_at" AS t1_r2, "owners"."updated_at" AS t1_r3 FROM "trees" LEFT OUTER JOIN "owners" ON "owners"."id" = "trees"."owner_id" WHERE (owners.updated_at = 'Sat Jul 02 2016 11:52:00 GMT-0400 (EDT)') ORDER BY trees.created_at DESC LIMIT 10 OFFSET 0
93200
+  (0.2ms) SELECT COUNT(DISTINCT "trees"."id") FROM "trees" LEFT OUTER JOIN "owners" ON "owners"."id" = "trees"."owner_id" WHERE (owners.updated_at = 'Sat Jul 02 2016 11:52:00 GMT-0400 (EDT)')
93201
+  (0.1ms) rollback transaction
93202
+  (0.1ms) begin transaction
93203
+ ----------------------------------------------------------------
93204
+ ForestLiana::ResourcesGetterTest: test_StringField_sort_by_field
93205
+ ----------------------------------------------------------------
93206
+ SQL (0.2ms) SELECT "string_fields"."id" AS t0_r0, "string_fields"."field" AS t0_r1 FROM "string_fields" ORDER BY string_fields.field DESC LIMIT 10 OFFSET 0
93207
+  (0.1ms) SELECT COUNT(*) FROM "string_fields"
93208
+  (0.1ms) rollback transaction
93209
+  (0.1ms) begin transaction
93210
+ ------------------------------------------------------------------------
93211
+ ForestLiana::SchemaAdapterTest: test_Float_should_have_the_type_`Number`
93212
+ ------------------------------------------------------------------------
93213
+  (0.1ms) rollback transaction
93214
+  (0.1ms) begin transaction
93215
+ ---------------------------------------------------------------------------
93216
+ ForestLiana::SchemaAdapterTest: test_Boolean_should_have_the_type_`Boolean`
93217
+ ---------------------------------------------------------------------------
93218
+  (0.0ms) rollback transaction
93219
+  (0.1ms) begin transaction
93220
+ -------------------------------------------------------------------------
93221
+ ForestLiana::SchemaAdapterTest: test_String_should_have_the_type_`String`
93222
+ -------------------------------------------------------------------------
93223
+  (0.0ms) rollback transaction
93224
+  (0.1ms) begin transaction
93225
+ -----------------------------------------------------------
93226
+ ForestLiana::SchemaAdapterTest: test_belongsTo_relationship
93227
+ -----------------------------------------------------------
93228
+  (0.0ms) rollback transaction
93229
+  (0.1ms) begin transaction
93230
+ --------------------------------------------------------
93231
+ ForestLiana::SchemaAdapterTest: test_hasOne_relationship
93232
+ --------------------------------------------------------
93233
+  (0.0ms) rollback transaction
93234
+  (0.1ms) begin transaction
93235
+ ---------------------------------------------------------
93236
+ ForestLiana::SchemaAdapterTest: test_hasMany_relationship
93237
+ ---------------------------------------------------------
93238
+  (0.0ms) rollback transaction
93239
+  (0.1ms) begin transaction
93240
+ -------------------------------------------------------------------------
93241
+ ForestLiana::SchemaAdapterTest: test_DateTime_should_have_the_type_`Date`
93242
+ -------------------------------------------------------------------------
93243
+  (0.1ms) rollback transaction
93244
+  (0.1ms) begin transaction
93245
+ ---------------------------------------------------------------------
93246
+ ForestLiana::SchemaAdapterTest: test_Date_should_have_the_type_`Date`
93247
+ ---------------------------------------------------------------------
93248
+  (0.0ms) rollback transaction
93249
+  (0.0ms) begin transaction
93250
+ ----------------------------------------------------------------------------------
93251
+ ForestLiana::SchemaAdapterTest: test_hasMany_relationhip_with_specified_class_name
93252
+ ----------------------------------------------------------------------------------
93253
+  (0.1ms) rollback transaction
93254
+  (0.1ms) begin transaction
93255
+ --------------------------------------------------------------------------
93256
+ ForestLiana::SchemaAdapterTest: test_Integer_should_have_the_type_`Number`
93257
+ --------------------------------------------------------------------------
93258
+  (0.1ms) rollback transaction
93259
+  (0.1ms) begin transaction
93260
+ ------------------------------------------------------------------------------------
93261
+ ForestLiana::SchemaAdapterTest: test_belongsTo_relationhip_with_specified_class_name
93262
+ ------------------------------------------------------------------------------------
93263
+  (0.1ms) rollback transaction
93264
+  (0.1ms) begin transaction
93265
+ --------------------------------------------------------------------------
93266
+ ForestLiana::SchemaAdapterTest: test_Decimal_should_have_the_type_`Number`
93267
+ --------------------------------------------------------------------------
93268
+  (0.2ms) rollback transaction
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_liana
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.10
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Munda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-15 00:00:00.000000000 Z
11
+ date: 2017-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails