Displaying 3 results from an estimated 3 matches for "current_company".
2007 Oct 26
3
Specing with Subdomains as Account Keys
How do you go about implementing and rspecing subdomains as account
keys? I''m sure that this must be an issues for others as well.
So I have an app using subdomains as account keys. The Application
Controller sets up @current_company in a before filter. Everything is
done within the context of the @current_company.
After reading about Demeter''s Revenge (http://www.lukeredpath.co.uk/
2007/10/18/demeters-revenge), and reading Sinclair''s advice (link
above), I refactored @current_company.items.find(:all) to...
2007 Oct 05
7
Easy AR association stubbing
I''ve added a method to the mock class that makes it pretty easy to
stub associations in rails. I''ve been using it for awhile and it seems
to cut down on a lot of setup code for the controller and model specs
that use associations.
#before
@person = mock_model(Person)
posts = mock(''post_proxy'')
posts.stub!(:build).and_return(mock_model(Post, :save => true))
2010 Mar 08
0
Nested Resources + Namespace + Friendly URL
...use the company is gonna be logged in my apps, and my apps already
gets your ID from the session, instead of to get from URL
I would like to have: dashboard/menus/new
Above is my code for to take a ID of the company
before_filter :load_company
def load_company
@company = Company.find(current_company.id)
end
Thanks
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to rubyonrails-t...