search for: table_exists

Displaying 11 results from an estimated 11 matches for "table_exists".

2012 May 15
5
setting up the SQLite database
...create AppName::Models.create_schema end 3.1 delete it after the db is created on the first run? 3.2 check if the db already exists (best way, please)? 3.3 check like this (never understood '':assume''?): AppName::Models.create_schema :assume => (AppName::Models:: table_name.table_exists? ? 1.0 : 0.0) or could we do something simpler like (?): AppName::Models.create_schema unless table_exists?(table_name) ? 4. There''s also this from a previous post (opinions please?): "On the part of migrations ... "def self.up" and "def self.down" ... gave me...
2011 Apr 05
1
Why does AR use base_class for polymorphic relationship "type"
...lass that then inherits from AR. When they are used in a polymorphic relationship the "type" is always the base class. Just curious if anyone has a reason why it doesn''t use the *actual* class rather then the base_class. I have patched AR to use the actual class if !base_class.table_exists? but it adds another query each time (which in turn fails some of the rails tests). My only guess was for use with STI, but even then I am not sure if there is a better solution then using the base_class -Eric -- You received this message because you are subscribed to the Google Groups "Ru...
2006 Feb 21
6
+ camping/session
...def get unless @state.user_id.blank? @user = User.find @state.user_id @post = Post.new end render :add end end ... def Blog.create Camping::Models::Session.create_schema unless Blog::Models::Post.table_exists? ActiveRecord::Schema.define(&Blog::Models.schema) end end This is also covered at the wiki: http://code.whytheluckystiff.net/camping/wiki/CampingSessions. _why
2013 May 09
0
Rails 4.0.0.rc1 - A copy of <class> has been removed from the module tree but is still active!
.... The error goes away after restarting the server but if I made a code change again and send a request, the error would appear again. This is what is in development.rb for reloading Reference::Base. * * *config.to_prepare do * * Reference::DataTypes.reload if ActiveRecord::Base.connection.table_exists? ''reference_data_lists''* * end* I found several other older posts that talk about this topic. One being [1]. Adding "*ActiveSupport::Dependencies.autoload_once_paths << "#{Rails.root}/app/models/reference/base"*" to environment.rb does fix the issu...
2006 Aug 13
3
+ migrations in camping
Camping apps are supposed to be little independent apps, often contained in a single file, which create the database tables and manage them without hassle. These days it''s common to see in a Camping app: module Tepee::Models def self.schema(&block) @@schema = block if block_given? @@schema end end Tepee::Models.schema do create_table :tepee_pages,
2012 Sep 18
2
NoMethodError with rake db:migrate
...nection_adapters/sqlite_adapter.rb:242:in `exec_query'' /var/lib/gems/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:335:in `tables'' /var/lib/gems/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:341:in `table_exists?'' /var/lib/gems/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/schema_statements.rb:425:in `initialize_schema_migrations_table'' /var/lib/gems/1.9.1/gems/activerecord-3.2.8/lib/active_record/migration.rb:663:in `initialize'' /var/lib/gems/1.9...
2008 Sep 24
2
Thinking_sphinx indexing problem on production
Hello, I have been using Sphinx with Thinking_sphinx plugin which works well on local development environment, but once I move it to production (shared host) I get this error and I''m not sure why linkamed-sE8khXQTlBmcZ8xLbwwaNw@public.gmane.org [~/public_html/linko/current/config]# rake thinking_sphinx:index RAILS_ENV=production (in
2006 Jul 05
2
Serialized object behaves weird
Hi! I got a class named EinsatzFilter which I serialized to session. Before saving to session it works afterwards I keep getting the message: "undefined method `to_s'' for #<Person:0x38c6ab8>". "Person" is a from ActiveRecord::Base inherited class. Code: class EinsatzFilter include ApplicationHelper attr_reader :personen, :monat, :projekte, :kunde
2007 Sep 26
0
Rake DB Migration
.../gems/1.8/gems/rails-1.2.3/rubricks/config/../vendor/rails/activ erecord/lib/active_record/connection_adapters/abstract/connection_specification. rb:78:in `connection'' C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/rubricks/config/../vendor/rails/activ erecord/lib/active_record/base.rb:746:in `table_exists?'' C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/rubricks/config/../vendor/plugins/rub ricks/lib/rubricks_components_plugin_reader.rb:2:in `init_plugins'' C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/rubricks/config/../vendor/plugins/rub ricks/lib/rubricks_components_plugin_reader.rb:11...
2014 Feb 17
0
Need help -FATAL: database "catarse_development" does not exist
.../lib/active_record/connection_handling.rb:79:in `retrieve_connection' /usr/local/rvm/gems/ruby-1.9.3-p484/gems/activerecord-4.0.2/lib/active_record/connection_handling.rb:53:in `connection' /usr/local/rvm/gems/ruby-1.9.3-p484/gems/activerecord-4.0.2/lib/active_record/model_schema.rb:203:in `table_exists?' /usr/local/rvm/gems/ruby-1.9.3-p484/gems/activerecord-4.0.2/lib/active_record/attribute_methods/primary_key.rb:92:in `get_primary_key' /usr/local/rvm/gems/ruby-1.9.3-p484/gems/activerecord-4.0.2/lib/active_record/attribute_methods/primary_key.rb:77:in `reset_primary_key' /usr/local/rv...
2010 Sep 18
0
Wine release 1.3.3
...UICallbackProc16 a bit. gdi32/tests: Fix another test description in test_logpen. setupx.dll16: Simplify VCP_CopyFiles by removing a set, but never read, variable. Hans Leidekker (15): dnsapi: Remove the critical section around res_query. msi: Fix comparison of table ids in TABLE_Exists. msi: Open relocated package database in transacted mode. msi/tests: Fix some test failures on 64-bit. msi: Avoid pointer truncation in MSI_ViewFetch and MSI_ViewModify. shell32: Add support for CSIDL_PROGRAM_FILESX86 and CSIDL_PROGRAM_FILES_COMMONX86. wine.inf: Create...