[Rails] update_attributes() for a single column

2013-05-19 Thread rihad
I was just faced with a strange ROLLBACK exception when attempting to execute this code: $ rails console user = User.first User Load (1.1ms) SELECT users.* FROM users ORDER BY users.id ASC LIMIT 1 = #User id: 1, name: Michael Hartl, email: f...@bar.com, created_at: 2013-05-12 12:47:23,

[Rails] Re: update_attributes() for a single column

2013-05-19 Thread rihad
class User ActiveRecord::Base         before_save { email.downcase! } ...         validates :password_confirmation, presence: true         validates :password, length: { minimum: 6 } I now think it may be the peculiarity of the model: it validates presence of password confirmation, which

[Rails] Ruby Problem update

2013-05-19 Thread Jean-René Saint-Etienne
Hello, I have always worked with ruby 1.8.7 on Linux Oracle from the depository available on the system. Today , I decide to install the latest version of ruby --V2.0.0 (from the ruby website). When I type : ruby -v, I have the result : ruby 1.8.7. Indeed, my OS doesn't recognize the update.

[Rails] ASCII Control Sequences ANSI Standard X3.64 Sent By rSpec and Cucumber End Up Mess in Windows Shell

2013-05-19 Thread mrockman
ANSICON, an open-source solution for displaying colors and formatting using ASCII Control Sequences (e.g. DEC-100), crashes when rSpec spits out its report to the Windows Shell.I speculated that Windows PowerShell (formerly Monad) would support colors and formatting, but it doesn't. I

[Rails] Feedback on my first gem: United Attributes

2013-05-19 Thread Niels Buus
I don't know if this is appropriate for this forum, so please kindly dicipline me, if I am out of line. :-) Some days ago, as I was working on a Rails project, it occured to me that numerical values on ActiveRecord objects can be kind of annoying to work with and I got an idea for a solution

[Rails] ActionMailer: Remove Content-ID from multipart emails

2013-05-19 Thread Fernando Morgenstern
Hi, Already asked this question in StackOverflow, but as not responses arrive, decided to give it a try here :) I'm using action mailer to send emails with both html and plain text version. Something like this: mail(:to = 'exam...@example.com', :subject = 'Test message', :from =

[Rails] Make a column data unique for each user_id

2013-05-19 Thread Denny Mueller
This is my setup. I have a table user where all user with password and so on are set. The customer table has some customer related data. The user_id is the foreign key to relate the customers to the user. On of the column in the customer table is the customernumber. These numbers has to be

[Rails] Active Admin with Ajax call

2013-05-19 Thread Bruno Sapienza
Hello everyone. I'm begining with Ruby on Rails, and i'm facing some trouble with ActiveAdmin with ajax. Here's the situation: It's a Kennel's web site, so, while i'm creating a new dog, i have one select/options for the dog's father, dog's mother, and dog's race. After select the dog's

[Rails] [JOBS] Full-time RoR Engineer, San Francisco @ Small, Fast-growing Mobile Company

2013-05-19 Thread Anton Bernstein
* Join us at Playground Worlds, where we’ve made it our mission to create the first virtual world for fun and play on mobile. We create experiences that are simple, engaging, and entertaining. We believe in teamwork, intellectual honesty and excellence. We take ownership of our work,

[Rails] Re: update_attributes() for a single column

2013-05-19 Thread Frederick Cheung
On Sunday, May 19, 2013 9:14:47 AM UTC+1, rihad wrote: I now think it may be the peculiarity of the model: it validates presence of password confirmation, which makes no sense when password itself isn't or shouldn't be updated. That is indeed weird - the only validation I've ever used

[Rails] Re: update_attributes() for a single column

2013-05-19 Thread Javix
Did you define: attr_accessible :email, :name, :password, :password_confirmation, .. #other attributes if needed On Sunday, 19 May 2013 10:37:50 UTC+2, Frederick Cheung wrote: On Sunday, May 19, 2013 9:14:47 AM UTC+1, rihad wrote: I now think it may be the peculiarity of the model: it

[Rails] Re: update_attributes() for a single column

2013-05-19 Thread rihad
On May 19, 1:37 pm, Frederick Cheung frederick.che...@gmail.com wrote: That is indeed weird - the only validation I've ever used in conjunction with the confirmation field is validates_confirmation_of.  You can check user.errors to see all the errors rails thinks the object has. Thanks,

[Rails] Re: update_attributes() for a single column

2013-05-19 Thread rihad
Validation should be conditional. Considering that both password and password_confirmation are virtual and are never saved to the database (only password_digest, a special field expected by has_secure_password), their validation should be special cased (like only password being present to signify

Re: [Rails] Ruby Problem update

2013-05-19 Thread Norbert Melzer
HOW did you installed 2.0 and WHERE did you put the binaries? Did you remember to update your path? If you used rvm, did you remember to load it in bashrc (or similar)? 2013/5/18 Jean-René Saint-Etienne jeanrene97...@gmail.com Hello, I have always worked with ruby 1.8.7 on Linux Oracle from

Re: [Rails] Make a column data unique for each user_id

2013-05-19 Thread Hassan Schroeder
On Sat, May 18, 2013 at 8:14 AM, Denny Mueller macda...@googlemail.com wrote: This is my setup. I have a table user where all user with password and so on are set. The customer table has some customer related data. The user_id is the foreign key to relate the customers to the user. On of the

Re: [Rails] Active Admin with Ajax call

2013-05-19 Thread Walter Lee Davis
On May 17, 2013, at 3:35 PM, Bruno Sapienza wrote: Hello everyone. I'm begining with Ruby on Rails, and i'm facing some trouble with ActiveAdmin with ajax. Here's the situation: It's a Kennel's web site, so, while i'm creating a new dog, i have one select/options for the dog's father,

Re: [Rails] Feedback on my first gem: United Attributes

2013-05-19 Thread Walter Lee Davis
On May 17, 2013, at 9:48 PM, Niels Buus wrote: I don't know if this is appropriate for this forum, so please kindly dicipline me, if I am out of line. :-) Some days ago, as I was working on a Rails project, it occured to me that numerical values on ActiveRecord objects can be kind of

Re: [Rails] Active Admin with Ajax call

2013-05-19 Thread Walter Lee Davis
On May 19, 2013, at 11:36 AM, Walter Lee Davis wrote: On May 17, 2013, at 3:35 PM, Bruno Sapienza wrote: Hello everyone. I'm begining with Ruby on Rails, and i'm facing some trouble with ActiveAdmin with ajax. Here's the situation: It's a Kennel's web site, so, while i'm creating a

[Rails] relationship of shopping cart and order

2013-05-19 Thread John Merlino
Most implementations of shopping carts I have seen is that a user stores line items in a cart, where the line items represent products or subscriptions. So a cart has many products through line items and a product can have many carts through line items. Then a customer makes an order and so you

[Rails] acts_as_list crashes with non-numeric id

2013-05-19 Thread Greg Willits
Seems to me acts_as_list has a bug -- I have data where the row id is a random alphaNumeric, not a simple integer. Using acts_as_list with a scope of a related model id, acts_as_list crashes the app due to a faulty query in MySQL something like this: class LineItem ActiveRecord::Base belongs_to

[Rails] Re: relationship of shopping cart and order

2013-05-19 Thread Nicholas Henry
It important to keep in mind that the episode is focused on PayPal notifications, not describing a fully fleshed out e-commerce domain model. Spree[1] provides a better example of a fully implemented domain model. In Spree, the concept of a 'cart' is implemented using a current order. When an