[Rails-core] ActiveRecord first vs last

2013-02-22 Thread Panayotis Matsinopoulos
Hi, According to http://guides.rubyonrails.org/active_record_querying.html, first does not use ORDER BY ID to bring the first record. Whereas last does. I find this inconsistent. I can also say that this is buggy on MySQL. limit 1 does not always bring the record with the minimum id. I can

[Rails-core] Why does it route to show when excepting new?

2012-05-30 Thread Panayotis Matsinopoulos
HI, I have the following in my routes: resources :photos, :except = [:new, :edit] When I get /photos/new instead of getting a no route error, it routes to show and recognizes new as id. Is that normal? Panayotis -- You received this message because you are subscribed to the Google Groups

[Rails-core] Re: Why does it route to show when excepting new?

2012-05-30 Thread Panayotis Matsinopoulos
:30, Panayotis Matsinopoulos wrote: HI, I have the following in my routes: resources :photos, :except = [:new, :edit] When I get /photos/new instead of getting a no route error, it routes to show and recognizes new as id. Is that normal? Panayotis -- You received this message

[Rails-core] ActionPack does not understand named routes in mailer views on version 3.0.11 and 3.0.12 on production environment

2012-03-25 Thread Panayotis Matsinopoulos
Hi, I can replicate the problem in which ActionPack fails to undertand named routes in mailer views for version 3.0.11 and 3.0.12 when in production environment. In version 3.0.10 it works ok. The exception that is raised for a statement like the following: link_to _(Click here to see the

[Rails-core] has_one association problem together with Object method override

2011-11-16 Thread Panayotis Matsinopoulos
Hi, I came across a peculiar problem with has_one association in combination with an Object method override. Can somebody explain to me what is going on? Here is how it goes: I have a 'has_one' relationship between Supplier and Account, like in the example of the has_one example used in Rails

[Rails-core] Re: Uniqueness Validator and Case Sensitivity

2011-10-17 Thread Panayotis Matsinopoulos
Let us not compare RDBMS in this thread, because it is irrelevant. Almost all the databases allow you to define the COLLATION at creation time. (except ORACLE which has core problem to support this, as far as I know. I may be wrong though). PostgreSQL does, MySQL does, MS SQL Server does...to name

[Rails-core] Re: Uniqueness Validator and Case Sensitivity

2011-10-17 Thread Panayotis Matsinopoulos
field's collation up front. -john On Mon, Oct 17, 2011 at 2:04 PM, Panayotis Matsinopoulos panayo...@matsinopoulos.gr wrote: Let us not compare RDBMS in this thread, because it is irrelevant. Almost all the databases allow you to define the COLLATION at creation time. (except ORACLE

[Rails-core] Uniqueness Validator and Case Sensitivity

2011-10-16 Thread Panayotis Matsinopoulos
Hi, I would like to ask what is the reason behind the fact that ActiveRecord Uniqueness Validator does the following: if value.nil? || (options[:case_sensitive] || !column.text?) sql = #{sql_attribute} #{operator} else sql = LOWER(#{sql_attribute}) = LOWER(?) end In other words, why it