remi-aux_codes 1.0.5 → 1.0.6

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.
Files changed (4) hide show
  1. data/README.markdown +3 -11
  2. data/VERSION.yml +1 -1
  3. data/lib/aux_codes.rb +6 -4
  4. metadata +1 -1
@@ -80,23 +80,15 @@ Or with an Indifferent Hash-like syntax
80
80
  Breed.golden_retriever
81
81
  AuxCodes.breeds.golden_retriever
82
82
 
83
+ Read [the spec](http://github.com/remi/aux_codes/blob/master/spec/aux_code_spec.rb) to see other usage examples
84
+
83
85
  TODO
84
86
  ----
85
87
 
86
88
  - make a spec specifically for showing off the different API features quickly and easily
87
89
  - convert this README to RDoc
88
- - custom fields, eg:
89
- - `Breed#acronym`
90
- - `Breed#description`
91
- - `Breed#kennel_association_id` ...
92
- - these need an easy way to be defined! `alias_attribute`?
93
- - this needs to work in development mode, when the models are constantly being reloaded!
94
- - you shouldn't have to know the name of the special field to use it ... something like `attr_string :name` could just grab the (first) string column!
95
- - should we have a field for misc serialized meta-data? could be abused ... but could also be helpful ...
96
- - create (or update) method(s) for helping with the original AuxCode migration and for creating the special additional fields
97
90
  - make table name and column names configurable (but with strong defaults)
98
- - should have a rails generator ... should be 1 command to setup `aux_codes` in Rails
99
- - after i add a rails generator, i'll bump to 1.1.0 and release
91
+ - staticly typed fields?
100
92
 
101
93
  NOTES
102
94
  -----
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 5
2
+ :patch: 6
3
3
  :major: 1
4
4
  :minor: 0
@@ -180,10 +180,12 @@ class AuxCode < ActiveRecord::Base
180
180
  # initialize AuxCodes ... looks for config/aux_codes.yml
181
181
  # and creates classes
182
182
  def init # should eventually take configuration options (hash || block)
183
- aux_codes_yml = File.join 'config', 'aux_codes.yml'
184
- if File.file? aux_codes_yml
185
- load_file aux_codes_yml
186
- create_classes!
183
+ if ActiveRecord::Base.connection.tables.include? 'aux_codes'
184
+ aux_codes_yml = File.join 'config', 'aux_codes.yml'
185
+ if File.file? aux_codes_yml
186
+ load_file aux_codes_yml
187
+ create_classes!
188
+ end
187
189
  end
188
190
  end
189
191
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remi-aux_codes
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - remi