smashingboxes / cardboard-admin-archive

Rails 4 CMS
http://smashingboxes.com
Other
65 stars 13 forks source link

Validation failed: Identifier has already been taken #54

Closed KennethAshley closed 11 years ago

KennethAshley commented 11 years ago

This error is shown sometimes when i seed my cardboard file. There are no like parts so im not sure why this issue is showing. The one fix i found was to comment my yml file, seed, uncomment the same yml file, and seed again.

KennethAshley commented 11 years ago
Validation failed: Identifier has already been taken
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/validations.rb:57:in `save!'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/attribute_methods/dirty.rb:41:in `save!'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/transactions.rb:275:in `block in save!'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/transactions.rb:326:in `block in with_transaction_returning_status'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:202:in `block in transaction'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:210:in `within_new_transaction'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:202:in `transaction'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/transactions.rb:209:in `transaction'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/transactions.rb:323:in `with_transaction_returning_status'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/transactions.rb:275:in `save!'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/validations.rb:41:in `create!'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/relation.rb:129:in `block in create!'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/relation.rb:270:in `scoping'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/relation.rb:129:in `create!'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/relation.rb:137:in `first_or_create!'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/bundler/gems/cardboard-02c0f846a0d5/lib/cardboard/helpers/seed.rb:50:in `block in populate_fields'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/bundler/gems/cardboard-02c0f846a0d5/lib/cardboard/helpers/seed.rb:48:in `each'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/bundler/gems/cardboard-02c0f846a0d5/lib/cardboard/helpers/seed.rb:48:in `populate_fields'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/bundler/gems/cardboard-02c0f846a0d5/lib/cardboard/helpers/seed.rb:35:in `block (2 levels) in populate_parts'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/relation/delegation.rb:13:in `each'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/relation/delegation.rb:13:in `each'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/bundler/gems/cardboard-02c0f846a0d5/lib/cardboard/helpers/seed.rb:34:in `block in populate_parts'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/bundler/gems/cardboard-02c0f846a0d5/lib/cardboard/helpers/seed.rb:28:in `each'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/bundler/gems/cardboard-02c0f846a0d5/lib/cardboard/helpers/seed.rb:28:in `populate_parts'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/bundler/gems/cardboard-02c0f846a0d5/lib/cardboard/helpers/seed.rb:15:in `block in populate_pages'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/bundler/gems/cardboard-02c0f846a0d5/lib/cardboard/helpers/seed.rb:10:in `each'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/bundler/gems/cardboard-02c0f846a0d5/lib/cardboard/helpers/seed.rb:10:in `populate_pages'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/bundler/gems/cardboard-02c0f846a0d5/lib/tasks/cardboard_tasks.rake:18:in `block in <top (required)>'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/home/deployer/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:149:in `invoke_task'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/bin/rake:23:in `load'
/home/deployer/www/alma/shared/bundle/ruby/2.0.0/bin/rake:23:in `<main>
elfassy commented 11 years ago

are you sure no two pages have the same identifier? Please paste your yaml file, thanks

KennethAshley commented 11 years ago
pages:
  home:
    title: Home
    parts:
      slides:
        repeatable: true
        fields:
          image:
            type: image
            default: app/assets/images/almahome.jpg
            position: 0
          title:
            type: string
            default: Lorem Ipsum 1
            position: 1
          description:
            type: string
            default: Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
            position: 2
            required: false
          button:
            type: string
            default: Call to Action
            position: 3
            required: false
          link:
            type: string
            position: 3
      mission_statement:
        fields:
          title:
            type: string
            default: Mission Statement
            position: 0
          text:
            type: rich_text
            default: Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
      recent_tweets:
        fields:
          title:
            type: string
            default: Recent Tweets
            position: 0
          handle:
            type: string
            position: 1
  about:
    title: About
    parts:
      about:
        fields:
          title:
            type: string
            default: What is Alma?
          statement:
            type: string
            default: This body was founded by African Heads of State and Government of utilize their individual and collective power across country and regional borders.
          content:
            type: rich_text
            default: <h3>African Leaders of Malaria</h3><p>ALMA is an alliance of African Heads of State and Government working to end malaria-related deaths. This body was founded by African Heads of State to utilize their individual and collective power across country and regional borders:</p><ul><li>Keep malaria high on the political and policy agenda at global national and local levels;</li><li>Provide a forum for high-level collective advocacy to ensure an efficient global procurement system with an emphasis on funding manufacturing and distribution; and</li><li>Provide a forum to share best practices and to review progress and address challenges in meeting the malaria targets.</li></ul><h3>Upcoming ALMA Events</h3><p>In January 2012 ALMA will reconvene during the African Union Summit in Addis Ababa Ethiopia.</p>
            position: 0
      members:
        title: Members
        fields:
          statement:
            type: string
            position: 1
      jobs:
        repeatable: true
        fields:
          statement:
            type: string
          content:
            type: rich_text
            position: 2
  scorecards:
    title: Scorecards
    parts:
      scorecards:
        fields:
          statement:
            type: string
      timeline:
        fields:
          statement:
            type: string
  reference_materials:
    title: Reference Materials
    parts:
      reference_materials:
        fields:    
          statement:
            type: string
      best_practices:
        repeatable: true
        fields:
          title:
            type: string
          practice:
            type: rich_text
            default: Lorem Ipsum color dolor
      reference_docs:
        repeatable: true
        fields:
          title:
            type: string        
          document:
            type: rich_text
            default: Lorem Ipsum color dolor
  ipad:
    title: Ipad View
    parts:
      ipad:
        fields:
          image:
            type: image
            default: app/assets/images/ipad.jpg
          image_statement:
            type: rich_text
            default: Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
          register_text:
            type: rich_text
            default: Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
      troubleshooting:
        title: Troubleshooting
        fields:
          statement:
            type: string
      problems:
        repeatable: true
        fields:
          title:
            type: string
          solution:
            type: rich_text
          video:
            type: string
          video_title:
            type: string
  events:
    title: Events
    parts:
      news:
        fields:
          statement:
            type: string
            position: 0
  news:
    title: News
    parts:
      news:
        fields:
          statement:
            type: string
            position: 0

  contact:
    title: Contact
    parts:
      contact:
        fields:
          statement:
            type: string
            default: Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
          send_to:
            type: string
  initiatives_list:
    title: Initiatives List
    parts:
      initiatives_list:
        fields:
          statement:
            type: string
settings:
  send_to:
    type: string
    required: false
  facebook:
    type: string
    required: false
  twitter:
    type: string
    required: false
  youtube:
    type: string
    required: false
  footer_copyright_year:
    type: integer
    default: 2013