neerajdotname-active_record_no_table 0.0.3 → 0.0.4
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/History.txt +4 -0
- data/lib/active_record_no_table.rb +3 -3
- metadata +1 -1
data/History.txt
CHANGED
|
@@ -103,7 +103,7 @@ module Validateable_2_3
|
|
|
103
103
|
end
|
|
104
104
|
|
|
105
105
|
module ClassMethods
|
|
106
|
-
def
|
|
106
|
+
def self_and_descendants_from_active_record
|
|
107
107
|
klass = self
|
|
108
108
|
classes = [klass]
|
|
109
109
|
while klass != klass.base_class
|
|
@@ -115,7 +115,7 @@ module Validateable_2_3
|
|
|
115
115
|
end
|
|
116
116
|
|
|
117
117
|
def human_name(options = {})
|
|
118
|
-
defaults =
|
|
118
|
+
defaults = self_and_descendants_from_active_record.map do |klass|
|
|
119
119
|
:"#{klass.name.underscore}"
|
|
120
120
|
end
|
|
121
121
|
defaults << self.name.humanize
|
|
@@ -123,7 +123,7 @@ module Validateable_2_3
|
|
|
123
123
|
end
|
|
124
124
|
|
|
125
125
|
def human_attribute_name(attribute_key_name, options = {})
|
|
126
|
-
defaults =
|
|
126
|
+
defaults = self_and_descendants_from_active_record.map do |klass|
|
|
127
127
|
:"#{klass.name.underscore}.#{attribute_key_name}"
|
|
128
128
|
end
|
|
129
129
|
defaults << options[:default] if options[:default]
|