search for: downcase

Displaying 20 results from an estimated 226 matches for "downcase".

Did you mean: downcast
2006 Jan 09
3
Pagination :conditions not working - MySQL v. PostgreSQL, Rails abstraction v. embedded SQL
Hi everyone, I have this code: @person_pages, @people = paginate :person, :per_page => 20, :conditions => [ "username LIKE ? OR first_name LIKE ? OR last_name LIKE ? OR preferred_name LIKE ?", "%" + params[:q].downcase + "%", "%" + params[:q].downcase + "%", "%" + params[:q].downcase + "%", "%" + params[:q].downcase + "%" ], :order => ''username DESC'' Works like...
2009 Aug 28
0
string downcase or how to use downcase an hostname in puppet?
...ered by puppet. Any change there will # be overwritten every 30 minutes # NETWORKING=yes <% if lsbmajdistrelease == "5" %> NETWORKING_IPV6=no <% end %> HOSTNAME="<%= myfqdn %>" Class used : $ cat rh-hostname.pp class hostnameclean { #$myfqdn = downcase ($fqdn) $fqdn.downcase => $myfqn case $operatingsystem { "Redhat" : { file { "/etc/sysconfig/network" : ensure => present, path => "/etc/sysconfig/network",...
2006 May 02
4
useful bit of code (hopefully)
...others can improve on it: ########### # fix user input before validating it before_validation :sanitize_input # santize input before actual validation is called # this uses the little methods defined below def sanitize_input trim %w(adres postcode woonplaats email naam telefoon mobiel) downcase :email empty_to_nil %w(telefoon mobiel) end # pass in a list of fields whose values will be converted to nil # you should only use these on objects that respond to empty? # if the value is empty (this causes empty strings '''' to become nils) def empty_to_nil(fields) field...
2010 Nov 10
0
Problem with case statement and mb_chars in Ruby-1.9.2
...ommon name" @my_correspondent.correspondent_common_name = s when "legal name" . . . else raise ArgumentError, "#{n} attribute is not provided for." end hll_normalize is defined as: def hll_normalise strip.squeeze(" ").mb_chars.downcase end I pass this case statement this value for n: "common name" When run with Ruby-1.8.7p302 this works. The exact same code run with Ruby-1.9.2p0 yields: common name attribute is not provided for. (ArgumentError) When I enter rails console then I see this: $ rails c Loading develo...
2005 Nov 30
3
Downcasing Legacy Table Column Names
I''m looking for the simplest way to *automatically* downcase the attribute names of Models mapped to legacy tables that use upper case. eg: class Workorder < ActiveRecord::Base set_table_name "WORKORDER" end which has "NAME" as an attribute can use "name" as an attribute. currently: workorder = Workorder.find(1) wor...
2006 Sep 23
8
svn problems
I can consistently segfault the 0.10.4 gem, so I''m trying to get the subversion version working with hopes towards tracking the problem down. I have a fresh SVN checkout but: a) the version (in ferret.rb) claims to be 0.9.6; and b) Ferret::Index::FieldInfos and a couple other classes are missing at run time. It looks like this is because they''re not exported in the C
2006 Sep 05
4
No matches
The following script creates a search index and then searches it. I get no results? Where am I going wrong? Thanks. -----------BEGIN SCRIPT---------------- require ''rubygems'' require ''ferret'' include Ferret path = ''/tmp/myindex'' field_infos = Ferret::Index::FieldInfos.new() field_infos.add_field(:name, :store => :yes, :index => :yes)
2006 Aug 12
0
BUG in actionpack , error evaluating nil.downcase ?
hi all, I try to deploy on my host (site5) on I have this error with dispatch.fcgi start ! ( RAILS_GEM_VERSION = ''1.1.6'' ) You have a nil object when you didn''t expect it! The error occured while evaluating nil.downcase /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/request.rb:18:in `method'' any idea ? arnaud
2006 Mar 13
0
Getting AR to downcase table and column names
...'poolid'' if STUDLY Pool.table_name = ''Pool'' def id; self.PoolId; end def name; self.Name; end def volretention; self.VolRetention; end end end While this works, it''s not very elegant. I''d much prefer some application-wide "downcase field names" setting, but haven''t found any way to force this behavior. Any hints would be greatly appreciated. -- John Kodis.
2013 Sep 15
1
Why does Rails convert scopes to downcase
I found a strange behavior in Rails 4 with scopes when I use postgres. I have a Object with saleStartDate and saleEndDate attributes. scope :active, -> { where(isActivate: true) } > scope :activeDate, -> { active.where("? BETWEEN saleStartDate AND > saleEndDate", Date.today)} When I use sqlite, all works when I want to get the object with the activeDate scope. When
2012 Sep 20
4
access controller's object attributes in view page
...;s view page to get the name of the admin. But when I try to access the name it is showing error as "undefined method `name'' for :current_admin:Symbol".. Please help.. Please find my code below Sessions Controller def create admin=Admin.find_by_email(params[:session][:email].downcase) if admin && admin.authenticate(params[:session][:password]) redirect_to(admins_index_path(:current_admin=>admin)) end end In view page of index_admin <%="Hi"%><%=params[:current_admin.name]%> -- Posted via http://www.ruby-forum.com/. -- You re...
2006 Jul 15
2
FieldQuery not returning anything
Hey .. The QueryParser RDoc page explains to me on how to search for a specific value in a specific field. This is not working the way i thought it should be, what am i doing wrong? Here''s an example .. I''m storing model data in the index like this: doc << Field.new( "object_id", object.id, Field::Store::YES) doc << Field.new( "type",
2005 May 23
1
has_and_belongs_to_many dual insert error ?
...to_increment, title varchar(80) ); create table tags ( id int primary key auto_increment, tag varchar(32) ); Domain objects -------------- class Picture < ActiveRecord::Base has_and_belongs_to_many :tags def update_tags(tags) tags = tags.collect! {|name| name.downcase} reject_invalid_tags(tags) remove_deleted_tags(tags) reject_existing_tags(tags) add_tags_to_picture(tags) end protected def reject_invalid_tags(tags) tags.reject! { |name| name.nil? or name.empty? } end def remove_deleted_tags(tags)...
2006 Dec 27
10
Mixing html tags and Ruby blocks
I''m trying to get the following idea to work: <%= @column_names.each { |t| <td> t.downcase </td> <td> @listing.send(t.downcase)</td> } %> Essentially I want to display a form that has a left and right TD, with the left TD being a column name and the right TD being the column data. If there''s a better way (the Rails way ?), I''m all ears (and half e...
2007 Jan 07
6
0.22.0 Errata: Facts are not downcased
I forgot to mention this in my announcement yesterday. Puppet facts are no longer downcased in the language, and string comparisons now default to being case-insensitive. Where your operating system might previously have been ''solaris'' or ''debian'', it is now ''Solaris'' or ''Debian''. However, you can still do co...
2007 Nov 02
11
xrcise tutorial, undefined method ''upper_bt''
...un'' from tutorial.rb:27 The relevant ruby code looks like. # Inherit from the generated base class and set up event handlers class CaseChangeFrame < TextFrameBase def initialize super evt_button(upper_bt) { text_box.upcase! } evt_button(lower_bt) { text_box.downcase! } end end I have triple checked that I have given the button widget an Id name of upper_bt in DialogBlocks Has anyone come across this before? Thanks Tim _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listi...
2007 Aug 26
2
Multi-word query searching across columns
...t_name and last_name columns. I am using the will_paginate plugin and have the following search method in the model: def self.search(search, page) paginate :page => page, :conditions => ["lower(last_name) like ? or lower(first_name) like ?", "%#{search.downcase}%", "%#{search.downcase} %"] end This works fine if the query entered is a single word like "Bob" - the last_name field is queried for "Bob" and the first_name field is queried for "Bob". However, if I enter a query like "Bob Dylan", how woul...
2006 Apr 20
7
Rails + postgres case insensitive searches.
Hello all I am wondering how rails handles case sensitivity in databases. If I do a Person.find_all_by_name("tim") in mysql I would expect to get tim, TIm, and Tim. Do I only get tim in postgres? How do other people deal with this? Do you resort to find_by_sql for all your postgres queries to get case insensitive results?
2006 May 30
3
match operator in find
Greetings! Is there some special syntax required to use the match operator (=~) in a find operation? Or is it not possible? I''ve got some data items from an external source that could be capitalized or not. So right now I''m stuck with doing: Item.find(:first, :conditions => ["name = ? or name =?", Potatoes, potatoes]) I''d prefer to do:
2010 Dec 30
4
perl code to remove newlines
...ages" href="ch-rpm-verify.html"> <link .... --------- end snippet --------- I've hit a wall trying to remove all the newlines. I've tried it several ways... here's just one: --------- begin snippet --------- while (<$in>) { s/<(\w*\W)/<\L$1/g; # Downcase XXX in "<XXX". s/<\/(\w*\W)/<\/\L$1/g; # Downcase XXX in "</XXX". if(/^>/) # if this line starts with '>' { # then $curr = tell $in; # Note current file position, seek $in, $prev, 0; # go back to previous line, chomp; # remove its...