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.
- data/README.markdown +3 -11
- data/VERSION.yml +1 -1
- data/lib/aux_codes.rb +6 -4
- metadata +1 -1
data/README.markdown
CHANGED
|
@@ -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
|
-
-
|
|
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
|
-----
|
data/VERSION.yml
CHANGED
data/lib/aux_codes.rb
CHANGED
|
@@ -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
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
|