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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca4ceb75798637272217a0092dbb2ca9d1ae61e2
4
- data.tar.gz: decdf8e777cfd5b2eb1ffedc7026a875ff454c70
3
+ metadata.gz: 5bbafe4c75a80264778316131249df751ab3c463
4
+ data.tar.gz: 1829f0028906cba2c97c36e9020d10c6a60e3bce
5
5
  SHA512:
6
- metadata.gz: 784e5834dd5f2a8bac5116bc12d82d70e2b435b8993c67677f2d356be8d19b7bffeff0ae502e121a56df12b890216918f4a9ddb99a00448425ddc6e832bb5095
7
- data.tar.gz: 3e60f20ed4af066cc2196d0abfa3f56ae0bb6c91c5b84ee800bc42459c7595cf4cd3cbbebc3bc3456e3b2f3dde7acb769f44d219c7e0087092522aaabdedc393
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
- host: ...
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
- Stock.all
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
 
@@ -1,3 +1,3 @@
1
1
  module RawgentoModels
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -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("db/config.yml")
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.2
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-22 00:00:00.000000000 Z
11
+ date: 2016-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord