lib/trust/test_helper.rb in trust-0.7.0 vs lib/trust/test_helper.rb in trust-0.8.0

- old
+ new

@@ -23,11 +23,11 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. class Trust::ResourceHelper attr_accessor :instance, :parent, :instances attr_accessor :properties, :params, :action, :instance_params - attr_accessor :info, :parent_info, :relation + attr_accessor :info, :parent_info, :relation, :collection, :association_name class << self attr_accessor :properties end def klass @@ -38,9 +38,13 @@ Trust::Controller::Resource::Info.var_name(klass) end def parent_name Trust::Controller::Resource::Info.var_name(parent.class) + end + + def association_name + @association_name || instance_name.to_s.pluralize.to_sym end def instantiated instances || instance end