diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-05-14 09:34:33 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-05-15 09:38:32 +0200 |
commit | 7ffe76046ad142377bf6b286f4477b09513d1e37 (patch) | |
tree | 434ccfa88cd3b6df896004d2d89749b29f988cfa /activeresource/lib/active_resource | |
parent | d18a2742e01d195eb2d228207062aff49f7eb854 (diff) | |
download | rails-7ffe76046ad142377bf6b286f4477b09513d1e37.tar.gz rails-7ffe76046ad142377bf6b286f4477b09513d1e37.tar.bz2 rails-7ffe76046ad142377bf6b286f4477b09513d1e37.zip |
ActiveResource shouldn't consider modules in the path
[#4529 state:committed]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activeresource/lib/active_resource')
-rw-r--r-- | activeresource/lib/active_resource/base.rb | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb index ffdb5fb50a..b976844c1c 100644 --- a/activeresource/lib/active_resource/base.rb +++ b/activeresource/lib/active_resource/base.rb @@ -551,22 +551,8 @@ module ActiveResource @headers ||= {} end - def element_name - @element_name ||= model_name.element - end - - def element_name=(element_name) - @element_name = element_name - @collection_name ||= model_name.collection.sub(/[^\/]*$/, @element_name.pluralize) - end - - def collection_name - @collection_name ||= model_name.collection - end - - def collection_name=(collection_name) - @collection_name = collection_name - end + attr_accessor_with_default(:element_name) { model_name.element } #:nodoc: + attr_accessor_with_default(:collection_name) { ActiveSupport::Inflector.pluralize(element_name) } #:nodoc: attr_accessor_with_default(:primary_key, 'id') #:nodoc: |