repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/db/migrate/20140518111006_create_message_transitions.rb
db/migrate/20140518111006_create_message_transitions.rb
class CreateMessageTransitions < ActiveRecord::Migration[5.2] def change create_table :message_transitions do |t| t.string :to_state t.text :metadata, default: '{}' t.integer :sort_key t.references :message t.timestamps end add_index :message_transitions, [:sort_key, :message_id], unique: true end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/db/migrate/20081220034117_create_reserve_stat_has_users.rb
db/migrate/20081220034117_create_reserve_stat_has_users.rb
class CreateReserveStatHasUsers < ActiveRecord::Migration[4.2] def up create_table :reserve_stat_has_users do |t| t.references :user_reserve_stat, index: true, foreign_key: true, null: false t.references :user, index: true, foreign_key: true, null: false t.integer :reserves_count t.timestamps end end def down drop_table :reserve_stat_has_users end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/db/migrate/20150506105356_add_error_message_to_user_import_result.rb
db/migrate/20150506105356_add_error_message_to_user_import_result.rb
class AddErrorMessageToUserImportResult < ActiveRecord::Migration[4.2] def change add_column :user_import_results, :error_message, :text end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb
db/migrate/20120319120638_add_content_type_id_to_manifestation.rb
class AddContentTypeIdToManifestation < ActiveRecord::Migration[4.2] def change add_column :manifestations, :content_type_id, :integer, default: 1 end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/db/migrate/20081028093607_create_event_import_files.rb
db/migrate/20081028093607_create_event_import_files.rb
class CreateEventImportFiles < ActiveRecord::Migration[4.2] def up create_table :event_import_files do |t| t.references :parent, index: true t.string :content_type t.integer :size t.references :user, index: true t.text :note t.datetime :imported_at t.string :event_import_file_name t.string :event_import_content_type t.integer :event_import_file_size t.datetime :event_import_updated_at t.string :edit_mode t.timestamps end end def down drop_table :event_import_files end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/db/migrate/20100211105551_add_admin_networks_to_library_group.rb
db/migrate/20100211105551_add_admin_networks_to_library_group.rb
class AddAdminNetworksToLibraryGroup < ActiveRecord::Migration[4.2] def up add_column :library_groups, :admin_networks, :text end def down remove_column :library_groups, :admin_networks end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/db/migrate/20221112082227_add_index_to_user_has_roles_on_user_id_and_role_id.rb
db/migrate/20221112082227_add_index_to_user_has_roles_on_user_id_and_role_id.rb
class AddIndexToUserHasRolesOnUserIdAndRoleId < ActiveRecord::Migration[6.1] def change remove_index :user_has_roles, :user_id add_index :user_has_roles, [:user_id, :role_id], unique: true end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/db/migrate/20220507153151_remove_deleted_at_from_tables.rb
db/migrate/20220507153151_remove_deleted_at_from_tables.rb
class RemoveDeletedAtFromTables < ActiveRecord::Migration[6.1] def change %i(agents manifestations items subjects reserves libraries shelves user_groups events bookstores subscriptions users ).each do |table| remove_column table, :deleted_at, :timestamp end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/db/migrate/20081025083905_create_languages.rb
db/migrate/20081025083905_create_languages.rb
class CreateLanguages < ActiveRecord::Migration[4.2] # ISO 639 is the set of international standards that lists short codes for language names. # Note this doesn't include macrolanguages (dialects) # Information on macrolanguages http://en.wikipedia.org/wiki/ISO_639_macrolanguage def change create_table :languages do |t| t.string :name, null: false t.string :native_name t.text :display_name t.string :iso_639_1, size: 3 t.string :iso_639_2, size: 3 t.string :iso_639_3, size: 3 t.text :note t.integer :position end add_index :languages, :name, unique: true add_index :languages, :iso_639_1 add_index :languages, :iso_639_2 add_index :languages, :iso_639_3 end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/rails_helper.rb
spec/rails_helper.rb
# This file is copied to spec/ when you run 'rails generate rspec:install' require 'simplecov' SimpleCov.start 'rails' require 'spec_helper' ENV['RAILS_ENV'] ||= 'test' require_relative '../config/environment' # Prevent database truncation if the environment is production abort("The Rails environment is running in production mode!") if Rails.env.production? require 'rspec/rails' # Add additional requires below this line. Rails is not loaded until this point! require 'pundit/rspec' Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } # Requires supporting ruby files with custom matchers and macros, etc, in # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are # run as spec files by default. This means that files in spec/support that end # in _spec.rb will both be required and run as specs, causing the specs to be # run twice. It is recommended that you do not name files matching this glob to # end with _spec.rb. You can configure this pattern with the --pattern # option on the command line or in ~/.rspec, .rspec or `.rspec-local`. # # The following line is provided for convenience purposes. It has the downside # of increasing the boot-up time by auto-requiring all files in the support # directory. Alternatively, in the individual `*_spec.rb` files, manually # require only the support files necessary. # # Dir[Rails.root.join('spec', 'support', '**', '*.rb')].sort.each { |f| require f } # Checks for pending migrations and applies them before tests are run. # If you are not using ActiveRecord, you can remove these lines. begin ActiveRecord::Migration.maintain_test_schema! rescue ActiveRecord::PendingMigrationError => e puts e.to_s.strip exit 1 end RSpec.configure do |config| # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures config.fixture_paths = [ Rails.root.join('spec/fixtures') ] # If you're not using ActiveRecord, or you'd prefer not to run each of your # examples within a transaction, remove the following line or assign false # instead of true. config.use_transactional_fixtures = true # You can uncomment this line to turn off ActiveRecord support entirely. # config.use_active_record = false # RSpec Rails can automatically mix in different behaviours to your tests # based on their file location, for example enabling you to call `get` and # `post` in specs under `spec/controllers`. # # You can disable this behaviour by removing the line below, and instead # explicitly tag your specs with their type, e.g.: # # RSpec.describe UsersController, type: :controller do # # ... # end # # The different available types are documented in the features, such as in # https://relishapp.com/rspec/rspec-rails/docs config.infer_spec_type_from_file_location! # Filter lines from Rails gems in backtraces. config.filter_rails_from_backtrace! # arbitrary gems may also be filtered via: # config.filter_gems_from_backtrace("gem name") config.extend ControllerMacros, type: :controller config.include Pundit::Authorization, type: :view end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/spec_helper.rb
spec/spec_helper.rb
# This file was generated by the `rails generate rspec:install` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # The generated `.rspec` file contains `--require spec_helper` which will cause # this file to always be loaded, without a need to explicitly require it in any # files. # # Given that it is always loaded, you are encouraged to keep this file as # light-weight as possible. Requiring heavyweight dependencies from this file # will add to the boot time of your test suite on EVERY test run, even for an # individual file that may not need all of that loaded. Instead, consider making # a separate helper file that requires the additional dependencies and performs # the additional setup, and require it from the spec files that actually need # it. # # See https://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration RSpec.configure do |config| # rspec-expectations config goes here. You can use an alternate # assertion/expectation library such as wrong or the stdlib/minitest # assertions if you prefer. config.expect_with :rspec do |expectations| # This option will default to `true` in RSpec 4. It makes the `description` # and `failure_message` of custom matchers include text for helper methods # defined using `chain`, e.g.: # be_bigger_than(2).and_smaller_than(4).description # # => "be bigger than 2 and smaller than 4" # ...rather than: # # => "be bigger than 2" expectations.include_chain_clauses_in_custom_matcher_descriptions = true end # rspec-mocks config goes here. You can use an alternate test double # library (such as bogus or mocha) by changing the `mock_with` option here. config.mock_with :rspec do |mocks| # Prevents you from mocking or stubbing a method that does not exist on # a real object. This is generally recommended, and will default to # `true` in RSpec 4. mocks.verify_partial_doubles = true end # This option will default to `:apply_to_host_groups` in RSpec 4 (and will # have no way to turn it off -- the option exists only for backwards # compatibility in RSpec 3). It causes shared context metadata to be # inherited by the metadata hash of host groups and examples, rather than # triggering implicit auto-inclusion in groups with matching metadata. config.shared_context_metadata_behavior = :apply_to_host_groups # The settings below are suggested to provide a good initial experience # with RSpec, but feel free to customize to your heart's content. =begin # This allows you to limit a spec run to individual examples or groups # you care about by tagging them with `:focus` metadata. When nothing # is tagged with `:focus`, all examples get run. RSpec also provides # aliases for `it`, `describe`, and `context` that include `:focus` # metadata: `fit`, `fdescribe` and `fcontext`, respectively. config.filter_run_when_matching :focus # Allows RSpec to persist some state between runs in order to support # the `--only-failures` and `--next-failure` CLI options. We recommend # you configure your source control system to ignore this file. config.example_status_persistence_file_path = "spec/examples.txt" # Limits the available syntax to the non-monkey patched syntax that is # recommended. For more details, see: # https://rspec.info/features/3-12/rspec-core/configuration/zero-monkey-patching-mode/ config.disable_monkey_patching! # Many RSpec users commonly either run the entire suite or an individual # file, and it's useful to allow more verbose output when running an # individual spec file. if config.files_to_run.one? # Use the documentation formatter for detailed output, # unless a formatter has already been configured # (e.g. via a command-line flag). config.default_formatter = "doc" end # Print the 10 slowest examples and example groups at the # end of the spec run, to help surface which specs are running # particularly slow. config.profile_examples = 10 # Run specs in random order to surface order dependencies. If you find an # order dependency and want to debug it, you can fix the order by providing # the seed, which is printed after each run. # --seed 1234 config.order = :random # Seed global randomization in this process using the `--seed` CLI option. # Setting this allows you to use `--seed` to deterministically reproduce # test failures related to randomization by passing the same `--seed` value # as the one that triggered the failure. Kernel.srand config.seed =end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/system/bookmarks_spec.rb
spec/system/bookmarks_spec.rb
require 'rails_helper' RSpec.describe 'Bookmarks', type: :system do include Devise::Test::IntegrationHelpers fixtures :all describe 'When logged in as Librarian' do it 'should get new bookmark' do sign_in users(:librarian1) visit new_bookmark_path('bookmark[title]': 'ブックマークのテスト') expect(page).to have_field('bookmark_title', with: 'ブックマークのテスト') end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/system/user_group_has_checkout_types_spec.rb
spec/system/user_group_has_checkout_types_spec.rb
require 'rails_helper' RSpec.describe 'UserGroupHasCheckoutType', type: :system do include Devise::Test::IntegrationHelpers fixtures :all describe 'When logged in as Admin' do it 'should render' do sign_in users(:admin) visit edit_user_group_has_checkout_type_path(user_group_has_checkout_types(:user_group_has_checkout_type_00001)) expect(page).to have_field 'user_group_has_checkout_type[checkout_limit]' end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/system/items_spec.rb
spec/system/items_spec.rb
require 'rails_helper' RSpec.describe 'Items', type: :system do include Devise::Test::IntegrationHelpers fixtures :all before do @item = FactoryBot.create(:item, shelf: shelves(:shelf_00002)) CarrierType.find_by(name: 'volume').attachment.attach(io: File.open("#{Rails.root.to_s}/app/assets/images/icons/book.png"), filename: 'book.png') FactoryBot.create(:withdraw, item: @item) end describe 'When logged in as Librarian' do before do sign_in users(:librarian1) end it 'should show memo' do @item.update(memo: 'memo') visit item_path(@item.id, locale: :ja) expect(page).to have_content @item.memo end it 'should show price' do @item.update(price: '1500') visit item_path(@item.id, locale: :ja) expect(page).to have_content @item.price end it 'should show budget_type' do budget_type = BudgetType.find(1) @item.update(budget_type: budget_type) visit item_path(@item.id, locale: :ja) expect(page).to have_content '公費' end it 'should show bookstore' do bookstore = Bookstore.find(2) @item.update(bookstore: bookstore) visit item_path(@item.id, locale: :ja) expect(page).to have_content bookstore.name end it 'should show custom properties' do @item.item_custom_values << FactoryBot.build(:item_custom_value) visit item_path(@item.id, locale: :ja) expect(page).to have_content @item.item_custom_values.first.value end it 'should show new item' do visit new_item_path(manifestation_id: @item.manifestation_id, locale: :ja) expect(page).to have_select('item[shelf_id]', selected: 'First shelf') end end describe 'When logged in as User' do before do sign_in users(:user1) end it 'should not show memo' do @item.update(memo: 'memo') visit item_path(@item.id, locale: :ja) expect(page).not_to have_content @item.memo end it 'should not show price' do @item.update(price: '1500') visit item_path(@item.id, locale: :ja) expect(page).not_to have_content @item.price end it 'should not show budget_type' do budget_type = BudgetType.find(1) @item.update(budget_type: budget_type) visit item_path(@item.id, locale: :ja) expect(page).not_to have_content budget_type.display_name end it 'should not show bookstore' do bookstore = Bookstore.find(2) @item.update(bookstore: bookstore) visit item_path(@item.id, locale: :ja) expect(page).not_to have_content bookstore.name end it 'should not show custom properties' do @item.item_custom_values << FactoryBot.build(:item_custom_value) visit item_path(@item.id, locale: :ja) expect(page).not_to have_content @item.item_custom_values.first.value end end describe 'When not logged in' do it 'should not show memo' do @item.update(memo: 'memo') visit item_path(@item.id, locale: :ja) expect(page).not_to have_content @item.memo end it 'should not show budget_type' do budget_type = BudgetType.find(1) @item.update(budget_type: budget_type) visit item_path(@item.id, locale: :ja) expect(page).not_to have_content budget_type.display_name end it 'should not show bookstore' do bookstore = Bookstore.find(2) @item.update(bookstore: bookstore) visit item_path(@item.id, locale: :ja) expect(page).not_to have_content bookstore.name end it 'should not show price' do @item.update(price: '1500') visit item_path(@item.id, locale: :ja) expect(page).not_to have_content @item.price end it 'should add a link to url' do @item.update(url: 'http://example.jp') visit item_path(@item.id) expect(page).to have_link 'http://example.jp' end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/system/series_statements_spec.rb
spec/system/series_statements_spec.rb
require 'rails_helper' RSpec.describe 'SeriesStatements', type: :system do include Devise::Test::IntegrationHelpers fixtures :all before do @series_statement = FactoryBot.create(:series_statement) end describe 'When not logged in' do it 'should show default series_statement' do visit series_statement_path(@series_statement.id, locale: :ja) expect(page).to have_content @series_statement.creator_string end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/system/checkouts_spec.rb
spec/system/checkouts_spec.rb
require 'rails_helper' RSpec.describe 'Checkouts', type: :system do include Devise::Test::IntegrationHelpers fixtures :all before(:each) do CarrierType.find_by(name: 'volume').attachment.attach(io: File.open("#{Rails.root.to_s}/app/assets/images/icons/book.png"), filename: 'book.png') end describe 'When logged in as Librarian' do it 'should contain query params in the facet' do sign_in users(:librarian1) visit checkout_path(checkouts(:checkout_00001)) expect(page).to have_content '利用者番号' expect(page).to have_content checkouts(:checkout_00001).user.username expect(page).to have_content checkouts(:checkout_00001).user.profile.user_number end it 'should edit checkout' do sign_in users(:librarian1) visit edit_checkout_path(checkouts(:checkout_00001)) expect(page).to have_content '貸出の表示' end it 'should get checkouts with item_id' do sign_in users(:librarian1) visit checkouts_path(item_id: 1) expect(page).to have_content checkouts(:checkout_00001).user.username expect(page).to have_content checkouts(:checkout_00001).user.profile.user_number end end describe 'When not logged in', solr: true do before(:each) do Checkout.reindex end it 'should contain query params in the facet' do sign_in users(:librarian1) visit checkouts_path(days_overdue: 10) expect(page).to have_link 'RSS', href: checkouts_path(format: :rss, days_overdue: 10) expect(page).to have_link 'TSV', href: checkouts_path(format: :txt, days_overdue: 10, locale: 'ja') end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/system/baskets_spec.rb
spec/system/baskets_spec.rb
require 'rails_helper' RSpec.describe 'Baskets', type: :system do include Devise::Test::IntegrationHelpers fixtures :all describe 'When logged in as Librarian' do it 'should contain checkout item' do sign_in users(:librarian1) visit new_basket_path fill_in :basket_user_number, with: '00003' click_on '読み込み' fill_in :checked_item_item_identifier, with: '00011' click_on '読み込み' expect(page).to have_content 'よくわかる最新Webサービス技術の基本と仕組み : 標準Webシステム技術とeコマース基盤技術入門' end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/system/manifestations_spec.rb
spec/system/manifestations_spec.rb
require 'rails_helper' RSpec.describe 'Manifestations', type: :system do include Devise::Test::IntegrationHelpers fixtures :all before do @item = FactoryBot.create(:item, shelf: shelves(:shelf_00002)) CarrierType.find_by(name: 'volume').attachment.attach(io: File.open("#{Rails.root.to_s}/app/assets/images/icons/book.png"), filename: 'book.png') FactoryBot.create(:withdraw, item: @item) end describe 'When logged in as Librarian' do before do sign_in users(:librarian1) end it 'should show default item' do visit manifestation_path(@item.manifestation.id, locale: :ja) expect(page).to have_content @item.item_identifier end it 'should show memo' do @item.manifestation.update(memo: 'memo') visit manifestation_path(@item.manifestation.id, locale: :ja) expect(page).to have_content @item.manifestation.memo end it 'should show manifestation in text format' do visit manifestation_path(@item.manifestation.id, locale: :ja, format: :txt) expect(page).to have_content @item.manifestation.original_title end it 'should show manifestation in json format' do visit manifestation_path(@item.manifestation.id, locale: :ja, format: :json) expect(page).not_to have_content @item.item_identifier end it 'should show manifestation in ttl format' do visit manifestation_path(@item.manifestation.id, locale: :ja, format: :ttl) expect(page).to have_content @item.manifestation.original_title end it 'should show custom properties' do @item.manifestation.manifestation_custom_values << FactoryBot.build(:manifestation_custom_value) visit manifestation_path(@item.manifestation.id, locale: :ja) expect(page).to have_content @item.manifestation.manifestation_custom_values.first.value end it 'should display delete_attachment if a file is attached' do @item.manifestation.attachment.attach(io: File.open(Rails.root.join('spec/fixtures/files/resource_import_file_sample1.tsv')), filename: 'attachment.txt') @item.manifestation.save visit edit_manifestation_path(@item.manifestation.id, locale: :ja) expect(page).to have_field('manifestation[delete_attachment]') end it 'should not display delete_attachment if a manifestation is a new record' do visit new_manifestation_path expect(page).not_to have_field('manifestation[delete_attachment]') end end describe 'When logged in as User' do before do sign_in users(:user1) end it 'should show default item' do visit manifestation_path(@item.manifestation.id, locale: :ja) expect(page).not_to have_content @item.item_identifier end it 'should not show memo' do @item.manifestation.update(memo: 'memo') visit manifestation_path(@item.manifestation.id, locale: :ja) expect(page).not_to have_content @item.manifestation.memo end it 'should not show custom properties' do @item.manifestation.manifestation_custom_values << FactoryBot.build(:manifestation_custom_value) visit manifestation_path(@item.manifestation.id, locale: :ja) expect(page).not_to have_content @item.manifestation.manifestation_custom_values.first.value end end describe 'When not logged in' do it 'should display a reservation link' do manifestations(:manifestation_00001).index! visit manifestations_path(query: 'よくわかるWeb') expect(page).to have_content 'Reserve' end it 'should show default item' do visit manifestation_path(@item.manifestation.id, locale: :ja) expect(page).not_to have_content @item.item_identifier end it 'should not show memo' do @item.manifestation.update(memo: 'memo') visit manifestation_path(@item.manifestation.id, locale: :ja) expect(page).not_to have_content @item.manifestation.memo end it 'should not show removed item' do manifestation = manifestations(:manifestation_00010) visit manifestation_path(manifestation) expect(page).not_to have_content '00026' end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/system/reserves_spec.rb
spec/system/reserves_spec.rb
require 'rails_helper' RSpec.describe 'Reserves', type: :system do include Devise::Test::IntegrationHelpers fixtures :all describe 'When logged in as Librarian' do before(:each) do sign_in users(:librarian1) end it 'should contain user information' do visit reserves_path(format: :text) expect(page).to have_content reserves(:reserve_00001).user.username expect(page).to have_content reserves(:reserve_00001).manifestation.original_title end it 'should set default library' do visit new_reserve_path(user_id: users(:user2)) expect(page).to have_select('reserve[pickup_location_id]', selected: 'Hachioji Library') end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/system/checkins_spec.rb
spec/system/checkins_spec.rb
require 'rails_helper' RSpec.describe 'Checkins', type: :system do include Devise::Test::IntegrationHelpers fixtures :all describe 'When logged in as Librarian' do it 'should contain checkin item' do sign_in users(:librarian1) visit new_checkin_path fill_in :checkin_item_identifier, with: '00011' click_on '返却(取り消しはできません)' expect(page).to have_content 'よくわかる最新Webサービス技術の基本と仕組み : 標準Webシステム技術とeコマース基盤技術入門' end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/system/libraries_spec.rb
spec/system/libraries_spec.rb
require 'rails_helper' RSpec.describe 'Libraries', type: :system do include Devise::Test::IntegrationHelpers fixtures :all describe 'When logged in as Administrator' do before do sign_in users(:admin) end xit 'should show library config' do visit library_path(libraries(:library_00002).id, locale: :ja) expect(page).to have_content '設定' end end describe 'When logged in as Librarian' do before do sign_in users(:librarian1) end xit 'should not show library config' do visit library_path(libraries(:library_00002).id, locale: :ja) expect(page).not_to have_link '設定' end it 'should show shelves' do visit library_path(libraries(:library_00002).id, locale: :ja, anchor: 'tab3') expect(find(:xpath, '//div[@id="tab3"]')).to have_content "First shelf 4\nSecond shelf 0" end end describe 'When logged in as User' do before do sign_in users(:user1) end it 'should not show library config' do visit library_path(libraries(:library_00002).id, locale: :ja) expect(page).not_to have_link '設定' end end describe 'When not logged in' do it 'should not show library config' do visit library_path(libraries(:library_00002).id, locale: :ja) expect(page).not_to have_link '設定' end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/support/capybara.rb
spec/support/capybara.rb
require 'capybara/rspec' require "selenium-webdriver" Capybara.register_driver :remote_chrome do |app| url = ENV['SELENIUM_DRIVER_URL'] options = ::Selenium::WebDriver::Chrome::Options.new options.add_argument("--headless") options.add_argument("--no-sandbox") options.add_argument('--disable-dev-shm-usage') options.add_argument('--window-size=1400,1400') Capybara::Selenium::Driver.new(app, browser: :remote, url: url, options: options) end RSpec.configure do |config| config.before(:each, type: :system) do if ENV['SELENIUM_DRIVER_URL'] Capybara.server_host = IPSocket.getaddress(Socket.gethostname) Capybara.app_host = "http://#{Capybara.server_host}" driven_by :remote_chrome else driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ] end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/support/vcr.rb
spec/support/vcr.rb
VCR.configure do |c| c.cassette_library_dir = 'spec/cassette_library' c.hook_into :webmock c.configure_rspec_metadata! c.allow_http_connections_when_no_cassette = true c.ignore_hosts 'localhost', 'solr' end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/support/precompile_assets.rb
spec/support/precompile_assets.rb
RSpec.configure do |config| config.before(:suite) do examples = RSpec.world.filtered_examples.values.flatten has_no_system_tests = examples.none? { |example| example.metadata[:type] == :system } if has_no_system_tests $stdout.puts "\n No system test selected. Skip assets compilation.\n" next end $stdout.puts "\n Precompiling assets.\n" original_stdout = $stdout.clone start = Time.current begin $stdout.reopen(File.new("/dev/null", "w")) require "rake" Rails.application.load_tasks Rake::Task["assets:precompile"].invoke rescue => e raise e.exception ensure $stdout.reopen(original_stdout) $stdout.puts "Finished in #{(Time.current - start).round(2)} seconds" end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/support/devise.rb
spec/support/devise.rb
RSpec.configure do |config| config.include Devise::Test::ControllerHelpers, type: :controller config.include Devise::Test::ControllerHelpers, type: :view config.include Devise::Test::IntegrationHelpers, type: :request end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/support/controller_macros.rb
spec/support/controller_macros.rb
module ControllerMacros def login_admin before(:each) do @request.env["devise.mapping"] = Devise.mappings[:admin] sign_in FactoryBot.create(:admin) end end def login_librarian before(:each) do @request.env["devise.mapping"] = Devise.mappings[:librarian] sign_in FactoryBot.create(:librarian) end end def login_user before(:each) do @request.env["devise.mapping"] = Devise.mappings[:user] sign_in FactoryBot.create(:user) end end def login_fixture_admin before(:each) do @request.env["devise.mapping"] = Devise.mappings[:admin] @user = users(:admin) sign_in @user end end def login_fixture_librarian before(:each) do @request.env["devise.mapping"] = Devise.mappings[:librarian] @user = users(:librarian1) sign_in @user end end def login_fixture_user before(:each) do @request.env["devise.mapping"] = Devise.mappings[:user] @user = users(:user1) sign_in @user end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/routing/periodicals_routing_spec.rb
spec/routing/periodicals_routing_spec.rb
require "rails_helper" RSpec.describe PeriodicalsController, type: :routing do describe "routing" do it "routes to #index" do expect(get: "/periodicals").to route_to("periodicals#index") end it "routes to #new" do expect(get: "/periodicals/new").to route_to("periodicals#new") end it "routes to #show" do expect(get: "/periodicals/1").to route_to("periodicals#show", id: "1") end it "routes to #edit" do expect(get: "/periodicals/1/edit").to route_to("periodicals#edit", id: "1") end it "routes to #create" do expect(post: "/periodicals").to route_to("periodicals#create") end it "routes to #update via PUT" do expect(put: "/periodicals/1").to route_to("periodicals#update", id: "1") end it "routes to #update via PATCH" do expect(patch: "/periodicals/1").to route_to("periodicals#update", id: "1") end it "routes to #destroy" do expect(delete: "/periodicals/1").to route_to("periodicals#destroy", id: "1") end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/routing/picture_files_routing_spec.rb
spec/routing/picture_files_routing_spec.rb
require "rails_helper" RSpec.describe PictureFilesController, type: :routing do describe "routing" do it "routes to #index" do expect(get: "/picture_files").to route_to("picture_files#index") end it "routes to #new" do expect(get: "/picture_files/new").to route_to("picture_files#new") end it "routes to #show" do expect(get: "/picture_files/1").to route_to("picture_files#show", id: "1") end it "routes to #edit" do expect(get: "/picture_files/1/edit").to route_to("picture_files#edit", id: "1") end it "routes to #create" do expect(post: "/picture_files").to route_to("picture_files#create") end it "routes to #update via PUT" do expect(put: "/picture_files/1").to route_to("picture_files#update", id: "1") end it "routes to #update via PATCH" do expect(patch: "/picture_files/1").to route_to("picture_files#update", id: "1") end it "routes to #destroy" do expect(delete: "/picture_files/1").to route_to("picture_files#destroy", id: "1") end it "routes to #download" do expect(get: "/picture_files/1/download").to route_to("picture_files#download", picture_file_id: "1") end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/requests/manifestations_controller_spec.rb
spec/requests/manifestations_controller_spec.rb
require 'rails_helper' RSpec.describe "ManifestationsController", type: :request do describe "GET /manifestations/1" do fixtures :all before(:each) do @manifestation = manifestations(:manifestation_00023) end it 'should not download an attachment file' do @manifestation.attachment.attach(io: File.open(Rails.root.join('app/assets/images/spinner.gif')), filename: 'spinner.gif') expect { get rails_blob_path(@manifestation.attachment) }.to raise_error(Pundit::NotAuthorizedError) expect { get rails_storage_proxy_path(@manifestation.attachment) }.to raise_error(Pundit::NotAuthorizedError) end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/requests/oai_controller_spec.rb
spec/requests/oai_controller_spec.rb
require 'rails_helper' RSpec.describe "OaiController", type: :request do describe "GET /oai" do fixtures :all before(:each) do @manifestation = manifestations(:manifestation_00001) end it "should get Identify" do get oai_path(verb: 'Identify') expect(response).to be_successful end it "should get ListIdentifiers" do get oai_path(verb: 'Identify') expect(response).to be_successful end describe 'oai_dc' do before(:each) do @metadata_format = 'oai_dc' end it "should get ListRecord" do get oai_path(verb: 'ListRecords', metadataPrefix: @metadata_format) expect(response).to be_successful end it "should get GetRecord" do get oai_path(verb: 'GetRecord', identifier: "oai:localhost:manifestations:#{@manifestation.id}", metadataPrefix: @metadata_format) expect(response).to be_successful end end describe 'jpcoar' do before(:each) do @metadata_format = 'jpcoar' end it "should get ListRecords" do get oai_path(verb: 'ListRecords', metadataPrefix: @metadata_format) expect(response).to be_successful end it "should get GetRecord" do get oai_path(verb: 'GetRecord', identifier: "oai:localhost:manifestations:#{@manifestation.id}", metadataPrefix: @metadata_format) expect(response).to be_successful end end describe 'dcndl' do before(:each) do @metadata_format = 'dcndl' end it "should get ListRecords" do get oai_path(verb: 'ListRecords', metadataPrefix: @metadata_format) expect(response).to be_successful end it "should get GetRecord" do get oai_path(verb: 'GetRecord', identifier: "oai:localhost:manifestations:#{@manifestation.id}", metadataPrefix: @metadata_format) expect(response).to be_successful end end describe 'junii2' do before(:each) do @metadata_format = 'junii2' end it "should get ListRecords" do get oai_path(verb: 'ListRecords', metadataPrefix: @metadata_format) expect(response).to be_successful end it "should get GetRecord" do get oai_path(verb: 'GetRecord', identifier: "oai:localhost:manifestations:#{@manifestation.id}", metadataPrefix: @metadata_format) expect(response).to be_successful end end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/requests/iiif_presentations_controller_spec.rb
spec/requests/iiif_presentations_controller_spec.rb
require 'rails_helper' RSpec.describe "IiifPresentationsController", type: :request do describe "GET /show" do fixtures :all before(:each) do @manifestation = manifestations(:manifestation_00001) @manifestation.picture_files.first.attachment.attach(io: File.open(Rails.root.join('app/assets/images/spinner.gif')), filename: 'spinner.gif') end it "should get show" do get iiif_presentation_path(@manifestation, format: :json) expect(response).to be_successful expect(JSON.parse(response.body)['label']).to eq 'よくわかる最新Webサービス技術の基本と仕組み : 標準Webシステム技術とeコマース基盤技術入門' end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/requests/periodicals_spec.rb
spec/requests/periodicals_spec.rb
require 'rails_helper' # This spec was generated by rspec-rails when you ran the scaffold generator. # It demonstrates how one might use RSpec to test the controller code that # was generated by Rails when you ran the scaffold generator. # # It assumes that the implementation code is generated by the rails scaffold # generator. If you are using any extension libraries to generate different # controller code, this generated spec may or may not pass. # # It only uses APIs available in rails and/or rspec-rails. There are a number # of tools you can use to make these specs even more expressive, but we're # sticking to rails and rspec-rails APIs to keep things simple and stable. RSpec.describe "/periodicals", type: :request do # This should return the minimal set of attributes required to create a valid # Periodical. As you add validations to Periodical, be sure to # adjust the attributes here as well. let(:valid_attributes) { FactoryBot.attributes_for(:periodical).merge(manifestation_id: 1) } let(:invalid_attributes) { { manifestation_id: nil } } fixtures :all before(:each) do @user = users(:admin) sign_in @user end describe "GET /index" do it "renders a successful response" do Periodical.create! valid_attributes get periodicals_url expect(response).to be_successful end end describe "GET /show" do it "renders a successful response" do periodical = Periodical.create! valid_attributes get periodical_url(periodical) expect(response).to be_successful end end describe "GET /new" do it "renders a successful response" do get new_periodical_url expect(response).to be_successful end end describe "GET /edit" do it "renders a successful response" do periodical = Periodical.create! valid_attributes get edit_periodical_url(periodical) expect(response).to be_successful end end describe "POST /create" do context "with valid parameters" do it "creates a new Periodical" do expect { post periodicals_url, params: { periodical: valid_attributes } }.to change(Periodical, :count).by(1) end it "redirects to the created periodical" do post periodicals_url, params: { periodical: valid_attributes } expect(response).to redirect_to(periodical_url(Periodical.last)) end end context "with invalid parameters" do it "does not create a new Periodical" do expect { post periodicals_url, params: { periodical: invalid_attributes } }.to change(Periodical, :count).by(0) end it "renders a successful response (i.e. to display the 'new' template)" do post periodicals_url, params: { periodical: invalid_attributes } expect(response).not_to be_successful end end end describe "PATCH /update" do context "with valid parameters" do let(:new_attributes) { skip("Add a hash of attributes valid for your model") } it "updates the requested periodical" do periodical = Periodical.create! valid_attributes patch periodical_url(periodical), params: { periodical: new_attributes } periodical.reload skip("Add assertions for updated state") end it "redirects to the periodical" do periodical = Periodical.create! valid_attributes patch periodical_url(periodical), params: { periodical: new_attributes } periodical.reload expect(response).to redirect_to(periodical_url(periodical)) end end context "with invalid parameters" do it "renders a successful response (i.e. to display the 'edit' template)" do periodical = Periodical.create! valid_attributes patch periodical_url(periodical), params: { periodical: invalid_attributes } expect(response).not_to be_successful end end end describe "DELETE /destroy" do it "destroys the requested periodical" do periodical = Periodical.create! valid_attributes expect { delete periodical_url(periodical) }.to change(Periodical, :count).by(-1) end it "redirects to the periodicals list" do periodical = Periodical.create! valid_attributes delete periodical_url(periodical) expect(response).to redirect_to(periodicals_url) end end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/helpers/application_helper_spec.rb
spec/helpers/application_helper_spec.rb
require 'rails_helper' # Specs in this file have access to a helper object that includes # the PatronsHelper. For example: # # describe PatronsHelper do # describe "string concat" do # it "concats two strings with spaces" do # helper.concat_strings("this","that").should == "this that" # end # end # end describe EnjuManifestationViewer::ApplicationHelper do fixtures :all it "should render google_books preview template" do helper.google_book_search_preview(manifestations(:manifestation_00001).isbn_records.first.body).should =~ /<div id='google_book_search_content'>/ end it "should render youtube template" do helper.embed_content(manifestations(:manifestation_00022)).should =~ /frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen/ end it "should render nicovideo template" do helper.embed_content(manifestations(:manifestation_00023)).should =~ /<script type="application\/javascript" src="https:\/\/embed.nicovideo.jp\/watch\// end it "should render flickr template" do helper.embed_content(manifestations(:manifestation_00218)).should =~ /<object width="400" height="300"><param name="flashvars"/ end #it "should render scribd template" do # helper.embed_content(manifestations(:manifestation_00001)).should =~ /<td colspan="2" style="width: 700px">/ #end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/helpers/manifestations_helper_spec.rb
spec/helpers/manifestations_helper_spec.rb
require 'rails_helper' describe ManifestationsHelper do fixtures :all it 'should export rdf_statement"' do expect(rdf_statement(manifestations(:manifestation_00001)).to_s).to match '<https://next-l.jp/vocab/originalTitle> "よくわかる最新Webサービス技術の基本と仕組み : 標準Webシステム技術とeコマース基盤技術入門"' end it "should get paginate_id_link" do helper.paginate_id_link(manifestations(:manifestation_00003), [ 1, 2, 3 ]).should =~ /Next <a href=\"\/manifestations\/2\">Previous<\/a>/ end it 'should export rdf_statement"' do expect(rdf_statement(manifestations(:manifestation_00001)).to_s).to match 'よくわかる最新Webサービス技術の基本と仕組み : 標準Webシステム技術とeコマース基盤技術入門' end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/helpers/book_jacket_helper_spec.rb
spec/helpers/book_jacket_helper_spec.rb
require 'rails_helper' # Specs in this file have access to a helper object that includes # the PatronsHelper. For example: # # describe PatronsHelper do # describe "string concat" do # it "concats two strings with spaces" do # helper.concat_strings("this","that").should == "this that" # end # end # end describe EnjuManifestationViewer::BookJacketHelper do fixtures :all it "should get screenshot", :vcr => true do helper.screenshot_tag(manifestations(:manifestation_00003)).should =~ /<a href=\"http:\/\/www.slis.keio.ac.jp\/\">/ end it "should get book jacket" do helper.book_jacket_tag(manifestations(:manifestation_00001)).should =~ /<div id=\"gbsthumbnail1\" class=\"book_jacket\"><\/div>/ end it "should get honmoto.com book jacket" do html = helper.book_jacket_tag(manifestations(:manifestation_00001), "hanmotocom") expect(html).to have_selector 'img[src="https://www.hanmoto.com/bd/img/9784798002064.jpg"]' end it "should get openbd book jacket" do helper.book_jacket_tag(manifestations(:manifestation_00001), "openbd").should =~ /<div id=\"openbd_thumbnail1\" class=\"book_jacket\"><\/div>/ end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/helpers/enju_biblio/application_helper_spec.rb
spec/helpers/enju_biblio/application_helper_spec.rb
require 'rails_helper' describe EnjuBiblio::ApplicationHelper do fixtures :all it "should render form_icon if carrier_type is nil" do expect(helper.form_icon(nil)).to match /src=\"\/assets\/icons\/help-/ end it "should render form_icon if carrier_type's attachment is blank" do expect(helper.form_icon(FactoryBot.create(:carrier_type))).to match /src=\"\/assets\/icons\/help-/ end it "should link to old NDL search if iss_itemno ends with '-00'" do expect( helper.ndl_bib_id_record_link( NdlBibIdRecord.new( body: 'R100000039-I001413988-00', manifestation: manifestations(:manifestation_00001) ) ) ).to eq "<a href=\"https://iss.ndl.go.jp/books/R100000039-I001413988-00\">R100000039-I001413988-00</a>" end it "should link to new NDL search if iss_itemno doesn't end with '-00'" do expect( helper.ndl_bib_id_record_link( NdlBibIdRecord.new( body: 'R100000039-I001413988', manifestation: manifestations(:manifestation_00001) ) ) ).to eq "<a href=\"https://ndlsearch.ndl.go.jp/books/R100000039-I001413988\">R100000039-I001413988</a>" end end
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/series_statement_merge_lists.rb
spec/factories/series_statement_merge_lists.rb
FactoryBot.define do factory :series_statement_merge_list do |f| f.sequence(:title) {|n| "series_statement_merge_list_#{n}"} end end # == Schema Information # # Table name: series_statement_merge_lists # # id :bigint not null, primary key # title :string # created_at :datetime not null # updated_at :datetime not null #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/classifications.rb
spec/factories/classifications.rb
FactoryBot.define do factory :classification do |f| f.sequence(:category) {|n| "classification_#{n}"} f.classification_type_id {FactoryBot.create(:classification_type).id} end end # == Schema Information # # Table name: classifications # # id :bigint not null, primary key # category :string not null # label :string # lft :integer # note :text # rgt :integer # url :string # created_at :datetime not null # updated_at :datetime not null # classification_type_id :bigint not null # manifestation_id :bigint # parent_id :bigint # # Indexes # # index_classifications_on_category (category) # index_classifications_on_classification_type_id (classification_type_id) # index_classifications_on_manifestation_id (manifestation_id) # index_classifications_on_parent_id (parent_id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/user_checkout_stats.rb
spec/factories/user_checkout_stats.rb
FactoryBot.define do factory :user_checkout_stat do start_date { 1.week.ago } end_date { 1.day.ago } association :user, factory: :librarian end end # == Schema Information # # Table name: user_checkout_stats # # id :bigint not null, primary key # completed_at :datetime # end_date :datetime # note :text # start_date :datetime # started_at :datetime # created_at :datetime not null # updated_at :datetime not null # user_id :bigint not null # # Indexes # # index_user_checkout_stats_on_user_id (user_id) # # Foreign Keys # # fk_rails_... (user_id => users.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/manifestations.rb
spec/factories/manifestations.rb
FactoryBot.define do factory :manifestation do |f| f.sequence(:original_title) {|n| "manifestation_title_#{n}"} f.carrier_type_id {CarrierType.find(1).id} end factory :manifestation_serial, class: Manifestation do |f| f.sequence(:original_title) {|n| "manifestation_title_#{n}"} f.carrier_type_id {CarrierType.find(1).id} f.language_id {Language.find(1).id} f.serial {true} f.series_statements {[ FactoryBot.create(:series_statement_serial) ]} end end # == Schema Information # # Table name: manifestations # # id :bigint not null, primary key # abstract :text # access_address :string # available_at :datetime # classification_number :string # date_accepted :datetime # date_captured :datetime # date_copyrighted :datetime # date_of_publication :datetime # date_submitted :datetime # depth :integer # description :text # dimensions :text # edition :integer # edition_string :string # end_page :integer # extent :text # fulltext :text # fulltext_content :boolean # height :integer # issue_number :integer # issue_number_string :string # lock_version :integer default(0), not null # manifestation_identifier :string # memo :text # month_of_publication :integer # note :text # original_title :text not null # price :integer # pub_date :string # publication_place :text # repository_content :boolean default(FALSE), not null # required_score :integer default(0), not null # serial :boolean # serial_number :integer # serial_number_string :string # start_page :integer # statement_of_responsibility :text # subscription_master :boolean default(FALSE), not null # title_alternative :text # title_alternative_transcription :text # title_transcription :text # valid_until :datetime # volume_number :integer # volume_number_string :string # width :integer # year_of_publication :integer # created_at :datetime not null # updated_at :datetime not null # carrier_type_id :bigint default(1), not null # content_type_id :bigint default(1) # frequency_id :bigint default(1), not null # language_id :bigint default(1), not null # nii_type_id :bigint # required_role_id :bigint default(1), not null # # Indexes # # index_manifestations_on_access_address (access_address) # index_manifestations_on_date_of_publication (date_of_publication) # index_manifestations_on_manifestation_identifier (manifestation_identifier) # index_manifestations_on_nii_type_id (nii_type_id) # index_manifestations_on_updated_at (updated_at) # # Foreign Keys # # fk_rails_... (required_role_id => roles.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/donates.rb
spec/factories/donates.rb
FactoryBot.define do factory :donate do |f| f.item_id {FactoryBot.create(:item).id} f.agent_id {FactoryBot.create(:agent).id} end end # == Schema Information # # Table name: donates # # id :bigint not null, primary key # created_at :datetime not null # updated_at :datetime not null # agent_id :bigint not null # item_id :bigint not null # # Indexes # # index_donates_on_agent_id (agent_id) # index_donates_on_item_id (item_id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/events.rb
spec/factories/events.rb
FactoryBot.define do factory :event do |f| f.sequence(:name) {|n| "event_#{n}"} f.start_at {Time.zone.now} f.end_at {1.hour.from_now} f.library_id {FactoryBot.create(:library).id} f.event_category_id {FactoryBot.create(:event_category).id} end end # == Schema Information # # Table name: events # # id :bigint not null, primary key # all_day :boolean default(FALSE), not null # display_name :text # end_at :datetime # name :string not null # note :text # start_at :datetime # created_at :datetime not null # updated_at :datetime not null # event_category_id :bigint not null # library_id :bigint not null # place_id :bigint # # Indexes # # index_events_on_event_category_id (event_category_id) # index_events_on_library_id (library_id) # index_events_on_place_id (place_id) # # Foreign Keys # # fk_rails_... (event_category_id => event_categories.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/bookmarks.rb
spec/factories/bookmarks.rb
FactoryBot.define do factory :bookmark do sequence(:title) {|n| "bookmark_#{n}"} sequence(:url) {|n| "http://example.jp/#{n}"} user_id {FactoryBot.create(:user).id} association :manifestation end end # == Schema Information # # Table name: bookmarks # # id :bigint not null, primary key # note :text # shared :boolean # title :text # url :string # created_at :datetime not null # updated_at :datetime not null # manifestation_id :bigint # user_id :bigint not null # # Indexes # # index_bookmarks_on_manifestation_id (manifestation_id) # index_bookmarks_on_url (url) # index_bookmarks_on_user_id (user_id) # # Foreign Keys # # fk_rails_... (user_id => users.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/carrier_type_has_checkout_types.rb
spec/factories/carrier_type_has_checkout_types.rb
FactoryBot.define do factory :carrier_type_has_checkout_type do |f| f.carrier_type_id {FactoryBot.create(:carrier_type).id} f.checkout_type_id {FactoryBot.create(:checkout_type).id} end end # == Schema Information # # Table name: carrier_type_has_checkout_types # # id :bigint not null, primary key # note :text # position :integer # created_at :datetime not null # updated_at :datetime not null # carrier_type_id :bigint not null # checkout_type_id :bigint not null # # Indexes # # index_carrier_type_has_checkout_types_on_carrier_type_id (carrier_type_id,checkout_type_id) UNIQUE # index_carrier_type_has_checkout_types_on_checkout_type_id (checkout_type_id) # # Foreign Keys # # fk_rails_... (carrier_type_id => carrier_types.id) # fk_rails_... (checkout_type_id => checkout_types.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/checkouts.rb
spec/factories/checkouts.rb
FactoryBot.define do factory :checkout, class: Checkout do |f| f.due_date { Time.zone.now.next_week } f.association :item, factory: :item f.association :user, factory: :user f.association :librarian, factory: :librarian f.association :basket, factory: :basket end end # == Schema Information # # Table name: checkouts # # id :bigint not null, primary key # checkout_renewal_count :integer default(0), not null # due_date :datetime # lock_version :integer default(0), not null # created_at :datetime not null # updated_at :datetime not null # basket_id :bigint # checkin_id :bigint # item_id :bigint not null # librarian_id :bigint # library_id :bigint # shelf_id :bigint # user_id :bigint # # Indexes # # index_checkouts_on_basket_id (basket_id) # index_checkouts_on_checkin_id (checkin_id) # index_checkouts_on_item_id (item_id) # index_checkouts_on_item_id_and_basket_id_and_user_id (item_id,basket_id,user_id) UNIQUE # index_checkouts_on_librarian_id (librarian_id) # index_checkouts_on_library_id (library_id) # index_checkouts_on_shelf_id (shelf_id) # index_checkouts_on_user_id (user_id) # # Foreign Keys # # fk_rails_... (checkin_id => checkins.id) # fk_rails_... (item_id => items.id) # fk_rails_... (library_id => libraries.id) # fk_rails_... (shelf_id => shelves.id) # fk_rails_... (user_id => users.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/users.rb
spec/factories/users.rb
FactoryBot.define do factory :admin, class: User do |f| f.sequence(:username) {|n| "admin_#{n}"} f.sequence(:email) {|n| "admin_#{n}@example.jp"} f.password { 'adminpassword' } f.password_confirmation { 'adminpassword' } f.association :profile, required_role_id: 4 f.after(:create) do |user| user_has_role = UserHasRole.new user_has_role.assign_attributes({ user_id: user.id, role_id: Role.find_by(name: 'Administrator').id }) user_has_role.save user.reload end end factory :librarian, class: User do |f| f.sequence(:username) {|n| "librarian_#{n}"} f.sequence(:email) {|n| "librarian_#{n}@example.jp"} f.password { 'librarianpassword' } f.password_confirmation { 'librarianpassword' } f.association :profile, required_role_id: 3 f.after(:create) do |user| user_has_role = UserHasRole.new user_has_role.assign_attributes({ user_id: user.id, role_id: Role.find_by(name: 'Librarian').id }) user_has_role.save user.reload end end factory :user, class: User do |f| f.sequence(:username) {|n| "user_#{n}"} f.sequence(:email) {|n| "user_#{n}@example.jp"} f.password { 'userpassword' } f.password_confirmation { 'userpassword' } f.association :profile f.after(:create) do |user| user_has_role = UserHasRole.new user_has_role.assign_attributes({ user_id: user.id, role_id: Role.find_by(name: 'User').id }) user_has_role.save user.reload end end factory :invalid_user, class: User do |f| f.association :profile end end # == Schema Information # # Table name: users # # id :bigint not null, primary key # confirmed_at :datetime # email :string default(""), not null # encrypted_password :string default(""), not null # expired_at :datetime # failed_attempts :integer default(0) # locked_at :datetime # remember_created_at :datetime # reset_password_sent_at :datetime # reset_password_token :string # unlock_token :string # username :string # created_at :datetime not null # updated_at :datetime not null # profile_id :bigint not null # # Indexes # # index_users_on_email (email) # index_users_on_profile_id (profile_id) # index_users_on_reset_password_token (reset_password_token) UNIQUE # index_users_on_unlock_token (unlock_token) UNIQUE # index_users_on_username (username) UNIQUE # # Foreign Keys # # fk_rails_... (profile_id => profiles.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/content_types.rb
spec/factories/content_types.rb
FactoryBot.define do factory :content_type do |f| f.sequence(:name) {|n| "content_type_#{n}"} end end # == Schema Information # # Table name: content_types # # id :bigint not null, primary key # display_name :text # name :string not null # note :text # position :integer # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_content_types_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/doi_records.rb
spec/factories/doi_records.rb
FactoryBot.define do factory :doi_record do sequence(:body) {|n| "body_#{n}"} association :manifestation end end # == Schema Information # # Table name: doi_records # # id :bigint not null, primary key # body :string not null # created_at :datetime not null # updated_at :datetime not null # manifestation_id :bigint not null # # Indexes # # index_doi_records_on_lower_body_manifestation_id (lower((body)::text), manifestation_id) UNIQUE # index_doi_records_on_manifestation_id (manifestation_id) # # Foreign Keys # # fk_rails_... (manifestation_id => manifestations.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/profiles.rb
spec/factories/profiles.rb
FactoryBot.define do factory :profile, class: Profile do |f| f.user_group_id {UserGroup.first.id} f.required_role_id {Role.where(name: 'User').first.id} f.sequence(:user_number) {|n| "user_number_#{n}"} f.library_id { 2 } f.locale { "ja" } end end # == Schema Information # # Table name: profiles # # id :bigint not null, primary key # checkout_icalendar_token :string # date_of_birth :datetime # expired_at :datetime # full_name :text # full_name_transcription :text # keyword_list :text # locale :string # note :text # save_checkout_history :boolean default(FALSE), not null # share_bookmarks :boolean # user_number :string # created_at :datetime not null # updated_at :datetime not null # library_id :bigint # required_role_id :bigint # user_group_id :bigint # # Indexes # # index_profiles_on_checkout_icalendar_token (checkout_icalendar_token) UNIQUE # index_profiles_on_library_id (library_id) # index_profiles_on_user_group_id (user_group_id) # index_profiles_on_user_number (user_number) UNIQUE # # Foreign Keys # # fk_rails_... (required_role_id => roles.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/budget_types.rb
spec/factories/budget_types.rb
FactoryBot.define do factory :budget_type do |f| f.sequence(:name) {|n| "budget_type_#{n}"} end end # == Schema Information # # Table name: budget_types # # id :bigint not null, primary key # display_name :text # name :string not null # note :text # position :integer # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_budget_types_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/news_posts.rb
spec/factories/news_posts.rb
FactoryBot.define do factory :news_post do |f| f.sequence(:title) {|n| "news_post_#{n}"} f.sequence(:body) {|n| "news_post_#{n}"} f.user {FactoryBot.create(:librarian)} end end # == Schema Information # # Table name: news_posts # # id :bigint not null, primary key # body :text # draft :boolean default(FALSE), not null # end_date :datetime # note :text # position :integer # start_date :datetime # title :text # url :string # created_at :datetime not null # updated_at :datetime not null # required_role_id :bigint default(1), not null # user_id :bigint not null # # Indexes # # index_news_posts_on_user_id (user_id) # # Foreign Keys # # fk_rails_... (required_role_id => roles.id) # fk_rails_... (user_id => users.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/order_lists.rb
spec/factories/order_lists.rb
FactoryBot.define do factory :order_list do |f| f.user_id {FactoryBot.create(:user).id} f.sequence(:title) {|n| "order_list_#{n}"} f.bookstore_id {FactoryBot.create(:bookstore).id} end end # == Schema Information # # Table name: order_lists # # id :bigint not null, primary key # note :text # ordered_at :datetime # title :text not null # created_at :datetime not null # updated_at :datetime not null # bookstore_id :bigint not null # user_id :bigint not null # # Indexes # # index_order_lists_on_bookstore_id (bookstore_id) # index_order_lists_on_user_id (user_id) # # Foreign Keys # # fk_rails_... (bookstore_id => bookstores.id) # fk_rails_... (user_id => users.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/baskets.rb
spec/factories/baskets.rb
FactoryBot.define do factory :basket do |f| f.user_id {FactoryBot.create(:user).id} end end # == Schema Information # # Table name: baskets # # id :bigint not null, primary key # lock_version :integer default(0), not null # note :text # created_at :datetime not null # updated_at :datetime not null # user_id :bigint # # Indexes # # index_baskets_on_user_id (user_id) # # Foreign Keys # # fk_rails_... (user_id => users.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/item_custom_properties.rb
spec/factories/item_custom_properties.rb
FactoryBot.define do factory :item_custom_property do sequence(:name) {|n| "property_name_#{n}"} sequence(:display_name) {|n| "プロパティ名_#{n}"} end end # == Schema Information # # Table name: item_custom_properties # # id :bigint not null, primary key # display_name(表示名) :text not null # name(ラベル名) :string not null # note(備考) :text # position :integer default(1), not null # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_item_custom_properties_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/items.rb
spec/factories/items.rb
FactoryBot.define do factory :item do sequence(:item_identifier) {|n| "item_#{n}"} circulation_status_id {CirculationStatus.find(1).id} manifestation_id {FactoryBot.create(:manifestation).id} after(:build) do |item| bookstore = Bookstore.find(1) budget_type = BudgetType.find(1) item.use_restriction = UseRestriction.find_by(name: 'Limited Circulation, Normal Loan Period') end end end # == Schema Information # # Table name: items # # id :bigint not null, primary key # acquired_at :datetime # binded_at :datetime # binding_call_number :string # binding_item_identifier :string # call_number :string # include_supplements :boolean default(FALSE), not null # item_identifier :string # lock_version :integer default(0), not null # memo :text # missing_since :date # note :text # price :integer # required_score :integer default(0), not null # url :string # created_at :datetime not null # updated_at :datetime not null # bookstore_id :bigint # budget_type_id :bigint # checkout_type_id :bigint default(1), not null # circulation_status_id :bigint default(5), not null # manifestation_id :bigint not null # required_role_id :bigint default(1), not null # shelf_id :bigint default(1), not null # # Indexes # # index_items_on_binding_item_identifier (binding_item_identifier) # index_items_on_bookstore_id (bookstore_id) # index_items_on_checkout_type_id (checkout_type_id) # index_items_on_circulation_status_id (circulation_status_id) # index_items_on_item_identifier (item_identifier) UNIQUE WHERE (((item_identifier)::text <> ''::text) AND (item_identifier IS NOT NULL)) # index_items_on_manifestation_id (manifestation_id) # index_items_on_required_role_id (required_role_id) # index_items_on_shelf_id (shelf_id) # # Foreign Keys # # fk_rails_... (manifestation_id => manifestations.id) # fk_rails_... (required_role_id => roles.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/user_group_has_checkout_types.rb
spec/factories/user_group_has_checkout_types.rb
FactoryBot.define do factory :user_group_has_checkout_type do |f| f.user_group_id {FactoryBot.create(:user_group).id} f.checkout_type_id {FactoryBot.create(:checkout_type).id} end end # == Schema Information # # Table name: user_group_has_checkout_types # # id :bigint not null, primary key # checkout_limit :integer default(0), not null # checkout_period :integer default(0), not null # checkout_renewal_limit :integer default(0), not null # current_checkout_count :integer # fixed_due_date :datetime # note :text # position :integer # reservation_expired_period :integer default(7), not null # reservation_limit :integer default(0), not null # set_due_date_before_closing_day :boolean default(FALSE), not null # created_at :datetime not null # updated_at :datetime not null # checkout_type_id :bigint not null # user_group_id :bigint not null # # Indexes # # index_user_group_has_checkout_types_on_checkout_type_id (checkout_type_id) # index_user_group_has_checkout_types_on_user_group_id (user_group_id,checkout_type_id) UNIQUE # # Foreign Keys # # fk_rails_... (checkout_type_id => checkout_types.id) # fk_rails_... (user_group_id => user_groups.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/frequencies.rb
spec/factories/frequencies.rb
FactoryBot.define do factory :frequency do |f| f.sequence(:name) {|n| "frequency_#{n}"} end end # == Schema Information # # Table name: frequencies # # id :bigint not null, primary key # display_name :text # name :string not null # note :text # position :integer # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_frequencies_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/request_types.rb
spec/factories/request_types.rb
FactoryBot.define do factory :request_type do |f| f.sequence(:name) {|n| "request_type_#{n}"} end end # == Schema Information # # Table name: request_types # # id :bigint not null, primary key # display_name :text # name :string not null # note :text # position :integer # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_request_types_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/checkout_types.rb
spec/factories/checkout_types.rb
FactoryBot.define do factory :checkout_type do |f| f.sequence(:name) {|n| "checkout_type_#{n}"} end end # == Schema Information # # Table name: checkout_types # # id :bigint not null, primary key # display_name :text # name :string not null # note :text # position :integer # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_checkout_types_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/orders.rb
spec/factories/orders.rb
FactoryBot.define do factory :order do |f| f.order_list_id {FactoryBot.create(:order_list).id} f.purchase_request_id {FactoryBot.create(:purchase_request).id} end end # == Schema Information # # Table name: orders # # id :bigint not null, primary key # position :integer # created_at :datetime not null # updated_at :datetime not null # order_list_id :bigint not null # purchase_request_id :bigint not null # # Indexes # # index_orders_on_order_list_id (order_list_id) # index_orders_on_purchase_request_id (purchase_request_id) # # Foreign Keys # # fk_rails_... (order_list_id => order_lists.id) # fk_rails_... (purchase_request_id => purchase_requests.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/user_groups.rb
spec/factories/user_groups.rb
FactoryBot.define do factory :user_group do |f| f.sequence(:name) {|n| "user_group_#{n}"} end end # == Schema Information # # Table name: user_groups # # id :bigint not null, primary key # display_name :text # expired_at :datetime # name :string not null # note :text # number_of_day_to_notify_due_date :integer default(0), not null # number_of_day_to_notify_overdue :integer default(0), not null # number_of_time_to_notify_overdue :integer default(0), not null # position :integer # valid_period_for_new_user :integer default(0), not null # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_user_groups_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/roles.rb
spec/factories/roles.rb
FactoryBot.define do factory :role, class: Role do |f| f.sequence(:name) do |n| idx = "a" n.times { idx = idx.next } "name#{idx}" end end end # == Schema Information # # Table name: roles # # id :bigint not null, primary key # display_name :string # name :string not null # note :text # position :integer # score :integer default(0), not null # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_roles_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/accepts.rb
spec/factories/accepts.rb
# Read about factories at https://github.com/thoughtbot/factory_bot FactoryBot.define do factory :accept do basket_id {FactoryBot.create(:basket).id} item_id {FactoryBot.create(:item).id} librarian_id {FactoryBot.create(:librarian).id} end end # == Schema Information # # Table name: accepts # # id :bigint not null, primary key # created_at :datetime not null # updated_at :datetime not null # basket_id :bigint # item_id :bigint # librarian_id :bigint # # Indexes # # index_accepts_on_basket_id (basket_id) # index_accepts_on_item_id (item_id) UNIQUE # index_accepts_on_librarian_id (librarian_id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/places.rb
spec/factories/places.rb
FactoryBot.define do factory :place do |f| f.sequence(:term) {|n| "term_#{n}"} end end # == Schema Information # # Table name: places # # id :bigint not null, primary key # city :text # latitude :float # longitude :float # term :string # created_at :datetime not null # updated_at :datetime not null # country_id :bigint # # Indexes # # index_places_on_country_id (country_id) # index_places_on_term (term) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/reserves.rb
spec/factories/reserves.rb
FactoryBot.define do factory :reserve do before(:create) do |reserve| profile = FactoryBot.create(:profile) user = User.new(FactoryBot.attributes_for(:user)) user.profile = profile reserve.user = user end after(:build) do |reserve| item = FactoryBot.create(:item, use_restriction: UseRestriction.find_by(name: 'Available On Shelf')) reserve.manifestation = item.manifestation reserve.item = item end end end # == Schema Information # # Table name: reserves # # id :bigint not null, primary key # canceled_at :datetime # checked_out_at :datetime # expiration_notice_to_library :boolean default(FALSE) # expiration_notice_to_patron :boolean default(FALSE) # expired_at :datetime # lock_version :integer default(0), not null # postponed_at :datetime # retained_at :datetime # created_at :datetime not null # updated_at :datetime not null # item_id :bigint # manifestation_id :bigint not null # pickup_location_id :bigint # request_status_type_id :bigint not null # user_id :bigint not null # # Indexes # # index_reserves_on_item_id (item_id) # index_reserves_on_manifestation_id (manifestation_id) # index_reserves_on_pickup_location_id (pickup_location_id) # index_reserves_on_user_id (user_id) # # Foreign Keys # # fk_rails_... (manifestation_id => manifestations.id) # fk_rails_... (user_id => users.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/produces.rb
spec/factories/produces.rb
FactoryBot.define do factory :produce do |f| f.manifestation_id {FactoryBot.create(:manifestation).id} f.agent_id {FactoryBot.create(:agent).id} end end # == Schema Information # # Table name: produces # # id :bigint not null, primary key # position :integer # created_at :datetime not null # updated_at :datetime not null # agent_id :bigint not null # manifestation_id :bigint not null # produce_type_id :bigint # # Indexes # # index_produces_on_agent_id (agent_id) # index_produces_on_manifestation_id_and_agent_id (manifestation_id,agent_id) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/participates.rb
spec/factories/participates.rb
FactoryBot.define do factory :participate do |f| f.event_id {FactoryBot.create(:event).id} f.agent_id {FactoryBot.create(:agent).id} end end # == Schema Information # # Table name: participates # # id :bigint not null, primary key # position :integer # created_at :datetime not null # updated_at :datetime not null # agent_id :bigint not null # event_id :bigint not null # # Indexes # # index_participates_on_agent_id (agent_id) # index_participates_on_event_id (event_id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/classification_types.rb
spec/factories/classification_types.rb
FactoryBot.define do factory :classification_type do |f| f.sequence(:name) {|n| "classification_type_#{n}"} end end # == Schema Information # # Table name: classification_types # # id :bigint not null, primary key # display_name :text # name :string not null # note :text # position :integer # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_classification_types_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/periodicals.rb
spec/factories/periodicals.rb
FactoryBot.define do factory :periodical do sequence(:original_title) {|n| "periodical_title_#{n}"} association :manifestation frequency_id { 1 } end end # == Schema Information # # Table name: periodicals # # id :bigint not null, primary key # original_title :text not null # created_at :datetime not null # updated_at :datetime not null # frequency_id :bigint not null # manifestation_id :bigint not null # # Indexes # # index_periodicals_on_frequency_id (frequency_id) # index_periodicals_on_manifestation_id (manifestation_id) # # Foreign Keys # # fk_rails_... (frequency_id => frequencies.id) # fk_rails_... (manifestation_id => manifestations.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/series_statements.rb
spec/factories/series_statements.rb
FactoryBot.define do factory :series_statement do sequence(:original_title) {|n| "series_statement_#{n}"} sequence(:creator_string) {|n| "シリーズの著者 #{n}" } end factory :series_statement_serial, class: SeriesStatement do sequence(:original_title) {|n| "series_statement_serial_#{n}" } #f.root_manifestation_id{FactoryBot.create(:manifestation_serial).id} series_master {true} end end # == Schema Information # # Table name: series_statements # # id :bigint not null, primary key # creator_string :text # note :text # numbering :text # numbering_subseries :text # original_title :text # position :integer # series_master :boolean # series_statement_identifier :string # title_alternative :text # title_subseries :text # title_subseries_transcription :text # title_transcription :text # volume_number_string :text # volume_number_transcription_string :text # created_at :datetime not null # updated_at :datetime not null # manifestation_id :bigint # root_manifestation_id :bigint # # Indexes # # index_series_statements_on_manifestation_id (manifestation_id) # index_series_statements_on_root_manifestation_id (root_manifestation_id) # index_series_statements_on_series_statement_identifier (series_statement_identifier) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/agent_relationship_types.rb
spec/factories/agent_relationship_types.rb
FactoryBot.define do factory :agent_relationship_type do |f| f.sequence(:name) {|n| "agent_relationship_type_#{n}"} end end # == Schema Information # # Table name: agent_relationship_types # # id :bigint not null, primary key # display_name :text # name :string not null # note :text # position :integer # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_agent_relationship_types_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/libraries.rb
spec/factories/libraries.rb
FactoryBot.define do factory :library do |f| f.sequence(:name) {|n| "library#{n}"} f.sequence(:short_display_name) {|n| "library_#{n}"} f.library_group_id {LibraryGroup.first.id} end end FactoryBot.define do factory :invalid_library, class: Library do |f| f.library_group_id {LibraryGroup.first.id} end end # == Schema Information # # Table name: libraries # # id :bigint not null, primary key # call_number_delimiter :string default("|"), not null # call_number_rows :integer default(1), not null # display_name :text # fax_number :string # isil :string # latitude :float # locality :text # longitude :float # name :string not null # note :text # opening_hour :text # position :integer # region :text # short_display_name :string not null # street :text # telephone_number_1 :string # telephone_number_2 :string # users_count :integer default(0), not null # zip_code :string # created_at :datetime not null # updated_at :datetime not null # country_id :bigint # library_group_id :bigint not null # # Indexes # # index_libraries_on_isil (isil) UNIQUE WHERE (((isil)::text <> ''::text) AND (isil IS NOT NULL)) # index_libraries_on_library_group_id (library_group_id) # index_libraries_on_lower_name (lower((name)::text)) UNIQUE # index_libraries_on_name (name) UNIQUE # # Foreign Keys # # fk_rails_... (library_group_id => library_groups.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/circulation_statuses.rb
spec/factories/circulation_statuses.rb
FactoryBot.define do factory :circulation_status do |f| f.sequence(:name) {|n| "circulation_status_#{n}"} end end # == Schema Information # # Table name: circulation_statuses # # id :bigint not null, primary key # display_name :text # name :string not null # note :text # position :integer # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_circulation_statuses_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/agent_merge_lists.rb
spec/factories/agent_merge_lists.rb
FactoryBot.define do factory :agent_merge_list do |f| f.sequence(:title) {|n| "agent_merge_list_#{n}"} end end # == Schema Information # # Table name: agent_merge_lists # # id :bigint not null, primary key # title :string # created_at :datetime not null # updated_at :datetime not null #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/withdraws.rb
spec/factories/withdraws.rb
# Read about factories at https://github.com/thoughtbot/factory_bot FactoryBot.define do factory :withdraw do item_id {FactoryBot.create(:item).id} librarian_id {FactoryBot.create(:librarian).id} basket_id {FactoryBot.create(:basket, user_id: librarian_id).id} end end # == Schema Information # # Table name: withdraws # # id :bigint not null, primary key # created_at :datetime not null # updated_at :datetime not null # basket_id :bigint # item_id :bigint # librarian_id :bigint # # Indexes # # index_withdraws_on_basket_id (basket_id) # index_withdraws_on_item_id (item_id) UNIQUE # index_withdraws_on_librarian_id (librarian_id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/demands.rb
spec/factories/demands.rb
FactoryBot.define do factory :demand do user_id { FactoryBot.create(:user).id } item_id { FactoryBot.create(:item).id } message_id { FactoryBot.create(:message).id } end end # == Schema Information # # Table name: demands # # id :bigint not null, primary key # created_at :datetime not null # updated_at :datetime not null # item_id :bigint # message_id :bigint # user_id :bigint not null # # Indexes # # index_demands_on_item_id (item_id) # index_demands_on_message_id (message_id) # index_demands_on_user_id (user_id) # # Foreign Keys # # fk_rails_... (item_id => items.id) # fk_rails_... (message_id => messages.id) # fk_rails_... (user_id => users.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/bookmark_stats.rb
spec/factories/bookmark_stats.rb
FactoryBot.define do factory :bookmark_stat do |f| f.start_date { 1.week.ago } f.end_date { 1.day.ago } end end # == Schema Information # # Table name: bookmark_stats # # id :bigint not null, primary key # start_date :datetime # end_date :datetime # started_at :datetime # completed_at :datetime # note :text # created_at :datetime not null # updated_at :datetime not null #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/identifier_types.rb
spec/factories/identifier_types.rb
FactoryBot.define do factory :identifier_type do |f| f.sequence(:name) {|n| "identifier_type_#{n}"} end end # == Schema Information # # Table name: identifier_types # # id :bigint not null, primary key # display_name :text # name :string not null # note :text # position :integer # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_identifier_types_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/manifestation_custom_values.rb
spec/factories/manifestation_custom_values.rb
FactoryBot.define do factory :manifestation_custom_value do association :manifestation_custom_property sequence(:value) {|n| "value_#{n}"} end end # == Schema Information # # Table name: manifestation_custom_values # # id :bigint not null, primary key # value :text # created_at :datetime not null # updated_at :datetime not null # manifestation_custom_property_id :bigint not null # manifestation_id :bigint not null # # Indexes # # index_manifestation_custom_values_on_custom_property_id (manifestation_custom_property_id) # index_manifestation_custom_values_on_manifestation_id (manifestation_id) # index_manifestation_custom_values_on_property_manifestation (manifestation_custom_property_id,manifestation_id) UNIQUE # # Foreign Keys # # fk_rails_... (manifestation_custom_property_id => manifestation_custom_properties.id) # fk_rails_... (manifestation_id => manifestations.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/countries.rb
spec/factories/countries.rb
FactoryBot.define do factory :country do |f| f.sequence(:name) {|n| "country_#{n}"} f.sequence(:alpha_2) {|n| "alpha_2_#{n}"} f.sequence(:alpha_3) {|n| "alpha_3_#{n}"} f.sequence(:numeric_3) {|n| "numeric_3_#{n}"} end end # == Schema Information # # Table name: countries # # id :bigint not null, primary key # alpha_2 :string # alpha_3 :string # display_name :text # name :string not null # note :text # numeric_3 :string # position :integer # # Indexes # # index_countries_on_alpha_2 (alpha_2) # index_countries_on_alpha_3 (alpha_3) # index_countries_on_lower_name (lower((name)::text)) UNIQUE # index_countries_on_numeric_3 (numeric_3) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/event_categories.rb
spec/factories/event_categories.rb
FactoryBot.define do factory :event_category do |f| f.sequence(:name) {|n| "event_category_#{n}"} end end # == Schema Information # # Table name: event_categories # # id :bigint not null, primary key # name :string not null # display_name :text # note :text # position :integer # created_at :datetime not null # updated_at :datetime not null #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/manifestation_custom_properties.rb
spec/factories/manifestation_custom_properties.rb
FactoryBot.define do factory :manifestation_custom_property do sequence(:name) {|n| "property_name_#{n}"} sequence(:display_name) {|n| "プロパティ名_#{n}"} end end # == Schema Information # # Table name: manifestation_custom_properties # # id :bigint not null, primary key # display_name(表示名) :text not null # name(ラベル名) :string not null # note(備考) :text # position :integer default(1), not null # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_manifestation_custom_properties_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/news_feeds.rb
spec/factories/news_feeds.rb
FactoryBot.define do factory :news_feed do |f| f.sequence(:title) {|n| "news_feed_#{n}"} f.sequence(:url) {|n| "http://www.example.com/feed/#{n}"} end end # == Schema Information # # Table name: news_feeds # # id :bigint not null, primary key # library_group_id :bigint default(1), not null # title :string # url :string # body :text # position :integer # created_at :datetime not null # updated_at :datetime not null #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/subject_types.rb
spec/factories/subject_types.rb
FactoryBot.define do factory :subject_type do |f| f.sequence(:name) {|n| "subject_type_#{n}"} end end # == Schema Information # # Table name: subject_types # # id :bigint not null, primary key # display_name :text # name :string not null # note :text # position :integer # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_subject_types_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/create_types.rb
spec/factories/create_types.rb
# Read about factories at http://github.com/thoughtbot/factory_bot FactoryBot.define do factory :create_type do name { "mystring" } display_name { "MyText" } note { "MyText" } end end # == Schema Information # # Table name: create_types # # id :bigint not null, primary key # display_name :text # name :string not null # note :text # position :integer # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_create_types_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/series_statement_merges.rb
spec/factories/series_statement_merges.rb
FactoryBot.define do factory :series_statement_merge do |f| f.series_statement_merge_list_id {FactoryBot.create(:series_statement_merge_list).id} f.series_statement_id {FactoryBot.create(:series_statement).id} end end # == Schema Information # # Table name: series_statement_merges # # id :bigint not null, primary key # created_at :datetime not null # updated_at :datetime not null # series_statement_id :bigint not null # series_statement_merge_list_id :bigint not null # # Indexes # # index_series_statement_merges_on_list_id (series_statement_merge_list_id) # index_series_statement_merges_on_series_statement_id (series_statement_id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/licenses.rb
spec/factories/licenses.rb
FactoryBot.define do factory :license do |f| f.sequence(:name) {|n| "license_#{n}"} end end # == Schema Information # # Table name: licenses # # id :bigint not null, primary key # display_name :string # name :string not null # note :text # position :integer # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_licenses_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/identifiers.rb
spec/factories/identifiers.rb
FactoryBot.define do factory :identifier do sequence(:body) {|n| "identifier_body_#{n}"} association :identifier_type association :manifestation end end # == Schema Information # # Table name: identifiers # # id :bigint not null, primary key # body :string not null # position :integer # created_at :datetime not null # updated_at :datetime not null # identifier_type_id :bigint not null # manifestation_id :bigint # # Indexes # # index_identifiers_on_body_and_identifier_type_id (body,identifier_type_id) # index_identifiers_on_manifestation_id (manifestation_id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/messages.rb
spec/factories/messages.rb
FactoryBot.define do factory :message do recipient { 'user1' } association :sender, factory: :user subject { 'new message' } body { 'new message body is really short' } end end # == Schema Information # # Table name: messages # # id :bigint not null, primary key # body :text # depth :integer # lft :integer # read_at :datetime # rgt :integer # subject :string not null # created_at :datetime not null # updated_at :datetime not null # message_request_id :bigint # parent_id :bigint # receiver_id :bigint # sender_id :bigint # # Indexes # # index_messages_on_message_request_id (message_request_id) # index_messages_on_parent_id (parent_id) # index_messages_on_receiver_id (receiver_id) # index_messages_on_sender_id (sender_id) # # Foreign Keys # # fk_rails_... (parent_id => messages.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/agent_merges.rb
spec/factories/agent_merges.rb
FactoryBot.define do factory :agent_merge do |f| f.agent_merge_list_id {FactoryBot.create(:agent_merge_list).id} f.agent_id {FactoryBot.create(:agent).id} end end # == Schema Information # # Table name: agent_merges # # id :bigint not null, primary key # created_at :datetime not null # updated_at :datetime not null # agent_id :bigint not null # agent_merge_list_id :bigint not null # # Indexes # # index_agent_merges_on_agent_id (agent_id) # index_agent_merges_on_agent_merge_list_id (agent_merge_list_id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/item_custom_values.rb
spec/factories/item_custom_values.rb
FactoryBot.define do factory :item_custom_value do association :item_custom_property sequence(:value) {|n| "value_#{n}"} end end # == Schema Information # # Table name: item_custom_values # # id :bigint not null, primary key # value :text # created_at :datetime not null # updated_at :datetime not null # item_custom_property_id :bigint not null # item_id :bigint not null # # Indexes # # index_item_custom_values_on_custom_item_property_and_item_id (item_custom_property_id,item_id) UNIQUE # index_item_custom_values_on_custom_property_id (item_custom_property_id) # index_item_custom_values_on_item_id (item_id) # # Foreign Keys # # fk_rails_... (item_custom_property_id => item_custom_properties.id) # fk_rails_... (item_id => items.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/subject_heading_types.rb
spec/factories/subject_heading_types.rb
FactoryBot.define do factory :subject_heading_type do |f| f.sequence(:name) {|n| "subject_heading_type_#{n}"} end end # == Schema Information # # Table name: subject_heading_types # # id :bigint not null, primary key # display_name :text # name :string not null # note :text # position :integer # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_subject_heading_types_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/manifestation_relationships.rb
spec/factories/manifestation_relationships.rb
FactoryBot.define do factory :manifestation_relationship do parent_id {FactoryBot.create(:manifestation).id} child_id {FactoryBot.create(:manifestation).id} association :manifestation_relationship_type end end # == Schema Information # # Table name: manifestation_relationships # # id :bigint not null, primary key # position :integer # created_at :datetime not null # updated_at :datetime not null # child_id :bigint # manifestation_relationship_type_id :bigint # parent_id :bigint # # Indexes # # index_manifestation_relationships_on_child_id (child_id) # index_manifestation_relationships_on_parent_id (parent_id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/agents.rb
spec/factories/agents.rb
FactoryBot.define do factory :agent do |f| f.sequence(:full_name) {|n| "full_name_#{n}"} f.agent_type_id {AgentType.find_by(name: 'person').id} f.country_id {Country.first.id} f.language_id {Language.first.id} end end FactoryBot.define do factory :invalid_agent, class: Agent do |f| end end # == Schema Information # # Table name: agents # # id :bigint not null, primary key # address_1 :text # address_1_note :text # address_2 :text # address_2_note :text # agent_identifier :string # birth_date :string # corporate_name :string # corporate_name_transcription :string # date_of_birth :datetime # date_of_death :datetime # death_date :string # email :text # fax_number_1 :string # fax_number_2 :string # first_name :string # first_name_transcription :string # full_name :string # full_name_alternative :text # full_name_alternative_transcription :text # full_name_transcription :text # last_name :string # last_name_transcription :string # locality :text # lock_version :integer default(0), not null # middle_name :string # middle_name_transcription :string # note :text # other_designation :text # place :text # postal_code :string # region :text # required_score :integer default(0), not null # street :text # telephone_number_1 :string # telephone_number_2 :string # url :text # zip_code_1 :string # zip_code_2 :string # created_at :datetime not null # updated_at :datetime not null # agent_type_id :bigint default(1), not null # country_id :bigint default(1), not null # language_id :bigint default(1), not null # profile_id :bigint # required_role_id :bigint default(1), not null # # Indexes # # index_agents_on_agent_identifier (agent_identifier) # index_agents_on_country_id (country_id) # index_agents_on_full_name (full_name) # index_agents_on_language_id (language_id) # index_agents_on_profile_id (profile_id) # index_agents_on_required_role_id (required_role_id) # # Foreign Keys # # fk_rails_... (required_role_id => roles.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/languages.rb
spec/factories/languages.rb
FactoryBot.define do factory :language do |f| f.sequence(:name) {|n| "language_#{n}"} f.sequence(:iso_639_1) {|n| "639_1_#{n}"} f.sequence(:iso_639_2) {|n| "639_2_#{n}"} f.sequence(:iso_639_3) {|n| "639_3_#{n}"} end end # == Schema Information # # Table name: languages # # id :bigint not null, primary key # display_name :text # iso_639_1 :string # iso_639_2 :string # iso_639_3 :string # name :string not null # native_name :string # note :text # position :integer # # Indexes # # index_languages_on_iso_639_1 (iso_639_1) # index_languages_on_iso_639_2 (iso_639_2) # index_languages_on_iso_639_3 (iso_639_3) # index_languages_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/carrier_types.rb
spec/factories/carrier_types.rb
FactoryBot.define do factory :carrier_type do |f| f.sequence(:name) {|n| "carrier_type_#{n}"} end end # == Schema Information # # Table name: carrier_types # # id :bigint not null, primary key # display_name :text # name :string not null # note :text # position :integer # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_carrier_types_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/lccn_records.rb
spec/factories/lccn_records.rb
FactoryBot.define do factory :lccn_record do sequence(:body) {|n| "body_#{n}"} association :manifestation end end # == Schema Information # # Table name: lccn_records # # id :bigint not null, primary key # body :string not null # created_at :datetime not null # updated_at :datetime not null # manifestation_id :bigint not null # # Indexes # # index_lccn_records_on_body (body) UNIQUE # index_lccn_records_on_manifestation_id (manifestation_id) # # Foreign Keys # # fk_rails_... (manifestation_id => manifestations.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/realize_types.rb
spec/factories/realize_types.rb
# Read about factories at http://github.com/thoughtbot/factory_bot FactoryBot.define do factory :realize_type do name { "mystring" } display_name { "MyText" } note { "MyText" } end end # == Schema Information # # Table name: realize_types # # id :bigint not null, primary key # display_name :text # name :string not null # note :text # position :integer # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_realize_types_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/agent_types.rb
spec/factories/agent_types.rb
FactoryBot.define do factory :agent_type do |f| f.sequence(:name) {|n| "agent_type_#{n}"} end end # == Schema Information # # Table name: agent_types # # id :bigint not null, primary key # display_name :text # name :string not null # note :text # position :integer # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_agent_types_on_lower_name (lower((name)::text)) UNIQUE #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false
next-l/enju_leaf
https://github.com/next-l/enju_leaf/blob/cd3cff6dcc8e67909e1cd0a12c38700b45af6a42/spec/factories/import_requests.rb
spec/factories/import_requests.rb
FactoryBot.define do factory :import_request do sequence(:isbn) {|n| "isbn_#{n}"} association :user, factory: :librarian end end # == Schema Information # # Table name: import_requests # # id :bigint not null, primary key # isbn :string # created_at :datetime not null # updated_at :datetime not null # manifestation_id :bigint # user_id :bigint not null # # Indexes # # index_import_requests_on_isbn (isbn) # index_import_requests_on_manifestation_id (manifestation_id) # index_import_requests_on_user_id (user_id) # # Foreign Keys # # fk_rails_... (user_id => users.id) #
ruby
MIT
cd3cff6dcc8e67909e1cd0a12c38700b45af6a42
2026-01-04T17:52:15.550406Z
false