Skip to content

Instantly share code, notes, and snippets.

ActiveRecord::RecordInvalid in PaymentsController#create
Validation failed: Amount is not a number
Rails.root: /Users/telagraphic/Documents/programming/rails_projects/life-ulator
Application Trace | Framework Trace | Full Trace
app/controllers/payments_controller.rb:8:in `block in create'
app/controllers/payments_controller.rb:7:in `create'
before_filter :correct_user, only: :show
def correct_user
@account = Account.find_by_id(params[:id])
redirect_to root_url unless correct_user?(@account.user_id)
end
<%= form_for @project do |f| %>
<%= f.label :name %>
<br>
<%= f.text_field :name %>
<br>
<%= f.label :description %>
<br>
<%= f.text_field :description%>
<br>
def feed_me(source, subtopic)
@feed = current_user.feeds.build(model_id: source.id, model_name: source.class.to_s, subtopic_id: subtopic.id)
@feed.save
end
NoMethodError in FeedsController#index
undefined method `feed_read' for #<ActiveRecord::Relation:0x007fc784132d58>
Rails.root: /Users/telagraphic/Documents/programming/rails_projects/codebase
Application Trace | Framework Trace | Full Trace
app/controllers/feeds_controller.rb:7:in `index'
class Project < ActiveRecord::Base
attr_accessible :description, :name
has_many :user_projects
has_many :users, :through => :user_projects
end
CREATE TABLE `accounts` (
`account_id` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(30) NOT NULL,
`balance` decimal(9,2) DEFAULT NULL,
PRIMARY KEY (`account_id`)
)
CREATE TABLE `transactions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date` datetime NOT NULL,
mysql> create table workouts
-> (
-> id INT NOT NULL AUTO_INCREMENT,
-> PRIMARY KEY (id),
-> date DATETIME NOT NULL,
-> reps INT NOT NULL,
-> notes VARCHAR(200)
-> );
workouts
________
id
date
reps
desc
exercise_id
exercise
________
@wip
Scenario: Table has columns # codebidspage/CodeTable.feature:22
Then table has only these columns: # CodeTableStepDefs.table_has_only_these_ Then table has only these columns: # CodeTableStepDefs.table_has_only_these_columns(String>)
java.lang.AssertionError
at org.junit.Assert.fail(Assert.java:92)
at org.junit.Assert.assertTrue(Assert.java:43)
at org.junit.Assert.assertTrue(Assert.java:54)
at com.gfs.corp.bid.cucumber.codebidspage.CodeTableStepDefs.table_has_only_these_columns(CodeTableStepDefs.java:51)
at ✽.Then table has only these columns:(codebidspage/CodeTable.feature:23)