vendor/plugins/make_resourceful/lib/resourceful/default/accessors.rb
# Returns an array of all of the parent objects
# as defined in belongs_to :thing
Returns an array of all of the parent objects
as defined in belongs_to :thing
Returns an array of all of the parent objects as defined in belongs_to : thing
def parent_objects
        return [] if parents.empty?
        return @parent_objects if @parent_objects
        first = parent_models[0].find(parent_params[0])
        @parent_objects = [first]
        parent_params.zip(parents)[1..-1].inject(first) do |memo, arr|
          id, name = arr
          @parent_objects << memo.send(name.pluralize).find(id)
        end
        @parent_objects
      end
def parent_objects return [ ] if parents . empty? return @parent_objects if @parent_objects first = parent_models [ 0 ] . find ( parent_params [ 0 ] ) @parent_objects = [ first ] parent_params . zip ( parents ) [ 1 .. - 1 ] . inject ( first ) do | memo , arr | id , name = arr @parent_objects << memo . send ( name . pluralize ) . find ( id ) end @parent_objects end
Returns an array of all of the parent objects
as defined in belongs_to :thing
Returns an array of all of the parent objects as defined in belongs_to : thing