ru.Bee 2.5.6 → 2.5.8
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/lib/rubee/cli/test.rb +1 -1
- data/lib/rubee/models/sequel_object.rb +4 -0
- data/lib/rubee/support/hash.rb +12 -0
- data/lib/rubee.rb +1 -1
- data/readme.md +23 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 326e4c90ee2f508b646bb859bc99b82a0b71e531528ccce28abf6c2871d7fa5c
|
|
4
|
+
data.tar.gz: e61f9e11b7fa099d5a602f61cac7a6929009d093ac925ad17f79373ba5ebc09d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 966496daef2ad7efe7a918edee0f9074c5668cf7b60ec9c1c43a844fe5dfa3640514ee8e03d4a606a4e94b03779a5cfa3ec2b743cf6e53686fa3fac18cf12124
|
|
7
|
+
data.tar.gz: 52d9ae220542a33c969403cdf166ae6bbaa43162dadded67d9f3692891be84d9e5ca1053ad0616b5f12714ffe34ee110e1f0cfa2d1ebdae04b2025b20c6f7e2d
|
data/lib/rubee/cli/test.rb
CHANGED
data/lib/rubee/support/hash.rb
CHANGED
data/lib/rubee.rb
CHANGED
data/readme.md
CHANGED
|
@@ -260,6 +260,12 @@ This will generate the following files
|
|
|
260
260
|
- comment_id → comments() on delete no_action on update no_action
|
|
261
261
|
- user_id → users() on delete no_action on update no_action
|
|
262
262
|
```
|
|
263
|
+
8. Drop all tables can be handy for development process. But be careful and make sure you pass desired environment
|
|
264
|
+
```bash
|
|
265
|
+
RACK_ENV=test rubee db drop_tables
|
|
266
|
+
These tables has been dropped for test env
|
|
267
|
+
[:companies, :company_clients, :services]
|
|
268
|
+
```
|
|
263
269
|
|
|
264
270
|
[Back to content](#content)
|
|
265
271
|
|
|
@@ -395,6 +401,18 @@ irb(main):021> user.destroy(cascade: true)
|
|
|
395
401
|
=> 1
|
|
396
402
|
```
|
|
397
403
|
|
|
404
|
+
Find record in the databse or initialize the instance for following persistence
|
|
405
|
+
```Ruby
|
|
406
|
+
irb(main):020> user = User.find_or_new(email: "ok23@ok.com")
|
|
407
|
+
=> #<User:0x000000010cfaa5c0 @email="ok23@ok.com", @id=2, @password="123">
|
|
408
|
+
irb(main):021> user.persisted?
|
|
409
|
+
=> true
|
|
410
|
+
irb(main):022> user = User.find_or_new(email: "new@ok.com")
|
|
411
|
+
=> #<User:0x000000010cfaa5c0 @email="new@ok.com", @id=nil, @password=nil>
|
|
412
|
+
irb(main):023> user.persisted?
|
|
413
|
+
=> false
|
|
414
|
+
```
|
|
415
|
+
|
|
398
416
|
Destroy all records one by one
|
|
399
417
|
```Ruby
|
|
400
418
|
irb(main):022> User.destroy_all
|
|
@@ -417,7 +435,7 @@ class Comment < Rubee::SequelObject
|
|
|
417
435
|
owns_many :users, over: :posts
|
|
418
436
|
end
|
|
419
437
|
|
|
420
|
-
# join post
|
|
438
|
+
# join post model
|
|
421
439
|
class Post < Rubee::SequelObject
|
|
422
440
|
attr_accessor :id, :user_id, :comment_id, :created, :updated
|
|
423
441
|
holds :comment
|
|
@@ -1104,6 +1122,10 @@ Here are list of additionl APIs extended for:
|
|
|
1104
1122
|
"test".plural? # => false
|
|
1105
1123
|
```
|
|
1106
1124
|
|
|
1125
|
+
```ruby
|
|
1126
|
+
{one: {two: 2}}.deep_dig(:two) # => 2
|
|
1127
|
+
```
|
|
1128
|
+
|
|
1107
1129
|
[Back to content](#content)
|
|
1108
1130
|
|
|
1109
1131
|
|
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.5.
|
|
4
|
+
version: 2.5.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Oleg Saltykov
|
|
@@ -322,7 +322,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
322
322
|
- !ruby/object:Gem::Version
|
|
323
323
|
version: '0'
|
|
324
324
|
requirements: []
|
|
325
|
-
rubygems_version:
|
|
325
|
+
rubygems_version: 4.0.4
|
|
326
326
|
specification_version: 4
|
|
327
327
|
summary: Fast and lightweight Ruby application server designed for minimalism and
|
|
328
328
|
flexibility
|