characterizable 0.0.4 → 0.0.5
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/VERSION +1 -1
- data/lib/characterizable.rb +4 -1
- metadata +2 -2
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.5
|
data/lib/characterizable.rb
CHANGED
|
@@ -105,7 +105,10 @@ module Characterizable
|
|
|
105
105
|
include Blockenspiel::DSL
|
|
106
106
|
def has(name, options = {}, &block)
|
|
107
107
|
characteristics[name] = Characteristic.new(self, name, options, &block)
|
|
108
|
-
|
|
108
|
+
if klass.respond_to? :attribute_methods_generated? and !klass.attribute_methods_generated?
|
|
109
|
+
# quacks like an activemodel
|
|
110
|
+
klass.define_attribute_methods
|
|
111
|
+
end
|
|
109
112
|
klass.module_eval(%{
|
|
110
113
|
def #{name}_with_expire_snapshot=(new_#{name})
|
|
111
114
|
expire_snapshot!
|