Hi all,
I’m upgrading Rails from 4.1 to 4.2, and I run into an error saying
“undefined method `type’ for “NUMBER(38)”:String”
I did some research but didn’t find any solution except this one:
https://www.ruby-forum.com/topic/6873169
I’m still new to ruby and rails, could you give some advise on how to
resolve this?
Thank you very much.
Here’s the model
class Item < CSRecordBase
has_many :Item_feature_values,
:foreign_key => :item_id
attr_accessible :is_active, :name, :description
self.sequence_name = :item_id_sequence
def self.all_active
return where("is_active='Y'").order("name")
end
end
Here’s the controller
class WorkCategoriesController < CSApplicationController
def index
@items = Item.all
respond_to do |format|
format.html # index.html.erb
end
end
def show
@item = Item.find(params[:id])
respond_to do |format|
format.html # show.html.erb
end
end
…
end
Hers’s the view
Listing items
Item id | Name | Description | |||
---|---|---|---|---|---|
<%=h item.work_category_id %> | <%=h item.name %> | <%=h item.description %> | <%= link_to 'Show', item %> | <%= link_to 'Edit', edit_item_path(item) %> | <%= link_to 'Destroy', item, data: { confirm: 'Are you sure?' }, :method => :delete %> |