easy_save 0.4.0 → 0.5.0
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/README.md +2 -9
- data/examples/schema.db +0 -0
- data/examples/{example.sql → schema.sql} +0 -0
- data/lib/easy_save/configuration.rb +0 -0
- data/lib/easy_save/db_connection.rb +2 -2
- data/lib/easy_save/sql_object.rb +1 -0
- data/lib/easy_save/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c833f0b9ad3e6ef750ea9cb8c2eb48e5843b8e0
|
4
|
+
data.tar.gz: 3bb6effadf80a1a970371e09f7bfa901bea51a06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebd0658dc494075002be255067688dc69eab6781f0b6be3fbd46d6790f7a15d804afb3bbe71ee35078461d8b1a820ad605196a28c2cbee46a5ef78dc5ff74604
|
7
|
+
data.tar.gz: 4013ca7e5734868f3c619cb5e0f2ca8d0714316b7926bcea6ce1cebffaf9acfee5cee267ce9c03dcbae835d2ad702dd03925ce5ee7c391b933ad491b6bf73a0e
|
data/README.md
CHANGED
@@ -23,16 +23,9 @@ Or install it yourself as:
|
|
23
23
|
|
24
24
|
### Setting up for your own usage:
|
25
25
|
|
26
|
-
Place your sql file in the root of the project directory, and
|
27
|
-
`
|
28
|
-
name.
|
26
|
+
Place your sql file in the root of the project directory, and name it
|
27
|
+
`schema.sql`.
|
29
28
|
|
30
|
-
```ruby
|
31
|
-
#lib/easy_save/db_connection.rb
|
32
|
-
USERS_SQL_FILE = File.join(ROOT_FOLDER, 'example.sql')
|
33
|
-
USERS_DB_FILE = File.join(ROOT_FOLDER, 'example.db')
|
34
|
-
|
35
|
-
```
|
36
29
|
|
37
30
|
Once that's done, in each model that is involved in the database, require
|
38
31
|
'easy_gem', subclass it from SQLObject and `finalize!` it to create the methods.
|
data/examples/schema.db
ADDED
Binary file
|
File without changes
|
File without changes
|
@@ -3,8 +3,8 @@ require 'sqlite3'
|
|
3
3
|
PRINT_QUERIES = ENV['PRINT_QUERIES'] == 'true'
|
4
4
|
# https://tomafro.net/2010/01/tip-relative-paths-with-file-expand-path
|
5
5
|
ROOT_FOLDER = Dir.pwd
|
6
|
-
USERS_SQL_FILE = File.join(ROOT_FOLDER, '
|
7
|
-
USERS_DB_FILE = File.join(ROOT_FOLDER, '
|
6
|
+
USERS_SQL_FILE = File.join(ROOT_FOLDER, 'schema.sql')
|
7
|
+
USERS_DB_FILE = File.join(ROOT_FOLDER, 'schema.db')
|
8
8
|
|
9
9
|
class DBConnection
|
10
10
|
|
data/lib/easy_save/sql_object.rb
CHANGED
data/lib/easy_save/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_save
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akshith Yellapragada
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -97,9 +97,11 @@ files:
|
|
97
97
|
- bin/setup
|
98
98
|
- easy_save.gemspec
|
99
99
|
- examples/example.rb
|
100
|
-
- examples/
|
100
|
+
- examples/schema.db
|
101
|
+
- examples/schema.sql
|
101
102
|
- lib/easy_save.rb
|
102
103
|
- lib/easy_save/associatable.rb
|
104
|
+
- lib/easy_save/configuration.rb
|
103
105
|
- lib/easy_save/db_connection.rb
|
104
106
|
- lib/easy_save/searchable.rb
|
105
107
|
- lib/easy_save/sql_object.rb
|