You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Form in model view as well as in the initial view of all objects related to a specific model, pulls the wrong value for a single attribute for one specific model.
It only appears to happen with this one specific field name ( t.string "title" ).
Versions and gemfile
Upmin 0.1.0
Rails 4.1.4
Ruby 2.0.0p451
source 'https://rubygems.org'
ruby '2.0.0'
gem 'rails', '4.1.4'
# Core
gem 'pg'
gem 'unicorn'
gem 'airbrake'
gem 'redis'
gem 'resque', "~> 1.22.0"
gem 'dotenv-rails'
# API
gem 'active_model_serializers'
gem 'apipie-rails', git: 'git://github.com/Pajk/apipie-rails'
# Auth
gem 'devise'
gem 'cancan'
# Admin
gem 'upmin-admin'
# Attachments/File Uploads
# gem 'paperclip', github: 'thoughtbot/paperclip'
# gem 'aws-sdk'
group :assets do
gem 'sass'
gem 'bootstrap-sass', '~> 3.2.0'
gem 'sass-rails', '~> 4.0.2' #, github: 'rails/sass-rails'
gem 'font-awesome-rails'
gem 'uglifier'
end
group :production do
gem 'heroku-deflater'
gem 'rails_12factor'
end
group :development do
gem 'spring'
end
group :development, :test do
gem 'guard-bundler'
gem 'guard-rspec'
gem 'rspec-rails'
gem 'rspec-collection_matchers'
gem 'factory_girl_rails'
gem 'faker'
end
group :development, :test, :integration, :staging do
gem 'byebug'
gem 'pry-rails', '~> 0.3.2'
end
group :test do
gem 'webmock'
gem 'spork', '> 0.9.0.rc'
gem 'guard-spork'
end
model attributes and sample object
The model in question has the following attributes:
create_table "topics", force: true do |t|
t.string "title"
t.integer "user_id"
t.string "cover_image"
t.datetime "created_at"
t.datetime "updated_at"
end
From the outset, the Topics view does not show the correct title, "Function-based needs-based projection", but shows Title Topic # 2
Similarly, after clicking the Topic object, Title in the form form#edit_topic_2 continues to read as Topic # 2 as does model.title called in the <h3> tag at the top.
I did notice that specifying model.model.title displays the correct title.
Further functionality I explored was a custom admin action for topics to update the title.
app/upmin/models/admin_topics.rb
class AdminTopic < Upmin::Model
attributes :id, :title, :cover_image
actions :update_title
def update_title(new_title)
model.new_title = new_title
model.save!
end
end
This action does render correctly on the page, and performs the action as expected—updating the Topic Title attribute. However, while the change is reflected in the database, it is not reflected in the model view.
The text was updated successfully, but these errors were encountered:
The Issue
Form in model view as well as in the initial view of all objects related to a specific model, pulls the wrong value for a single attribute for one specific model.
It only appears to happen with this one specific field name (
t.string "title"
).Versions and gemfile
Upmin 0.1.0
Rails 4.1.4
Ruby 2.0.0p451
model attributes and sample object
The model in question has the following attributes:
From the outset, the
Topics
view does not show the correct title, "Function-based needs-based projection", but showsTitle Topic # 2
Similarly, after clicking the Topic object,
Title
in the formform#edit_topic_2
continues to read asTopic # 2
as doesmodel.title
called in the<h3>
tag at the top.I did notice that specifying
model.model.title
displays the correct title.Further functionality I explored was a custom admin action for topics to update the title.
app/upmin/models/admin_topics.rb
This action does render correctly on the page, and performs the action as expected—updating the Topic Title attribute. However, while the change is reflected in the database, it is not reflected in the model view.
The text was updated successfully, but these errors were encountered: