rawgento_models 0.0.2 → 0.0.3
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 +12 -3
- data/lib/rawgento_models/version.rb +1 -1
- data/lib/rawgento_models.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5bbafe4c75a80264778316131249df751ab3c463
|
|
4
|
+
data.tar.gz: 1829f0028906cba2c97c36e9020d10c6a60e3bce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 199e5b7a962d544dfd835885dd9cf2afa61fd02ff0d0a029e67883d5696a65d013bd4a6ba997908a687d93b9cb30df415852da1a7efc34b61609c41df1c4c9db
|
|
7
|
+
data.tar.gz: 7280c7fbc7bc13ac38c64c660695cd1bcbfc83dd927c19be3396c6b96e571ed4361d3a095f4609ae7d2cba18f3ff098fb769135a3d4fbcca0fec9e2e7c564e31
|
data/README.md
CHANGED
|
@@ -32,8 +32,10 @@ Or install it yourself as:
|
|
|
32
32
|
|
|
33
33
|
2. Setup your databse
|
|
34
34
|
|
|
35
|
-
# db/config.yml
|
|
36
|
-
|
|
35
|
+
# db/config.yml as in a vanilla rails
|
|
36
|
+
adapter: ...
|
|
37
|
+
host: ...
|
|
38
|
+
#...
|
|
37
39
|
|
|
38
40
|
# TODO this does not yet work
|
|
39
41
|
rake db:migrate
|
|
@@ -42,7 +44,14 @@ Or install it yourself as:
|
|
|
42
44
|
|
|
43
45
|
# yourapp.rb
|
|
44
46
|
require 'rawgento_models'
|
|
45
|
-
|
|
47
|
+
|
|
48
|
+
RawgentoModels.establish_connection
|
|
49
|
+
#RawgentoModels.establish_connection("alternative-config-file.yml")
|
|
50
|
+
|
|
51
|
+
RawgentoModels::LocalProducts.all
|
|
52
|
+
# or include the RawgentoModels module/namespace
|
|
53
|
+
include RawgentoModels
|
|
54
|
+
LocalProducts.all
|
|
46
55
|
|
|
47
56
|
## Development
|
|
48
57
|
|
data/lib/rawgento_models.rb
CHANGED
|
@@ -15,8 +15,8 @@ module RawgentoModels
|
|
|
15
15
|
ActiveRecordMigrations.configure {|c| c.migrations_paths = [MIGRATION_PATH] }
|
|
16
16
|
|
|
17
17
|
# Reads config and wires up AR
|
|
18
|
-
def self.establish_connection
|
|
19
|
-
config = OpenStruct.new YAML.load_file(
|
|
18
|
+
def self.establish_connection(config_file_path="db/config.yml")
|
|
19
|
+
config = OpenStruct.new YAML.load_file(config_file_path)
|
|
20
20
|
ActiveRecord::Base.establish_connection(config.default)
|
|
21
21
|
#ActiveRecord::Base.establish_connection({
|
|
22
22
|
# :adapter => 'mysql2',
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rawgento_models
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Felix Wolfsteller
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-01-
|
|
11
|
+
date: 2016-01-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|