Any reason you have the user_id :integer, :hidden => :true in the
fields list?
this will be automatically added to the migration by hobo_migrate
because of the belongs to user.

At least that is the first thing I see that may cause trouble for you.

you can also use the rake route command to check the routes you have
in development and production.

/MartOn

On Feb 24, 12:47 pm, Edward Samokhvalov <[email protected]> wrote:
> I've just recreated all the app from the scratch and it still works in
> development, but no in production mode.
> In production mode I get working /users/1/stories and /users/1/
> messages, but NOT USERS/1/STATUSES
>
> maybe the problem is in my model? (but how come it works from the
> development still...)
>
> class Status < ActiveRecord::Base
>
>   hobo_model # Don't put anything above this
>
>    fields do
>     details :text
>     user_id :integer, :hidden => :true
>     location :string, :default => "web frontend"
>
>     info_label :string, :name => true, :hidden => :true
>
>     timestamps
>   end
>
>   validates_presence_of :location
>   validates_presence_of :message
>
>   belongs_to :user, :creator => true
>   belongs_to :message
>
>   # or should it be after_update?
>   before_create :set_info_label
>
>   private
>    # this is what user will actually see in the historis statuses list
>    def set_info_label
>         txt = Message.find_by_id(message_id).message_text
>         self.info_label = txt
>    end
>
>   # --- Permissions --- #
>
>   def create_permitted?
>     acting_user.administrator? || acting_user.id == user_id
>   end
>
>   def update_permitted?
>     acting_user.administrator? || acting_user.id == user_id
>   end
>
>   def destroy_permitted?
>    acting_user.administrator? || acting_user.id == user_id
>   end
>
>   def view_permitted?(field)
>     true
>   end
>
> end
>
> On Feb 24, 11:02 am, Edward Samokhvalov <[email protected]> wrote:
>
> > Bryan, maybe it's some permission problem? LIke an app doesn't have
> > access to one controllers code and has to another or smth like that?
> > how can i check?
>
> > On Feb 23, 10:30 pm, Bryan Larsen <[email protected]> wrote:
>
> > > I suspect that your two environments aren't as identical as you think
> > > they are.  That kind of error is easy to make, I've done it many times.
> > > For me, it usually involves forgetting to do a 'git add', although I've
> > > done it many different ways.   It's frustrating when things work perfect
> > > on your dev box and then blow up in deployment.
>
> > > do
>
> > > RAILS_ENV=production rake routes
>
> > > RAILS_ENV=development rake routes
>
> > > have all of the expected routes, and are they the same?
>
> > > Bryan
>
> > > Edward Samokhvalov wrote:
> > > > I'll check tomorrow if it's above, but how come it works in
> > > > development and not in production?
> > > > maybe something was not compiled fully for production?
>
> > > > thx
>
> > > > On Feb 23, 9:12 pm, Bryan Larsen <[email protected]> wrote:
> > > >> This looks like the default routing that Rails puts at the bottom of
> > > >> config/routes.rb.  It explains the failure of users/1/messages and the
> > > >> success of users/messages
>
> > > >> Is Hobo.add_routes(map) in your config/routes.rb, and is it above the
> > > >> rails default route? (which should probably be removed regardless).
>
> > > >> Bryan
>
> > > >> Edward Samokhvalov wrote:
> > > >>> Hello, everyone!
> > > >>> I have a routing for users/index/messages, which works fine in the
> > > >>> development mode on Mongrel.
> > > >>> I tried to migrate it to production like this:
> > > >>> 1) rake db:migrate RAILS_ENV=production
> > > >>> 2) sudo /etc/init.d/apache2 start
> > > >>> It starts, the application works, but when I go 
> > > >>> tohttp://app/users/1/messages
> > > >>> it shows an error, and that's the production.log
> > > >>> Processing UsersController#1 (for 10.0.133.28 at 2010-02-23 16:12:57)
> > > >>> [GET]
> > > >>>   Parameters: {"action"=>"1", "id"=>"statuses", "controller"=>"users"}
> > > >>> ActionController::UnknownAction (No action responded to 1. Actions:
> > > >>> access_denied, account, authenticated_user_from_cookie, authorized?,
> > > >>> create, create_auth_cookie, destroy, do_reset_password, do_signup,
> > > >>> edit, forgot_password, ht, index, login, login_from_cookie,
> > > >>> login_required, logout, model, new,redirect_back_or_default,
> > > >>> reset_password, show, signup, store_location, and update):
> > > >>>   hobo (1.0.0) lib/hobo/controller.rb:23:in `call'
> > > >>>   hobo (1.0.0) lib/hobo/controller.rb:23:in `included_in_class'
> > > >>>   passenger (2.2.7) lib/phusion_passenger/rack/request_handler.rb:
> > > >>> 95:in `process_request'
> > > >>>   passenger (2.2.7) lib/phusion_passenger/abstract_request_handler.rb:
> > > >>> 207:in `main_loop'
> > > >>>   passenger (2.2.7) 
> > > >>> lib/phusion_passenger/railz/application_spawner.rb:
> > > >>> 374:in `start_request_handler'
> > > >>>   passenger (2.2.7) 
> > > >>> lib/phusion_passenger/railz/application_spawner.rb:
> > > >>> 332:in `handle_spawn_application'
> > > >>>   passenger (2.2.7) lib/phusion_passenger/utils.rb:184:in `safe_fork'
> > > >>>   passenger (2.2.7) 
> > > >>> lib/phusion_passenger/railz/application_spawner.rb:
> > > >>> 330:in `handle_spawn_application'
> > > >>>   passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:352:in
> > > >>> `__send__'
> > > >>>   passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:352:in
> > > >>> `main_loop'
> > > >>>   passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:196:in
> > > >>> `start_synchronously'
> > > >>>   passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:163:in
> > > >>> `start'
> > > >>>   passenger (2.2.7) 
> > > >>> lib/phusion_passenger/railz/application_spawner.rb:
> > > >>> 209:in `start'
> > > >>>   passenger (2.2.7) lib/phusion_passenger/spawn_manager.rb:262:in
> > > >>> `spawn_rails_application'
> > > >>>   passenger (2.2.7) lib/phusion_passenger/
> > > >>> abstract_server_collection.rb:126:in `lookup_or_add'
> > > >>>   passenger (2.2.7) lib/phusion_passenger/spawn_manager.rb:256:in
> > > >>> `spawn_rails_application'
> > > >>>   passenger (2.2.7) lib/phusion_passenger/
> > > >>> abstract_server_collection.rb:80:in `synchronize'
> > > >>>   passenger (2.2.7) lib/phusion_passenger/
> > > >>> abstract_server_collection.rb:79:in `synchronize'
> > > >>>   passenger (2.2.7) lib/phusion_passenger/spawn_manager.rb:255:in
> > > >>> `spawn_rails_application'
> > > >>>   passenger (2.2.7) lib/phusion_passenger/spawn_manager.rb:154:in
> > > >>> `spawn_application'
> > > >>>   passenger (2.2.7) lib/phusion_passenger/spawn_manager.rb:287:in
> > > >>> `handle_spawn_application'
> > > >>>   passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:352:in
> > > >>> `__send__'
> > > >>>   passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:352:in
> > > >>> `main_loop'
> > > >>>   passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:196:in
> > > >>> `start_synchronously'
> > > >>> At the same timehttp://app/statusesworks, showing all the statuses
> > > >>> (not for particular user).
> > > >>> Thx in advance.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to