mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
annotate class_eval method for active resource schema attributes
This commit is contained in:
parent
c2c8ef57d6
commit
e1b202fc70
1 changed files with 8 additions and 2 deletions
|
@ -20,8 +20,8 @@ module ActiveResource # :nodoc:
|
|||
# end
|
||||
#
|
||||
# The schema stores the name and type of each attribute. That is then
|
||||
# read out by the schema method to populate the actual
|
||||
# Resource's schema
|
||||
# read out by the schema method to populate the schema of the actual
|
||||
# resource.
|
||||
def initialize
|
||||
@attrs = {}
|
||||
end
|
||||
|
@ -40,6 +40,12 @@ module ActiveResource # :nodoc:
|
|||
# The following are the attribute types supported by Active Resource
|
||||
# migrations.
|
||||
KNOWN_ATTRIBUTE_TYPES.each do |attr_type|
|
||||
# def string(*args)
|
||||
# options = args.extract_options!
|
||||
# attr_names = args
|
||||
#
|
||||
# attr_names.each { |name| attribute(name, 'string', options) }
|
||||
# end
|
||||
class_eval <<-EOV, __FILE__, __LINE__ + 1
|
||||
def #{attr_type.to_s}(*args)
|
||||
options = args.extract_options!
|
||||
|
|
Loading…
Reference in a new issue