ru.Bee 2.6.0 → 2.6.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 796e02f0a5684f55333e56d9f0431017253e16540393fa419164398d2f275e16
4
- data.tar.gz: 6ccf0a99ad59c183a7ca366ac91340cf49b4302f010574393bdade7c33aca515
3
+ metadata.gz: 8d4bff55ead09a3ea9e9158f8d73b68406a410a51c33753c133c78b9fc24a022
4
+ data.tar.gz: 3f878438d5a75d20214fe9fe79dfa55ba51a1d6a6c2fe22de648b7b4b5f8629a
5
5
  SHA512:
6
- metadata.gz: 66d5ab7ea47e0761ff7c146aec727498e6b4cea1c3874dca437e10066aa1b6184c5d9834e0b7e7b2da378317b112b05f678bd65a7b96998e1b0c565c8f6226f3
7
- data.tar.gz: c8523d00239a9e14abf3fc3174074de4eeee3935ee51667f1ead8fcdc68a3ed6de26c153d3743b1930914282b7c52fd575492ce6782e2e33c4706377a02f0fe4
6
+ metadata.gz: d0800df7672efcf2234ec92cc829d60c1e6a92c9fecfaa64714fb11cf9f136d0dc92df2053896ed4a71dde7c28d94fcef72c59011b01ea3cb1391dc820e460fd
7
+ data.tar.gz: a0ade2d09f3be7854fd6b7688a62006d6aef768a026553ac601691f4e0b5639c821567bcd6840018327a82a70ff6568e3b6e34664b6f4c4a89b6e005b5392ac1
data/lib/db/test.db CHANGED
Binary file
@@ -120,9 +120,9 @@ module Rubee
120
120
  .join(over.to_sym, "#{singularized_assoc_name.snakeize}_id".to_sym => :id)
121
121
  .where(Sequel[over][fk_name.to_sym] => id).select_all(original_assoc).all
122
122
 
123
- AssocArray.new([], klass, sequel_dataset)
123
+ ::Rubee::AssocArray.new([], klass, sequel_dataset)
124
124
  else
125
- AssocArray.new([], klass, klass.dataset.where(fk_name.to_sym => id))
125
+ ::Rubee::AssocArray.new([], klass, klass.dataset.where(fk_name.to_sym => id))
126
126
  end
127
127
  end
128
128
  end
@@ -192,7 +192,7 @@ module Rubee
192
192
  end
193
193
 
194
194
  def all
195
- AssocArray.new([], self, dataset)
195
+ ::Rubee::AssocArray.new([], self, dataset)
196
196
  end
197
197
 
198
198
  def find(id)
@@ -205,7 +205,7 @@ module Rubee
205
205
  def where(args, options = {})
206
206
  query_dataset = options[:__query_dataset] || dataset
207
207
 
208
- AssocArray.new([], self, query_dataset.where(**args))
208
+ ::Rubee::AssocArray.new([], self, query_dataset.where(**args))
209
209
  end
210
210
 
211
211
  def order(args, options = {})
@@ -216,32 +216,32 @@ module Rubee
216
216
  else
217
217
  args
218
218
  end
219
- AssocArray.new([], self, query_dataset.order(order_arg))
219
+ ::Rubee::AssocArray.new([], self, query_dataset.order(order_arg))
220
220
  end
221
221
 
222
222
  def join(assoc, args, options = {})
223
223
  query_dataset = options[:__query_dataset] || dataset
224
224
 
225
- AssocArray.new([], self, query_dataset.join(assoc, **args))
225
+ ::Rubee::AssocArray.new([], self, query_dataset.join(assoc, **args))
226
226
  end
227
227
 
228
228
  def limit(args, options = {})
229
229
  query_dataset = options[:__query_dataset] || dataset
230
230
 
231
- AssocArray.new([], self, query_dataset.limit(*args))
231
+ ::Rubee::AssocArray.new([], self, query_dataset.limit(*args))
232
232
  end
233
233
 
234
234
  def offset(args, options = {})
235
235
  query_dataset = options[:__query_dataset] || dataset
