Rake problems

Hello, I'm trying to make my db, but when I put the code, it just don't
do nothing..

felipe <at> Felipe:~/rails_projects/mailler$ rake db:migrate
felipe <at> Felipe:~/rails_projects/mailler$

what can be ?

Thank you.

-- 
Posted via http://www.ruby-forum.com/.

--

-- 
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@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Erwin | 9 Feb 23:38
Picon
Gravatar

how to get the model name of an AR instance

I have a polymorphic class Event

class Event < ActiveRecord::Base
  belongs_to :taskable, :polymorphic => true

so an event.instance has  :  event.taskable_type    and
event.taskable_id
i.e.   event[:taskable_type] = "Project"  event[:taskable_id] = 2

Is it possible to localize the  taskable_type  ( "Project")  using
Model.model_name.human ?   taskable_type is a string...

I tried to get it from the instance ,
event.taskable.model_name.human, but model_name is not an AR instance
method
( NoMethodError: undefined method `human_name' for #<Project...>

--

-- 
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@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Bruno Meira | 9 Feb 23:11
Picon

Will_Paginate

Hi Guys,
In my application I created this method:

  def self.find_paginated_posts_by_post_type(post_type,page=1,query="")
    if query.empty? == false
      query = "%#{query}%"
    else
      query = "%"
    end
    result = includes(:user).
             where(['post_type_id = ? AND title LIKE ?', post_type.id, query]).
             order('created_at DESC').
             page(page)
   return result
  end
 

this method is returning an ActiveRecord::Relation Object. So, when I use
will_paginate method my application throws an exception :

undefined method `total_pages' for #<ActiveRecord::Relation:0x007f94581e7848>
How can I fix it?
Thx

Bruno Meira


--
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-talk+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Erwin | 9 Feb 19:20
Picon
Gravatar

which gem or lib ? name forgotten

When european accentuated characters in strings are displayed  to
uppercase , the accent is displayed...
I know there is ( was) a gem or library to managed such
internationalized strings better ...  but I can't remember the name ..

anyguess ?

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@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Sa Pa | 9 Feb 19:05

Cucumber coverage -- how?

Hello all. I am trying to see how much of my code is covered by Cucumber
features/scenarios. The feature steps are actually using the
browser/views to tests, so they are not directly instantiating
controllers, etc.

My question is, is there a way using SimpleCov or any other coverage
tool to give me a report? Please note that I am NOT directly
instantiating controllers from my steps, rather using the
browser/views/capybara.

I would appreciate any and all replies! Thanks.

S

-- 
Posted via http://www.ruby-forum.com/.

--

-- 
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@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

John Hinnegan | 9 Feb 18:43
Picon
Gravatar

Differing Schemas (MySQL / RDS)

I'm using AWS RDS / MySQL for my DB layer.


I ran migrations on my sandbox environment, and then on my production environment, and I'm getting slight differences.  I'm fairly new to MySQL.  The differences are these AUTO_INCREMENT fields.  Should I take the difference to indicate that I've messed up my migrations and should start fresh?  Or is it possible for the same migrations to result in different schemas?

Schema's dumped using mysqldump:
mysqldump -u xxx -pxxx dbnamexxx --no-data=true --add-drop-table=false -h dbhostxxx > dbnamexxx.schema

then diffed
50c50
< ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
---
> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
69c69
< ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
---
> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
86c86
< ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
---
> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/ATgupfEGbrYJ.
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-talk+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Jade Zallao | 9 Feb 17:47
Picon
Gravatar

Eliminating Duplicates

How will I convert this into searchlogic query?

@students = Students.find_by_sql(["SELECT DISTINCT * FROM students
WHERE first_name LIKE ? OR last_name LIKE ? GROUP BY first_name,
last_name, middle_name",  params[:first_name], params[:last_name] ])

Thank you,

Jade

--

-- 
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@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Pedro | 9 Feb 17:46
Picon
Gravatar

Photo Gallery

Hi there,

I need a photo gallery and was thinking to use picasa or flickr to do
it. Is there a gem or pluging that I could use with rails 2.3.8?

Thanks,

Pedro

--

-- 
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@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Mauro | 9 Feb 17:17
Picon

how to rename a method of a module.

I'm using the gem bootstrap-will_paginate and inside this gem there is
the initializer:

require 'will_paginate/view_helpers/action_view'

module WillPaginate
 module ActionView
   def will_paginate(collection = nil, options = {})
     options, collection = collection, nil if collection.is_a? Hash
     # Taken from original will_paginate code to handle if the helper
is not passed a collection object.
     collection ||= infer_collection_from_controller
     options[:renderer] ||= BootstrapLinkRenderer
     super.try :html_safe
   end

.............

So when I call will_paginate it's rendered using BootstrapLinkRenderer.
I want to rename the method name will_paginate in, for example
bootstrap-will_paginate, so that I can use will_paginate with its own
render and bootstrap-will_paginate with BootstrapLinkRenderer.
How can I do this?

--

-- 
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@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Kausik Bakshi | 9 Feb 16:58

request.subdomain Returns blank array

Hi I am a new Rails Developer

My application_controller is:

class ApplicationController < ActionController::Base
  protect_from_forgery

  before_filter :sshow

  def sshow
    puts "==========================="
    puts YAML::dump(request.subdomains)
  end
end

now when I put kausik.localhost:3000 in my browser address bar it
returns blank Array [] instead ['kausik'] .

Also I rewrite etc/host file for this subdomain.

Please help me

Thanks & regards
Kausik

-- 
Posted via http://www.ruby-forum.com/.

--

-- 
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@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Muruga | 9 Feb 14:19
Picon

Web Services for iphone App

Hi All
        I am working an Rails 2.3.14.I am providing web services for
an iphone app thru xml.
My Rails app uses an authlogic gem for authentication.How to
authenticate  a API call from an iphone app.
       Initially i can able to sign up and login thru  XML post
request.After login how my rails app identify me as a logged
user.Whether i need to provide any token after login and using token
for further request for an API call.I am novice in this.please suggest
me the best way to implement authentication for an iphone app.

    Thanks in advance....

--

-- 
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@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


Gmane