236
236
 
237
- AssocArray.new([], self, query_dataset.offset(*args))
237
+ ::Rubee::AssocArray.new([], self, query_dataset.offset(*args))
238
238
  end
239
239
 
240
240
  def paginate(page = 1, per_page = 10, options = {})
241
241
  query_dataset = options[:__query_dataset] || dataset
242
242
  offset = (page - 1) * per_page
243
243
 
244
- AssocArray.new([], self, query_dataset.offset(offset).limit(per_page),
244
+ ::Rubee::AssocArray.new([], self, query_dataset.offset(offset).limit(per_page),
245
245
  pagination_meta: options[:__pagination_meta])
246
246
  end
247
247
 
data/lib/rubee.rb CHANGED
@@ -20,7 +20,7 @@ module Rubee
20
20
  RUBEE_SUPPORT = { "Rubee::Support::Hash" => Hash, "Rubee::Support::String" => String }
21
21
  end
22
22
 
23
- VERSION = '2.6.0'
23
+ VERSION = '2.6.1'
24
24
 
25
25
  require_relative 'rubee/router'
26
26
  require_relative 'rubee/logger'
data/readme.md CHANGED
@@ -5,8 +5,7 @@
5
5
  ![Gem](https://img.shields.io/gem/v/ru.Bee.svg)
6
6
  ![GitHub Repo stars](https://img.shields.io/github/stars/nucleom42/rubee?style=social)
7
7
 
8
-
9
- # <img src="lib/images/rubee.svg" alt="ru.Bee" height="40"> ... ru.Bee
8
+ <img width="363" height="131" alt="Screen Shot 2026-01-27 at 11 19 15 PM" src="https://github.com/user-attachments/assets/f6f07b88-f58d-4f36-a857-a293e613269e" />
10
9
 
11
10
  ru.Bee is a Ruby-based web framework designed to streamline the development of modular monolith web applications. \
12
11
  Under the hood, it leverages the power of Ruby and Rack backed by Puma, offering a clean, efficient, and flexible architecture. \
@@ -461,6 +460,24 @@ irb(main):010> .then { |dataset| Comment.serialize(dataset) }
461
460
  This is recommended when you want to run one query and serialize it back to ru.Bee object only once.
462
461
  So it may safe some resources.
463
462
 
463
+ Since version 2.6.0 Rubee::SequelObject supports chaining queries:
464
+ ```ruby
465
+ irb(main):001> Comment.where(text: "test").where(user_id: 1)
466
+ => [#<Comment:0x0000000121889998 @id=30, @text="test", @user_id=702, @created=2025-09-28 22:03:07.011332 -0400, @updated=2025-09-28 22:03:07.011332 -0400>]
467
+ ```
468
+ It will run only one query tho.
469
+ Supported methods: where, order, limit, offset, all, owns_many, owns_one, join, paginate
470
+
471
+ Also new paginate method is available:
472
+ ```ruby
473
+ irb(main):001> comments = Comment.all.paginate(page: 1, per_page: 3)
474
+ [#<Comment:0x0000000121889998 @id=30, @text="test", @user_id=702, @created=2025-09-28 22:03:07.011332 -0400, @updated=2025-09-28 22:03:07.011332 -0400>,
475
+ #<Comment:0x0000000121889998 @id=30, @text="test", @user_id=702, @created=2025-09-28 22:03:07.011332 -0400, @updated=2025-09-28 22:03:07.011332 -0400>,
476
+ #<Comment:0x0000000121889998 @id=30, @text="test", @user_id=702, @created=2025-09-28 22:03:07.011332 -0400, @updated=2025-09-28 22:03:07.011332 -0400>]
477
+
478
+ irb(main):001> comments.pagination_meta
479
+ => {:current_page=>1, :per_page=>3, :total_count=>10, :first_page?=>true, :last_page=>false, :prev=>nil, :next=>2}
480
+ ```
464
481
  [Back to content](#content)
465
482
 
466
483
  ## Database
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ru.Bee
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Saltykov